forked from anirban0328/Restaurant-Management-System
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patholdbill2.php
47 lines (45 loc) · 899 Bytes
/
oldbill2.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
<?php
session_start();
if(!isset($_SESSION[username]))
{
header("Location:index.php");
exit;
}
include("header.php");
?>
<html>
<head>
<title>CUSTOMERS</title>
<link href="stylesheets/main.css" media="all" rel="stylesheet" type="text/css" />
</head>
<body>
<?php
$total=0;
include("sql.php");
$q="SELECT * FROM orders WHERE bill_id=".$_POST[billid].";";
$res=mysql_query($q,$con) or die('error');
echo '
<table>
<tr>
<th>ORDER ID</th>
<th>FOOD ID</th>
<th>QUANTITY</th>
<th>AMOUNT</th>
<th>PAID</th>
</tr>';
while($arr=mysql_fetch_array($res))
{
$total+=$arr[3];
echo '<tr>
<td>'.$arr[0].' </td>
<td>'.$arr[1].' </td>
<td>'.$arr[2].' </td>
<td>'.$arr[3].' </td>
<td>'.$arr[5].' </td>
</tr>';
}
echo '</table>';
echo "TOTAL AMOUNT:{$total}";
$q='UPDATE bills SET total_amount='.$total.' WHERE bill_id='.$_POST[billid].';';
$res=mysql_query($q,$con);
?>