Arquivos já criados em sala
This commit is contained in:
11
Telas/altFalta.php
Normal file
11
Telas/altFalta.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Document</title>
|
||||
</head>
|
||||
<body>
|
||||
Atualizado de novo.
|
||||
</body>
|
||||
</html>
|
||||
371
Telas/listFalta.php
Normal file
371
Telas/listFalta.php
Normal file
@@ -0,0 +1,371 @@
|
||||
<?php
|
||||
// 1. Pegamos a data atual para calcular a regra dos 10 dias no histórico
|
||||
$hoje = new DateTime();
|
||||
|
||||
// 2. Seu Banco de Dados (Array estático)
|
||||
$faltas = [
|
||||
["24/02/2026", "Edwarda Ingrid", "Capa Case", "14 pro max branca", "--", "para ter na loja", "1"],
|
||||
["23/02/2026", "Josiane Fagundes", "Capa Case", "iphone 17 pro max", "lilas, cinza", "para ter na loja", "1 de cada"],
|
||||
["24/02/2026", "Yasmin", "Capa Case", "poco f3", "vermelha, preta", "para ter na loja", "1 de cada"],
|
||||
["24/02/2026", "Yasmin", "Capa Case", "poco x5", "lilas, roxa", "para ter na loja", "1 de cada"],
|
||||
["12/02/2026", "Josiane Fagundes", "Capa Case", "SAMSUNG S26 FE", "todas as cores", "para ter na loja", "1 DE CADA"],
|
||||
["23/02/2026", "Aline Pinheiro", "Outro", "cartão memoria 64 gb", "sandisk", "--", "3 UNIDADES"],
|
||||
// Item Entregue (Identificado pelo ✅)
|
||||
["20/02/2026", "Edwarda Ingrid", "Outro", "CHAVEIRO ROSA", "CONSULTAR", "encomenda", "✅"],
|
||||
// Item antigo (Mais de 10 dias) - Esse não vai aparecer na tela por causa da regra do PHP!
|
||||
["10/01/2026", "Sistema", "Outro", "Item Antigo (Sumiu)", "--", "--", "✅"]
|
||||
];
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="pt-br">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Big Cell - Controle de Faltas</title>
|
||||
|
||||
<link rel="stylesheet" href="lista.css">
|
||||
|
||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="fundo-fluxo"></div>
|
||||
|
||||
<div class="container">
|
||||
|
||||
<div class="painel-topo">
|
||||
<button class="btn btn-roxo-escuro" onclick="abrirModal()">
|
||||
<span class="material-icons">add_circle</span> Adicionar Item
|
||||
</button>
|
||||
|
||||
<button class="btn btn-roxo-medio" onclick="entregarSelecionados()">
|
||||
<span class="material-icons">done_all</span> Concluir Selecionados
|
||||
</button>
|
||||
|
||||
<button class="btn btn-cinza" onclick="forcarMobile()">
|
||||
<span class="material-icons">smartphone</span> Versão Móvel
|
||||
</button>
|
||||
|
||||
<div class="divisor"></div>
|
||||
|
||||
<button class="btn-aba ativo" onclick="filtrarAbas('pendente', this)">Pendentes</button>
|
||||
<button class="btn-aba" onclick="filtrarAbas('entregue', this)">Histórico Entregues</button>
|
||||
</div>
|
||||
|
||||
<div class="tabela-container">
|
||||
<div class="grid-row header">
|
||||
<div class="center" style="width: 30px;">
|
||||
<input type="checkbox" onchange="selecionarTodos(this)">
|
||||
</div>
|
||||
<div>Data</div>
|
||||
<div>Funcionário</div>
|
||||
<div>Depto.</div>
|
||||
<div>Aparelho</div>
|
||||
<div>Detalhe</div>
|
||||
<div>OBS Loja</div>
|
||||
<div>Qtd</div>
|
||||
<div class="center">Ações</div>
|
||||
</div>
|
||||
|
||||
<div id="lista-corpo">
|
||||
<?php
|
||||
foreach ($faltas as $index => $item):
|
||||
$isEntregue = strpos($item[6], '✅') !== false;
|
||||
$classeStatus = $isEntregue ? "entregue" : "pendente";
|
||||
|
||||
// REGRA DOS 10 DIAS
|
||||
if ($isEntregue) {
|
||||
$dataItem = DateTime::createFromFormat('d/m/Y', $item[0]);
|
||||
if ($dataItem) {
|
||||
$diasPassados = $hoje->diff($dataItem)->days;
|
||||
if ($diasPassados > 10) {
|
||||
continue; // Pula este item se passou do prazo
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
<div class="grid-row item <?php echo $classeStatus; ?>" id="linha-<?php echo $index; ?>">
|
||||
<div class="center" data-label="Sel">
|
||||
<?php if(!$isEntregue): ?>
|
||||
<input type="checkbox" class="check-item">
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div data-label="Data"><?php echo $item[0]; ?></div>
|
||||
<div data-label="Funcionário"><?php echo $item[1]; ?></div>
|
||||
<div data-label="Depto."><?php echo $item[2]; ?></div>
|
||||
<div data-label="Aparelho" class="destaque-texto"><?php echo $item[3]; ?></div>
|
||||
<div data-label="Detalhe"><?php echo $item[4]; ?></div>
|
||||
<div data-label="OBS"><?php echo $item[5]; ?></div>
|
||||
<div data-label="Qtd"><?php echo $item[6]; ?></div>
|
||||
|
||||
<div data-label="Ações" class="acoes center">
|
||||
<?php if(!$isEntregue): ?>
|
||||
<button class="btn-icon icone-roxo" onclick="marcarComoEntregue(this)" title="Marcar Entregue">
|
||||
<span class="material-icons">check_circle</span>
|
||||
</button>
|
||||
<?php else: ?>
|
||||
<span style="color: #5B2A86; font-weight: bold; font-size: 12px;">✅</span>
|
||||
<?php endif; ?>
|
||||
|
||||
<button class="btn-icon icone-excluir" onclick="deletarLinha(this)" title="Excluir">
|
||||
<span class="material-icons">delete</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="modal-adicionar" class="modal-overlay">
|
||||
<div class="modal-box">
|
||||
<div class="modal-header">
|
||||
<h2>Adicionar Pedido</h2>
|
||||
<span class="close-btn" onclick="fecharModal()">×</span>
|
||||
</div>
|
||||
|
||||
<div class="form-grid">
|
||||
<div class="campo-full">
|
||||
<label>Data</label>
|
||||
<input type="date" id="inp-data" class="input-form">
|
||||
</div>
|
||||
|
||||
<div class="campo-full">
|
||||
<label>Funcionário</label>
|
||||
<select id="inp-func" class="input-form">
|
||||
<option value="">Selecione...</option>
|
||||
<option value="Edwarda Ingrid">Edwarda Ingrid</option>
|
||||
<option value="Josiane Fagundes">Josiane Fagundes</option>
|
||||
<option value="Yasmin">Yasmin</option>
|
||||
<option value="Aline Pinheiro">Aline Pinheiro</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="campo-full">
|
||||
<label>Departamento</label>
|
||||
<select id="inp-depto" class="input-form">
|
||||
<option value="Capa Case">Capa Case</option>
|
||||
<option value="Pelicula">Pelicula</option>
|
||||
<option value="Outro">Outro</option>
|
||||
<option value="Eletrônicos">Eletrônicos</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="campo-full">
|
||||
<label>Aparelho</label>
|
||||
<input type="text" id="inp-aparelho" placeholder="Ex: iPhone 13 Pro Max" class="input-form">
|
||||
</div>
|
||||
|
||||
<div class="campo-duplo">
|
||||
<div>
|
||||
<label>Detalhe</label>
|
||||
<input type="text" id="inp-detalhe" placeholder="Cor, Tipo..." class="input-form">
|
||||
</div>
|
||||
<div>
|
||||
<label>Qtd</label>
|
||||
<input type="number" id="inp-qtd" value="1" min="1" class="input-form">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="campo-full">
|
||||
<label>OBS Loja</label>
|
||||
<input type="text" id="inp-obs" value="para ter na loja" class="input-form">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-buttons">
|
||||
<button class="btn btn-cinza" onclick="fecharModal()">Cancelar</button>
|
||||
<button class="btn btn-roxo-escuro" onclick="salvarNovoItem()">Salvar</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="listfalta.js"></script>
|
||||
</body>
|
||||
</html><?php
|
||||
// 1. Pegamos a data atual para calcular a regra dos 10 dias no histórico
|
||||
$hoje = new DateTime();
|
||||
|
||||
// 2. Seu Banco de Dados (Array estático)
|
||||
$faltas = [
|
||||
["24/02/2026", "Edwarda Ingrid", "Capa Case", "14 pro max branca", "--", "para ter na loja", "1"],
|
||||
["23/02/2026", "Josiane Fagundes", "Capa Case", "iphone 17 pro max", "lilas, cinza", "para ter na loja", "1 de cada"],
|
||||
["24/02/2026", "Yasmin", "Capa Case", "poco f3", "vermelha, preta", "para ter na loja", "1 de cada"],
|
||||
["24/02/2026", "Yasmin", "Capa Case", "poco x5", "lilas, roxa", "para ter na loja", "1 de cada"],
|
||||
["12/02/2026", "Josiane Fagundes", "Capa Case", "SAMSUNG S26 FE", "todas as cores", "para ter na loja", "1 DE CADA"],
|
||||
["23/02/2026", "Aline Pinheiro", "Outro", "cartão memoria 64 gb", "sandisk", "--", "3 UNIDADES"],
|
||||
// Item Entregue (Identificado pelo ✅)
|
||||
["20/02/2026", "Edwarda Ingrid", "Outro", "CHAVEIRO ROSA", "CONSULTAR", "encomenda", "✅"],
|
||||
// Item antigo (Mais de 10 dias) - Esse não vai aparecer na tela por causa da regra do PHP!
|
||||
["10/01/2026", "Sistema", "Outro", "Item Antigo (Sumiu)", "--", "--", "✅"]
|
||||
];
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="pt-br">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Big Cell - Controle de Faltas</title>
|
||||
|
||||
<link rel="stylesheet" href="lista.css">
|
||||
|
||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="fundo-fluxo"></div>
|
||||
|
||||
<div class="container">
|
||||
|
||||
<div class="painel-topo">
|
||||
<button class="btn btn-roxo-escuro" onclick="abrirModal()">
|
||||
<span class="material-icons">add_circle</span> Adicionar Item
|
||||
</button>
|
||||
|
||||
<button class="btn btn-roxo-medio" onclick="entregarSelecionados()">
|
||||
<span class="material-icons">done_all</span> Concluir Selecionados
|
||||
</button>
|
||||
|
||||
<button class="btn btn-cinza" onclick="forcarMobile()">
|
||||
<span class="material-icons">smartphone</span> Versão Móvel
|
||||
</button>
|
||||
|
||||
<div class="divisor"></div>
|
||||
|
||||
<button class="btn-aba ativo" onclick="filtrarAbas('pendente', this)">Pendentes</button>
|
||||
<button class="btn-aba" onclick="filtrarAbas('entregue', this)">Histórico Entregues</button>
|
||||
</div>
|
||||
|
||||
<div class="tabela-container">
|
||||
<div class="grid-row header">
|
||||
<div class="center" style="width: 30px;">
|
||||
<input type="checkbox" onchange="selecionarTodos(this)">
|
||||
</div>
|
||||
<div>Data</div>
|
||||
<div>Funcionário</div>
|
||||
<div>Depto.</div>
|
||||
<div>Aparelho</div>
|
||||
<div>Detalhe</div>
|
||||
<div>OBS Loja</div>
|
||||
<div>Qtd</div>
|
||||
<div class="center">Ações</div>
|
||||
</div>
|
||||
|
||||
<div id="lista-corpo">
|
||||
<?php
|
||||
foreach ($faltas as $index => $item):
|
||||
$isEntregue = strpos($item[6], '✅') !== false;
|
||||
$classeStatus = $isEntregue ? "entregue" : "pendente";
|
||||
|
||||
// REGRA DOS 10 DIAS
|
||||
if ($isEntregue) {
|
||||
$dataItem = DateTime::createFromFormat('d/m/Y', $item[0]);
|
||||
if ($dataItem) {
|
||||
$diasPassados = $hoje->diff($dataItem)->days;
|
||||
if ($diasPassados > 10) {
|
||||
continue; // Pula este item se passou do prazo
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
<div class="grid-row item <?php echo $classeStatus; ?>" id="linha-<?php echo $index; ?>">
|
||||
<div class="center" data-label="Sel">
|
||||
<?php if(!$isEntregue): ?>
|
||||
<input type="checkbox" class="check-item">
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div data-label="Data"><?php echo $item[0]; ?></div>
|
||||
<div data-label="Funcionário"><?php echo $item[1]; ?></div>
|
||||
<div data-label="Depto."><?php echo $item[2]; ?></div>
|
||||
<div data-label="Aparelho" class="destaque-texto"><?php echo $item[3]; ?></div>
|
||||
<div data-label="Detalhe"><?php echo $item[4]; ?></div>
|
||||
<div data-label="OBS"><?php echo $item[5]; ?></div>
|
||||
<div data-label="Qtd"><?php echo $item[6]; ?></div>
|
||||
|
||||
<div data-label="Ações" class="acoes center">
|
||||
<?php if(!$isEntregue): ?>
|
||||
<button class="btn-icon icone-roxo" onclick="marcarComoEntregue(this)" title="Marcar Entregue">
|
||||
<span class="material-icons">check_circle</span>
|
||||
</button>
|
||||
<?php else: ?>
|
||||
<span style="color: #5B2A86; font-weight: bold; font-size: 12px;">✅</span>
|
||||
<?php endif; ?>
|
||||
|
||||
<button class="btn-icon icone-excluir" onclick="deletarLinha(this)" title="Excluir">
|
||||
<span class="material-icons">delete</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="modal-adicionar" class="modal-overlay">
|
||||
<div class="modal-box">
|
||||
<div class="modal-header">
|
||||
<h2>Adicionar Pedido</h2>
|
||||
<span class="close-btn" onclick="fecharModal()">×</span>
|
||||
</div>
|
||||
|
||||
<div class="form-grid">
|
||||
<div class="campo-full">
|
||||
<label>Data</label>
|
||||
<input type="date" id="inp-data" class="input-form">
|
||||
</div>
|
||||
|
||||
<div class="campo-full">
|
||||
<label>Funcionário</label>
|
||||
<select id="inp-func" class="input-form">
|
||||
<option value="">Selecione...</option>
|
||||
<option value="Edwarda Ingrid">Edwarda Ingrid</option>
|
||||
<option value="Josiane Fagundes">Josiane Fagundes</option>
|
||||
<option value="Yasmin">Yasmin</option>
|
||||
<option value="Aline Pinheiro">Aline Pinheiro</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="campo-full">
|
||||
<label>Departamento</label>
|
||||
<select id="inp-depto" class="input-form">
|
||||
<option value="Capa Case">Capa Case</option>
|
||||
<option value="Pelicula">Pelicula</option>
|
||||
<option value="Outro">Outro</option>
|
||||
<option value="Eletrônicos">Eletrônicos</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="campo-full">
|
||||
<label>Aparelho</label>
|
||||
<input type="text" id="inp-aparelho" placeholder="Ex: iPhone 13 Pro Max" class="input-form">
|
||||
</div>
|
||||
|
||||
<div class="campo-duplo">
|
||||
<div>
|
||||
<label>Detalhe</label>
|
||||
<input type="text" id="inp-detalhe" placeholder="Cor, Tipo..." class="input-form">
|
||||
</div>
|
||||
<div>
|
||||
<label>Qtd</label>
|
||||
<input type="number" id="inp-qtd" value="1" min="1" class="input-form">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="campo-full">
|
||||
<label>OBS Loja</label>
|
||||
<input type="text" id="inp-obs" value="para ter na loja" class="input-form">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-buttons">
|
||||
<button class="btn btn-cinza" onclick="fecharModal()">Cancelar</button>
|
||||
<button class="btn btn-roxo-escuro" onclick="salvarNovoItem()">Salvar</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="listfalta.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
164
Telas/lista.css
Normal file
164
Telas/lista.css
Normal file
@@ -0,0 +1,164 @@
|
||||
/* --- Reset e Base --- */
|
||||
* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', Tahoma, sans-serif; }
|
||||
|
||||
body {
|
||||
background-color: #111;
|
||||
padding: 20px;
|
||||
min-height: 100vh;
|
||||
position: relative;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
/* --- O FLUXO ROXO (FUNDO ANIMADO) --- */
|
||||
.fundo-fluxo {
|
||||
position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1;
|
||||
}
|
||||
|
||||
.fundo-fluxo::after {
|
||||
content: ''; position: absolute;
|
||||
bottom: -150vh; left: 10%; width: 80vw; height: 150vh;
|
||||
background: radial-gradient(ellipse at center, rgba(54, 5, 104, 0.8) 0%, transparent 60%);
|
||||
filter: blur(50px);
|
||||
animation: subirFluxo 15s infinite linear;
|
||||
}
|
||||
|
||||
@keyframes subirFluxo {
|
||||
0% { transform: translateY(50%); opacity: 0.5; }
|
||||
50% { opacity: 1; }
|
||||
100% { transform: translateY(-100%); opacity: 0.5; }
|
||||
}
|
||||
|
||||
/* --- CONTAINER E TABELA --- */
|
||||
.container {
|
||||
max-width: 1200px; margin: 0 auto;
|
||||
}
|
||||
|
||||
.painel-topo {
|
||||
background: rgba(255, 255, 255, 0.95);
|
||||
padding: 15px; border-radius: 8px; margin-bottom: 20px;
|
||||
display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
|
||||
box-shadow: 0 4px 10px rgba(0,0,0,0.3);
|
||||
}
|
||||
|
||||
.tabela-container {
|
||||
background: white; border-radius: 8px; overflow: hidden;
|
||||
box-shadow: 0 4px 15px rgba(0,0,0,0.3);
|
||||
}
|
||||
|
||||
/* --- BOTÕES --- */
|
||||
.btn {
|
||||
padding: 10px 15px; border: none; border-radius: 5px; cursor: pointer;
|
||||
font-weight: bold; font-size: 13px; display: flex; align-items: center; gap: 5px;
|
||||
color: white; transition: 0.2s;
|
||||
}
|
||||
.btn:hover { opacity: 0.9; transform: scale(1.02); }
|
||||
|
||||
.btn-roxo-escuro { background-color: #360568; }
|
||||
.btn-roxo-medio { background-color: #5B2A86; }
|
||||
.btn-cinza { background-color: #6c757d; }
|
||||
|
||||
/* Botões de Filtro */
|
||||
.btn-aba {
|
||||
background: transparent; color: #777; border: none; font-weight: bold;
|
||||
padding: 10px; cursor: pointer; border-bottom: 2px solid transparent; transition: 0.2s;
|
||||
}
|
||||
.btn-aba:hover { color: #360568; }
|
||||
.btn-aba.ativo { color: #360568; border-bottom: 2px solid #360568; }
|
||||
|
||||
.divisor { width: 1px; height: 30px; background: #ddd; margin: 0 10px; }
|
||||
|
||||
/* --- A GRID DA TABELA --- */
|
||||
.grid-row {
|
||||
display: grid;
|
||||
grid-template-columns: 30px 90px 130px 100px 1.5fr 1fr 100px 50px 120px;
|
||||
border-bottom: 1px solid #eee; align-items: center;
|
||||
}
|
||||
|
||||
.header {
|
||||
background: #f4f4f4; color: #444; font-weight: bold; font-size: 12px;
|
||||
padding: 15px 10px; text-transform: uppercase; border-bottom: 2px solid #ddd;
|
||||
}
|
||||
|
||||
.item { font-size: 13px; color: #333; padding: 10px; transition: 0.2s; }
|
||||
.item:hover { background-color: #f9f9f9; }
|
||||
|
||||
/* Item Entregue */
|
||||
.item.entregue { background-color: #f0fdf4; opacity: 0.8; }
|
||||
.item.entregue .destaque-texto { color: #888; text-decoration: line-through; }
|
||||
|
||||
.item div { word-wrap: break-word; overflow: hidden; }
|
||||
.destaque-texto { font-weight: bold; color: #360568; }
|
||||
.center { text-align: center; justify-content: center; display: flex; align-items: center; }
|
||||
|
||||
/* --- AÇÕES NA TABELA --- */
|
||||
.acoes { display: flex; gap: 8px; align-items: center; justify-content: center; }
|
||||
.btn-icon { background: none; border: none; cursor: pointer; padding: 4px; border-radius: 4px; transition: 0.2s; }
|
||||
.btn-icon:hover { background: #eee; transform: scale(1.1); }
|
||||
.icone-roxo { color: #5B2A86; }
|
||||
.icone-excluir { color: #555; }
|
||||
.icone-excluir:hover { color: #d32f2f; }
|
||||
|
||||
/* --- MODAL --- */
|
||||
.modal-overlay {
|
||||
display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
|
||||
background: rgba(0,0,0,0.7); justify-content: center; align-items: center; z-index: 999;
|
||||
}
|
||||
.modal-box {
|
||||
background: white; padding: 25px; border-radius: 8px; width: 95%; max-width: 500px;
|
||||
border-top: 5px solid #360568; box-shadow: 0 10px 30px rgba(0,0,0,0.3);
|
||||
}
|
||||
.modal-header { display: flex; justify-content: space-between; margin-bottom: 20px; }
|
||||
.modal-header h2 { color: #360568; font-size: 18px; margin: 0; }
|
||||
.close-btn { font-size: 24px; cursor: pointer; color: #999; }
|
||||
.close-btn:hover { color: #333; }
|
||||
.form-grid { display: flex; flex-direction: column; gap: 12px; }
|
||||
.campo-full { width: 100%; }
|
||||
.campo-duplo { display: flex; gap: 10px; }
|
||||
.campo-duplo div { flex: 1; }
|
||||
label { display: block; font-size: 12px; font-weight: bold; color: #555; margin-bottom: 4px; }
|
||||
.input-form { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 4px; font-size: 14px; }
|
||||
.input-form:focus { border-color: #360568; outline: none; }
|
||||
.modal-buttons { margin-top: 20px; display: flex; justify-content: flex-end; gap: 10px; }
|
||||
|
||||
/* =======================================================
|
||||
VERSÃO MÓVEL (SEM ERROS NO VS CODE)
|
||||
======================================================= */
|
||||
.tabela-container.mobile-mode .header { display: none; }
|
||||
|
||||
.tabela-container.mobile-mode .grid-row {
|
||||
display: flex; flex-direction: column; margin-bottom: 15px;
|
||||
border: 1px solid #ccc; border-radius: 8px; padding: 15px; background: white;
|
||||
}
|
||||
|
||||
.tabela-container.mobile-mode .item div {
|
||||
display: flex; justify-content: space-between; padding: 8px 0;
|
||||
border-bottom: 1px solid #eee; width: 100%; text-align: right;
|
||||
}
|
||||
|
||||
.tabela-container.mobile-mode .item div::before {
|
||||
content: attr(data-label); font-weight: bold; color: #360568;
|
||||
text-transform: uppercase; font-size: 11px; margin-right: 10px; text-align: left;
|
||||
}
|
||||
|
||||
.tabela-container.mobile-mode .item div:last-child { border-bottom: none; }
|
||||
.tabela-container.mobile-mode .acoes { justify-content: flex-end; padding-top: 10px; }
|
||||
|
||||
/* Regra para celular real (Media Query) */
|
||||
@media (max-width: 900px) {
|
||||
.header { display: none; }
|
||||
|
||||
.grid-row {
|
||||
display: flex; flex-direction: column; margin-bottom: 15px;
|
||||
border: 1px solid #ccc; border-radius: 8px; padding: 15px; background: white;
|
||||
}
|
||||
.item div {
|
||||
display: flex; justify-content: space-between; padding: 8px 0;
|
||||
border-bottom: 1px solid #eee; width: 100%; text-align: right;
|
||||
}
|
||||
.item div::before {
|
||||
content: attr(data-label); font-weight: bold; color: #360568;
|
||||
text-transform: uppercase; font-size: 11px; margin-right: 10px; text-align: left;
|
||||
}
|
||||
.item div:last-child { border-bottom: none; }
|
||||
.acoes { justify-content: flex-end; padding-top: 10px; }
|
||||
}
|
||||
123
Telas/listfalta.js
Normal file
123
Telas/listfalta.js
Normal file
@@ -0,0 +1,123 @@
|
||||
let abaAtual = 'pendente';
|
||||
|
||||
// --- 1. MODAL ---
|
||||
function abrirModal() {
|
||||
document.getElementById('modal-adicionar').style.display = 'flex';
|
||||
document.getElementById('inp-data').value = new Date().toISOString().split('T')[0];
|
||||
}
|
||||
|
||||
function fecharModal() {
|
||||
document.getElementById('modal-adicionar').style.display = 'none';
|
||||
document.getElementById('inp-aparelho').value = '';
|
||||
document.getElementById('inp-detalhe').value = '';
|
||||
}
|
||||
|
||||
function salvarNovoItem() {
|
||||
let data = document.getElementById('inp-data').value;
|
||||
let func = document.getElementById('inp-func').value;
|
||||
let depto = document.getElementById('inp-depto').value;
|
||||
let aparelho = document.getElementById('inp-aparelho').value;
|
||||
let detalhe = document.getElementById('inp-detalhe').value || "--";
|
||||
let qtd = document.getElementById('inp-qtd').value;
|
||||
let obs = document.getElementById('inp-obs').value;
|
||||
|
||||
if (aparelho === "" || func === "") {
|
||||
alert("Preencha o Funcionário e o Aparelho!");
|
||||
return;
|
||||
}
|
||||
|
||||
let dataFormatada = data ? data.split('-').reverse().join('/') : "Hoje";
|
||||
|
||||
const novaLinha = document.createElement('div');
|
||||
novaLinha.className = 'grid-row item pendente';
|
||||
|
||||
novaLinha.innerHTML = `
|
||||
<div class="center" data-label="Sel"><input type="checkbox" class="check-item"></div>
|
||||
<div data-label="Data">${dataFormatada}</div>
|
||||
<div data-label="Funcionário">${func}</div>
|
||||
<div data-label="Depto.">${depto}</div>
|
||||
<div data-label="Aparelho" class="destaque-texto">${aparelho}</div>
|
||||
<div data-label="Detalhe">${detalhe}</div>
|
||||
<div data-label="OBS">${obs}</div>
|
||||
<div data-label="Qtd">${qtd}</div>
|
||||
<div data-label="Ações" class="acoes center">
|
||||
<button class="btn-icon icone-roxo" onclick="marcarComoEntregue(this)" title="Marcar Entregue">
|
||||
<span class="material-icons">check_circle</span>
|
||||
</button>
|
||||
<button class="btn-icon icone-excluir" onclick="deletarLinha(this)" title="Excluir">
|
||||
<span class="material-icons">delete</span>
|
||||
</button>
|
||||
</div>
|
||||
`;
|
||||
|
||||
document.getElementById('lista-corpo').prepend(novaLinha);
|
||||
fecharModal();
|
||||
aplicarFiltro();
|
||||
}
|
||||
|
||||
// --- 2. EXCLUSÃO E BAIXA ---
|
||||
function deletarLinha(botao) {
|
||||
if(confirm("Deseja excluir este registro do sistema?")) {
|
||||
botao.closest('.grid-row').remove();
|
||||
}
|
||||
}
|
||||
|
||||
function marcarComoEntregue(botao) {
|
||||
if(confirm("Confirmar a entrega deste item?")) {
|
||||
let linha = botao.closest('.grid-row');
|
||||
linha.classList.remove('pendente');
|
||||
linha.classList.add('entregue');
|
||||
|
||||
let acoes = linha.querySelector('.acoes');
|
||||
acoes.innerHTML = `
|
||||
<span style="color: #5B2A86; font-weight: bold; font-size: 12px;">✅</span>
|
||||
<button class="btn-icon icone-excluir" onclick="deletarLinha(this)"><span class="material-icons">delete</span></button>
|
||||
`;
|
||||
linha.querySelector('input[type="checkbox"]').style.display = 'none';
|
||||
|
||||
aplicarFiltro();
|
||||
}
|
||||
}
|
||||
|
||||
// --- 3. SELEÇÃO EM MASSA ---
|
||||
function selecionarTodos(chkMestre) {
|
||||
document.querySelectorAll('.check-item').forEach(c => c.checked = chkMestre.checked);
|
||||
}
|
||||
|
||||
function entregarSelecionados() {
|
||||
const checks = document.querySelectorAll('.check-item:checked');
|
||||
if(checks.length > 0 && confirm(`Baixar ${checks.length} itens selecionados?`)) {
|
||||
checks.forEach(chk => {
|
||||
let btn = chk.closest('.grid-row').querySelector('.icone-roxo');
|
||||
if(btn) marcarComoEntregue(btn);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// --- 4. ABAS E MODO MOBILE ---
|
||||
function filtrarAbas(tipo, botao) {
|
||||
abaAtual = tipo;
|
||||
document.querySelectorAll('.btn-aba').forEach(b => b.classList.remove('ativo'));
|
||||
botao.classList.add('ativo');
|
||||
aplicarFiltro();
|
||||
}
|
||||
|
||||
function aplicarFiltro() {
|
||||
const linhas = document.querySelectorAll('.item');
|
||||
const isMobile = document.querySelector('.tabela-container').classList.contains('mobile-mode');
|
||||
|
||||
linhas.forEach(linha => {
|
||||
if(linha.classList.contains(abaAtual)) {
|
||||
linha.style.display = isMobile ? 'flex' : 'grid';
|
||||
} else {
|
||||
linha.style.display = 'none';
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function forcarMobile() {
|
||||
document.querySelector('.tabela-container').classList.toggle('mobile-mode');
|
||||
aplicarFiltro();
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', aplicarFiltro);
|
||||
Reference in New Issue
Block a user