<!DOCTYPE html>
<html>

<head>
    <title>Report Print</title>
    <style>
        body {
            font-family: "Time New Roman";
            font-size: 13px;
        }

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

        .main_body {
            margin-top: 160px;
        }


        .table {
            width: 100%;
            border-collapse: collapse;
            border: 1px solid #000;
        }
      .table_reg {
            width: 100%;
        	border-collapse: collapse;
            border: 1px solid #000;
        	border-bottom: none;
        }

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

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

        .report {
            margin-top: 10px;
            min-height: 530px;
            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->custom_css) { ?>
    <style>
        <?php echo $this->global_setting->custom_css; ?>
    </style>
    <?php } ?>
</head>

<body>
    <div class="page">
        <div class="main_body">
          
          <table style="width: 100%;">
          	<tr>
              <td style="width: 25%;">
                <img src="<?php echo IMG_URL; ?>report_barcode.png" alt="h" width="50%">
              </td>
              <td style="width: 50%;">
              	<div style="text-align: center; vertical-align: bottom; font-size: 15px; font-weight: bold; text-transform: uppercase; margin-bottom: 10px;"><?php echo $template->group; ?> Report</div>
              </td>
              <td style="text-align: right; width: 25%;">
              	<img src="<?php echo IMG_URL; ?>report_barcode.png" alt="h" width="50%">
              </td>            
            </tr>
          </table>    
          <table class="table table_patient">
                <tbody>
                    <tr>
                        <td width="14%" style="border-right:none;"><b>ID No:</b></td>
                        <td width="1%" style="border-left:none; border-right:none;"><b>:</b></td>
                        <td style="border-left:none; border-right:none; text-transform:uppercase"><b><?php echo $template->patient_unique_id; ?></b></td>
                        <td style="border-left:none; border-right:none;"> </td>
                        <td width="35%" style="border-left:none; border-right:none;"><b>Invoice no:</b> <?php echo $template->custom_invoice_id; ?></td>
                        
                    </tr>
                    <tr>
                        <td width="14%" style="border-right:none;"><b>Name</b></td>
                        <td width="1%" style="border-left:none; border-right:none;">:</td>
                        <td style="border-left:none; border-right:none;"><b><?php echo $template->patient; ?></b></td>
                        <td style="border-right:none;"></td>
                        <td style="border-left:none; border-right:none;"><b>Received Date:</b> <?php echo date('d/m/Y', strtotime($template->billcreate)); ?></td>
                        
                    </tr>
                  	<tr>
                        <td width="14%" style="border-right:none;"><b>Age:</b></td>
                        <td width="1%" style="border-left:none; border-right:none;">:</td>
                        <td style="border-left:none; border-right:none;"><?php echo calculate_age($template->dob); ?></td>
                        <td style="border-right:none;"></td>
                        <td style="border-left:none; border-right:none;"><b>Specimen:</b> <span style="text-transform:uppercase"><?php echo $template->specimen; ?></span></td>
                    </tr>
                    <tr>
                        <td width="14%" style="border-right:none;"><b>Gender:</b></td>
                        <td width="1%" style="border-left:none; border-right:none;">:</td>
                        <td style="border-left:none; border-right:none;"><?php echo $this->lang->line($template->gender); ?></td>
                        <td style="border-right:none;"></td>
                        <td style="border-left:none; border-right:none;"><b>Mobile:</b> <?php echo $template->mobile; ?> </td>
                    </tr>
                    
                    <tr>
                        <td width="14%" style="border-right:none;"><b>Refd. By</b></td>
                        <td width="1%" style="border-left:none; border-right:none;">:</td>
                        <td colspan="3" style="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>
                
                    <?php if ($template->remark) { ?>
                        <tr>
                            <td width="14%" style="border-right:none;"><b>Remark:</b></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>          
            

            <!-- 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>