<?php
include getcwd() . "/codes/patient-details-by-get-id.php";
include getcwd() . "/codes/get-payment-details-by-payment-id.php";
?>

<!-- Main Content -->
<div class="container">
  <div class="row">

    <div class="col-md-12">
      <div class="widget-area-2 proclinic-box-shadow pb-3">

        <!-- Invoice Head -->
        <div class="text-center">
          <button onclick="print();" class="button btn-sm" style="text-align:center;">Print</button>
        </div>
        <div style="height:80px;"></div>
        <div class="row justify-content-md-center">
          <div class="col-md-auto">
            <div class="col-sm-12">
              <div class="row">
                <div class="col-sm-6" style="line-height: .9 !important; ">
                  <img src="<?php echo imgPATH . $siteLogo['configValue']; ?>"> |
                  <img src="<?php echo imgPATH; ?>uduth-logo.png" width="60">
                  <br>
                  <small>
                      <?php
                      print($udutAddress["configValue"]);
                      ?>
                  </small>
                </div>
                <div class="col-sm-6">
                  <div class="text-md-right ">
                    <h3>[Receipt Info]</h3>
                    <img src="<?php echo path(); ?>functions/lib.barcode.php?text=<?php echo $receiptNo; ?>"/>
                    <br>
                    <span>Invoice No. <?php echo $receiptNo; ?></span>
                    <br>
                    <span>Patient ID: <?php echo $patient['patientUId']; ?></span>
                    <br>
                    <span>Date: <?php echo $patient['patientDateAdded']; ?></span>
                  </div>
                </div>
              </div>
              <hr>
              <div class="row">
                <div class="col-md-6">
                  <table class="table table-bordered table-striped table-invioce" width="100%">
                    <tbody>
                    <tr>
                      <th style="padding: 0 5px;" scope="row">PatientUID</th>
                      <td style="padding: 0 5px;"><?php echo $patient['patientUId']; ?></td>
                    </tr>
                    <tr>
                      <th style="padding: 0 5px;" scope="row">Name</th>
                      <td style="padding: 0 5px;"><?php echo $patient['patientName']; ?></td>
                    </tr>
                    <tr>
                      <th style="padding: 0 5px;" scope="row">Gender</th>
                      <td style="padding: 0 5px;"><?php echo $patient['patientGender']; ?></td>
                    </tr>
                    <tr>
                      <th style="padding: 0 5px;" scope="row">Address</th>
                      <td style="padding: 0 5px;"><?php echo $patient['patientAddress']; ?></td>
                    </tr>
                    <tr>
                      <th style="padding: 0 5px;" scope="row">Patient Type</th>
                      <td style="padding: 0 5px;"><?php echo $patient['patientTypeName']; ?></td>
                    </tr>
                    <tr>
                      <th style="padding: 0 5px;" scope="row">Patient File No</th>
                      <td style="padding: 0 5px;"><?php echo $patient['patientFileNo']; ?></td>
                    </tr>
                    <tr>
                      <td style="padding: 0 5px;" colspan="2" align="center">
                        <img src="<?php echo path(); ?>functions/lib.barcode.php?text=<?php echo $patient['patientUId']; ?>"/>
                      </td>
                    </tr>
                    </tbody>
                  </table>
                </div>
                <div class="col-md-6">
                  <table class="table table-bordered table-striped table-invioce" width="100%">
                    <thead>
                    <tr>

                      <th>Service Type</th>
                      <th>Amount Paid</th>
                      <th>Payment Type</th>
                      <th>Date</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr>

                      <td style="padding: 0 5px;"><?php echo $receipt['typeName']; ?></td>
                      <td style="padding: 0 5px;"><?php echo $receipt['typeAmount']; ?></td>
                      <td style="padding: 0 5px;"><?php echo $receipt['paymentTypeName']; ?></td>
                      <td style="padding: 0 5px;"><?php echo $receipt['paymentDateAdded']; ?></td>
                    </tr>
                    </tbody>
                  </table>
                </div>
              </div>
            </div>
          </div>
          <br>
          <br>
          <h5>Served By: <?php echo $user['userFullname']; ?></h5>
        </div>
        <div style="height:80px;"></div>
        <!-- /Invoice Head -->

        <hr style="border: 2px dashed #cccccc;">

        <!-- Invoice Head -->
        <div style="height:80px;"></div>
        <div class="row justify-content-md-center">
          <div class="col-md-auto">
            <div class="col-sm-12">
              <div class="row">
                <div class="col-sm-6" style="line-height: .9 !important; ">
                  <img src="<?php echo imgPATH . $siteLogo['configValue']; ?>"> |
                  <img src="<?php echo imgPATH; ?>uduth-logo.png" width="60">
                  <br>
                  <small>
                      <?php
                      print($udutAddress["configValue"]);
                      ?>
                  </small>
                </div>
                <div class="col-sm-6">
                  <div class="text-md-right ">
                    <h3>[Receipt Info]</h3>
                    <img src="<?php echo path(); ?>functions/lib.barcode.php?text=<?php echo $receiptNo; ?>"/>
                    <br>
                    <span>Invoice No. <?php echo $receiptNo; ?></span>
                    <br>
                    <span>Patient ID: <?php echo $patient['patientUId']; ?></span>
                    <br>
                    <span>Date: <?php echo $patient['patientDateAdded']; ?></span>
                  </div>
                </div>
              </div>
              <hr>
              <div class="row">
                <div class="col-md-6">
                  <table class="table table-bordered table-striped table-invioce" width="100%">
                    <tbody>
                    <tr>
                      <th style="padding: 0 5px;" scope="row">PatientUID</th>
                      <td style="padding: 0 5px;"><?php echo $patient['patientUId']; ?></td>
                    </tr>
                    <tr>
                      <th style="padding: 0 5px;" scope="row">Name</th>
                      <td style="padding: 0 5px;"><?php echo $patient['patientName']; ?></td>
                    </tr>
                    <tr>
                      <th style="padding: 0 5px;" scope="row">Gender</th>
                      <td style="padding: 0 5px;"><?php echo $patient['patientGender']; ?></td>
                    </tr>
                    <tr>
                      <th style="padding: 0 5px;" scope="row">Address</th>
                      <td style="padding: 0 5px;"><?php echo $patient['patientAddress']; ?></td>
                    </tr>
                    <tr>
                      <th style="padding: 0 5px;" scope="row">Patient Type</th>
                      <td style="padding: 0 5px;"><?php echo $patient['patientTypeName']; ?></td>
                    </tr>
                    <tr>
                      <th style="padding: 0 5px;" scope="row">Patient File No</th>
                      <td style="padding: 0 5px;"><?php echo $patient['patientFileNo']; ?></td>
                    </tr>
                    <tr>
                      <td style="padding: 0 5px;" colspan="2" align="center">
                        <img src="<?php echo path(); ?>functions/lib.barcode.php?text=<?php echo $patient['patientUId']; ?>"/>
                      </td>
                    </tr>
                    </tbody>
                  </table>
                </div>
                <div class="col-md-6">
                  <table class="table table-bordered table-striped table-invioce" width="100%">
                    <thead>
                    <tr>

                      <th>Service Type</th>
                      <th>Amount Paid</th>
                      <th>Payment Type</th>
                      <th>Date</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr>

                      <td style="padding: 0 5px;"><?php echo $receipt['typeName']; ?></td>
                      <td style="padding: 0 5px;"><?php echo $receipt['typeAmount']; ?></td>
                      <td style="padding: 0 5px;"><?php echo $receipt['paymentTypeName']; ?></td>
                      <td style="padding: 0 5px;"><?php echo $receipt['paymentDateAdded']; ?></td>
                    </tr>
                    </tbody>
                  </table>
                </div>
              </div>
            </div>
          </div>
          <br>
          <br>
          <h5>Served By: <?php echo $user['userFullname']; ?></h5>
        </div>

        <div style="height:80px;"></div>
        <!-- /Invoice Head -->


      </div>
      <!-- /Invoice Content -->
    </div>
  </div>
</div>
</div>
<!-- /Main Content -->
