




hhhhhhhhhhhhhhhhhhhhhhhhhh



<!DOCTYPE html>
<html>
<head>

</head>
<body >

	
<?php


session_start();



$q = $_GET['q'];

		
require 'config.php';

$con = mysqli_connect(DB_SERVER, DB_USER, DB_PASS);
$database = $_SESSION['database'];
	
	
	$branch_key = $_SESSION['branch_key'];
	
	
//$con = mysqli_connect('localhost','peter','abc123','my_db');
if (!$con) {
  die('Could not connect: ' . mysqli_error($con));
}

mysqli_select_db($con,$database);
//$sql="SELECT * FROM txn_table WHERE product_name = '".$q."'";
	//$sql="SELECT * FROM debtors_table WHERE customers_name = '$q'";//
	
	$sql="SELECT * FROM product_table WHERE cat = '$q'";
$result = mysqli_query($con,$sql);

//$row = mysqli_fetch_array($result) ;
	
	//$row = mysql_fetch_assoc($result) ;

	

	
		echo '<select class=custom-select style=background-color:green;color:white;  onchange=showUse(this.value)  name=product>';
										
										echo	'<option value = "" selected>Select Product</option>';
		
										
											
											$SQL_customer = "SELECT * FROM product_table WHERE cat = '$q' and branch_key = '$branch_key' ";
											
											$result = mysqli_query($con, $SQL_customer);
											
											$i =1;

											
											while ( $db_found = mysqli_fetch_assoc($result) )
											{
											
												echo '<option value="'. $db_found['product_name'].'">'. $db_found['product_name'].'</option>'; 
																									  }
		
											
											
										echo	'</select>';
	
	
	// echo $row['customers_name'].'<br>';
 // echo "Unit Price:  ". $row['unit_p'].'<br>';
	// echo "  Avail Qty:  ". $row['unit_q'] ;
	
	
 
?>

	
<!--

	<input type="hidden"  value = "<?php echo  $row['unit_p'] ?>" name="unit_p" id="unit_p">
<input type="hidden"  value = "<?php echo  $row['unit_q'] ?>" name="unit_q" id="unit_q">
	
	
-->
	


	
	
</body>
</html>
