prepare("SELECT * FROM payroll_runs WHERE id = ? AND company_id = ?"); $stmt->execute([$run_id, $company_id]); $run = $stmt->fetch(); if (!$run) { header('Location: /payroll_history.php'); exit; } // Fetch payslips for the run $stmt = db()->prepare("SELECT p.*, e.first_name, e.last_name FROM payslips p JOIN employees e ON p.employee_id = e.id WHERE p.payroll_run_id = ?"); $stmt->execute([$run_id]); $payslips = $stmt->fetchAll(); ?> Payslips for <?= htmlspecialchars(date('F Y', mktime(0,0,0, (int)$run['pay_period_month'], 1, (int)$run['pay_period_year']))) ?> - GPTPayroll

Payslips for

Employee Net Pay Actions
No payslips found for this run.
ZMW Download PDF