<?php

include('db_coni.php');

$type_id = $_POST['type_id'];

$output = '';

if($type_id > 0)
{
	$query = "SELECT * FROM items WHERE status = 'Active' and type_id= '".$type_id."'";
}else{$query = "SELECT * FROM items WHERE status = 'Active'";}


$result = mysqli_query($connecti, $query);

$output .= '<option value="">Select Item</option>';

while($row = mysqli_fetch_array($result))

{

 $output .= '<option value="'.$row["item_id"].'">'.$row["item_name"].'  ( '.number_format($row["stock"],0).' )</option>';

 

}

	

	echo $output;

	

?>

