gdc_cmod/app/Views/shared/layout.php
mahdahar 01908bb002 feat: Implement status-based row coloring and enhance validation dialog
This commit implements a comprehensive status color system across the dashboard and validation interfaces, ensuring visual consistency between table rows and filter buttons.

Color System Changes:
- Updated statusRowBg mapping in script_requests.php with custom hex colors:
  * Pend: white (#ffffff) with black text
  * PartColl: pink (#ff99aa) with black text
  * Coll: red (#d63031) with white text
  * PartRecv: light blue (#a0c0d9) with black text
  * Recv: blue (#0984e3) with white text
  * Inc: yellow (#ffff00) with black text
  * Fin: green (#008000) with white text
- Added custom CSS button classes in layout.php matching row background colors
- Applied color backgrounds to table rows (Order through Tests columns)
- Removed hardcoded text-white classes, now using dynamic text colors from mapping

UI/UX Improvements:
- Table rows now have consistent color-coded backgrounds based on request status
- Filter button badges match their corresponding row background colors
- Yellow status uses black text for better readability
- Swapped Coll (yellow) and Inc (orange) colors as requested

Validation Dialog Enhancement:
- Updated dialog_val.php iframe to use dynamic URL generation
- Removed preview type selection (ID, EN, PDF options) - uses default only
- Added getPreviewUrl() method in script_validation.php
- Now uses same URL pattern as preview dialog: http://glenlis/spooler_db/main_dev.php?acc={accessnumber}

Documentation Updates:
- Added Serena MCP tool usage guidelines to AGENTS.md
- Renamed CHECKLIST.md to TODO.md
- Removed CLAUDE.md

Technical Details:
- Color mappings now include both background and text color classes
- Implemented using Tailwind arbitrary values for precise hex color matching
- Status buttons use btn-status-{status} and badge-status-{status} classes
- All 7 columns from Order through Tests have status-colored backgrounds
2026-02-02 14:27:12 +07:00

85 lines
3.4 KiB
PHP

<!DOCTYPE html>
<html lang="en" data-theme="corporate">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CMOD</title>
<link href="<?= base_url('css/daisyui.min.css'); ?>" rel="stylesheet" type="text/css" />
<script src="<?= base_url('css/tailwind.min.js'); ?>"></script>
<script src="<?= base_url('js/alpine-focus.min.js'); ?>"></script>
<link href="<?= base_url('css/themes.min.css'); ?>" rel="stylesheet" type="text/css" />
<script src="<?= base_url('js/fontawesome.min.js'); ?>"></script>
<style>
body {
margin: 0;
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
font-size: 0.71rem;
}
.navbar {
padding: 0.2rem 1rem;
min-height: 0rem;
}
.card-body {
font-size: 0.71rem !important;
}
/* Status Button Colors - Matching Row Backgrounds */
.btn-status-pend, .badge-status-pend { background-color: #ffffff; color: black; border: 1px solid #d1d5db; }
.btn-status-coll, .badge-status-coll { background-color: #d63031; color: white; }
.btn-status-recv, .badge-status-recv { background-color: #0984e3; color: white; }
.btn-status-inc, .badge-status-inc { background-color: #ffff00; color: black; }
.btn-status-fin, .badge-status-fin { background-color: #008000; color: white; }
</style>
</head>
<body class="bg-base-200 min-h-screen" x-data="main">
<div class="flex flex-col min-h-screen">
<!-- Navbar -->
<nav class="navbar bg-base-100 shadow-md px-6 z-20">
<div class='flex-1'>
<a class='text-xl text-primary font-bold tracking-wide flex items-center gap-2 ml-2'>
<i class="fa fa-cube"></i> CMOD <span class="text-base-content/40 font-light text-sm hidden sm:inline-block">|
<?= esc($roleConfig['title'] ?? 'Dashboard') ?></span>
</a>
</div>
<div class="flex gap-2">
<div class="text-right hidden sm:block leading-tight">
<div class="text-sm font-bold opacity-70">Hi, <?= session('userid'); ?></div>
<div class="text-xs opacity-50"><?= session()->get('userrole') ?></div>
</div>
<div class="dropdown dropdown-end">
<div tabindex="0" role="button" class="btn btn-ghost avatar placeholder px-2">
<span class="text-xl"><i class="fa fa-bars"></i></span>
</div>
<ul tabindex="0"
class="dropdown-content menu bg-base-100 rounded-box z-[1] w-52 p-2 shadow-lg border border-base-300">
<li><a href="<?= base_url('logout') ?>" class="text-error hover:bg-error/10"><i
class="fa fa-sign-out-alt mr-2"></i> Logout</a></li>
<li><a @click.prevent="openDialogSetPassword()"><i class="fa fa-key mr-2"></i> Change Password</a></li>
<div class="divider my-1"></div>
<?php foreach ($roleConfig['menuItems'] ?? [] as $item): ?>
<li><a href="<?= base_url($item['href']) ?>"><i class="fa fa-<?= $item['icon'] ?> mr-2"></i>
<?= $item['label'] ?></a></li>
<?php endforeach; ?>
</ul>
</div>
</div>
</nav>
<!-- Page Content -->
<?= $this->renderSection('content'); ?>
<?= $this->include('shared/dialog_setPassword'); ?>
<footer class='bg-base-100 p-1 mt-auto'>&copy; <?= date('Y'); ?> - 5Panda</footer>
</div>
<script>
window.BASEURL = "<?= base_url(); ?>";
</script>
<?= $this->renderSection('script'); ?>
</body>
</html>