-
Notifications
You must be signed in to change notification settings - Fork 0
/
paybill.php
51 lines (48 loc) · 1.37 KB
/
paybill.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
<?php session_start(); ?>
<?php
include 'db.php';
$owner_id =$_REQUEST['id'];
$result = mysql_query("SELECT * FROM owners WHERE id = '$owner_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'] ;
$q = mysql_query("select Prev from tempo_bill where Client = '$fname'");
$results = mysql_fetch_array($q);
$previous = $results['Prev'];
?>
<p><h1>Client Bill</h1></p>
<h1>Name: <?php echo $lname.' ' .$fname.' '.$mi;?></h1>
<p><?php $date=date('y/m/d H:i:s');
echo $date;?></p>
<form method="post" action="addbill.php">
<table width="346" border="1">
<tr>
<input type="hidden" name="owners_id" value="<?php echo $id; ?>" />
<input type="hidden" name="date" value="<?php echo $date; ?>" />
<td width="118">Previous Reading:</td>
<td width="66"><input type="text" name="prev" value="<?php echo $previous; ?>" /></td>
<td>ml</td>
</tr>
<tr>
<td>Present Reading:</td>
<td><input type="text" name="pres" /></td>
<td>ml</td>
</tr>
<tr>
<td>Price/ml</td>
<td><input type="text" name="price" value="10" /></td>
<td>Tshs</td>
</tr>
<tr>
<td><input type="submit" name="total" value="Add" /></td>
</tr>
</table>
</form>