« Back to History
daily_folding_entry_list.php
|
20260721_154032.php
Initial Bulk Import
Copy Code
<?php /* ============================================================================ File: daily_folding_entry_list.php Purpose: List Folding Entries Scope: Company scoped, NO global edits ============================================================================ */ require_once __DIR__ . '/modules/auth/page_acl.php'; $ctx = page_require_access('daily_folding_entry_list'); $pdo = $ctx['pdo'] ?? null; $company_id = (int)($ctx['company_id'] ?? 0); if (!$pdo) require_once __DIR__ . '/core/db.php'; function h($s){ return htmlspecialchars((string)$s, ENT_QUOTES, 'UTF-8'); } /* ================= FETCH DATA ================= */ $stmt = $pdo->prepare(" SELECT fe.*, q.quality_name, k.name AS khata_name FROM folding_entry fe LEFT JOIN qualities q ON q.id = fe.quality_id AND q.company_id = fe.company_id LEFT JOIN khatas k ON k.id = fe.khata_id AND k.company_id = fe.company_id WHERE fe.company_id = :cid ORDER BY fe.id DESC "); $stmt->execute([':cid' => $company_id]); $rows = $stmt->fetchAll(PDO::FETCH_ASSOC); require_once __DIR__ . '/partials/header.php'; ?> <div class="card"> <div class="card-header d-flex justify-content-between align-items-center"> <h5>Daily Folding Entry List</h5> <a href="daily_folding_entry_add.php" class="btn btn-primary btn-sm"> + Add Entry </a> </div> <div class="card-body p-0"> <div class="table-responsive"> <table class="table table-striped table-bordered table-sm mb-0"> <thead class="table-light text-uppercase small text-center"> <tr> <th>ID</th> <th>Date</th> <th>Folder</th> <th>Khata</th> <th>Quality</th> <th>Taka</th> <th>Meter</th> <th>Saree</th> <th>Weight</th> <th>Action</th> </tr> </thead> <tbody> <?php if (!$rows): ?> <tr> <td colspan="10" class="text-center">No records found</td> </tr> <?php else: ?> <?php foreach ($rows as $r): ?> <tr class="text-center"> <td><?= (int)$r['id'] ?></td> <td><?= h($r['entry_date']) ?></td> <td><?= h($r['folder_id']) ?></td> <td><?= h($r['khata_name']) ?></td> <td><?= h($r['quality_name']) ?></td> <td><?= h($r['total_taka']) ?></td> <td><?= h($r['total_meter']) ?></td> <td><?= h($r['total_saree']) ?></td> <td><?= h($r['total_weight']) ?></td> <td> <a href="daily_folding_entry_edit.php?id=<?= (int)$r['id'] ?>" class="btn btn-sm btn-warning"> Edit </a> </td> </tr> <?php endforeach; ?> <?php endif; ?> </tbody> </table> </div> </div> </div> <?php require_once __DIR__ . '/partials/footer.php'; ?>