Viewing file: print.php (6.2 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <script type="text/javascript">
function print1(strid) { if(confirm("Do you want to print?")) { var values = document.getElementById(strid); var printing = window.open('','','left=0,top=0,width=550,height=400,toolbar=0,scrollbars=0,sta?tus=0'); printing.document.write(values.innerHTML); printing.document.close(); printing.focus(); printing.print(); printing.close(); } } </script> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title></title> <style type="text/css"> body,td,th { font-size: 20x; } </style> </head>
<body> <div id="print2"> <table width="800" p border="0" cellspacing="10" cellpadding="10" bgcolor="#66CCCC"> <tr> <td>
<?php $genreceipt=$_POST[receiptno];
$accountname=$_POST[namet]; $fname=$_POST[fname]; $account=$_POST[acname]; $noofinstall=$_POST[noofinst]; $address=$_POST[address]; $paymentmode=$_POST[mpayment]; $receiptdate=$_POST[rdate]; $branchname=$_POST[branchname]; $nextinstdate=$_POST[nextdate]; $chequeno=$_POST[chequeno]; $agentcode=$_POST[agentcode]; $instdate=$_POST[intdate]; $amount=$_POST[amount]; $amountinword=$_POST[amountrs];
$ndate=$_POST[jdate]; $nmonth=$_POST[jmonth]; $nyear=$_POST[jyear];
$todaydate=$ndate.'/'.$nmonth.'/'.$nyear; if ($nmonth==12) { $nmonth=1; $nyearr=$nyear+1; } else { $nmonthn=$nmonth+1; $nyearr=$nyear; }
$nextdate=$ndate.'/'.$nmonthn.'/'.$nyearr;
?>
<?php $upamount=$_POST[assamount]-$_POST[amount];
?> <?php $con=mysqli_connect("localhost","sarkmicr_user","rb!sar838","sarkmicr_data"); // Check connection if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } $sql = "UPDATE branch SET assetamount='$upamount' WHERE branchname='$_POST[branchname]'";
if (!mysqli_query($con,$sql)) { die('Error: ' . mysqli_error($con)); }
mysqli_close($con); ?> <?php $con=mysqli_connect("localhost","sarkmicr_user","rb!sar838","sarkmicr_data"); // Check connection if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); }
$sql = "INSERT INTO create_receipt (acc_no, receive_date, branch_name,mode_payment,bank_name,amount,noofinstallment,cheque_no, receipt2, accountholder, address, next_inst, agentcode,insdate, agentname,amountrups,jdate,jmonth,jyear,njdate,njmonth,njyear,depositby,planname,plantime)
VALUES ('$_POST[acname]', '$_POST[rdate]', '$_POST[branchname]', '$_POST[mpayment]', '$_POST[bankno]', '$_POST[amount]', '$_POST[noofinst]', '$_POST[chequeno]','$genreceipt','$_POST[namet]','$address','$_POST[intdate]','$_POST[agentcode]', '$_POST[intdate]','$_POST[agentname]','$_POST[amountrs]','$_POST[jdate]','$_POST[jmonth]','$_POST[jyear]','$_POST[nnjdate]','$_POST[nnjmonth]','$_POST[nnjyear]','$_POST[depositby]','$_POST[planname]','$_POST[plantime]')";
if (!mysqli_query($con,$sql)) { die('Error: ' . mysqli_error($con)); }
mysqli_close($con); ?>
<div id="print2"> <table width="900" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="97" colspan="4"><p><img src="images/receiptbanner.jpg" width="100%" height="150" /></p> <p> </p></td> </tr> <tr> <td width="154" align="left"><strong>Receipt No</strong></td> <td width="229" align="left"><?php echo $genreceipt ?> </td> <td width="142" align="left"><strong>Print Date</strong></td> <td width="365" align="left"><?php echo $_POST[jdate].'/'.$_POST[jmonth].'/'.$_POST[jyear] ?></td> </tr> <tr> <td align="left"><strong>Branch Name</strong></td> <td align="left"><?php echo $branchname ?></td> <td align="left"></td> <td align="left"></td> </tr> <tr> <td align="left"><strong>Name</strong></td> <td align="left"><?php echo $accountname?></td> <td align="left">Father/Husband name</td> <td align="left"><?php echo $fname?></td> </tr> <tr> <td align="left" valign="top"><strong>Applicant Address</strong></td> <td colspan="3" align="left" valign="top"><?php echo $address ?> <p> </p></td> </tr> <tr> <td align="left"><strong>Deposit Amount</strong></td> <td align="left"><?php echo $_POST[amount] ?></td> <td align="left"><strong>Deposit Rs.</strong></td> <td align="left"><?php echo $amountinword ?></td> </tr> <tr> </tr> <tr> <td align="left"><strong>Next Due Date</strong></td> <td align="left"><?php echo $_POST[nintdate ]?></td> <td align="left"><strong>Deposit Date</strong></td> <td align="left"><?php echo $todaydate ?></td> </tr> <tr> <td align="left"><strong>Account No</strong></td> <td align="left"><?php echo $account ?></td> <td align="left"> </td> <td align="left"> </td> </tr> <tr> <td align="left"> </td> <td align="left"></td> <td align="left"><strong>Installment No</strong></td> <td align="left"><?php echo $noofinstall ?></td> </tr> <tr> <td align="left"><strong>Late Fine</strong></td> <td align="left"></td> <td align="left"></td> <td align="left"></td> </tr> <tr> <td align="left"><strong>Member Code</strong></td> <td align="left"><?php echo $agentcode ?></td> <td align="left">Total Paid Amount</td> <td align="left"><?php echo $_POST[totalpaidamount] ?></td> </tr> <tr> <td align="left"> </td> <td align="left"> </td> <td align="left"> </td> <td align="left"> </td> </tr> <tr> <td align="left"> </td> <td align="left"> </td> <td align="left"> </td> <td align="left"> </td> </tr> <tr> <td align="left"> </td> <td align="left"> </td> <td align="left"> </td> <td align="left">Authorised Signatory</td> </tr> </table></td> </tr> </table> <table width="300" border="0" cellspacing="10" cellpadding="10"> <tr> <td><form action=""> <input type="button" value="New" onclick="window.location.href='createreceipt.php';"/> </form></td> </tr> </table> <form action=""> <input type="button" name="printbutton" value="Print Receipt" onclick="return print1('print2')"/> </form> <p> </p>
</body> </html>
|