<?
session_start();

include_once("../includes/function.php");
$brcode=$_SESSION['brcode'];
$user=$_SESSION['user'];
$jvno=$_REQUEST['jvno'];
if(strlen($brcode)<=0)
{
 print "<script> alert('Session timed out'); parent.document.location='../ind.php'; </script>";
 return;
}
include_once("../opendb.php");

$rs=mysqli_query($db,"select max(crno) from cshrec where brcode='$brcode'");
$cr_row=mysqli_fetch_row($rs);
 if($cr_row[0]<=0)
   $crno=1;
 else   
   $crno=$cr_row[0]+1;
?>


<!DOCTYPE html>
<html><head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<title>Xpress</title>


<link type="text/css" href="../includes/style1.css" rel="stylesheet" />
      <link type="text/css" href="../css/form1.css" rel="stylesheet" />




<style>


#mask {
	display: none;
	background:url(images/bgimg1.gif) repeat;
	//background: #000; 
	position: fixed; left: 0; top: 0; 
	z-index: 10;
	width: 100%; height: 100%;
	opacity: 0.8;
	z-index: 999;
}

.login-popup{
		display:none;
	background:white;
	padding: 10px; 	
	border: 2px solid #ddd;
	float: left;
	font-size: 1.2em;
	position: fixed;
	top: 4%; left: 45%;
	z-index: 99999;
	box-shadow: 0px 0px 20px #999;
	-moz-box-shadow: 0px 0px 20px #999; /* Firefox */
    -webkit-box-shadow: 0px 0px 20px #999; /* Safari, Chrome */
	border-radius:3px 3px 3px 3px;
    -moz-border-radius: 3px; /* Firefox */
    -webkit-border-radius: 3px; /* Safari, Chrome */
}
}

img.btn_close {
	float: right; 
	margin: -28px -28px 0 0;
}

fieldset { 
	border:none; 
}

form.signin .textbox label { 
	display:block; 
	padding-bottom:7px; 
}

form.signin .textbox span { 
	display:block;
}

form.signin p, form.signin span { 
	color:white; 
	font-size:11px; 
	line-height:18px;
} 

form.signin .textbox input { 
	background:#666666; 
	border-bottom:1px solid #333;
	border-left:1px solid #000;
	border-right:1px solid #333;
	border-top:1px solid #000;
	color:white; 
	border-radius: 3px 3px 3px 3px;
	-moz-border-radius: 3px;
    -webkit-border-radius: 3px;
	font:13px Arial, Helvetica, sans-serif;
	padding:6px 6px 4px;
	width:200px;
}

form.signin input:-moz-placeholder { color:white; text-shadow:0 0 2px #000; }
form.signin input::-webkit-input-placeholder { color:hwite; text-shadow:0 0 2px #000;  }

.submit button { 
	background: -moz-linear-gradient(center top, #f3f3f3, #dddddd);
	background: -webkit-gradient(linear, left top, left bottom, from(#f3f3f3), to(#dddddd));
	background:  -o-linear-gradient(top, #f3f3f3, #dddddd);
    filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#f3f3f3', EndColorStr='#dddddd');
	border-color:#000; 
	border-width:1px;
	border-radius:4px 4px 4px 4px;
	-moz-border-radius: 4px;
    -webkit-border-radius: 4px;
	color:#333;
	cursor:pointer;
	display:inline-block;
	padding:6px 6px 4px;
	margin-top:10px;
	font:12px; 
	width:100px;
}

.button:hover { background:#ddd; }

.del{
      border: none;
     background: url("images/delete.png") no-repeat scroll 0 0 transparent;
}
</style>

<script type="text/javascript" src="../js/jquery.js"></script>



<!-- js code below for active enter with textfield-->

 





<style>
.cont
	{
	background-color:#3b5998;

	//background:url(images/bg-inner.jpg) #e9e0c3 repeat-x;
  	width: 100%;position: absolute ;
	height:99%;
    	/* Optional - just for DIV)*/
    	//border: solid 1px #000000;
	-moz-box-shadow: 0px 5px 5px #888;
	-webkit-box-shadow: 0px 5px 5px #888;
	box-shadow: 0px 5px 10px #888;
    }
.tble1 input {
background-color:transparent;
border: 0px solid;
height:20px;
//width:160px;
color:black;
}
.tble1
{
border-collapse:collapse;
border:1px solid silver;

}	
.tble1 td
{
//border-collapse:collapse;
border:1px solid silver;

}



</style>

    
<?
$sql=mysqli_query($db,"select tr_no,date from journal2 where jvno='$jvno' and j_type='CR' and brcode='$brcode'");
$sql1=mysqli_fetch_array($sql);
?>
	
<body style="text-align: center;"  >

 
<center ><h2>Cash Receipt Number:<?print $sql1[tr_no];?></h2></center >
 <table class='tbl2' id='tbl2' ><tr><td align='left'>

Credit
</td></tr>
<?

$re2=mysqli_query($db,"select * from journal2 where jvno='$jvno'  and brcode='$brcode'") or die(mysqli_error($db));

//$row=mysqli_fetch_array($re2);
$cshdt=implode("-",array_reverse(explode("-",$sql1[date])));
print "<tr><td align='left'> date: ".$cshdt;
print "</td></tr>";
?>
<tr><td>
<table width=100% class='tble1' border=1>
<tr bgcolor='#767668' style='color:white'><th>No.<th>Cr <th>Amt <th>Narr<th>Against <th>Value</tr>
<? 
$j=1;
$dbamttot=0;

while($row=mysqli_fetch_array($re2))
{

 print "<tr><td>".$j."</td><td>".$row[partic]."</td>";
 print "<td>".$row[cramt]."</td>";
 print "<td>".$row[narr]."</td>";
 print "<td>".$row[against]."</td>";  
 print "<td>".$row[no]."</td>"; 
$cramttot+=$row[cramt];
$j++;
print "<script>cur2++;</script>";
print "<script>cnt2++;</script>";
}
print "</tr></table>";

?>

</td></tr>
<tr><td colspan='6' align='right'> Total Credit Amount:<? print $cramttot; ?></td></tr>
<tr><td colspan=2 align='left'><a href="#pop2"  onclick=' showHint()' style="text-decoration:none;"><img src='images/back.png'/></a></td></tr>
</table>
<datalist id="htmlListTags"></datalist>
<br>
<div id='clb'></div>
<Hr>
</table>
  </form>		
</body></html>
</div>