<?php
error_reporting(0);
include_once("../classes/class.MySQL.php");
$db	=new MySQL();
$date=$_REQUEST['date'];
		$opt='';
		if($date!=''){
		$date=date("Y-m-d",strtotime($date));
		$join="  a.id=b.Ingredient and b.date='".$date."'";
		}
		$from="  Ingredients as a,purchase as  b  ";
		$names = $db->fetchAlljoin($from , $where='', $orderBy='a.id', $limit='', $like=false, $operand='AND',$cols='a.id,a.Ingredient' ,$asc='',$join='',$start='');
	//	$opt.="<option value=''>--Vendor--</option>";
		foreach($names as $names)
		{
		$opt.="<option value='".$names['id']."'>".$names['Ingredient']."</option>";
		}
        echo $opt;exit;
?>
