<?php declare(strict_types=1);ini_set('display_errors','0');header('Cache-Control: private, no-store, max-age=0');require_once __DIR__.'/../../includes/console_shell.php';require_login();require_acl('can_view','reports/attendance/daily-status-report.php');require_once __DIR__.'/daily-status-report-common.php';try{$o=dsr_options($con);$f=dsr_filters($_GET);$e=dsr_validate($f,$o);$rows=$e?[]:dsr_report($con,$f);}catch(Throwable $x){$e=['Unable to generate print report.'];$rows=[];}?><!doctype html><html><head><meta charset="utf-8"><title>Daily Status Report</title><style>@page{size:landscape;margin:8mm}body{font:10px Arial}table{width:100%;border-collapse:collapse}th,td{border:1px solid #222;padding:4px;text-align:center;white-space:pre-line}th{background:#eee}button{margin-bottom:8px}@media print{button{display:none}}</style></head><body><button onclick="window.print()">Print</button><h1 style="text-align:center">Daily Status Report - Dated on <?=h(date('d-m-Y',strtotime($f['date'])))?></h1><?php if($e):?><p><?=h(implode(' ',$e))?></p><?php else:dsr_render($rows);?><script>addEventListener('load',()=>window.print())</script><?php endif;?></body></html>
