forked from taukir4u/WaterBillingSystem
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathviewpayment.php
87 lines (72 loc) · 2.68 KB
/
viewpayment.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
<?php session_start();
if(!isset($_SESSION['id'])){
echo '<script>windows: location="index.php"</script>';
}
?>
<?php
include 'db.php';
$id =$_REQUEST['id'];
$result = mysql_query("SELECT * FROM bill where id='$id'");
while($row = mysql_fetch_array($result))
{
$prev=$row['prev'];
$owners_id=$row['owners_id'];
$pres=$row['pres'];
$price=$row['price'];
$totalcons=$pres - $prev;
$bill=$totalcons * $price;
$date=$row['date'];
}
?>
<?php
include 'db.php';
$result = mysql_query("SELECT * FROM owners WHERE id = '$owners_id'");
$test = mysql_fetch_array($result);
if (!$result)
{
die("Error: Data not found..");
}
$id=$test['id'] ;
$lname= $test['lname'] ;
$fname=$test['fname'] ;
$mi=$test['mi'] ;
$address=$test['address'] ;
$contact=$test['contact'] ;
?>
<style type="text/css">
#data { margin: 0 auto; width:600px; }
</style>
<div id="data">
<center>
<h1>LAWAAN WATER STATION</h1>
<p>Camilla Homes Lawaan Talisay City</p>
<p><strong>Eng. Welfredo Pitolan</strong></p>
<p>Phone: 4917180 </p>
</center>
<div id="context">
<p>Name: <?php echo $lname.' '.$fname.' '.$mi; ?> Client Id: 000<?php echo $id; ?>
<br /><br />
Address: <?php echo $address; ?>
<br /> <br />
Contact: <?php echo $contact; ?>
</p>
<center>Date: <?php echo $date; ?> </center>
<p>
Previous Reading : <?php echo $prev;?> Price: <?php echo $price; ?><br /><br />
Present Reading : <?php echo $pres; ?> <br /><br />
Consuption: <?php echo $totalcons;?>
<h1 align="center">Bill Amount:P <?php echo $bill; ?> </h1><br /><br />
<?php
$session=$_SESSION['id'];
include 'db.php';
$result = mysql_query("SELECT * FROM user where id= '$session'");
while($row = mysql_fetch_array($result))
{
$sessionname=$row['name'];
}
?>
<p>Casher: <?php echo $sessionname;?></p>
</p>
<CENTER><form><input type="button" onclick="window.print()" value="Print page" /></form><a href="bill.php">Back</a></CENTER>
</div>
</div>