forked from vishaloshnif/stock-management-system
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpayment_receipt_print.php
More file actions
executable file
·137 lines (120 loc) · 4.33 KB
/
Copy pathpayment_receipt_print.php
File metadata and controls
executable file
·137 lines (120 loc) · 4.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<?php
session_start(); // Use session variable on this page. This function must put on the top of page.
if(!isset($_SESSION['username']) || $_SESSION['usertype'] !='admin'){ // if session variable "username" does not exist.
header("location:index.php?msg=Please%20login%20to%20access%20admin%20area%20!"); // Re-direct to index.php
}
else
{
include_once "db.php";
error_reporting (E_ALL ^ E_NOTICE);
if(isset($_GET['sid']))
{
?><!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>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Sales Print</title>
<style type="text/css" media="print">
.hide{display:none}
</style>
<script type="text/javascript">
function printpage() {
document.getElementById('printButton').style.visibility="hidden";
window.print();
document.getElementById('printButton').style.visibility="visible";
}
</script>
</head>
<body>
<input name="print" type="button" value="Print" id="printButton" onClick="printpage()">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" valign="top">
<table width="595" cellspacing="0" cellpadding="0" id="bordertable" border="1">
<tr>
<td align="center"><strong>Payment Receipt <br />
</strong>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="67%" align="left" valign="top"> Date: <?php
$sid=$_GET['sid'];
$line = $db->queryUniqueObject("SELECT * FROM transactions WHERE id='$sid' ");
$mysqldate=$line->date;
$phpdate = strtotime( $mysqldate );
$phpdate = date("d/m/Y",$phpdate);
echo $phpdate;
?> <br />
<br />
<strong><br />
Receipt No: <?php echo $line->receiptid;
?> </strong><br /></td>
<td width="33%">Oshnif Technologies Pvt.Ltd<br />
address :F-119 Pushp Encalve Pratap nagar <br />
jaipur<br />
Phone:0141-0000000</td>
</tr>
</table></td>
</tr>
<tr>
<td height="90" align="left" valign="top"><br />
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="5%" align="left" valign="top"><strong> TO:</strong></td>
<td width="95%" align="left" valign="top"><br />
<?php
echo $line->customer;
$cname=$line->customer_id;
$line2 = $db->queryUniqueObject("SELECT * FROM customer_details WHERE customer_name='$cname' ");
echo $line2->customer_address;
?>
<br />
<?php
echo "Contact1: ".$line2->customer_contact1."<br>";
echo "Contact1: ".$line2->customer_contact2."<br>";
?></td>
</tr>
</table></td>
</tr>
<tr>
<td align="right"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="33%" align="left" valign="top"> </td>
<td width="67%" align="left"><br />
<br />
<strong> Paid Amount : <?php echo $line->payment; ?><br />
Balance : <?php echo $line->balance; ?><br />
Due Date :
<?php
$bal=$line->balance;
if( $bal!= 0) {
$mysqldate=$line->due;
$phpdate = strtotime( $mysqldate );
$phpdate = date("d/m/Y",$phpdate);
echo $phpdate;
}
else
echo "NONE";
?> <br />
</strong>
<br />
<br /> </td>
</tr>
<tr>
<td height="100" align="left" valign="top"> </td>
<td height="100" align="right" valign="bottom">Signature </td>
</tr>
</table></td>
</tr>
<tr>
<td align="center" bgcolor="#CCCCCC">Thank you for Business with Us </td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
<?php
}
else "Error in processing printing the Payment receipt";
}
?>