versao 12

This commit is contained in:
Flatlogic Bot 2025-10-29 16:23:54 +00:00
parent e84e983545
commit 024d69e367
2 changed files with 7 additions and 5 deletions

View File

@ -46,12 +46,14 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
// Update
$stmt = $pdo->prepare('UPDATE macro_areas SET nome = ?, slug = ?, descricao = ?, ativo = ? WHERE id = ?');
$stmt->execute([$nome, $slug, $descricao, $ativo, $id]);
$redirect_id = $id;
} else {
// Create
$stmt = $pdo->prepare('INSERT INTO macro_areas (nome, slug, descricao, ativo, user_id) VALUES (?, ?, ?, ?, ?)');
$stmt->execute([$nome, $slug, $descricao, $ativo, $_SESSION['user_id'] ?? 1]);
$redirect_id = $pdo->lastInsertId();
}
header("Location: macro_areas.php");
header("Location: macro_area_form.php");
exit;
}
}

View File

@ -47,13 +47,13 @@ $macro_areas = $stmt->fetchAll(PDO::FETCH_ASSOC);
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table table-bordered" id="dataTable" width="100%" cellspacing="0">
<table class="table table-bordered table-sm" id="dataTable" width="100%" cellspacing="0">
<thead>
<tr>
<th>Nome</th>
<th>Descrição</th>
<th>Status</th>
<th style="width: 100px;">Ações</th>
<th style="width: 85px;">Ações</th>
</tr>
</thead>
<tbody id="tableBody">
@ -133,8 +133,8 @@ document.addEventListener('DOMContentLoaded', function () {
border-left: 0;
}
.btn-sm i[data-lucide] {
width: 16px;
height: 16px;
width: 13px;
height: 13px;
}
/* Custom styles for status badges */
.badge-status-ativo {