<?php
   $cc=0;
 
if(isset($_POST["searchValue"]))

{

	$searchValue= $_POST['searchValue'];
                                                           //CHECKING ENDS HERE

  require_once"labClass.php";

  $con=new labClass();

  $rQ= $con->getMtestBySearch($searchValue);

               //print_r($rQ);
  if ($rQ->rowCount()>0) {

    $chp=$rQ->fetchAll();
      ?> 
 <div class="row">
      <div class="col">
        <small><h6>S/N-MEDICAL TEST</h6></small>
      </div>
       <div class="col">
        <small><h6>TEST PRICE</h6></small>
      </div>
       <div class="col">
        <small><h6>DISCOUNT</h6></small>
      </div>
       <div class="col">
        <small><h6>REASON</h6></small>
      </div>
       <div class="col">
        <small><h6>SEND</h6></small>
      </div>
    </div>

   
  <?php

 foreach ($chp as $key => $p) {

    $testID=$p['testID'];
    
      $cc++; 
     
        ?>


 <div class="row">
      
     <div class="col">
       <sup id="rdn<?php echo $cc;?>" class="text-danger" ></sup>
     </div>
   </div> 
  <div class="row">
  
 
  
   <div class="col justify-content-center" >

       <input type="hidden" name="testID<?php echo $cc;?>" id="testID<?php echo $cc;?>" value="<?php echo $p['testID'];?>"/>
    <!--<div class="input-group">
    <span class="input-group-text">-->

      <?php
          echo $cc;
       ?>  
         .<textarea style="height:30px; width:90%;" disabled="true" name="tname<?php echo $cc;?>" id="tname<?php echo $cc;?>"><?php echo $p['mName'];?></textarea><br/>
         
  
  </div>
  

  <div class="col">
        <input type="text" style="width:100%;" disabled="true" name="tPrice<?php echo $cc;?>" id="tPrice<?php echo $cc;?>"  value="<?php echo $p['tPrice'];?>" />
  </div> 
    
     <div class="col">
        <input type="number" style="width:100%;" name="dsPrice<?php echo $cc;?>" id="dsPrice<?php echo $cc;?>"  value="" />
  </div> 
  <div class="col">
        <input type="number" style="width:100%;" name="dsReason<?php echo $cc;?>" id="dsReason<?php echo $cc;?>"  value="" />
  </div> 
  <div class="col">
    

        <input type="submit" name="postUpdate<?php echo $cc;?>" id="postUpdate<?php echo $cc;?>"value="SEND" id="submit" onclick="  var tname=$('#tname<?php echo $cc;?>').val();var dsReason=$('#dsReason<?php echo $cc;?>').val();var dsPrice=$('#dsPrice<?php echo $cc;?>').val();var tPrice=$('#tPrice<?php echo $cc;?>').val(); var patientID =$('#pID').val();if(patientID!='' && dsReason!='' && dsPrice!='' && tPrice!='' && tname!='') {  $.post('sendMedicalTPro.php',{patientID:patientID,dsReason:dsReason,dsPrice:dsPrice,tPrice:tPrice,tname:tname},function(data){$('#rdn<?php echo $cc;?>').html(data).show();});} else{document.getElementById('rdn<?php echo $cc;?>').innerHTML='The problem occured, make sure you entered patient ID!..';}" />
  </div>
    
     
 
 
</div> 
 
  <?php
 
}
  $cc=0;

 
}

         
}


?>