<?php include "../../includes/start_ajax.php";

?>

<?php


if($_REQUEST["search"]!=="")
{
    
	
     
         $query="select *
                         from t_".$key_table_prefix."_product
                         where ( pdt_code like '%".$_REQUEST["search"]."%'
                         or pdt_name like '%".$_REQUEST["search"]."%' 
					or pdt_barcode like '%".$_REQUEST["search"]."%' 
					
					) 
     				order by pdt_code
                         ";
          
         $query=$query." limit 0,50 ; ";
         $result=mysqli_query($dbconn, $query);
         while($line=mysqli_fetch_array($result,MYSQLI_ASSOC))
         {
             $found=true;
             
             
                 echo "<div style='cursor:hand;border:1px solid #dddddd;padding:10px 5px 10px 5px;' 
     		  	onclick=\"
     					document.getElementById('autofill_stock_replenish').style.visibility='hidden';
     					document.form_replenishment_report.product.value='".$line["pdt_code"]."';
						mon_submit_form('form_replenishment_report','report/stock_replenishment/index.php');
     					\" >";
                 
                    echo "<b>".$line["pdt_code"]." ".$line["pdt_name"]."</b>";
                    echo "<br><input type=button class='button button-blue' value='Choose' >";
                 
		
                 echo "</div>";
          
         }
         
         
         if(!$found)
         {
             
             echo "<div style='cursor:hand;border:1px solid #dddddd;padding:10px 5px 10px 5px;' onclick=\"document.getElementById('autofill_stock_replenish').style.visibility='hidden';\" >";
             
                
                echo "No Found";
             
             echo "</div>";
         }
}

?>



<?php include "../../includes/end_ajax.php";

?>