PK

ADDRLIN : /home/anibklip/pcfcindia.com/dump/
FLL :
Current File : /home/anibklip/pcfcindia.com/dump/forminsert.php

<?php
	session_start();
	require_once 'common/common.php';
	require_once 'common/secure.php';

	include("connexion.php");
	include("head.php");
//print_r($_GET);
?>
<?php
if($_GET[addition]=='on')
{
$deckl=".$_GET[deck]";

}
else
{
$deckl="";

}

// Certificate
$din=date('D, d M Y + H:i:s a');
	if($_SESSION['formtwo']=='inserted')//only one insert for use session
	{
		$q="select * from certificate where certypo='b' order by certno desc";
		$q=mysql_query($q) or die(mysql_error());
		if($r=mysql_fetch_array($q)){
			if($r[certno]==0){
				$certno=100;
			}else{
				$certno=$r[certno]+1;
			}
		}

		$sql="INSERT INTO certificate(certno,issuedate,desgood,quantitydeclared,distmarks,conslinkno,portcountry,nameship,countrydes,declentry,nameaddress,declarednameaddress,namefumigant,datefumigantion,placefumigantion,dosagefumigant,durationfumigantion,airtemp,contype,presstest,airspace,discharge,enclosure,commodity,consignment,wrapping,perforated,height,cstatus,ctime,decla,clnid,ajtid,licetype,certypo,sub_c,cancel_reason,consignment_link,container20feet,container40feet,container40HC,containerLCL)
		VALUES('$certno', '".$_GET['issuedate']."','".$_GET['desgood']."','".$_GET['quantitydeclared']."','".$_GET['distmarks']."','".$_GET['conslinkno']."','".$_GET['portcountry']."','".$_GET['nameship']."','".$_GET['countrydes']."','".$_GET['declentry']."','".$_GET['nameaddress']."','".$_GET['declarednameaddress']."','".$_GET['namefumigant']."','".$_GET['datefumigantion']."','".$_GET['placefumigantion']."','".$_GET['dosagefumigant']."','".$_GET['durationfumigantion']."','".$_GET['airtemp']."','".$_GET['contype']."','".$_GET['presstest']."','".$_GET['airspace']."','".$_GET['discharge']."','".$_GET['enclosure']."','".$_GET['commodity']."','".$_GET['consignment']."','".$_GET['wrapping']."','".$_GET['perforated']."','".$_GET['height']."','0','".$din."','".$deckl."','".$_GET['clntid']."','".$_GET['ajtname']."','".$_GET['dtype']."','".$_GET['formno']."','".$_GET['sub_c']."','0','$_GET[consignment_link]','$_GET[container20feet]','$_GET[container40feet]','$_GET[container40HC]','$_GET[containerLCL]')";
		
		$result=mysql_query($sql) or die(mysql_error().'error in certificate');
		
		$certificateno=mysql_insert_id();
	}
?>
<?php 
	$sqlo="SELECT count(*) FROM certificate ";
	$resulto=mysql_fetch_array(mysql_query($sqlo));
	$count=$resulto[0];
	//$certificateno="$count";
	// Invoice
	if($_GET[stax]=='yes'){
		$srtax=$_GET[srtax];
	}else{
		$srtax=0;
	}

	$dis_test=$_GET[discount];
	if($dis_test==''){
		$dis_amt=0;
	}else{
		$dis_amt=$_GET[discount];
	}
	
if($_SESSION['city']=="ludhiana")
{
include("connexion2.php");
$dat=date("Y-m-d");

	if($_SESSION['formtwo']=='inserted')
	{
		$sql="INSERT INTO invoices(clnid,ajtid,certid,dtd,amount,discount,servicetax,grandtotal,invstatus,cmntz,branch)
		VALUES('$_GET[clntid]','$_GET[ajtname]','$certificateno','$dat','$_GET[amount]','$dis_amt','$srtax','$_GET[finalone]','pending','$_GET[cmntz]','$_SESSION[city]')";
		$result=mysql_query($sql) or die('error in inserting ');
		$invoiceid=mysql_insert_id();
	}
}
else
{
$dat=date("Y-m-d");

	if($_SESSION['formtwo']=='inserted')
	{
		$sql="INSERT INTO invoices(clnid,ajtid,certid,dtd,amount,discount,servicetax,grandtotal,invstatus,cmntz,branch)
		VALUES('$_GET[clntid]','$_GET[ajtname]','$certificateno','$dat','$_GET[amount]','$dis_amt','$srtax','$_GET[finalone]','pending','$_GET[cmntz]','$_SESSION[city]')";
		$result=mysql_query($sql) or die('error in inserting ');
		$invoiceid=mysql_insert_id();
	}	
}
$_SESSION['formtwo']='wrong';
?>
<table align="center" width="100%" border="0">
<tr><td>
<form action="printcerts.php" method="get" target="_blank">
<input type="hidden" name="formno" value="<?php echo"$_GET[formno]";?>">
<input type="hidden" name="dtype" value="<?php echo"$_GET[dtype]";?>">
<input type="hidden" name="clntid" value="<?php echo"$_GET[clntid]";?>">
<input type="hidden" name="certificateno" value="0<?php echo"$certno";?>">
<input type="hidden" name="issuedate" value="<?php echo"$_GET[issuedate]";?>">
<input type="hidden" name="desgood" value="<?php echo"$_GET[desgood]";?>">
<input type="hidden" name="quantitydeclared" value="<?php echo"$_GET[quantitydeclared]";?>">
<input type="hidden" name="distmarks" value="<?php echo"$_GET[distmarks]";?>">
<input type="hidden" name="conslinkno" value="<?php echo"$_GET[conslinkno]";?>">
<input type="hidden" name="portcountry" value="<?php echo"$_GET[portcountry]";?>">
<input type="hidden" name="countrydes" value="<?php echo"$_GET[countrydes]";?>">
<input type="hidden" name="declentry" value="<?php echo"$_GET[declentry]";?>">
<input type="hidden" name="nameaddress" value="<?php echo"$_GET[nameaddress]";?>">
<input type="hidden" name="declarednameaddress" value="<?php echo"$_GET[declarednameaddress]";?>">
<input type="hidden" name="namefumigant" value="<?php echo"$_GET[namefumigant]";?>">
<input type="hidden" name="datefumigantion" value="<?php echo"$_GET[datefumigantion]";?>">
<input type="hidden" name="placefumigantion" value="<?php echo"$_GET[placefumigantion]";?>">
<input type="hidden" name="dosagefumigant" value="<?php echo"$_GET[dosagefumigant]";?>">
<input type="hidden" name="durationfumigantion" value="<?php echo"$_GET[durationfumigantion]";?>">
<input type="hidden" name="airtemp" value="<?php echo"$_GET[airtemp]";?>">
<input type="hidden" name="contype" value="<?php echo"$_GET[contype]";?>">
<input type="hidden" name="airspace" value="<?php echo"$_GET[airspace]";?>">
<input type="hidden" name="presstest" value="<?php echo"$_GET[presstest]";?>">
<input type="hidden" name="discharge" value="<?php echo"$_GET[discharge]";?>">
<input type="hidden" name="enclosure" value="<?php echo"$_GET[enclosure]";?>">
<input type="hidden" name="commodity" value="<?php echo"$_GET[commodity]";?>">
<input type="hidden" name="consignment" value="<?php echo"$_GET[consignment]";?>">
<input type="hidden" name="wrapping" value="<?php echo"$_GET[wrapping]";?>">
<input type="hidden" name="perforated" value="<?php echo"$_GET[perforated]";?>">
<input type="hidden" name="height" value="<?php echo"$_GET[height]";?>">
<input type="hidden" name="cmntz" value="<?php echo"$_GET[cmntz]";?>">
<input type="hidden" name="deck" value="<?php echo"$_GET[deck]";?>">
<input type="hidden" name="ajtname" value="<?php echo"$_GET[ajtname]";?>">
<input type="hidden" name="addition" value="<?php echo"$_GET[addition]";?>">
<input type="hidden" name="nameship" value="<?php echo"$_GET[nameship]";?>">
<input type="submit" value="Print Certificate"></form>
</td><td align=center><a href=certificate.php>Click here to Get Back Home</a></td>
<td align=right>
<form action="printinvc2.php" method="get" target="_blank">
<input type="hidden" name="formno" value="<?php echo"$_GET[formno]";?>">
<input type="hidden" name="dtype" value="<?php echo"$_GET[dtype]";?>">
<input type="hidden" name="clntid" value="<?php echo"$_GET[clntid]";?>">
<input type="hidden" name="certno" value="<?php echo"0$certno";?>">
<input type="hidden" name="invoiceid" value="<?php echo"$invoiceid";?>">
<input type="hidden" name="dat" value="<?php echo"$_GET[issuedate]";?>">
<input type="hidden" name="desgood" value="<?php echo"$_GET[desgood]";?>">
<input type="hidden" name="quantitydeclared" value="<?php echo"$_GET[quantitydeclared]";?>">
<input type="hidden" name="invoice" value="<?php echo"$_GET[distmarks]";?>">
<input type="hidden" name="vessel" value="<?php echo"$_GET[conslinkno]";?>">
<input type="hidden" name="portcountry" value="<?php echo"$_GET[portcountry]";?>">
<input type="hidden" name="destinat" value="<?php echo"$_GET[countrydes]";?>">
<input type="hidden" name="declentry" value="<?php echo"$_GET[declentry]";?>">
<input type="hidden" name="nameaddress" value="<?php echo"$_GET[nameaddress]";?>">
<input type="hidden" name="declarednameaddress" value="<?php echo"$_GET[declarednameaddress]";?>">
<input type="hidden" name="namefumigant" value="<?php echo"$_GET[namefumigant]";?>">
<input type="hidden" name="datefumigantion" value="<?php echo"$_GET[datefumigantion]";?>">
<input type="hidden" name="placefumigantion" value="<?php echo"$_GET[placefumigantion]";?>">
<input type="hidden" name="dosagefumigant" value="<?php echo"$_GET[dosagefumigant]";?>">
<input type="hidden" name="durationfumigantion" value="<?php echo"$_GET[durationfumigantion]";?>">
<input type="hidden" name="airtemp" value="<?php echo"$_GET[airtemp]";?>">
<input type="hidden" name="contype" value="<?php echo"$_GET[contype]";?>">
<input type="hidden" name="airspace" value="<?php echo"$_GET[airspace]";?>">
<input type="hidden" name="presstest" value="<?php echo"$_GET[presstest]";?>">
<input type="hidden" name="discharge" value="<?php echo"$_GET[discharge]";?>">
<input type="hidden" name="enclosure" value="<?php echo"$_GET[enclosure]";?>">
<input type="hidden" name="commodity" value="<?php echo"$_GET[commodity]";?>">
<input type="hidden" name="consignment" value="<?php echo"$_GET[consignment]";?>">
<input type="hidden" name="wrapping" value="<?php echo"$_GET[wrapping]";?>">
<input type="hidden" name="perforated" value="<?php echo"$_GET[perforated]";?>">
<input type="hidden" name="height" value="<?php echo"$_GET[height]";?>">
<input type="hidden" name="cmntz" value="<?php echo"$_GET[cmntz]";?>">
<input type="hidden" name="deck" value="<?php echo"$_GET[deck]";?>">
<input type="hidden" name="ajtname" value="<?php echo"$_GET[ajtname]";?>">
<input type="hidden" name="nameship" value="<?php echo"$_GET[nameship]";?>">
<input type="hidden" name="finalone" value="<?php echo"$_GET[finalone]";?>">
<input type="hidden" name="amount" value="<?php echo"$_GET[amount]";?>">
<input type="hidden" name="discount" value="<?php echo"$_GET[discount]";?>">
<input type="hidden" name="srtax" value="<?php echo"$_GET[srtax]";?>">
<input type="hidden" name="stax" value="<?php echo"$_GET[stax]";?>">
<?php
if($_GET['amount']!="")
{
 ?>
<input type="submit" value="Print Invoice"></form>
<? }?></td></tr></table>

<?php
include"foot.php";
	
?>
<br><br><br>


PK 99