单击提交按钮

时间:2019-06-13 21:12:41

标签: php html sql oracle modal-dialog

因此,我正在尝试创建一个页面,其中当用户选择患者时,该表将显示该患者当前的账单,并且该表正在运行,除了当我单击按钮时,模态退出但当我重新打开该表时显示

这是我的代码:

<div id="check_patient_bill" class="modal">
 <div class="modal-content">
 <h4>Check Patien Bill</h4>
</div>
<div class="row">


    <!-- Select the Patient -->

        <form class="col s12" action="" method="POST" onsubmit="required()" id="check_patient_bill">
            <div class="row">
            <div class="input-field col s12">


              <select name="bill_pid" id="bill_pid" class="browser-default">
                <?php

                $query = "SELECT PID,PNAME FROM PATIENT";
                $stid = oci_parse($conn, $query);
                oci_execute($stid);
                while ($row = oci_fetch_array($stid, OCI_ASSOC+OCI_RETURN_NULLS)) {

                ?>

                <option value="<?php echo $row['PID'];?>"> <?php echo $row['PNAME']; ?></option>

                <?php
                }
                ?>

              </select>  
            </div>
            </div>

            <div class="row">
                <button data-target='bill' class ="waves-effect waves-light btn modal-trigger col s2 offset-s5" name="check_bill" type="submit"  >Submit</button>
                <i class="material-icons right">send</i>
                </button>
            </div>
        </form>

    <!-- display table when the user selects the patient -->

    <table class="highlight">
    <thead>
      <tr>
          <th>Bill ID</th>
          <th>Medicine Charges</th>
          <th>Doctor Charges</th>
          <th>Room Charges</th>
          <th>Total</th>
      </tr>
    </thead>
    <tbody>
    <?php
        if(isset($_POST['check_bill'])){
            $pid = $_POST['bill_pid'];
            $query = "SELECT BID, MEDICINE_CHARGES , DOCTOR_CHARGES, ROOM_CHARGES
            FROM BILL
            WHERE PID= '$pid'";
            $stid = oci_parse($conn, $query);
            oci_execute($stid);
            while ($row = oci_fetch_array($stid, OCI_ASSOC+OCI_RETURN_NULLS)) {
            echo "<tr>\n";     
            echo"<tr><td>";
                    echo $row['BID'];
                    echo "</td><td>";
                    echo $row['MEDICINE_CHARGES'];
                    echo "</td><td>";
                    echo $row['DOCTOR_CHARGES'];
                    echo "</td><td>";
                    echo $row['ROOM_CHARGES'];
                    echo"</td></tr>\n";

            }
        }
    ?>
</tbody>
</table>
</div>
</div>
</div>

当我单击按钮时,javascript中是否有任何功能可保持模式打开?似乎是什么问题?

0 个答案:

没有答案