<!DOCTYPE html>
<html>

<head>
    <title>Report Print</title>
    <style>
        body {
            font-family: "Arial, sans-serif";
            font-size: 13px;
        }

        .page {
            width: 100%;
            margin: 0 auto;
        }

        .main_body {
            margin-top: 110px;
        }


        .table {
            width: 100%;
            border: 0.5px solid #b4b4b4;
            border-radius: 10px;
        }

        .table_patient thead th {
            padding: 0;
            vertical-align: middle;
            border: 0.5px solid #b4b4b4;
            
            font-size: 12px;
        }

        .table_patient tbody td {
            padding: 0px 0px;
            vertical-align: middle;
            border: 0;
            font-size: 12px;
        }
       .table_rvalue{
            width: 100%;
            border: 0.5px solid #000;
            margin-top: 10px;
       }

        .report {
            margin-top: 10px;
            min-height: 570px;
            font-size: 12px;
        }

        .report table td {
            padding-left: 3px;
            vertical-align: middle;
        }

        .footer p {
            font-size: 10px;
        }

        .footer strong {
            font-size: 10px;
        }
    </style>
    <?php if ($this->global_setting->backend_custom_css) { ?>
        <style>
            <?php echo $this->global_setting->backend_custom_css; ?>
        </style>
    <?php } ?>
</head>

<body>
    <div class="page">
        <div class="main_body">
            <div style="text-align: center; font-size: 20px; font-weight: bold; text-transform: uppercase; margin-bottom: 10px;"><?php echo $template->group; ?> Report</div>
            <table class="table table_patient">
                <tbody>
                    <tr>
                        <td width="7%" style="border-right:none;"><b>ID No:</b></td>
                        <td width="1%" style="border-left:none; border-right:none;"><b>:</b></td>
                        <td width="23%" style="border-left:none; border-right:none; text-transform:uppercase"><b><?php echo $template->patient_unique_id; ?></b></td>
                        <td width="33%" style="border-left:none; border-right:none;">Received: <?php echo $template->bill_date; ?></td>
                        <td width="36%" style="border-left:none; border-right:none;">Print Date: <?php echo date('d/m/Y h:i A'); ?></td>
                        
                    </tr>
                    <tr>
                        <td width="7%" style="border-right:none;">Name</td>
                        <td width="1%" style="border-left:none; border-right:none;">:</td>
                        <td style="border-left:none; border-right:none;"><?php echo $template->patient; ?></td>
                        <td style="border-right:none;">Gender: <?php echo $this->lang->line($template->gender); ?></td>
                        <td style="border-left:none; border-right:none;">Age: <?php echo $template->dob != NULL ? floor((time() - strtotime($template->dob)) / 31556926) : ''; ?> Yrs</td>
                        
                    </tr>
                    
                    <tr>
                        <td width="7%" style="border-right:none;">Refd. By</td>
                        <td width="1%" style="border-left:none; border-right:none;">:</td>
                        <td colspan="3" style="font-size: 12px; border-left:none;">
                            
                                <?php if ($template->self) {
                                    echo 'Self';
                                } elseif ($template->ref_dr_id > 0) {
                                    echo $template->doctor . ', ' . $template->specialist;
                                } else {
                                    echo $template->ref_dr_name;
                                }
                                ?>
                            
                        </td>
                    </tr>
                    <tr>
                        <td width="7%" style="border-right:none;">Specimen:</td>
                        <td width="1%" style="border-left:none; border-right:none;">:</td>
                        <td style="font-size: 12px; border-left:none; text-transform: uppercase;"><?php echo $template->specimen; ?></td>
                        <td colspan="2" style="border-right:none;">Address: <?php echo $template->address; ?></td>
                    </tr>
                    <?php if ($template->remark) { ?>
                        <tr>
                            <td width="7%" style="border-right:none;">Remark:</td>
                            <td width="1%" style="border-left:none; border-right:none;"><b>:</b></td>
                            <td colspan="2" style="border-left:none;"><?php echo $template->remark; ?></td>
                        </tr>
                    <?php } ?>
                </tbody>
            </table>
            <?php 
            
            $Your_array = [1,2,69];
            if (in_array($template->investagation_id, $Your_array)) { ?>
               
            <?php } else { ?>
                <table class="table_rvalue">
                    <tr>
                        <td width="40%" style="border-right:0.5px solid #b4b4b4;"><b>Test</b></td>
                        <td width="30%" style="border-right:0.5px solid #b4b4b4;"><b>Result</b></td>
                        <td width="30%"><b>Reference Value</b></td>
                        
                    </tr>
            </table>
            <style>
                .report td:first-child{
                    width:40% !important;
                }
             .report td:first-child + td{
                    width:30% !important;
                }
                .report td:last-child{
                    width:30% !important;
                }
            </style>
            <?php } ?>
            <style>
                .report td:first-child{
                    width:40% !important;
                }
             .report td:first-child + td{
                    width:30% !important;
                }
                .report td:last-child{
                    width:30% !important;
                }
            </style>
            
            

            <!-- Repoart Body Start-->
            <div class="report">
                <?php echo $template->template ? $template->template : ''; ?>
            </div>
            <!-- Repoart Body End-->

            <!-- Footer -->
            
            <div class="footer" style="width: 100%;">
                <div style="width: 30%; float: left;">
                <?php echo isset($signature_1->name) && !empty($signature_1->name) ? $signature_1->name : '&nbsp;'; ?>
                </div>
                <div style="width: 30%; margin: 0 5%; float: left;">
                    <?php echo isset($signature_2->name) && !empty($signature_2->name) ? $signature_2->name : '&nbsp;'; ?>
                </div>
                <div style="width: 30%; float: left;">
                <?php echo isset($signature_3->name) && !empty($signature_3->name) ? $signature_3->name : '&nbsp;'; ?>
                </div>
            </div>
        </div>
    </div>
</body>

</html>