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

  <div class="row">
    <!-- Widget Item -->
    <div class="col-md-12">
      <div class="widget-area-2 proclinic-box-shadow">
        <h3 class="widget-title">Add Patient</h3>
        <form name="add-patient-form" method="post" action="<?php echo path(); ?>codes/add-patient-form.php"
              enctype="multipart/form-data">
          <div class="row justify-content-center">
            <div class="col-md-8">
              <div class="row">
                <div class="form-group col-md-6">
                  <label for="patientName">Fullname</label>
                  <input name="patientName" type="text" required class="form-control" placeholder="Patient name"
                         id="patientName">
                </div>
                <div class="form-group col-md-6">
                  <label for="patientDob">Date Of Birth</label>
                  <input name="patientDob" type="date" required placeholder="Date of Birth" class="form-control"
                         id="patientDob">
                </div>
                <div class="form-group col-md-6">
                  <label for="patientGender">Gender</label>
                  <select name="patientGender" required class="form-control" id="patientGender">
                    <option>Male</option>
                    <option>Female</option>
                    <option>Other</option>
                  </select>
                </div>
                <!--<div class="form-group col-md-6">
                  <label for="patientGender">Type</label>
                  <select name="typeId" required class="form-control" id="patientGender">
                    <?php
                /*                      $stmt = $conn->query("SELECT * FROM udut_services_types ORDER BY typeName ASC");
                                      foreach ($stmt as $type){
                                        echo print "<option value='".$type['typeId']."'>".$type['typeName']."</option>";
                                      }
                                    */ ?>
                  </select>
                </div>-->
                <div class="form-group col-md-6">
                  <label for="patientPhone">Phone</label>
                  <input name="patientPhone" type="text" required placeholder="Phone" class="form-control"
                         id="patientPhone">
                </div>
                <div class="form-group col-md-6">
                  <label for="patientEmail">Email</label>
                  <input name="patientEmail" type="email" placeholder="Email" class="form-control" id="patientEmail">
                </div>
                <div class="form-group col-md-6">
                  <label for="patientCompanion">Name of Companion</label>
                  <input name="patientCompanion" type="text" required placeholder="Name of Companion"
                         class="form-control" id="patientCompanion">
                </div>
                <div class="form-group col-md-12">
                  <label for="patientAddress">Address</label>
                  <textarea name="patientAddress" required placeholder="Address" class="form-control"
                            id="patientAddress"
                            rows="3"></textarea>
                </div>
                <!--<div class="form-group col-md-12">
                  <label for="patientReferralLetter">Referral Letter</label>
                  <input name="patientReferralLetter" type="file" class="form-control" id="patientReferralLetter">
                </div>-->
                <div class="form-group col-md-6">
                  <label for="patientTypeId">Patient Type</label>
                  <select name="patientTypeId" required class="form-control" id="patientTypeId">
                      <?php
                      $stmt = $conn->query("SELECT * FROM udut_patients_types ORDER BY patientTypeName ASC");
                      while ($type = $stmt->fetch_array()) {
                          echo print "<option value='" . $type['patientTypeId'] . "'>" . $type['patientTypeName'] . "</option>";
                      }
                      ?>
                  </select>
                </div>
                <div class="form-group col-md-6">
                  <label for="patientFileNo">Patient File No. (If Local)</label>
                  <input name="patientFileNo" type="text" placeholder="Patient File No. (If Local)" class="form-control"
                         id="patientFileNo">
                </div>
                <div class="form-group col-md-12">
                  <label for="typeId">Service</label>
                  <select name="serviceId" required class="form-control" id="serviceId">
                      <?php
                      $stmt = $conn->query("SELECT * FROM udut_services ORDER BY serviceName ASC");
                      while ($service = $stmt->fetch_array()) {
                          echo print "<option value='" . $service['serviceId'] . "'>" . $service['serviceName'] . "</option>";
                      }
                      ?>
                  </select>
                </div>
                <div class="form-group col-md-6">
                  <label for="typeId">Service Type</label>
                  <br>
                  <label class="container-radio">Adult
                    <input type="radio" name="typeId" value="Adult" required>
                    <span class="checkmark"></span>
                  </label>
                  <label class="container-radio">Child
                    <input type="radio" name="typeId" value="Child" required>
                    <span class="checkmark"></span>
                  </label>
<!--                  <label for="typeId">Service Type</label>-->
<!--                  <select name="typeId" required class="form-control" id="typeId">-->
<!--                      --><?php
//                      $stmt = $conn->query("SELECT * FROM udut_services_types ORDER BY typeName ASC");
//                      while ($type = $stmt->fetch_array()) {
//                          echo print "<option value='" . $type['typeId'] . "'>" . $type['typeName'] . "</option>";
//                      }
//                      ?>
<!--                  </select>-->
                </div>
                <div class="form-group col-md-6">
                  <label for="paymentTypeId">Payment Type</label>
                  <select name="paymentTypeId" required class="form-control" id="paymentTypeId">
                      <?php
                      $stmt = $conn->query("SELECT * FROM udut_payments_types");
                      while ($type = $stmt->fetch_array()) {
                          echo print "<option value='" . $type['paymentTypeId'] . "'>" . $type['paymentTypeName'] . "</option>";
                      }
                      ?>
                  </select>
                </div>
                <div class="form-group col-md-6">
                  <label for="paymentStatusId">Payment Status</label>
                  <select name="paymentStatusId" required class="form-control" id="paymentStatusId">
                      <?php
                      $stmt = $conn->query("SELECT * FROM udut_payments_status");
                      while ($status = $stmt->fetch_array()) {
                          echo print "<option value='" . $status['paymentStatusId'] . "'>" . $status['paymentStatusName'] . "</option>";
                      }
                      ?>
                  </select>
                </div>
                <div class="form-group col-md-6">
                  <label for="patientReferralLetter">Referral Letter</label>
                  <input name="patientReferralLetter" type="file" class="form-control" id="patientReferralLetter">
                </div>
                <div class="form-check col-md-12 mb-2">
                  <div class="text-left">
                    <div class="custom-control custom-checkbox">
                      <input class="custom-control-input" type="checkbox" id="ex-check-2" required>
                      <label class="custom-control-label" for="ex-check-2">Please Confirm</label>
                    </div>
                  </div>
                </div>
                <div class="form-group col-md-6 mb-3">
                  <button type="submit" class="btn btn-primary btn-lg">Submit</button>
                </div>
              </div>
            </div>
          </div>
        </form>
        <hr>
      </div>
    </div>
    <!-- /Widget Item -->
  </div>
</div>
<!-- /Main Content -->


