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

{

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

  require_once "labClass.php";
  
  $con = new labClass();
  
 $chkp= $con->getProfPrevItemBySch($searchValue); 
    
     
if ($chkp->rowCount()>0) {

  $chp=$chkp->fetchAll();
  ?>
  <table class="table"> 
   
<?php
 foreach ($chp as $key => $p) {
    $orderID=$p['orderID'];
      $cc++; 
     
        ?>
 
  <tr>
   <td>
    <sup id="rdn<?php echo $cc;?>" class="text-danger" ></sup>
       <input type="hidden" name="orderID<?php echo $cc;?>" id="orderID<?php echo $cc;?>" value="<?php echo $p['orderID'];?>"/>No:<br/>
       <a href="#" onclick="var orderID =$('#orderID<?php echo $cc;?>').val();var cnm=document.getElementById('cn<?php echo $cc;?>').innerHTML;var dat=document.getElementById('td<?php echo $cc;?>').innerHTML;document.getElementById('ms').innerHTML=cnm; document.getElementById('dt').innerHTML=dat;document.getElementById('orno').innerHTML=orderID; 
         if(orderID!='' ) {$.post('profGItmLst.php',{orderID:orderID },function(data){$('#dR').html(data).show();});} else{document.getElementById('rdn<?php echo $cc;?>').innerHTML='Valide item detail required!..';}">
           <?php echo $p['orderID'];?> </a>
     </td>
       <td>
    <!--<div class="input-group">
    <span class="input-group-text">-->

       Customer name:<br/>
        <sup id="cn<?php echo $cc;?>"><?php echo $p['cname'];?></sup>
  </td>
 
  <td>
    Amount:<br/>
  <sup><?php echo $p['payableA'];?></sup>
  </td> 
   
   
    <td>
    Prepared:<br/>
    <sup id="td<?php echo $cc;?>"><?php echo $p['orderdate'];?> </sup> 
  </td>
   
   
</tr> 
  <?php
}
$cc=0;
 
}
}
  ?>