
<body  background="../forms/i.jpg"  oncontextmenu = "javascript:return false;" ondragdrop= "javascript:return false;" onselectstart="javascript:return false;">

  
<script language="javascript">
function check()
{
	if(myform2.compcode.value=="")
	{
		alert("Please select Company");
		myform2.compcode.focus();
		return false;
	}	

	if(myform2.bcode.value=="0")
	{
		alert("Please Select Customer");
		myform2.bcode.focus();
		return false;
	}



	
}
</script>



<?php include("../../include/dbconnect.php");

foreach($_POST as $q=>$r)
{
	$_POST[$q] = trim($r);
}

$myCompany = $_POST['Company'];

// Get all _POST VALUES HERE..

foreach($_POST as $p=>$t)
{
	$_POST[$p] = trim($t);
}

$myCat = $_POST['Cat'];
// Get all _POST VALUES HERE..

foreach($_POST as $q=>$r)
{
	$_POST[$q] = trim($r);
}

$myBuyer = $_POST['Buyer'];

foreach($_POST as $q=>$r)
{
	$_POST[$q] = trim($r);
}

$myTax = $_POST['Tax'];


foreach($_POST as $q=>$r)
{
	$_POST[$q] = trim($r);
}

$myCenvat = $_POST['Cenvat'];


foreach($_POST as $q=>$r)
{
	$_POST[$q] = trim($r);
}

$myprodcode = $_POST['prodcode'];

?>
<SCRIPT LANGUAGE="JavaScript" src="../../include/CalendarPopup.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
var cal = new CalendarPopup();
</SCRIPT>
<title>Receipt</title>
<body background="images/blater01.gif" topmargin=0>
<center> 
<table border=0 cellpadding=3 cellspacing=4 width="724" bgcolor="#E6E6FF">
  <tr> 
    <td  colspan="100%"  bgcolor="#93BEE2"><font face="Verdana, Arial, Helvetica, sans-serif"><b><b>Trading Invoice  </b></font></td>
  </tr>



  <?

// Pull all the data from Cat master & populate it

$result= mysqli_query($conn," select distinct compcode,name from company  order by name")or die( mysqli_error() );


?>
  <form name='myform' method='POST' action='<?=$_SERVER['PHP_SELF']?>'>
    <tr > 
      <td  width="59" height="31" align="left" ><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Company 
        &nbsp;</b></font></td>
      <td width="148" > <select name='Company' onChange="javascript:submit();">
          <?php 
	// echo "<option selected value=\" 0\"> Select Company";	  
      while ( $row1= mysqli_fetch_row($result))
      {
	  	if(isset($myCompany) && preg_match("/" . preg_quote($myCompany", '/') . "/", $row1[0]))
		{
			echo "<option selected value=\"$row1[0]\">$row1[1]";
	  	}
	  	else
	  	{
			echo "<option value=\"$row1[0]\">$row1[1]";
	  	}
	}
?>
      </select> </td>
      <td width="43" height="31" align="left" ><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Customer 
        </b></font></td>
      <td colspan="3" > 
        <?



$sBuyQuery = mysqli_query($conn,"SELECT distinct bcode,name FROM   buy  where buyertype != 'Supplier' order by name ") or die(mysqli_error());
?>
        <select name='Buyer' onChange="javascript:submit();">
          <?
		  

echo "<option selected value=\" 0\"> Select Customer";
while($row = mysqli_fetch_row($sBuyQuery))
{
	
	if(isset($myBuyer) && preg_match("/" . preg_quote($myBuyer", '/') . "/", $row[0]))
	{
		echo "<option selected value=\"$row[0]\">$row[1]";
	}
	else{
		echo "<option value=\"$row[0]\">$row[1]";
	}
}
?>
        </select></td>
    </tr>



<tr>
      <td width="43" height="32" align="left" ><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Tax </b></font></td>
       <td>
        <?



$staxQuery = mysqli_query($conn,"SELECT distinct taxtype,description from salestax order by description ") or die(mysqli_error());
?>
        <select name='Tax' onChange="javascript:submit();">
          <?
echo "<option selected value=\" 0\"> Select Taxtype";
while($row = mysqli_fetch_row($staxQuery ))
{
	
	if(isset($myTax) && preg_match("/" . preg_quote($myTax", '/') . "/", $row[0]))
	{
		echo "<option selected value=\"$row[0]\">$row[1]";
	}
	else{
		echo "<option value=\"$row[0]\">$row[1]";
	}
}
?>
        </select></td>
      <td width="43" height="32" align="right" ><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Cenvat</b></font></td>
      <td > 
        <?



$cenQuery = mysqli_query($conn,"SELECT distinct tariff,commodity from excise order by commodity ") or die(mysqli_error());
?>
        <select name='Cenvat' onChange="javascript:submit();">
          <?
echo "<option selected value=\" 0\"> NIL";
while($row = mysqli_fetch_row($cenQuery ))
{
	
	if(isset($myCenvat) && preg_match("/" . preg_quote($myCenvat", '/') . "/", $row[0]))
	{
		echo "<option selected value=\"$row[0]\">$row[1]";
	}
	else{
		echo "<option value=\"$row[0]\">$row[1]";
	}
}
?>
        </select></td>
		
	
		
  </tr>
		
    

	
	
    <tr> 
      <td width="59" height="31" align="left" ><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Category&nbsp;</b></font></td>
      <td> 
        <?
$stQuery = mysqli_query($conn,"select catcode,category from prodcat order by category")or die( mysqli_error() );



?>
        <select name='Cat' onChange="javascript:submit();">
          <?
echo "<option selected value=\" 0\"> Select Cat";
while($row = mysqli_fetch_row($stQuery))
{
	
	if(isset($myCat) && preg_match("/" . preg_quote($myCat", '/') . "/", $row[0]))
	{
		 echo "<option  selected value=\"$row[0]\">$row[1]";
	}
	else{
		echo "<option value=\"$row[0]\">$row[1]";
	}
}
?>
        </select></td>
      <?
	//$prodresult = mysqli_query($conn,"select distinct tpurreg.prodcode,product.prodname,tpurreg.record,product.packing from tpurreg,product where tpurreg.balance > 0 and compcode = '$myCompany' and product.groupcode = '$myCat' and tpurreg.prodcode = product.prodcode  order by product.prodname") or die(mysqli_error());
	
	$query= "select distinct prodcode,prodname from product where catcode =  '$myCat' ";
	$prodresult = mysqli_query($conn,$query) or die(mysqli_error());	
	
?>
      <td  height="31" align="left" ><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Product 
        </b></font></td>
      <td ><select name='prodcode'  onChange="javascript:submit();" >
        <?

	echo "<option selected value=\" 0\"> Product & Stock";
	while($prodrow = mysqli_fetch_row($prodresult))
	{
		$stresult = mysqli_query($conn,"select sum(inqty) - sum(outqty) from stktrans where acctcode = '$prodrow[0]'  and compcode = '$myCompany' ") or die(mysqli_error());
		$srow = mysqli_fetch_row($stresult);
		
		$tresult = mysqli_query($conn,"select sum(qty) from spurch where prodcode = '$prodrow[0]'  and compcode = '$myCompany' ") or die(mysqli_error());
		$trow = mysqli_fetch_row($tresult);		
		
		$netqty = $srow[0] - $trow[0];
	//	if($netqty > 0)
	//	{		
			$temp= $prodrow[1].'&nbsp;::&nbsp;Av.Qty:&nbsp;'.$netqty;
			if(isset($myprodcode) && preg_match("/" . preg_quote($myprodcode",$prodrow[0]))
			{			
				
				echo "<option  selected value=\"$prodrow[0]\">$temp";
			}
			else
			{
				echo "<option value=\"$prodrow[0]\">$temp";		
			}
		//}
	}
	?>
      </select></td>

      <td align="left" ><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Description        </b></font></td>
      <td colspan="100%"> 
      <input type="text" size="20"   onKeyPress="return event.keyCode!=13" name="remarks" value=""></td></tr>	

	<?

	$mresult = mysqli_query($conn,"select rate from product where prodcode = '$myprodcode' ") or die(mysqli_error());
	$mrow = mysqli_fetch_row($mresult);
	if($rt ==0)
	{
		$rt = $mrow[0];	
	}
	
	
	?>

	
    <tr> 
	
	

      <td width="59" align="right"><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Qty 
        </b></font></td>
      <td width="148"><input type="text" onKeyPress="return event.keyCode!=13" name="qty" value=""></td>
      <td width="43" align="left"><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Rate  
        </b></font></td>
      <td width="144"><input type="text" onKeyPress="return event.keyCode!=13" name="rate" value="<?=$rt?>"></td>
		<td  height="31" align="left" ><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Discount</b></font></td>
		<td><input type="text" onKeyPress="return event.keyCode!=13"  name="discount" value=""></td>
	  
  </tr>

</table>
<table>
</table>
 <table cellpading=0 cellspacing=10 width= 676>
<tr><td width="307" align="left"><blockquote><input type =submit name="Clear" value = "Clear" ></blockquote></td><td width="288" align="right">
 <blockquote>  <input type =submit name="refresh" value = "Refresh" ></blockquote></td><td width="307" align="left"><blockquote><input type =submit name="add" value = "Add" ></blockquote></td>

</table>

<?

if($Clear == 'Clear')
{
	mysqli_query($conn,"truncate spurch ") or die(mysqli_error());
}


if($prodcode == '0' and $qty > 0)
{
?>
<script language="JavaScript">
alert("Select Product plase");
</script>
<?
exit;
}

$myresult = mysqli_query($conn,"select distinct bcode from spurch") or die(mysqli_error());
while($myrow = mysqli_fetch_row($myresult))
{
	if( $myBuyer != $myrow[0])
	{
		?>
		<script language="JavaScript">
		alert("Wrong Selection of Buyer");
		</script>
		<?
		exit;
	}
}

$hresult = mysqli_query($conn,"select distinct prodcode from spurch") or die(mysqli_error());
while($hrow = mysqli_fetch_row($hresult))
{
	if( $myprodcode == $hrow[0])
	{
		?>
		<script language="JavaScript">
		alert("Product already added. Please select different product to continue");
		</script>
		<?
		exit;
	}
}


if($qty >0 and $add == 'Add')
{

	$mresult = mysqli_query($conn,"select capacity from product where prodcode = '$myprodcode' ") or die(mysqli_error());
	$mrow = mysqli_fetch_row($mresult);
	$capacity = $mrow[0];

	$result = mysqli_query($conn,"insert into spurch values ( '$myCompany','$myBuyer','$myprodcode','$qty','$capacity','$rate','$discount','$remarks',NULL)") or die(mysqli_error());
	$rt=0;
}

?>


  </form><tr >
  


<form name='myform2' method='POST' action='entry.php' onSubmit="return check()" >

<input type="hidden" name="bcode" value="<?=$myBuyer?>">
<input type="hidden" name="compcode" value="<?=$myCompany?>">
<input type="hidden" name="taxtype" value="<?=$myTax?>">
<input type="hidden" name="cenv" value="<?=$myCenvat?>">



<table width="818">
  <tr  bgcolor="#A4A4FF">

<td width="52" height="31" align="right" ><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Modify&nbsp;</b></font></td>
<td width="251" height="31" align="left" ><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Product &nbsp;</b></font></td>

<td width="45" height="31" align="right" ><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Qty &nbsp;</b></font></td>
<td width="53" height="31" align="right" ><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Capacity</b></font></td>
<td width="52" height="31" align="right" ><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Rate </b></font></td>
<td width="79" height="31" align="right" ><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Value </b></font></td>
<td width="50" height="31" align="right" ><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Discount </b></font></td>
<td width="81" height="31" align="right" ><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Value.a.dis. </b></font></td>
<td width="115" height="31" align="right" ><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Description </b></font></td>
<?

$aresult = mysqli_query($conn,"select distinct account_year from company where compcode = '$myCompany' ") or die(mysqli_error());
$arow = mysqli_fetch_row($aresult);
$account_year = $arow[0];

$aresult = mysqli_query($conn,"select sum(assess_value) from trading where compcode = '$myCompany' and account_year = '$account_year' ") or die(mysqli_error());
$arow = mysqli_fetch_row($aresult);
$pre_assess_value = $arow[0];	

$assesstotal = 0;
$gtotal = 0;
$gdisc =0;
$totalvalue=0;
$result = mysqli_query($conn,"select * from spurch ") or die(mysqli_error());
while($row = mysqli_fetch_row($result))
{
	$compcode = $row[0];
	$bcode = $row[1];
	$prodcode = $row[2];
	$qty = $row[3];
	$capacity = $row[4];
	$rate = $row[5];
	$discount = $row[6];
	$remarks = $row[7];
	$record = $row[8];
	if($capacity >0)
	{
		$actualvalue = $capacity * $rate * $qty;
		$disamt = $actualvalue * $discount /100;
		$value = $actualvalue - $disamt;
	}
	else
	{
		$actualvalue = $rate * $qty;
		$disamt = $actualvalue * $discount /100;
		$value = $actualvalue - $disamt;
		
	}
	
	
	$gtotal = $gtotal + $actualvalue;
	$gdisc = $gdisc +$disamt;

	
	

	$prodname = mysqli_fetch_array(mysqli_query($conn,"select prodname from product where prodcode = '$prodcode'")) or die(mysqli_error());
	?>
	<tr  bgcolor="#D7D7FF">
	<td width="52" height="31" align="right" ><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b><a href = "peditview.php?record=<?echo($record);?>"><?echo($record);?></a></b></font></td>
	<td width="251" height="31" align="left" ><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b><?=$prodname['prodname']?></b></font></td>
	
	<td width="45" height="31" align="right" ><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b><?=$qty?></b></font></td>
	<td width="53" height="31" align="right" ><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b><?=$capacity;?></b></font></td>
	<td width="52" height="31" align="right" ><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b><?=$rate?></b></font></td>
	<td width="79" height="31" align="right" ><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b><?=$actualvalue?></b></font></td>
	<td width="50" height="31" align="right" ><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b><?=$disamt?></b></font></td>
	<td width="81" height="31" align="right" ><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b><?=$value?></b></font></td>
	<td width="115" height="31" align="right" ><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b><?=$remarks?></b></font></td>
	</tr>
	
	<?
}

?>

<tr  bgcolor="#D7D7FF">
<td  colspan="5" height="31" align="right" ><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Total</b></font></td>
<td width="79" height="31" align="right" ><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b><?=$gtotal?></b></font></td>
<td width="50" height="31" align="right" ><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b><?=$gdisc?></b></font></td>
<td width="81" height="31" align="right" ><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b><?=$gtotal-$gdisc?></b></font></td>
<td width="115" height="31" align="right" ><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b><?=$remarks?></b></font></td>
</tr>

<?
$totalvalue=$gtotal - $gdisc;

$tresult = mysqli_query($conn,"select tax,cess from salestax where taxtype = '$myTax' ") or die(mysqli_error());
$trow = mysqli_fetch_row($tresult);
$stax = $trow[0];
$stcess = $trow[1];

$cresult = mysqli_query($conn,"select bed,cess,hcess from excise where tariff = '$myCenvat' ") or die(mysqli_error());
$crow = mysqli_fetch_row($cresult);
$bed = $crow[0];
$edcess = $crow[1];
$hscess = $crow[2];

		if($bed >0)
		{
			$val1=$bed;
		}
		if($edcess>0)
		{
			$val2 = $bed*$edcess/100;
		}
		if($hscess>0)
		{
			$val3 = $bed*$hscess/100;
		}
		$divider = 100+$val1+$val2+$val3;
	
			
		if($divider >0)
		{	
			$assesstotal = $totalvalue *100/$divider;
		}
		else
		{
			$assesstotal = $totalvalue;
		}

	 



$dutyamt = $assesstotal * $bed /100;
$edcess = $dutyamt * $edcess /100;
$hcess = $dutyamt *$hscess /100;
$subtotal = round($assesstotal + $dutyamt + $edcess + $hcess,2);

$stamt = round($subtotal * $stax /100,2);
$stcessamt = round($stamt * $stcess/100,2);
$netamt = round($subtotal + $stamt + $stcessamt,2);



?>
<tr bgcolor="#D7D7FF">

<td   align="right" ><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Clearance</b></font></td>
<td width="251"  align="right" ><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b><?=number_format($pre_assess_value,2,'.','')?></b></font></td>

<td  colspan="5"  align="right" ><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Assesable Value</b></font></td>
<td width="81"  align="right" ><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b><?=number_format($assesstotal,2,'.','')?></b></font></td>
<td>&nbsp;</td>
</tr>
<?
if($dutyamt > 0)
{
	?>
	<tr bgcolor="#D7D7FF">
	<td  colspan="7"  align="right" ><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Duty Amount</b></font></td>
	<td width="81"  align="right" ><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b><?=number_format($dutyamt,2,'.','')?></b></font></td>
	<td>&nbsp;</td>
	</tr>
<?
}

if($edcess > 0)
{
	?>
	<tr bgcolor="#D7D7FF">
	<td  colspan="7"  align="right" ><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Educational Cess</b></font></td>
	<td width="81"  align="right" ><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b><?=number_format($edcess,2,'.','')?></b></font></td>
	<td>&nbsp;</td>
	</tr>
<?
}
if($hcess > 0)
{
	?>
	<tr bgcolor="#D7D7FF">
	<td  colspan="7"  align="right" ><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>H.Secondary Cess</b></font></td>
	<td width="81"  align="right" ><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b><?=number_format($hcess,2,'.','')?></b></font></td>
	<td>&nbsp;</td>
	</tr>
<?
}
if($dutyamt > 0)
{
?>
	<tr bgcolor="#D7D7FF">
	<td  colspan="7"  align="right" ><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Sub Total</b></font></td>
	<td width="81"  align="right" ><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b><?=number_format($subtotal,2,'.','')?></b></font></td>
	<td>&nbsp;</td>
	</tr>
<?
}
if($stamt > 0)
{
	?>
	<tr bgcolor="#D7D7FF">
	<td  colspan="7"  align="right" ><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Vat Amount</b></font></td>
	<td width="81"  align="right" ><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b><?=number_format($stamt,2,'.','')?></b></font></td>
	<td>&nbsp;</td>
	</tr>
<?
}
if($stcessamt > 0)
{
	?>
	<tr bgcolor="#D7D7FF">
	<td  colspan="7"  align="right" ><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Vat Cess </b></font></td>
	<td width="81"  align="right" ><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b><?=number_format($stcessamt,2,'.','')?></b></font></td>
	<td>&nbsp;</td>
	</tr>
<?
}
?>
<tr bgcolor="#D7D7FF">
<td  colspan="7"  align="right" ><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Net Amount</b></font></td>
<td width="81"  align="right" ><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b><?=number_format($netamt,2,'.','')?></b></font></td>
<td>&nbsp;</td>
</tr>


</table>
<table width="682">

		<?
			$aresult = mysqli_query($conn,"select account_year from company where compcode = '$myCompany'") or die(mysqli_error());
			$arow = mysqli_fetch_row($aresult);
			$account_year = $arow[0];
			

		?>

		<tr > 
<?
	if($myBuyer == '111200020011')
	{
	?>
	<tr>
	 <td width="50" height="31" align="right" ><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Local Customer Name and address
        </b></font></td>
		<td><textarea rows="5" cols="30" name="address" ></textarea></td><tr>
  
	<?
	}

		$aresult = mysqli_query($conn,"select distinct account_year from company where compcode = '$myCompany' ") or die(mysqli_error());
		$arow = mysqli_fetch_row($aresult);
		$account_year = $arow[0];		

		$aresult = mysqli_query($conn,"select max(invno) from trading where compcode = '$myCompany' and account_year = '$account_year' ") or die(mysqli_error());
		$arow = mysqli_fetch_row($aresult);
		$bill_no = $arow[0]+1;

?>		
		<td width="99" height="31" align="right" ><div align="left"><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><b><font color="#003366">Trading Invoice No<font color="#CC0000"><b>(T)</b></font>
		  &nbsp;</font></b></font></div></td>
		<td width="125" > <input type="text"  size="10" onKeyPress="return event.keyCode!=13" name="bill_no" value= '<?=$bill_no?>' >		</td>

	<td width="61"  align="left"><div align="left"><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><b><font color="#003366">Trading Invoice Date</font></b></font> </div></td>
		<td width="159" class="small_site_font_black" > 
		<?
		
		$today=strftime ("%d/%m/%Y", mktime(0,0,0,date("m"),date("d"),date("Y"))); ?>
		<input name="today" type="text" onKeyPress="return event.keyCode!=13" class="text_box_button" value="<?=$today?>" size="10"   > 
		<a href="#" onClick="cal.select(document.myform2.today,'anchor1','dd/MM/yyyy'); return false;"name="anchor1" id="anchor1"><img  src="../../images/cal.gif" border="0"></a>		</td>
		<td width="99" height="31" align="right" ><div align="left">
		  <font face="Verdana, Arial, Helvetica, sans-serif" size="1"><b><font color="#003366">Modeof Sales &nbsp;</font></b></font></div></td>
		<td width="125" > 
		
		<select name="salemode">
		<option value="Cash">Cash</option>
		<option  selected  value="Credit">Credit</option>
		</select></td>
		
		</tr>		



		<tr > 
	<td width="85"  align="left"><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><b><font color="#003366">Date and Time of Preparation
      </font></b></font></td>
		<td width="125" class="small_site_font_black" > 
		<?
		
		$prepdate=strftime ("%d/%m/%Y", mktime(0,0,0,date("m"),date("d"),date("Y"))); ?>
		<input name="prepdate" type="text" onKeyPress="return event.keyCode!=13" class="text_box_button" value="<?=$prepdate?>" size="10"   > 
		<a href="#" onClick="cal.select(document.myform2.prepdate,'anchor1','dd/MM/yyyy'); return false;"name="anchor1" id="anchor1"><img  src="../../images/cal.gif" border="0"></a>		<input name="preptime" type="text" onKeyPress="return event.keyCode!=13" class="text_box_button" value="<?=date('H:m')?>" size="10"   > 		</td>
	  

	<td width="85"  align="left"><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><b><font color="#003366">Date and Time of Removal
      </font></b></font></td>
		<td width="125" class="small_site_font_black" > 
		<?
		
		$remdate=strftime ("%d/%m/%Y", mktime(0,0,0,date("m"),date("d"),date("Y"))); ?>
		<input name="remdate" type="text" onKeyPress="return event.keyCode!=13" class="text_box_button" value="<?=$remdate?>" size="10"   > 
		<a href="#" onClick="cal.select(document.myform2.remdate,'anchor1','dd/MM/yyyy'); return false;"name="anchor1" id="anchor1"><img  src="../../images/cal.gif" border="0"></a>		<input name="remtime" type="text" onKeyPress="return event.keyCode!=13" class="text_box_button" value="<?=date('H:m')?>" size="10"   > 		</td>


		<td width="99" height="31" align="right" ><div align="left"><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><b><font color="#003366">Vehicle  No
		  &nbsp;</font></b></font></div></td>
		<td width="125" > <input type="text"  size="10" onKeyPress="return event.keyCode!=13" name="vehicle_no" value= '' >		</td>


		</tr>		


    <tr>
      <td align="right" colspan="2" ><font color="#003366" size="2" face="Verdana, Arial, Helvetica, sans-serif"><b> Tick to send SMS </b></font></td>
      <td  ><input  type="checkbox"  onKeyPress="return event.keyCode!=13" name="sms" value="Yes"></td></tr>

  <tr> 
    <td align="right" colspan="2" ><font color="#FF0000" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Confirm</b></font></td>
    <td colspan="2"> <input type="radio"    onKeyPress="return event.keyCode!=13"   name="cnf" value = "No" checked> <font color="#FF0000" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>No 
    </b></font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input type="radio"    onKeyPress="return event.keyCode!=13"   name="cnf" value = "Yes"> <font color="#FF0000" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Yes
      </b></font>&nbsp;</td>
  </tr> 
  <table cellpading=0 cellspacing=10 width= 50>
    <tr> 
      <td> <blockquote> <input type =submit name="submit" value = "Submit"></blockquote></td>
  </table>
</table>

<font size=1> 
<p><font size=1>
<a href= "javascript:window.close();">Close Window</a></font></p>
</center>
</font> 
</form>