<?php 
session_name('CAKEPHP'); session_start();
$PageSecurity = 11;
include('includes/session.inc');
include('includes/function_lib.php');
$data1="";
$data2="";
$data3="";
$data4="";
if($_REQUEST['GRNTYPE']=='PO')
{
	$data1.="<strong>PO Type</strong>";
	
	$data2.="<select name='PoType' id='PoType'	style='width:100%;'>";
    	$data2.="<option value=''>Select</option>";
		$data2.="<option value='IO'>Import Order</option>";
		$data2.="<option value='DO'>Domestic Order</option>";
		
    $data2.="</select>";
	
	
	$data3.="<strong>Recevied From</strong>";
	
	$data4.="<select name='vendor' id='vendor'  style='width:100%;'  onchange='GetIndentPONo(this.value)'>";
			$data4.="<option value='' >Select</option>";
			$sql="select id  ,vendor_code, vendor_name from suppliers where CompanyId='".$_SESSION['ACGCompanyId']."'";
			$result = DB_query($sql, $db);
			while($myrow = DB_fetch_array($result))
			{ 
			$p='';
			if($vendor==$myrow['id'])
			$p="selected";
			 $data4.="<option  value='".$myrow['id']."'>".str_replace(array("M/s ","M/S"),'',$myrow['vendor_name'])."</option>";
		 }
			
		$data4.="</select>";
		
		$data6.="<strong>PO Category</strong>";
		$data5.="<select name='Pocategory' id='Pocategory'	style='width:100%;'>";
    	$data5.="<option value=''>Select</option>";
		$data5.="<option value='AT'>Asset</option>";
		$data5.="<option value='MT'>Material</option>";
		$data5.="<option value='SV'>Service</option>";
		
    $data5.="</select>";
	
		
		
}

if($_REQUEST['GRNTYPE']=='Indent')
{
	$data1.="<strong>Recevied From<font color='#FF0000'>*</font></strong>";
	
	$data2.="<select name='vendor' id='vendor'  style='width:100%;' onchange='GetIndentPONo(this.value)'>";
			$data2.="<option value='' >Select</option>";
			$sql="select id  ,vendor_code, vendor_name from suppliers where CompanyId='".$_SESSION['ACGCompanyId']."'";
			$result = DB_query($sql, $db);
			while($myrow = DB_fetch_array($result))
			{ 
			 $data2.="<option  value='".$myrow['id']."'>".str_replace(array("M/s ","M/S"),'',$myrow['vendor_name'])."</option>";
		}
		$data2.="</select>";
		
		
		$data3.="<strong>Indent/PR No</strong>";
		
		$data4.="<select name='indentprno' id='indentprno' style='width:100%;'>";
		
					$data4.="<option value=''>Select</option>";
					$data4.="</select>";
}
if($_REQUEST['GRNTYPE']=='INV')
{
	$data1.="<strong>Invoice Type</strong>";
	
	$data2.="<select name='PoType' id='PoType'	style='width:100%;'>";
    	$data2.="<option value=''>Select</option>";
		$data2.="<option value='LS'>Local Sale</option>";
		$data2.="<option value='ES'>Export Sale</option>";
		
    $data2.="</select>";
	
	
	$data3.="<strong>Recevied From</strong>";
	
	$data4.="<select name='vendor' id='vendor'  style='width:100%;'  onchange='GetIndentPONo(this.value)'>";
			$data4.="<option value='' >Select</option>";
			$sql="select id,client_code, c_name from clientmaster where CompanyId='".$_SESSION['ACGCompanyId']."'";
			$result = DB_query($sql, $db);
			while($myrow = DB_fetch_array($result))
			{ 
			$p='';
			if($vendor==$myrow['id'])
			$p="selected";
			 $data4.="<option  value='".$myrow['id']."'>".str_replace(array("M/s ","M/S"),'',$myrow['c_name'])."</option>";
		 }
			
		$data4.="</select>";
		
		$data6.="<strong>Invoice Category</strong>";
		$data5.="<select name='Pocategory' id='Pocategory'	style='width:100%;'>";
    	$data5.="<option value=''>Select</option>";
		$data5.="<option value='MT'>Material</option>";
		
		
    $data5.="</select>";
	
		
		
}
echo $data=$data1."__".$data2."__".$data3."__".$data4."__".$data6."__".$data5;
?>
