nhance-enrollment/app/Views/mail/enrollment_status_tiles.php
2026-06-26 11:50:54 +05:30

58 lines
3.4 KiB
PHP

<?php
$counts = $counts ?? [];
$tiles = [
['label' => 'Emp Count', 'value' => (int) ($counts['emp_count'] ?? 0), 'accent' => '#00999E'],
['label' => 'Enroled', 'value' => (int) ($counts['enrolled'] ?? 0), 'accent' => '#0ab39c'],
['label' => 'Not Enroled', 'value' => (int) ($counts['not_enrolled'] ?? 0), 'accent' => '#f06548'],
['label' => 'Logged-In', 'value' => (int) ($counts['logged_in'] ?? 0), 'accent' => '#299cdb'],
['label' => 'Not Logged-In', 'value' => (int) ($counts['not_logged_in'] ?? 0), 'accent' => '#878a99'],
['label' => 'Draft', 'value' => (int) ($counts['draft'] ?? 0), 'accent' => '#f7b84b'],
];
$tileRows = array_chunk($tiles, 3);
?>
<div align="center" style="width:100%; margin:24px 0;">
<table width="100%" border="0" cellspacing="0" cellpadding="0" style="max-width:600px; border-collapse:collapse;">
<tr>
<td style="padding:0 12px 12px; font-family:arial, sans-serif; font-size:15px; font-weight:600; color:#343a40; text-align:left;">
Enrollment Summary
</td>
</tr>
<tr>
<td style="padding:0 8px;">
<table width="100%" border="0" cellspacing="0" cellpadding="0" style="border-collapse:collapse;">
<?php foreach ($tileRows as $rowTiles): ?>
<tr>
<?php foreach ($rowTiles as $tile): ?>
<td width="33%" align="center" valign="top" style="padding:6px;">
<table width="100%" border="0" cellspacing="0" cellpadding="0" style="border-collapse:collapse; background-color:#ffffff; border:1px solid #e9ecef; border-radius:8px;">
<tr>
<td height="4" style="background-color:<?= esc($tile['accent']) ?>; font-size:0; line-height:0; border-radius:8px 8px 0 0;">&nbsp;</td>
</tr>
<tr>
<td align="center" style="padding:18px 10px 20px;">
<div style="font-family:arial, sans-serif; font-size:26px; font-weight:700; color:#212529; line-height:1.1; margin:0 0 6px 0;">
<?= $tile['value'] ?>
</div>
<div style="font-family:arial, sans-serif; font-size:12px; font-weight:500; color:#6c757d; line-height:1.3; letter-spacing:0.2px;">
<?= esc($tile['label']) ?>
</div>
</td>
</tr>
</table>
</td>
<?php endforeach; ?>
<?php
$missingCells = 3 - count($rowTiles);
for ($i = 0; $i < $missingCells; $i++):
?>
<td width="33%" style="padding:6px; font-size:0; line-height:0;">&nbsp;</td>
<?php endfor; ?>
</tr>
<?php endforeach; ?>
</table>
</td>
</tr>
</table>
</div>