= $this->extend('layout/main_layout') ?> = $this->section('content') ?> attendance['timezone'] ?? user_timezone()); } catch (Throwable $e) { $displayTz = user_timezone(); } } if ($raw instanceof DateTimeInterface) { $dt = new DateTime('@' . $raw->getTimestamp()); return $dt->setTimezone(new DateTimeZone($displayTz)); } $s = trim((string)$raw); if ($s === '' || preg_match('/^0{4}-0{2}-0{2}/', $s)) return null; $srcTz = new DateTimeZone($sourceTz); $outTz = new DateTimeZone($displayTz); // Try full datetime first $dt = DateTime::createFromFormat('Y-m-d H:i:s', $s, $srcTz); if ($dt !== false) { return $dt->setTimezone($outTz); } // Try date-only $d = DateTime::createFromFormat('Y-m-d', $s, $srcTz); if ($d !== false) { if ($defaultTime) { [$H, $i, $sec] = array_map('intval', explode(':', $defaultTime)); $d->setTime($H, $i, $sec); } // else leave 00:00:00 return $d->setTimezone($outTz); } // Fallback parser try { $fallback = new DateTime($s, $srcTz); return $fallback->setTimezone($outTz); } catch (Throwable $e) { return null; } } } ?>
| # | Invoice Number | Issue Date | Due Date | Balance | Last Payment Amount | Last Payment Date | Status | Actions |
|---|---|---|---|---|---|---|---|---|
| = (int)$index + 1 ?> | = esc($invoice['invoice_number']) ?> | = $issueDt ? esc($issueDt->format('m-d-Y h:i A')) : '—' ?> | = $dueDt ? esc($dueDt->format('m-d-Y')) : '—' ?> | $= number_format((float)($invoice['balance'] ?? 0), 2) ?> | $= number_format((float)($invoice['last_paid_amount'] ?? 0), 2) ?> | = $lastPay ? esc($lastPay->format('m-d-Y h:i A')) : '—' ?> | = esc($invoice['status'] ?? '') ?> | View/Print PDF |