« Back to History
company_bank_accounts_manage.php
|
20261118_125741.php
Initial Domain Snapshot
Copy Code
<?php /* ========================================== File: company_bank_accounts_manage.php Shows company_bank_accounts for login company ========================================== */ error_reporting(E_ALL); ini_set('display_errors', 1); /* ---- Auth + DB ---- */ require_once __DIR__ . '/modules/auth/page_acl.php'; $ctx = page_require_access('beam_entry_manage'); // 👈 aapne jo diya tha wahi $u = $ctx['user'] ?? null; $COMPANY_ID = (int)($ctx['company_id'] ?? 0); $USER_ID = (int)($u['id'] ?? 0); $pdo = $ctx['pdo'] ?? null; if (!($pdo instanceof PDO)) { require __DIR__ . '/core/db.php'; } /* ---- Data load ---- */ $sql = "SELECT id, company_id, bank_user_id, debit_ac_no, debit_account, created_at, updated_at FROM company_bank_accounts WHERE company_id = :cid ORDER BY id DESC"; $stmt = $pdo->prepare($sql); $stmt->execute([':cid' => $COMPANY_ID]); $rows = $stmt->fetchAll(PDO::FETCH_ASSOC); /* ---- Header include ---- */ require __DIR__ . '/partials/header.php'; ?> <div class="wrap"> <h1 class="h1">Company Bank Accounts</h1> <?php if (!$rows): ?> <p>No bank accounts found for this company.</p> <?php else: ?> <div class="card"> <div class="card-body"> <table class="table"> <thead> <tr> <th>ID</th> <th>Company ID</th> <th>Bank User ID</th> <th>Debit A/C No</th> <th>Debit Account</th> <th>Created At</th> <th>Updated At</th> </tr> </thead> <tbody> <?php foreach ($rows as $r): ?> <tr> <td><?php echo (int)$r['id']; ?></td> <td><?php echo (int)$r['company_id']; ?></td> <td><?php echo htmlspecialchars($r['bank_user_id']); ?></td> <td><?php echo htmlspecialchars($r['debit_ac_no']); ?></td> <td><?php echo htmlspecialchars($r['debit_account']); ?></td> <td><?php echo htmlspecialchars($r['created_at']); ?></td> <td><?php echo htmlspecialchars($r['updated_at']); ?></td> </tr> <?php endforeach; ?> </tbody> </table> </div> </div> <?php endif; ?> </div> <?php /* ---- Footer include ---- */ require __DIR__ . '/partials/footer.php';