<?php

session_start();
header("Content-type: text/html; charset=".$_SESSION['encodingmode']);
if($_SESSION['dbName']==""){
header("location:../index.php");
}
include("config.inc.php");

$connection = mysql_connect($config['dbServer'],$config['dbUser'],$config['dbPass']) or die("Could not connect to DB");
mysql_select_db($_SESSION['dbName'],$connection) or die("Could not find DB");

if(	$_SESSION['encodingmode'] == 'utf8' || $_SESSION['encodingmode'] == 'utf-8'){
	mysql_query("SET NAMES 'utf8'"); 
	mysql_query('SET CHARACTER SET utf8'); 
	mysql_set_charset('utf8', $connection);
}




	
$querysetup="select DecimalBase, DecimalBase1, DecimalBase2, base1, base2, grid_color1, grid_color2,maxperpage from setup";
$resultsetup=mysql_query($querysetup,$connection) or die(mysql_error());
while($rowsetup=mysql_fetch_array($resultsetup)){
	extract($rowsetup);
}
$type = $_GET['type'];
$crftdate	= $_POST['crftdate'];
$extra_info	= $_POST['extra_info'];


$crfttype = $type;
if($crfttype == 'CRF') {
	$title = 'CRF';
	$datetitle = 'CRF';
	$phase_lvl = 1;
}
else if($crfttype == 'CT') {
	$title = 'CT';
	$datetitle = 'CT';
	$phase_lvl = 1;
}

if($showinfo == '') $showinfo = 0;

if($showinfo == 1 && $crft_id != ''){
	$queryheader = "select reference, extra_info, manifest_auto, date_format(crft_date,'%d-%m-%Y') from crft_header where crft_id = $crft_id ";
	$resheader = mysql_query($queryheader, $connection);
	$rowheader = mysql_fetch_row($resheader);
	$manifest_auto 	= $rowheader[2];
	if ($extra_info == '')
		$extra_info 	= $rowheader[1]; 
	$crft_reference	= $rowheader[0];
	if ($crftdate == '') 
		$crftdate		= $rowheader[3];
}


print <<<HERE
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 
<meta name="viewport" content="width=device-width, initial-scale=1.0"> 
<LINK REL="stylesheet" TYPE="text/css" MEDIA="all" HREF="css/tabs.css">


<title>$title</title>
<script>
function SubmitRecord(){
	var x = document.fromcr;	
	if(x.crft_id.value == '')
		var mode = 'submitRecord';
	else var mode = 'editRecord';
	
	x.action = 'Form_CRFT_action.php?mode='+mode;
	x.submit();
}

function subEnter(e){
	  if (e.keyCode == 13) {
	if(document.getElementById('BL_number').value == ''){
		alert('Bill of Ladding is Empty!');
		document.getElementById('BL_number').focus();
		return 0;
	} else if(document.getElementById('voy_number').value == ''){
		alert('Voyage Number is Empty!');
		document.getElementById('voy_number').focus();
		return 0;
	} else if(document.getElementById('voy_year').value == ''){
		alert('Voyage Year is Empty!');
		document.getElementById('voy_year').focus();
		return 0;
	} else {
		document.fromcr.showinfo.value = 1;
		document.fromcr.submit();
		
	}
	  }
}

function refreshPage(){
	document.fromcr.submit();
}

function searchCR(type){
	win = window.open('Form_CRFTSearch.php?type='+type, 'Form_CRFTSearch', 'toolbar=no,location=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=700,height=500,top=100');		
	win.creator = self;
	win.focus();
}

function openManifest(){
	win = window.open('Form_ManifestsOnlySearch.php', 'Form_ManifestsOnlySearch', 'toolbar=no,location=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=700,height=500,top=100');		
	win.creator = self;
	win.focus();	
}

function ClearPage(){
	var x = document.fromcr;
	
	x.voy_year.value		= '';
	x.extra_info.value		= '';
	x.BL_number.value		= '';
	x.voy_number.value		= '';
	x.crftdate.value		= '';
	x.cosignee.value		= '';
	x.destination.value		= '';
	x.fromdate.value		= '';
	x.receiveddate.value	= '';
	x.message.value			= '';
	x.crft_id.value			= '';
	x.showinfo.value		= '';
	x.manifest_auto.value   = '';
	
	x.action = 'Form_CRFT.php?type='+x.crfttype.value;
	x.submit();
}

function setChck(index){
	var chkid = 'chk_id'+index;
	if (document.getElementById(chkid).checked)
		document.getElementById(chkid).value = 1;
	else 
		document.getElementById(chkid).value = 0;
}
</script>
<style type="text/css">
.styledt{
    font-size: 13px;
}

.dem {
	font-size: 16px;
    font-family: sans-serif;
    font-weight: bold;
}
.dem {
	font-size: 14px;
    font-family: sans-serif;
    font-weight: bold;
}
</style>

<link type="text/css" rel="stylesheet" href="dhtmlgoodies_calendar.css?random=20051112" media="screen"></LINK>
<SCRIPT type="text/javascript" src="dhtmlgoodies_calendar.js?random=20060118"></script>
<LINK REL="stylesheet" TYPE="text/css" MEDIA="all" HREF="tabs.css">

<link rel="stylesheet" type="text/css" media="all" href="css-v2/style.css">
</head>
<body >
<form name='fromcr' id='formcr' method='post' >
<input type=hidden name='mode' value='$mode'>
<input type=hidden name='message' value='$message'>
<input type=hidden name='crft_id' value='$crft_id'>
<input type=hidden name='crfttype' value='$crfttype'>
<input type=hidden name='showinfo' value='$showinfo'>
<input type=hidden name='manifest_auto' value='$manifest_auto'>
HERE;


if($crft_id == '' && $showinfo == 0){
	$extra_info = "TO CONTAINER TERMINAL OFFICER \nPLEASE DELIVER FOLLOWING FULL CONTAINER(S) TO: ";
	$voy_year= date("y");
}

if($showinfo == 1 && $manifest_auto != '' ){
	$queryheader = " select distinct manifest.manifest_auto, consignee1, PortofDischarge, date_format(From_date, '%d-%m-%Y'), date_format(To_Date, '%d-%m-%Y'), currency, 
					 date_format(crf_date, '%Y-%m-%d' ), client_code, ledger_name, Phase_id, date_format(crt_date, '%Y-%m-%d' ), manifest.Voyage_year,
					 manifest.voyage_number, manifest.BOL_identification, Portofloading, manifest.vessel_id
					 from manifest
					 left join containertrace on manifest_manifestauto = manifest.manifest_auto 
					 left join clients on clients.ledger_number = manifest.client_code 
					 where manifest.manifest_auto = '$manifest_auto' ";
	//echo $queryheader;
	$resheader = mysql_query($queryheader, $connection);
	$numheader = mysql_num_rows($resheader);
	$rwheader = mysql_fetch_row($resheader);
	if($numheader > 0){
		$phase_id = $rwheader[9];
		$client_code	= $rwheader[7];
		
		/* if( $phase_id > $phase_lvl)
			$message = "Containers aleardy in Phase $phase_id!";
		 */
		if($client_code == '')
			$message = "Client is Empty!";
		
		else {
			$manifest_auto 	= $rwheader[0];
			$cosignee 		= $rwheader[1];
			$destination 	= $rwheader[2];
			$fromdate 		= $rwheader[3];
			$receiveddate 	= $rwheader[4];
			if($crftdate == '') $crftdate = date('d-m-Y');
			$currency_code 	= $rwheader[5];
			$crf_date 		= $rwheader[6];
			$client_name	= $rwheader[8];
			$crt_date 		= $rwheader[10];
			$voy_year 		= $rwheader[11];
			$voy_number 	= $rwheader[12];
			$BL_number 		= $rwheader[13];
			$POL	 		= $rwheader[14];
			$vessel	 		= $rwheader[15];
		}
	} else $message = "No Records Found!";
}



echo"<table cellpadding='0' cellspacing='0' border='0'  align='center' class='layout-width'>";
include_once("header.php");
echo" <tr><td  valign='top'>";

include_once("sidemenu.php");
echo"  </td></tr>";


echo" <tr style='height:26px;'>
		<td  valign='top' id='content-top'>
			<table border='0' cellpadding='0' cellspacing='0' style='table-layout:fixed; height:26px;' class='layout-width'>
			<tr style='height:26px;'>
				<td style='width:38px; height:26px;'>&nbsp;</td>
				<td valign='middle' style='width:300px; height:26px;'><span class='title' style='text-transform: uppercase'>$title</span></td>
				<td class='message' valign='middle' style='height:26px;'>".htmlspecialchars($message, ENT_QUOTES)."</td>
			</tr></table>
		</td>
	  </tr>";
	  

echo"<tr>
		<td  height='34'  valign='top' id='content-top2'>
		<table border='0' cellpadding='0' cellspacing='0' class='layout-width'>
			<tr>
				<td width='38'  height='34'>&nbsp;</td>
				<td valign='middle' height='34' width='720px'>
					<button type='button' id='btnClear' name='btnClear' onclick='ClearPage(); return false;' title='Clear Page'><span><span>ClearPage</span></span></button>";
					
				if($showinfo == 1) 
					echo "<button type='button' id='btnPost' name='btnPost' onclick='SubmitRecord(); return false;' title='Save Changes' ><span><span>Save</span></span></button>&nbsp;";
				if($crft_id == '')
					echo "<button type='button' id='btnSearch' name='btnSearch' onclick=\"searchCR('$crfttype'); return false;\" title='Search' ><span><span>Search</span></span></button>&nbsp;";
				echo"</td>
				<td align='left' width='250px'>
					</td>
				<td align='left'></td>
			</tr>
		</table>
	</td>
</tr>
<tr>
	<td id='content-body'>
		<table border='0'  align='center' valign='top'  class='tablecontent' >
				<col width=65%>
				<tr bgcolor='#F7F7F7' >
					<td valign='top' align='left'>
						<table border='0' style='table-layout:fixed' align='left'  cellpadding='0' cellspacing='0' valign='top'>
							<col width=120><col width=155><col width=120><col width=155><col width=120><col width=155><col width=120><col width=155>
							<col width=120><col width=155><col width=120><col width=155><col width=120><col width=155><col width=120><col width=155>";
//header
echo "<tr bgcolor='#F7F7F7' height='25'>
			<td valign='center' align='left' ><span class='style1'>Voyage Year</span></td>
			<td align='left'><input type='text' name='voy_year' id='voy_year' value='".$voy_year."' style='font-size:12px; width:40px; ' maxlength='2' /></td>
			<td valign='center' align='left' ><span class='style1'>No. BS</span></td>
			<td align='left'><span class='style1'>".$crft_reference." </span></td>
			<td valign='center' align='left' colspan='4'></td>
		</tr>";

echo "<tr bgcolor='#F7F7F7' height='25'>
			<td valign='center' align='left' colspan='8'><span class='style1'>
			<textarea name='extra_info' id='extra_info' cols='150' rows='3'>".htmlspecialchars($extra_info, ENT_QUOTES)."</textarea>
			</span></td>
		</tr>";
		
echo "<tr bgcolor='#F7F7F7' height='25'>
			<td valign='center' align='left' ><span class='style1'>Messrs</span></td>
			<td align='left' colspan='2'><input type='text' name='cosignee' id='cosignee' value='".$cosignee."' style='font-size:12px; width:250px; border: none;' readonly /></td>
			<td valign='center' align='left'></td>
			<td valign='center' align='left' ><span class='style1'>B\L No.</span></td>
			<td align='left' colspan='3'><input type='text' name='BL_number' id='BL_number' value='".$BL_number."' style='font-size:12px; width:150px; ' readonly onkeypress=\"subEnter(event);\" maxlength='16' /> 
			<img src='img/btnopen.jpg' title='Select client ' width='15' height='17' onmouseover=\"style.cursor='hand'\" onclick=\"openManifest(); return false\" style='cursor: pointer;'>
			- <span class='style1'>".$POL."</span></td>
		</tr>";
									
		
echo "<tr bgcolor='#F7F7F7' height='25'>
			<td valign='center' align='left' ><span class='style1'>M/V</span></td>
			<td align='left' colspan='2'><input type='text' name='' id='' value='".$vessel."' style='font-size:12px; width:250px; border: none;' readonly /></td>
			<td valign='center' align='left'></td>
			<td valign='center' align='left'><span class='style1'>Voyage Number</span></td>
			<td valign='center' align='left' ><input type='text' name='voy_number' id='voy_number' value='".$voy_number."' style='font-size:12px; width:120px; '  readonly onkeypress=\"subEnter(event);\" /></td>
			<td align='left' colspan='2'></td>
		</tr>";

echo "<tr bgcolor='#F7F7F7' height='25'>
			<td valign='center' align='left' ><span class='style1'>AT</span></td>
			<td align='left' ><input type='text' name='destination' id='destination' value='$destination' style='font-size:12px; width:145px; border: none;' readonly /></td>
			<td valign='center' align='left'><input type='text' name='fromdate' id='fromdate' value='$fromdate' style='font-size:12px; width:90px; border: none;' readonly ></td>
			<td valign='center' align='left'><input type='text' name='receiveddate' id='receiveddate' value='$receiveddate' style='font-size:12px; width:90px; border: none;' readonly ></td>
			<td valign='center' align='left'><span class='style1'>$datetitle Date</span></td>
			<td valign='center' align='left'><input type='text' name='crftdate' id='crftdate' value='$crftdate' style='font-size:12px; width:90px;' onchange=\"refreshPage();\" readonly >
				<a HREF='#' onClick=\"displayCalendar(document.fromcr.crftdate,'dd-mm-yyyy',this); return false;\" NAME=\"anchor1\" ID=\"anchor1\" >
				<image src='./img/cal.gif' border=0 align=center ></image></a>
			</td>
			<td align='left' colspan='3'><span class='style1'>Previous $crfttype Date: ";
		if($crfttype == 'CRF') 	echo $crf_date;
		else if($crfttype == 'CT')	echo $crt_date;
echo"		</span></td>
		</tr>";

if($manifest_auto != ''){
	$cnt = 0;
	if($crfttype == 'CRF') 		$crftid = 'crft_id';
	else if($crfttype == 'CT')	$crftid = 'crft_id2';
	
	echo "<tr><td colspan='8'><hr></td></tr>";
	echo "<tr><td colspan='8'><div style='height:300px; overflow-x:none; overflow-y:scroll;'><table border=0 align='left'  cellpadding='0' cellspacing='0' valign='top'>
				<col width=30><col width=150><col width=120><col width=755>";
	$querydt = "select Container, Marks, Container_Weight, CubeMeters, auto, $crftid  from manifestdt
				where manifest_manifestauto = $manifest_auto and (ifnull(ctrflag,'') <> '*' or ifnull(detailtype,'') = 1) ";
	if($crfttype == 'CT')
		$querydt .= "  and ifnull(crft_id,'') <> '' ";			
	$querydt .= " order by ifnull($crftid,'') desc, detailsequence; "; //echo $querydt;
	$resdt = mysql_query($querydt, $connection);
	while($rwdt = mysql_fetch_array($resdt)){
		if ($cnt%2) 	$bgcolor = "bgcolor='#dbeaf7'";
		else		$bgcolor = "bgcolor='#d3d3d3'";
		$chk_id = 'chk_id'.$rwdt[4];
		
		if ($rwdt[5] == $crft_id && $rwdt[5] != '') $$chk_id = '1';	
		else if ($rwdt[5] != $crft_id && $rwdt[5] != '') $$chk_id = 'x';
		else $$chk_id = 0;
	
		if ($crft_id == '' && $rwdt[5] == '' && $$chk_id == '') $$chk_id = '1';
		if ($$chk_id == '') $$chk_id = 0;
		
		echo "<tr height='20px' $bgcolor>
							<td>";
		
		if ($$chk_id == '1' || $$chk_id == '0')	
			echo "				<input type='checkbox' name='$chk_id' id='$chk_id' value='".$$chk_id."' onclick=\"setChck('$rwdt[4]');\" ".($$chk_id=='1'?'checked':'').">";
		else if ($$chk_id == "x")					
			echo "				<input type='hidden' name='$chk_id' id='$chk_id' value='*' >";
		echo "				</td>
							<td><span class='styledt'>$rwdt[0]</span></td><td><span class='styledt'>$rwdt[1]</span></td>
							<td><span class='styledt'>$rwdt[2]</span></td><td><span class='styledt'>$rwdt[3]</span></td>
							<td ></td>
			  </tr>";
		$cnt++;
	}
	
	echo "</table></div></td></tr>";
}

if( $receiveddate != '' && $crftdate != ''){
	echo "<tr height='30px'><td colspan='8'></td></tr>";
	$ndate = explode('-', $receiveddate);
	$receiveddate = $ndate[2]."-".$ndate[1]."-".$ndate[0];
	
	$ndate = explode('-', $crftdate);
	$crftdate = $ndate[2]."-".$ndate[1]."-".$ndate[0];
	
	if($crfttype == 'CRF'){
		$querydif = "SELECT DATEDIFF('$crftdate', '$receiveddate'); ";
		$resdif = mysql_query($querydif, $connection);
		$rwdif = mysql_fetch_row($resdif);
		$datedif = $rwdif[0];
	} else if($crfttype == 'CT'){
	
		if($crt_date != '')
			$querydif = "SELECT DATEDIFF('$crftdate', '$crt_date'); ";
		else if($crf_date != '')
				$querydif = "SELECT if(DATEDIFF('$crf_date', '$crftdate') < 0, DATEDIFF('$crftdate', '$crf_date'), DATEDIFF('$crf_date', '$crftdate')); ";
		else $querydif = "SELECT DATEDIFF('$crftdate', '$receiveddate'); ";
			$resdif = mysql_query($querydif, $connection);
			$rwdif = mysql_fetch_row($resdif);
			$datedif = $rwdif[0];
		
	}
	
	if($datedif > 0){
		$queryval = "select dem_value from demarage_values";
		$resval = mysql_query($queryval, $connection);
		$rwval = mysql_fetch_row($resval);
		$dem_value = $rwval[0]*$datedif;
		
		echo "<tr height='30px'>
					<td></td>
					<td colspan='2' align='center' style='border-top: 1px solid red;border-bottom: 1px solid red;border-left: 1px solid red;'><span class='dem'> Demarage </span></td>
					<td colspan='2' align='center' style='border-top: 1px solid red;border-bottom: 1px solid red;'><span class='dem'> $datedif Days Late</span></td>
					<td colspan='2' align='center' style='border-top: 1px solid red;border-bottom: 1px solid red;border-right: 1px solid red;'><span class='dem'>".number_format($dem_value,$DecimalBase)." $currency_code</span>
					</td>
					<td ></td></tr>";
		echo "<tr height='30px'><td colspan='8'></td></tr>";
		echo "<tr height='30px'><td colspan='8'><span class='dem'><b>$client_name Balance</b></span></td></tr>";
		
		$queryPrev = "select sum(if(Journaldt_dbcd='D',Journaldt_amount1,0) - if(Journaldt_dbcd='D',Journaldt_amount1,0))
					 from journaldt
					 where ledger_number = '$client_code';";
		$resPrev = mysql_query($queryPrev, $connection);
		$rwPrev = mysql_fetch_row($resPrev);
		$prevBal = $rwPrev[0];
		if($prevBal	== '') $prevBal = 0;
		
		$query = "SELECT ifNull(convertcurfunc('".$base1."', '".$currency_code."', now(), 0, 0, '', '', ifNull($prevBal,0)),0) From Dual ";
		$result = mysql_query($query, $connection);
		$row = mysql_fetch_row($result);
		$prevBal = $row[0];
		$curBal = $prevBal + $dem_value;
		echo "<tr height='30px'><td ><span class='dem2'>Previous Balance</span></td><td ><span class='dem2'>".number_format($prevBal,$DecimalBase)." $currency_code</span></td>
								<td ><span class='dem2'>Current Balance</span></td><td ><span class='dem2'>".number_format($curBal,$DecimalBase)." $currency_code</span></td>
			</tr>";
	}
	
	echo "<tr height='30px'>
			<td colspan='8'><input type='hidden' name='item_code' id='item_code' value='demarage'>
						<input type='hidden' name='client_code' id='client_code' value='$client_code'>
						<input type='hidden' name='amount' id='amount' value='$dem_value'>
						<input type='hidden' name='currency_code' id='currency_code' value='$currency_code'>
			</td></tr>";
}	
/* 
echo "<tr><td colspan='8'><div id='demcalc' style='height:300px; overflow-x:none; overflow-y:scroll;'><table border=0 align='left'  cellpadding='0' cellspacing='0' valign='top'>";
calculate_demurrage($connection);
echo "</table></div></td></tr>"; */
// Calculate date difference

echo "</table></td></tr>
	</table></td></tr>
	</td>
	</tr>";							
echo" 	</td></tr>";

echo" <tr height='30'><td align='center' id='content-bottom' ></td></tr>";
include("footer.php");	
echo" </table>  ";//end of last table menu		 



print <<<HERE
</form>
</body>

HERE;
/* 
function calculate_demurrage($receiveddate, $crftdate, $crfttype, $DecimalBase, $connection){
	if( $receiveddate != '' && $crftdate != ''){
	echo "<tr height='30px'><td colspan='8'></td></tr>";
	$ndate = explode('-', $receiveddate);
	$receiveddate = $ndate[2]."-".$ndate[1]."-".$ndate[0];
	
	$ndate = explode('-', $crftdate);
	$crftdate = $ndate[2]."-".$ndate[1]."-".$ndate[0];
	
	if($crfttype == 'CRF'){
		$querydif = "SELECT DATEDIFF('$crftdate', '$receiveddate'); ";
		$resdif = mysql_query($querydif, $connection);
		$rwdif = mysql_fetch_row($resdif);
		$datedif = $rwdif[0];
	} else if($crfttype == 'CT'){
	
		if($crt_date != '')
			$querydif = "SELECT DATEDIFF('$crftdate', '$crt_date'); ";
		else if($crf_date != '')
				$querydif = "SELECT if(DATEDIFF('$crf_date', '$crftdate') < 0, DATEDIFF('$crftdate', '$crf_date'), DATEDIFF('$crf_date', '$crftdate')); ";
		else $querydif = "SELECT DATEDIFF('$crftdate', '$receiveddate'); ";
			$resdif = mysql_query($querydif, $connection);
			$rwdif = mysql_fetch_row($resdif);
			$datedif = $rwdif[0];
		
	}
	
	if($datedif > 0){
		$queryval = "select dem_value from demarage_values";
		$resval = mysql_query($queryval, $connection);
		$rwval = mysql_fetch_row($resval);
		$dem_value = $rwval[0]*$datedif;
		
		echo "<tr height='30px'>
					<td></td>
					<td colspan='2' align='center' style='border-top: 1px solid red;border-bottom: 1px solid red;border-left: 1px solid red;'><span class='dem'> Demarage </span></td>
					<td colspan='2' align='center' style='border-top: 1px solid red;border-bottom: 1px solid red;'><span class='dem'> $datedif Days Late</span></td>
					<td colspan='2' align='center' style='border-top: 1px solid red;border-bottom: 1px solid red;border-right: 1px solid red;'><span class='dem'>".number_format($dem_value,$DecimalBase)." $currency_code</span>
					</td>
					<td ></td></tr>";
		echo "<tr height='30px'><td colspan='8'></td></tr>";
		echo "<tr height='30px'><td colspan='8'><span class='dem'><b>$client_name Balance</b></span></td></tr>";
		
		$queryPrev = "select sum(if(Journaldt_dbcd='D',Journaldt_amount1,0) - if(Journaldt_dbcd='D',Journaldt_amount1,0))
					 from journaldt
					 where ledger_number = '$client_code';";
		$resPrev = mysql_query($queryPrev, $connection);
		$rwPrev = mysql_fetch_row($resPrev);
		$prevBal = $rwPrev[0];
		if($prevBal	== '') $prevBal = 0;
		
		$query = "SELECT ifNull(convertcurfunc('".$base1."', '".$currency_code."', now(), 0, 0, '', '', ifNull($prevBal,0)),0) From Dual ";
		$result = mysql_query($query, $connection);
		$row = mysql_fetch_row($result);
		$prevBal = $row[0];
		$curBal = $prevBal + $dem_value;
		echo "<tr height='30px'><td ><span class='dem2'>Previous Balance</span></td><td ><span class='dem2'>".number_format($prevBal,$DecimalBase)." $currency_code</span></td>
								<td ><span class='dem2'>Current Balance</span></td><td ><span class='dem2'>".number_format($curBal,$DecimalBase)." $currency_code</span></td>
			</tr>";
	}
	
	echo "<tr height='30px'>
			<td colspan='8'><input type='hidden' name='item_code' id='item_code' value='demarage'>
						<input type='hidden' name='client_code' id='client_code' value='$client_code'>
						<input type='hidden' name='amount' id='amount' value='$dem_value'>
						<input type='hidden' name='currency_code' id='currency_code' value='$currency_code'>
			</td></tr>";
}	

	
} */
?>














