<!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: 1px solid #000;
          	border-top: 1px dashed #000;
          	margin-bottom: 20px;
        }

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

        .table_patient tbody td {
            padding: 0px 10px;
            vertical-align: middle;
            border: 0;
            font-size: 15px;
        }
      
      	.table_reg {
            width: 100%;
        	border-collapse: collapse;
            border: 1px solid #000;
        	border-bottom: none;
          	border-top: 1px dashed #000;
        }
      	.table_h {
            width: 100%;
        	border-collapse: collapse;
            border: 1px solid #000;
        	border-bottom: none;
        }

        .report {
            margin-top: 10px;
            min-height: 670px;
            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 class="table_h" 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;"></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_reg">
            <tr style="border-bottom:none;">
              <td width="15%"><b>Registered On</b></td>
              <td width="1%">:</td>
              <td width="25%"><?php echo date('d/m/Y h:i A', strtotime($template->createdpatient)); ?></td>
              <td width="35%" style="text-align: center;" rowspan="3"><img src="<?php echo IMG_URL; ?>repot_qrcode.png" alt="h" width="20%"></td>
              <td><b>Specimen:</b> <span style="text-transform: uppercase;"><?php echo $template->specimen; ?></span></td>
            </tr>
            <tr>
              <td width="15%"><b>Invoice Date</b></td>
              <td width="1%">:</td>
              <td width="25%"><?php echo date('d/m/Y h:i A', strtotime($template->billcreate)); ?></td>    
              <td rowspan="2" style="vertical-align: top;"><b>Test advice:</b> <?php echo $template->tname; ?></td>
            </tr>
            <tr>
              <td width="15%"><b>Delivery Date</b></td>
              <td width="1%">:</td>
              <td width="15%"><?php echo date('d/m/Y h:i A'); ?></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 colspan="2" style="border-left:none; border-right:none;"><b><?php echo $template->patient; ?></b></td>
                        <td style="border-left:none; border-right:none;"><b>Gender:</b> <?php echo $this->lang->line($template->gender); ?></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 colspan="3" style="border-left:none;"><?php echo $template->dob != NULL ? floor((time() - strtotime($template->dob)) / 31556926) : ''; ?> Yrs</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="reportultra">
                <?php echo $template->template ? $template->template : ''; ?>
            </div>
            <!-- Repoart Body End-->

            <!-- Footer -->

            <div class="footer" style="width: 100%; margin-top: 70px;">
                <div style="width: 30%; float: left;">
                    &nbsp;
                </div>
                <div style="width: 30%; margin: 0 5%; float: left;">
                    &nbsp;
                </div>
                <div style="width: 30%; float: left;">
                    <?php echo $template->ultrasonography ? $template->ultrasonography : ''; ?>
                </div>
            </div>
        </div>
    </div>
</body>

</html>