« Back to History
gray_receive_list.php
|
20260723_000646.php
Initial Domain Snapshot
Copy Code
<?php require_once __DIR__ . '/modules/auth/page_acl.php'; $ctx = page_require_access('gray_receive_entry'); $pdo = $ctx['pdo']; $company_id = (int)$ctx['company_id']; $u = $ctx['user'] ?? null; require_once __DIR__ . '/partials/header.php'; // ===== DATA FETCHING ===== $stmt = $pdo->prepare(" SELECT gr.*, m.mill_name, q.quality_name FROM gray_receive gr LEFT JOIN mill_master m ON m.id = gr.mill_id LEFT JOIN fabric_quality_master q ON q.id = gr.quality_id WHERE gr.company_id = :cid ORDER BY gr.gray_id DESC "); $stmt->execute([':cid'=>$company_id]); $rows = $stmt->fetchAll(PDO::FETCH_ASSOC); ?> <div class="container-fluid mt-3 px-4"> <div class="card p-3 shadow-sm border-0"> <div class="d-flex justify-content-between align-items-center mb-3"> <h5 class="text-primary fw-bold">Gray Receive List</h5> <a href="gray_receive_entry.php" class="btn btn-success btn-sm">+ New Entry</a> </div> <div class="table-responsive"> <table class="table table-bordered table-hover table-sm align-middle"> <thead class="table-dark"> <tr> <th class="text-center">Gray ID</th> <th>Date</th> <th>Mill</th> <th>GP No</th> <th>Quality</th> <th class="text-end">Grey MTS</th> <th class="text-end">Finish MTS</th> <th class="text-center">Action</th> </tr> </thead> <tbody> <?php if (count($rows) > 0): ?> <?php foreach($rows as $r): ?> <tr> <td class="text-center fw-bold">#<?= $r['gray_id'] ?></td> <td><?= date('d-m-Y', strtotime($r['rec_date'])) ?></td> <td><?= htmlspecialchars($r['mill_name']) ?></td> <td><?= htmlspecialchars($r['gpno']) ?></td> <td><?= htmlspecialchars($r['quality_name']) ?></td> <td class="text-end"><?= number_format($r['grey_mts'], 2) ?></td> <td class="text-end"><?= number_format($r['finish_mts'], 2) ?></td> <td class="text-center"> <a href="gray_receive_edit.php?gray_id=<?= $r['gray_id'] ?>" class="btn btn-sm btn-primary"> Edit </a> </td> </tr> <?php endforeach; ?> <?php else: ?> <tr><td colspan="8" class="text-center py-4 text-muted">No records found.</td></tr> <?php endif; ?> </tbody> </table> </div> </div> </div> <?php require_once __DIR__ . '/partials/footer.php'; ?>