-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathofficial_receipt1.php
150 lines (119 loc) · 4.24 KB
/
official_receipt1.php
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
138
139
140
141
142
143
144
145
146
147
148
149
150
<?php include('include/connect.php');
function formatMoney($number, $fractional=false) {
if ($fractional) {
$number = sprintf('%.2f', $number);
}
while (true) {
$replaced = preg_replace('/(-?\d+)(\d\d\d)/', '$1,$2', $number);
if ($replaced != $number) {
$number = $replaced;
} else {
break;
}
}
return $number;
}
?>
<!DOCTYPE html>
<html lang="en">
<title>JERSEY DEVELOPERS LTD.</title>
<head>
<link href="receipt.css" media="all" rel="stylesheet" type="text/css" />
<script>
function myFunction()
{
var printButton = document.getElementById("printpagebutton");
var back = document.getElementById("back");
printButton.style.visibility = 'hidden';
back.style.visibility = 'hidden';
printButton.style.visibility = 'hidden';
window.print()
}
</script>
</head>
<body >
<a id="back" href="user_order.php">Back</a>
<div id="print">
<a href="" id="printpagebutton" onclick="myFunction()"><B>Print</B></a>
<h3 class="one"><img src="img/images.png" /><br/>JERSEY DEVELOPERS LTD. OFFICIAL BILL OF SALE<br />
<font color="red"><U>UNPAID</U><br/>
<font color="black"><U>
<b>PRINTED ON: <?php echo date("m/d/Y");?></b></U>
</font></h3>
<div class="printtitle">
<hr>
<b> The company is located at 1 Ololua Lane <Br/>
<table>
<?php
$id=$_GET['id'];
$query=mysql_query("select * from payment where PaymentID='$id'") or die(mysql_error());
while($row=mysql_fetch_array($query)){
$CID=$row['customerID'];
$tax=$row['tax'];
$query2=mysql_query("select * from customers where CustomerID='$CID'") or die(mysql_error());
$row2=mysql_fetch_array($query2);
?>
<tr><td>Transaction No.: <u><?php echo $row['Transaction_code'];?></u>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td>Payment Date: <u><?php echo date("F j, Y", strtotime( $row['paymentdate']));?></u></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td>Client Name: <u><?php echo $row2['Firstname'].' '.$row2['Lastname'];?></u></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<?php } ?>
</table>
<br/><br/>
<table border="" color="black">
<thead>
<th>Description</th>
<th>Price</th>
<th>Units</th>
<th>Total</th>
</thead>
<tbody>
<tr>
<?php
$id=$_GET['id'];
$query3=mysql_query("select * from payment_details where PaymentID='$id'") or die(mysql_error());
while($row3=mysql_fetch_array($query3)){
$pid=$row3['PropertyID'];
$query4=mysql_query("select * from tb_properties where PropertyID='$pid'") or die(mysql_error());
$row4=mysql_fetch_array($query4);
echo '<tr><td><div align="center">'.$row4['name'].'</div></td>';
echo '<td><div align="center">KES '.formatMoney($row4['price'],2).'</div></td>';
echo '<td><div align="center">'.$row3['Unit'].'</div></td>';
echo '<td><div align="center">KES '.formatMoney($row3['Total'],2).'</div></td></tr>';
} ?>
</tr>
<tr>
<!--<td><div align="center"><strong>GATEWAY</strong></div></td>-->
<td><div align="center" ><strong>Document Processing Fee</strong></div></td>
</tr>
<tr>
<td align='center'>CASH SALE</td>
<td >KES 150.00</td>
<!--<td ><?php echo 'KES '.formatMoney($tax,2); ?></td>-->
</tr>
<tr>
<td colspan="3" style="text-align:right;"><b>TOTAL AMOUNT:</b></td>
<td style="text-align:center;"> <?php
$id=$_GET['id'];
$result5 = mysql_query("SELECT sum(total) FROM payment_details WHERE PaymentID='$id'");
while($row5 = mysql_fetch_array($result5))
{
$total=150+$row5['sum(total)'];
echo 'KES '.formatMoney($total,2);
}
?></td>
</tr>
</tbody>
</table>
<br>
<br>
<br/><br/>
</div>
</body>
</html>