nhance/app/Views/daily_report_email_template.php

346 lines
18 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
/* Base */
body {
font-family: 'Segoe UI', Arial, sans-serif;
margin: 0;
padding: 0;
background-color: #f4f7f6;
color: #333;
-webkit-text-size-adjust: 100%;
}
.container {
width: 100%;
max-width: 680px;
margin: 0 auto;
background: #ffffff;
border-radius: 8px;
overflow: hidden;
box-shadow: 0 4px 10px rgba(0,0,0,0.06);
}
/* Header */
.header {
background: linear-gradient(135deg, #1f618d, #21618c, #117a65);
color: #ffffff;
padding: 24px 16px;
text-align: center;
}
.header h1 {
margin: 0;
font-size: 24px;
letter-spacing: 0.5px;
}
.header-subtitle {
margin-top: 6px;
font-size: 13px;
opacity: 0.9;
}
/* Content */
.content {
padding: 20px;
}
.report-date {
color: #7f8c8d;
font-size: 13px;
margin-bottom: 16px;
text-align: right;
}
.section-title {
font-size: 17px;
color: #2c3e50;
border-bottom: 2px solid #3498db;
display: inline-block;
margin: 18px 0 12px;
padding-bottom: 4px;
}
/* Stats Grid - stacked for better email support */
.stats-grid {
margin-bottom: 18px;
}
.stat-card {
width: 100%;
display: block;
background: #f8f9fa;
padding: 12px 14px;
border-radius: 6px;
border-left: 4px solid #3498db;
box-sizing: border-box;
margin-bottom: 10px;
}
.stat-label {
font-size: 11px;
text-transform: uppercase;
color: #7f8c8d;
font-weight: 600;
letter-spacing: 0.5px;
}
.stat-value {
font-size: 18px;
color: #2c3e50;
margin-top: 4px;
font-weight: bold;
}
.stat-note {
font-size: 11px;
color: #95a5a6;
margin-top: 2px;
}
/* Table */
.table-container {
width: 100%;
}
.status-table {
width: 100%;
border-collapse: collapse;
margin-top: 8px;
}
.status-table th {
background-color: #ecf0f1;
text-align: left;
padding: 10px 8px;
font-size: 13px;
border-bottom: 2px solid #bdc3c7;
}
.status-table td {
padding: 10px 8px;
border-bottom: 1px solid #eee;
font-size: 13px;
}
.badge {
display: inline-block;
padding: 2px 8px;
border-radius: 10px;
font-size: 11px;
background: #ecf0f1;
color: #2c3e50;
}
/* Footer */
.footer {
background: #f8f9fa;
padding: 14px 18px;
text-align: center;
font-size: 11px;
color: #95a5a6;
}
/* Mobile */
@media only screen and (max-width: 480px) {
.content {
padding: 14px;
}
.header h1 {
font-size: 20px;
}
.header-subtitle {
font-size: 12px;
}
.section-title {
font-size: 15px;
}
.stat-card {
min-width: 100%;
}
.report-date {
text-align: left;
}
}
</style>
</head>
<body>
<div class="container" style="width:100%;max-width:680px;margin:0 auto;background:#ffffff;border-radius:8px;overflow:hidden;box-shadow:0 4px 10px rgba(0,0,0,0.06);">
<div class="header" style="background:#1f618d;color:#ffffff;padding:24px 16px;text-align:center;">
<h1>Daily Activity Report</h1>
<div class="header-subtitle">
Key operations, sales and claim metrics for the day
</div>
</div>
<div class="content" style="padding:20px;">
<div class="report-date" style="color:#7f8c8d;font-size:13px;margin-bottom:16px;text-align:right;">Date: <?= $today ?? "" ?></div>
<!-- File Operations -->
<h3 class="section-title" style="font-size:17px;color:#2c3e50;border-bottom:2px solid #3498db;display:inline-block;margin:18px 0 12px;padding-bottom:4px;">Inception &amp; Endorsement (File Upload)</h3>
<div class="stats-grid">
<div class="stat-card" style="width:100%;display:block;background:#f8f9fa;padding:12px 14px;border-radius:6px;border-left:4px solid #3498db;box-sizing:border-box;margin-bottom:10px;">
<div class="stat-label">Total Inception</div>
<div class="stat-value"><?= $total_inception_count ?? 0 ?></div>
<div class="stat-note">Employee file uploads marked as inception</div>
</div>
<div class="stat-card" style="width:100%;display:block;background:#f8f9fa;padding:12px 14px;border-radius:6px;border-left:4px solid #3498db;box-sizing:border-box;margin-bottom:10px;">
<div class="stat-label">Total Endorsement</div>
<div class="stat-value"><?= $total_endorsement_count ?? 0 ?></div>
<div class="stat-note">All noninception successful uploads</div>
</div>
</div>
<!-- Employee Enrollment (new data points as cards only) -->
<h3 class="section-title" style="font-size:17px;color:#2c3e50;border-bottom:2px solid #3498db;display:inline-block;margin:18px 0 12px;padding-bottom:4px;">Employee Enrollment</h3>
<div class="stats-grid">
<div class="stat-card" style="width:100%;display:block;background:#f8f9fa;padding:12px 14px;border-radius:6px;border-left:4px solid #3498db;box-sizing:border-box;margin-bottom:10px;">
<div class="stat-label">Draft / Enrolled </div>
<div class="stat-value"><?= $total_employee_draft_count ?? 0 ?> / <?= $total_employee_enrolled_count ?? 0 ?></div>
<div class="stat-note">Employees in draft / enrolled status for the day</div>
</div>
<div class="stat-card" style="width:100%;display:block;background:#f8f9fa;padding:12px 14px;border-radius:6px;border-left:4px solid #9b59b6;box-sizing:border-box;margin-bottom:10px;">
<div class="stat-label">Open for Enrollment Policies</div>
<div class="stat-value"><?= $total_open_for_enrollemnt_policy_count ?? 0 ?></div>
<div class="stat-note">Policies currently open for enrollment</div>
</div>
</div>
<!-- TPA / Insurer -->
<h3 class="section-title" style="font-size:17px;color:#2c3e50;border-bottom:2px solid #3498db;display:inline-block;margin:18px 0 12px;padding-bottom:4px;">TPA &amp; Insurer Batch Summary</h3>
<div class="stats-grid">
<div class="stat-card" style="width:100%;display:block;background:#f8f9fa;padding:12px 14px;border-radius:6px;border-left:4px solid #e67e22;box-sizing:border-box;margin-bottom:10px;">
<div class="stat-label">TPA (Inception / Endorsement)</div>
<div class="stat-value"><?= $total_tpa_incetion_count ?? 0 ?> / <?= $total_tpa_endorsement_count ?? 0 ?></div>
<div class="stat-note">Successful TPA events</div>
</div>
<div class="stat-card" style="width:100%;display:block;background:#f8f9fa;padding:12px 14px;border-radius:6px;border-left:4px solid #9b59b6;box-sizing:border-box;margin-bottom:10px;">
<div class="stat-label">Insurer (Inception / Endorsement)</div>
<div class="stat-value"><?= $total_insurer_incetion_count ?? 0 ?> / <?= $total_insurer_endorsement_count ?? 0 ?></div>
<div class="stat-note">Successful insurer events</div>
</div>
</div>
<!-- Sales Funnel -->
<h3 class="section-title" style="font-size:17px;color:#2c3e50;border-bottom:2px solid #3498db;display:inline-block;margin:18px 0 12px;padding-bottom:4px;">Sales Funnel &amp; Leads</h3>
<div class="stats-grid">
<div class="stat-card" style="width:100%;display:block;background:#f8f9fa;padding:12px 14px;border-radius:6px;border-left:4px solid #27ae60;box-sizing:border-box;margin-bottom:10px;">
<div class="stat-label">Opportunities &amp; Won</div>
<div class="stat-value"><?= $total_opportunity_count ?? 0 ?> / <?= $total_placement_count ?? 0 ?></div>
<div class="stat-note">Total opportunities created vs converted</div>
</div>
<div class="stat-card" style="width:100%;display:block;background:#f8f9fa;padding:12px 14px;border-radius:6px;border-left:4px solid #16a085;box-sizing:border-box;margin-bottom:10px;">
<div class="stat-label">RFQ (Created / Sent to Insurer)</div>
<div class="stat-value"><?= $total_rfq_created_count ?? 0 ?> / <?= $total_rfq_insurer_send_count ?? 0 ?></div>
<div class="stat-note">Movement from opportunity to RFQ</div>
</div>
<div class="stat-card" style="width:100%;display:block;background:#f8f9fa;padding:12px 14px;border-radius:6px;border-left:4px solid #2980b9;box-sizing:border-box;margin-bottom:10px;">
<div class="stat-label">QCR (Created / Sent to Client)</div>
<div class="stat-value"><?= $total_qcr_created_count ?? 0 ?> / <?= $total_qcr_client_send_count ?? 0 ?></div>
<div class="stat-note">Quotes prepared and shared</div>
</div>
<div class="stat-card" style="width:100%;display:block;background:#f8f9fa;padding:12px 14px;border-radius:6px;border-left:4px solid #8e44ad;box-sizing:border-box;margin-bottom:10px;">
<div class="stat-label">Total Leads &amp; Activities</div>
<div class="stat-value"><?= $total_lead_count ?? 0 ?> / <?= $total_activity_count ?? 0 ?></div>
<div class="stat-note">Lead entries and logged touchpoints</div>
</div>
</div>
<!-- BDS / Policy Transactions -->
<h3 class="section-title" style="font-size:17px;color:#2c3e50;border-bottom:2px solid #3498db;display:inline-block;margin:18px 0 12px;padding-bottom:4px;">BDS Policy Transactions</h3>
<div class="stats-grid">
<div class="stat-card" style="width:100%;display:block;background:#f8f9fa;padding:12px 14px;border-radius:6px;border-left:4px solid #d35400;box-sizing:border-box;margin-bottom:10px;">
<div class="stat-label">Total BDS Transactions</div>
<div class="stat-value"><?= $total_bds_count ?? 0 ?></div>
<div class="stat-note">All policy transactions processed</div>
</div>
<div class="stat-card" style="width:100%;display:block;background:#f8f9fa;padding:12px 14px;border-radius:6px;border-left:4px solid #c0392b;box-sizing:border-box;margin-bottom:10px;">
<div class="stat-label">BDS (Policy / Endorsement)</div>
<div class="stat-value"><?= $total_bds_policy_wise_count ?? 0?> / <?= $total_bds_endorsement_wise_count ?? 0 ?></div>
<div class="stat-note">Split of inceptions vs endorsements</div>
</div>
</div>
<!-- BDS by Policy Type -->
<h3 class="section-title" style="font-size:17px;color:#2c3e50;border-bottom:2px solid #3498db;display:inline-block;margin:18px 0 12px;padding-bottom:4px;">BDS by Policy Type</h3>
<div class="table-container" style="width:100%;">
<table class="status-table" style="width:100%;border-collapse:collapse;margin-top:8px;">
<thead>
<tr>
<th style="background-color:#ecf0f1;text-align:left;padding:10px 8px;font-size:13px;border-bottom:2px solid #bdc3c7;">Policy Type</th>
<th style="background-color:#ecf0f1;text-align:right;padding:10px 8px;font-size:13px;border-bottom:2px solid #bdc3c7;">Count</th>
</tr>
</thead>
<tbody>
<?php if (!empty($total_bds_policy_type_wise_count)): ?>
<?php foreach ($total_bds_policy_type_wise_count as $row): ?>
<tr>
<td style="padding:10px 8px;border-bottom:1px solid #eee;font-size:13px;">
<span class="badge" style="display:inline-block;padding:2px 8px;border-radius:10px;font-size:11px;background:#ecf0f1;color:#2c3e50;"><?= esc($row['policy_type']) ?></span>
</td>
<td style="padding:10px 8px;border-bottom:1px solid #eee;font-size:13px;text-align:right;font-weight:bold;"><?= $row['count'] ?></td>
</tr>
<?php endforeach; ?>
<?php else: ?>
<tr>
<td colspan="2" style="padding:10px 8px;border-bottom:1px solid #eee;font-size:12px;text-align:center;color:#7f8c8d;">
No BDS activity recorded for today.
</td>
</tr>
<?php endif; ?>
</tbody>
</table>
</div>
<!-- Claims -->
<h3 class="section-title" style="font-size:17px;color:#2c3e50;border-bottom:2px solid #3498db;display:inline-block;margin:18px 0 12px;padding-bottom:4px;">Claims</h3>
<div class="stats-grid">
<div class="stat-card" style="width:100%;display:block;background:#f8f9fa;padding:12px 14px;border-radius:6px;border-left:4px solid #d35400;box-sizing:border-box;margin-bottom:10px;">
<div class="stat-label">Total Claims Registered for the day</div>
<div class="stat-value"><?= $total_claim_count ?? 0 ?></div>
<div class="stat-note"></div>
</div>
</div>
<h3 class="section-title" style="font-size:17px;color:#2c3e50;border-bottom:2px solid #3498db;display:inline-block;margin:18px 0 12px;padding-bottom:4px;">Claim Status Breakdown</h3>
<div style="padding:10px 8px;border:1px solid #eee;border-radius:4px;font-size:12px;text-align:center;color:#7f8c8d;margin-top:8px;">
The total claims received so far are listed policy type-wise.
</div>
<?php
$claimSections = [
'GMC Claims' => $total_gmc_status_wise_claim_count ?? [],
'GPA Claims' => $total_gpa_status_wise_claim_count ?? [],
'EDLI Claims' => $total_edli_status_wise_claim_count ?? [],
'GTLI Claims' => $total_gtli_status_wise_claim_count ?? [],
];
$hasAnyClaimData = false;
?>
<?php foreach ($claimSections as $sectionTitle => $rows): ?>
<?php if (!empty($rows)): ?>
<?php $hasAnyClaimData = true; ?>
<h4 style="font-size:14px;color:#34495e;margin:14px 0 6px;"><?= esc($sectionTitle) ?></h4>
<div class="table-container" style="width:100%;margin-bottom:10px;">
<table class="status-table" style="width:100%;border-collapse:collapse;margin-top:4px;">
<thead>
<tr>
<th style="background-color:#ecf0f1;text-align:left;padding:10px 8px;font-size:13px;border-bottom:2px solid #bdc3c7;">Status</th>
<th style="background-color:#ecf0f1;text-align:right;padding:10px 8px;font-size:13px;border-bottom:2px solid #bdc3c7;">Count</th>
</tr>
</thead>
<tbody>
<?php foreach ($rows as $row): ?>
<tr>
<td style="padding:10px 8px;border-bottom:1px solid #eee;font-size:13px;">
<span class="badge" style="display:inline-block;padding:2px 8px;border-radius:10px;font-size:11px;background:#ecf0f1;color:#2c3e50;"><?= esc($row['claim_status']) ?></span>
</td>
<td style="padding:10px 8px;border-bottom:1px solid #eee;font-size:13px;text-align:right;font-weight:bold;"><?= $row['count'] ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<?php endif; ?>
<?php endforeach; ?>
</div>
<div class="footer" style="background:#f8f9fa;padding:14px 18px;text-align:center;font-size:11px;color:#95a5a6;">
This is an automated system generated report. Please do not reply to this email.
</div>
</div>
</body>
</html>