« Back to History
new_employee_list.php
|
20260721_154033.php
Initial Bulk Import
Copy Code
<?php require_once __DIR__ . '/modules/auth/page_acl.php'; $ctx = page_require_access('employee_list'); $pdo = $ctx['pdo']; $company_id = (int)$ctx['company_id']; function h($s){ return htmlspecialchars((string)$s, ENT_QUOTES, 'UTF-8'); } /* ========================= FETCH EMPLOYEES ========================= */ $st = $pdo->prepare(" SELECT id, employee_code, name, mobile, department_name, designation_name, payment_type, is_active FROM company_employee_master WHERE company_id = :cid ORDER BY name "); $st->execute([':cid' => $company_id]); $rows = $st->fetchAll(PDO::FETCH_ASSOC); ?> <?php require_once __DIR__ . '/partials/header.php'; ?> <div class="card"> <h2>Employee List</h2> <table class="table"> <thead> <tr> <th>Code</th> <th>Name</th> <th>Mobile</th> <th>Department</th> <th>Designation</th> <th>Payment Type</th> <th>Status</th> <th></th> </tr> </thead> <tbody> <?php foreach ($rows as $r): ?> <tr> <td><?=h($r['employee_code'])?></td> <td><?=h($r['name'])?></td> <td><?=h($r['mobile'])?></td> <td><?=h($r['department_name'])?></td> <td><?=h($r['designation_name'])?></td> <td><?=h($r['payment_type'])?></td> <td><?= $r['is_active'] ? 'Active' : 'Inactive' ?></td> <td> <a class="btn btn-sm btn-primary" href="employee_edit_new.php?id=<?=$r['id']?>"> Edit </a> </td> </tr> <?php endforeach; ?> </tbody> </table> </div> <?php require_once __DIR__ . '/partials/footer.php'; ?>