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

{

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

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

  $chp=$chkp->fetchAll();
  ?>
  <table class="table"> 
   
<?php
 foreach ($chp as $key => $p) {
    $orderID=$p['orderID'];
      $cc++; 
     
        ?>
 <tr>
     
   </tr> 
  <tr>
   <td colspan="3">
    <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'];?>"/>
    <!--<div class="input-group">
    <span class="input-group-text">-->

       Customer name:<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('pharmporderPrevItemLPO.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>.<font color="blue"><sup id="cn<?php echo $cc;?>"><?php echo $p['cname'];?></sup></font> 
  </td>
</tr>
<tr>
  <td>
    Order amount:<br/>
  <?php echo $p['payableA'];?>
  </td> 
   
    <td>
    Order date:<br/>
    <sup id="td<?php echo $cc;?>"><?php echo $p['orderdate'];?> </sup> 
  </td>
   
   
</tr> 
  <?php
}
$cc=0;
 
}
}
  ?>