<?php 
 $cc=0;
  if ($_POST['searchValue']) {
  $searchValue=$_POST['searchValue'];
  require_once "labClass.php";
  $con = new labClass();

  ?>
     <div class="row">
      <div class="col">
        <small><h6>S/N CODE</h6></small>
      </div>
       <div class="col">
        <small><h6>DISEASE</h6></small>
      </div>
      <div class="col">
        <small><h6>SAVE</h6></small>
      </div> 
    </div>
  
<?php
$chkp= $con->getThisCodeDisease($searchValue);    
if ($chkp->rowCount()>0) {
?>
 <div class="row">    
   <div class="col">
    <h5>Provisional diagnosis</h5>
     </div>
   </div> 
  <?php
  $chp=$chkp->fetchAll();
   foreach ($chp as $key => $p) { 
   $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" >
       <input type="hidden" name="recID<?php echo $cc;?>" id="recID<?php echo $cc;?>" value="<?php echo $p['recID'];?>"/>
  
      <?php
          echo $cc;
       ?>  
         .<input type="text" style="height:30px; width:90%;" disabled="true" name="code<?php echo $cc;?>" id="code<?php echo $cc;?>" value="<?php echo $p['code'];?>">
            
         
  </div>
  <div class="col">
        <textarea style="width:100%;" disabled="true" name="disease<?php echo $cc;?>" id="disease<?php echo $cc;?>"><?php echo $p['disease'];?></textarea>
  </div>  
  <div class="col"> 
        <input type="submit" name="sent<?php echo $cc;?>" id="postUpdate<?php echo $cc;?>"value="SAVE" id="submit" onclick="var sID=$('#sID').val(); var patientID=$('#pID').val();var sdate=$('#sdate').val();var user=$('#user').val();  var code=$('#code<?php echo $cc;?>').val(); var disease=$('#disease<?php echo $cc;?>').val(); if(sID!=''&& patientID!=''  && code!=''  && disease!='') {$.post('pdiagnosisPro.php',{sID:sID,patientID:patientID,sdate:sdate,user:user,code:code,disease:disease},function(data){$('#rdn<?php echo $cc;?>').html(data).show();}); } else{document.getElementById('rdn<?php echo $cc;?>').innerHTML='Valide item detail required!..';}" />
  </div>
</div> 
 <?php
}
}

$chkp= $con->getThisCodeDisease($searchValue);    
if ($chkp->rowCount()>0) {
  ?>
<div class="row">    
  <div class="col">
  <h5>Final diagnosis</h5>
  </div>
  </div> 
<?php
 $chp=$chkp->fetchAll(); 
 foreach ($chp as $key => $p) {
  $testID=$p['recID'];
  $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" >
       <input type="hidden" name="recID<?php echo $cc;?>" id="recID<?php echo $cc;?>" value="<?php echo $p['recID'];?>"/>
       <?php
          echo $cc;
       ?> .<input type="text" style="height:30px; width:90%;" disabled="true" name="code<?php echo $cc;?>" id="code<?php echo $cc;?>" value="<?php echo $p['code'];?>">     
  </div>
  <div class="col">
  <textarea style="width:100%;" disabled="true" name="disease<?php echo $cc;?>" id="disease<?php echo $cc;?>"><?php echo $p['disease'];?></textarea>
  </div>  
  <div class="col"> 
  <input type="submit" name="sent<?php echo $cc;?>" id="postUpdate<?php echo $cc;?>"value="SAVE" id="submit" onclick="var sID=$('#sID').val(); var patientID=$('#pID').val();var sdate=$('#sdate').val();var user=$('#user').val();  var code=$('#code<?php echo $cc;?>').val(); var disease=$('#disease<?php echo $cc;?>').val(); if(sID!=''&& patientID!=''  && code!=''  && disease!='') {$.post('pdiagnosisFinalPro.php',{sID:sID,patientID:patientID,sdate:sdate,user:user,code:code,disease:disease},function(data){$('#rdn<?php echo $cc;?>').html(data).show();}); } else{document.getElementById('rdn<?php echo $cc;?>').innerHTML='Valide item detail required!..';}" />
  </div>
</div> 
 <?php
}
$cc=0;
}
}
?>