<?php
if($_REQUEST['DeleteId']!='' )
{
if($_REQUEST['idfy_quotes']=='AMD'){
/****************************DELETE FROM PURCHASEORDER Ammendment TABLE ******************/
	$slq_del=DB_query("delete from vendor_quotes_ammendment where id='".$_REQUEST['DeleteId']."'",$db);
	$sql_del1=DB_query("delete from vendor_quotes_ammendment_details where vendor_quotes_ammendment_id='".$_REQUEST['DeleteId']."'",$db);
}

}

?>
<link rel="stylesheet" href="css/new_mxerp.css">
<div class="body_contain">
<div class="tab_div">
<h1>Vendor Quotations Ammendment</h1>
<div class="centre" id="slidingDiv">
<form action="" method="post">
<table width="100%" border="1" cellspacing="0" cellpadding="3">
<tr class="row1">
    <td class="tabledata1"><strong>Site Name</strong></td>
    <td colspan="3"><select name="sitecode" style="width:150px">
		<option value="">----Select----</option>
		<?php
		
	if($_SESSION['AssignedBranch']!='')
	  {	  	
		$sqlsite=DB_query("select * from locations where CompanyId='".$_SESSION['ACGCompanyId']."'  and loccode in ('".$_SESSION['AssignedBranch']."')",$db);
		}
else
 {
	$sqlsite=DB_query("select * from locations where CompanyId='".$_SESSION['ACGCompanyId']."'",$db);
}
		while($site_row=DB_fetch_array($sqlsite))
		{
				$s='';
				if($_REQUEST['sitecode']==$site_row['loccode'])
				$s="selected";
		?>
		 <option value="<?php echo $site_row['loccode'];?>" <?php echo $s;?>><?php echo $site_row['locationname'];?></option>
		<?php } ?>
	</select>
	</td>
	</tr>
	
<tr class="row1">
	<td class="tabledata1"><strong>Vendor</strong></td>
	<td><select name="suppliers" style="width:150px">
	<option value="">----Select----</option>
	<?php
	$sqlsuppliers=DB_query("Select * from suppliers",$db);
	while($suppliers_row=DB_fetch_array($sqlsuppliers))
	{
	$s='';
	if($_REQUEST['suppliers']==$suppliers_row['id'])
	$s="selected";
	?>
	<option value="<?php echo $suppliers_row['id'];?>" <?php echo $s;?>><?php echo  str_replace(array("M/s ","M/S"),'',$suppliers_row['vendor_name']);		 ?></option>
	<?php } ?>
	</select></td>
	<td class="tabledata1"><strong>Qoutation No. </strong></td>
	<td><input type="text" name="vernder_quotation" value="<?php echo $_REQUEST['vernder_quotation'];?>" style="width:150px" /></td>
</tr>
<tr class="row1">
	<td class="tabledata1"><strong>From</strong></td>
	<td><input type="text" name="fromDate" style="width:150px"  value="<?php  echo $_REQUEST['fromDate'];?>" class="datepicker"/></td>
	<td class="tabledata1"><strong>To</strong></td>
	<td><input type="text" name="toDate" style="width:150px" value="<?php  echo $_REQUEST['toDate'];?>" class="datepicker"/></td>
</tr>
<tr class="row1">
	<td class="tabledata1" colspan="4" style="text-align:center;">
	<input type="submit" name="search" value="Search" class="search" />
	<input type="reset" value="Reset" name="reset" class="search" />
	</td>
</tr>
</table>
</form>
</div>
<br />
<!-- For this div of pagination -->
<div class="new_tab">

<div class="inside_tab">

	<ul>
		<li><a href="index.php?route=POModule/Vendor_Quotes_Ammendment_index1&modid=<?php echo $_REQUEST['modid'];?>&frmid=<?php echo $_REQUEST['frmid'];?>&tab=2&type=POModule/vQ">Vendor Quotations</a></li>
		<li><a href="index.php?route=POModule/Vendor_Quotes_Ammendment_index1&modid=<?php echo $_REQUEST['modid'];?>&frmid=<?php echo $_REQUEST['frmid'];?>&tab=2&type=POModule/AVQ">Ammended Vendor Quotations</a></li>
<div style="clear:both;"></div>

	</ul>
</div>
</div>
<div style="height:3px;"></div>

<div style="width:100%; ">

	<?php for($i=1; $i<3; $i++)
	{
		if($i==$_REQUEST['tab']){
	?>

			<?php
			if($_REQUEST['route']!=''&& $_REQUEST['type']!='')
			{	
				include($_REQUEST['type'].".php");
			}
			
			 ?>

	<?php }
	   
	
	}
	if($_REQUEST['tab']=='')
	{
	include("vQ.php");
	}
	
	 ?>
</div>
