<?php 

if($_POST["patientID"] && $_POST["sdate"])
{ 
  require_once"labClass.php";
  $con=new labClass();
   $patientID= $_POST['patientID'];
    $pn= $con->getThisPatientD($patientID);
    if ($pn->rowCount()>0) {
    $n=$pn->fetch();
    $regDate= $_POST['sdate'];
   $sd= $con->getServID($patientID,$regDate);
      if($sd->rowCount()>0)
      {
        $g=$sd->fetch();
        $sID=$g['sID'];
     
      ?>
      <input type="hidden" name="sID" id="sID" value="<?php echo $sID;?>">
  <small>PATIENT NAME:<h6 class="text-primary"><?php echo $n['fname']." ". $n['mname']." ".$n['lname'];?></h6></small>  
 
 <div class="container mt-3" style="width:100%;">

  
<!--SEARCH BOX-->
   <div class="row">
    <div class="col">
      <h6>Search here:</h6>
    <div class="form-floating mb-3 mt-3"> 
      <input type="text" onkeyup ="submision()" class="form-control" id="tname" style="width:74%; height:20px;" placeholder="Test name" name="tname" required>
       <label for="tname">Search:</label> 
    </div>
</div> 
</div>

<!-- SEARCH BOX END-->

</div>

 </div>
 <div id="dispR">
  
   
 </div>
 <?php
  }
else{
         echo "Consultation fees required!..";
  }
     }
  else{
       ?>
        <h6 class="text-danger">Invalid patient ID!..</h6>
       <?php
       }
       }
  else{
       ?>
        <h6 class="text-danger">Patient ID required!..</h6>
       <?php
       }
?>
 <script>

  function submision(){
    var searchValue=$('#tname').val();
    $('#dispR').empty();
    $.post('pcodeDseaseSentListSearch.php',{searchValue:searchValue},function(data){
      $('#dispR').html(data);

    });
  }
  
</script>
 