<?php
 require_once "labClass.php";
 $con = new labClass();
?>
<div  class="mt-4 p-5 bg-white text-dark rounded">
<div class="row">
    <div class="col">
     
     
     
     <table width="100%" border="0">
    
    <td colspan="2">
     <div >Select item name here:</div>
        <input class="form-control" id="cus" name="cus" list="cnames" onchange="getCusN()">
<datalist id="cnames">
<?php
 $Q= $con->getDrugList();
 if ($Q->rowCount()>0) {
 $lb=$Q->fetchAll();
     foreach ($lb as $key => $l){
      ?>
      <option value="<?php echo  $l["iname"];?>">  
             <?php
           }
           }
      ?></datalist> 
  
    </td>
  </tr>
</table>
     
     
     
     
     
       
    </div>
   </div>
    <div id="dispR">
        
    </div>
    <script>
       function getCusN(){
    
    var iname=$('#cus').val();
    
    $('#dispR').empty();
    $.post('pharmProductR.php',{iname:iname},function(data){
      $('#dispR').html(data);});
     
  }
        </script>