File: /var/www/html/taxicamera/application/views/admin/report/levy/levy_report_pdf.php
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>Punjab Motors</title>
<link href="https://fonts.googleapis.com/css?family=Open+Sans&display=swap" rel="stylesheet">
<style>
.content_part {
width: 70%;
margin: 0 auto;
font-family: 'Open Sans', sans-serif;
}
.header_part {
text-align: center;
}
</style>
</head>
<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0" style="font-family: Verdana,' sans-serif';">
<tbody>
<tr>
<td align="center" style="padding: 10px;"><img src="./public/images/logo_pdf.png"></td>
</tr>
<tr>
<td align="center">
<h4 style="margin: 0;padding: 3px 0;">24 Graham Rd Clayton South , VIC-3169 Australia</h4>
<h4 style="margin: 0;padding: 3px 0;">Ph: +61 3 9540 8998</h4>
<h4 style="margin: 0;padding: 3px 0;">Email: punjabmotor@hotmail.com</h4>
</td>
</tr>
<tr>
<td style="padding: 20px 0 30px 0;">
<h4 style="margin: 0 0 15px 0;padding: 3px 0; text-align: center ">Levy Report</h4>
<table border="0" width="100%" cellpadding="0" cellspacing="0" style="border-top: #ddd 1px solid; border-right: #ddd 1px solid;">
<tr>
<td style="border-bottom: #ddd 1px solid; border-left: #ddd 1px solid; padding: 10px"><strong>Period</strong></td>
<td style="border-bottom: #ddd 1px solid; border-left: #ddd 1px solid; padding: 10px"><?= $levy_data[0]['created_ts'] ?></td>
<td style="border-bottom: #ddd 1px solid; border-left: #ddd 1px solid; padding: 10px"><strong>Till</strong></td>
<td style="border-bottom: #ddd 1px solid; border-left: #ddd 1px solid; padding: 10px"><?= $levy_data[count($levy_data) - 1]['created_ts'] ?></td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="left">
<h4 style="margin: 0;padding: 3px 0;"><?= $levy_data[0]['full_name'] ?></h4>
<h4 style="margin: 0;padding: 3px 0;"><?= $levy_data[0]['address'] ?></h4>
<h4 style="margin: 0;padding: 3px 0;">DC No: <?= $levy_data[0]['dc_no'] ?></h4>
<h4 style="margin: 0;padding: 3px 0;">ABN: <?= $levy_data[0]['abn'] ?></h4>
<h4 style="margin: 0;padding: 3px 0;">Mob: <?= $levy_data[0]['mobile'] ?></h4>
</td>
</tr>
<tr>
<td>
<table width="100%" border="0" cellpadding="0" cellspacing="0" style="border-top: #ddd 1px solid; border-right: #ddd 1px solid;">
<thead>
<tr>
<th align="center" style="border-bottom: #ddd 1px solid; border-left: #ddd 1px solid; padding: 10px">Date</th>
<th align="center" style="border-bottom: #ddd 1px solid; border-left: #ddd 1px solid; padding: 10px">Car No</th>
<th align="center" style="border-bottom: #ddd 1px solid; border-left: #ddd 1px solid; padding: 10px">Shift</th>
<th align="center" style="border-bottom: #ddd 1px solid; border-left: #ddd 1px solid; padding: 10px">Hail Job</th>
<th align="center" style="border-bottom: #ddd 1px solid; border-left: #ddd 1px solid; padding: 10px">Booking Job</th>
<th align="center" style="border-bottom: #ddd 1px solid; border-left: #ddd 1px solid; padding: 10px">Amount</th>
<th align="center" style="border-bottom: #ddd 1px solid; border-left: #ddd 1px solid; padding: 10px">GST</th>
<th align="center" style="border-bottom: #ddd 1px solid; border-left: #ddd 1px solid; padding: 10px">Total</th>
</tr>
</thead>
<tbody>
<?php $total_levy_amt =0;$total_levy_gst_amt = $total_levy_without_gst = 0;
foreach ($levy_data as $key => $levy) {?>
<tr>
<td align="center" style="border-bottom: #ddd 1px solid; border-left: #ddd 1px solid; padding: 10px"><?= $levy['created_ts'] ?></td>
<td align="center" style="border-bottom: #ddd 1px solid; border-left: #ddd 1px solid; padding: 10px"><?= $levy['registration_no'] ?></td>
<?php if($levy['shift_name'] == "D"){
$shift_name = "Day";
}
else if($levy['shift_name'] == "H"){
$shift_name = "Hungry";
}
else{
$shift_name = "Night";
}
?>
<td align="center" style="border-bottom: #ddd 1px solid; border-left: #ddd 1px solid; padding: 10px"><?= $shift_name ?></td>
<?php
$levy_gst_amt = $levy_without_gst = $hail_job_cnt= $booking_job_cnt = 0;
if ((isset($levy['levy']) && isset($levy['levy_gst']))) {
$levy_without_gst = ($levy['levy']) * 100 / (100 + $levy['levy_gst']);
$levy_gst_amt = $levy['levy'] - $levy_without_gst;
}
$total_levy_gst_amt +=$levy_gst_amt;
$total_levy_without_gst +=$levy_without_gst;
$total_levy_amt +=$levy['levy'];
$hail_job_cnt = number_format(abs((($levy['extra_end'] - $levy['extra_start'])/2) - ($levy['no_of_hiring_end'] - $levy['no_of_hiring_start'])),0);
$booking_job_cnt = number_format(abs(($levy['no_of_hiring_end'] - $levy['no_of_hiring_start']) - $hail_job_cnt),0);
?>
<td align="center" style="border-bottom: #ddd 1px solid; border-left: #ddd 1px solid; padding: 10px"><?= $hail_job_cnt ?></td>
<td align="center" style="border-bottom: #ddd 1px solid; border-left: #ddd 1px solid; padding: 10px"><?= $booking_job_cnt ?></td>
<td align="center" style="border-bottom: #ddd 1px solid; border-left: #ddd 1px solid; padding: 10px"><?= number_format($levy_without_gst,2) ?></td>
<td align="center" style="border-bottom: #ddd 1px solid; border-left: #ddd 1px solid; padding: 10px"><?= number_format($levy_gst_amt,2) ?></td>
<td align="center" style="border-bottom: #ddd 1px solid; border-left: #ddd 1px solid; padding: 10px"><?= number_format($levy['levy'],2) ?></td>
</tr>
<?php } ?>
<tr>
<td colspan="5" align="center" style="border-bottom: #ddd 1px solid; border-left: #ddd 1px solid; padding: 10px"><strong>TOTAL</strong></td>
<td align="center" style="border-bottom: #ddd 1px solid; border-left: #ddd 1px solid; padding: 10px"><strong><?=number_format($total_levy_without_gst,2)?></strong></td>
<td align="center" style="border-bottom: #ddd 1px solid; border-left: #ddd 1px solid; padding: 10px"><strong><?=number_format($total_levy_gst_amt,2)?></strong></td>
<td align="center" style="border-bottom: #ddd 1px solid; border-left: #ddd 1px solid; padding: 10px"><strong><?=number_format($total_levy_amt,2)?></strong></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</body>
</html>