<?php
	$PageSecurity = 11;
 	include('includes/SQL_CommonFunctions.inc');
 	include('includes/session.inc');
   	include('includes/function_lib.php');
	include('includes/Class_Client.php');
	
	$partyid = $_REQUEST['partyid'];
	
?>
<?php 
$data1 = '';
$data2 = '';
	  	$InvoiceSQL="Select invoice_id,invoiceNo from invoice where client_id='".$partyid."'";
		$Invoice_No = DB_query($InvoiceSQL,$db);
	
            $data1 .="<select name='invoiceNo' id='invoiceNo' style='width:100%'  onchange='showInvoiceDetails(this.value)' >";
            $data1 .="<option selected Value=''>Select your option</option>";
            while($Invoice = DB_fetch_array($Invoice_No)){
            $data1 .="<option Value='".$Invoice['invoice_id']."'>".$Invoice['invoiceNo']."</option>";
            } 
            $data1 .="</select>";
			
			
			
			
			
	$InvoiceProdSQL="Select DISTINCT(ItemCode) from invoice_details where invoiceid IN (Select invoice_id from invoice where client_id='".$partyid."')";
		$Product_Code = DB_query($InvoiceProdSQL,$db);
	
            $data2 .="<select name='product_name' id='productId' style='width:100%'  onchange='getInvoice(this.value)' >";
            $data2 .="<option selected Value=''>Select your option</option>";
            while($Product = DB_fetch_array($Product_Code)){
			$itemname = $s->GetFieldValue('item_master', 'id="'.$Product['ItemCode'].'"', 'item_name');
            $data2 .="<option Value='".$Product['ItemCode']."'>".$itemname."</option>";
            } 
            $data2 .="</select>";
			
echo $data .= $data1."__".$data2;

?>		
			
			
			