-
Notifications
You must be signed in to change notification settings - Fork 0
/
finalbill.php
70 lines (58 loc) · 1.5 KB
/
finalbill.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
<?php
session_start();
if(isset($_SESSION['username']))
{
include ("header.php");
$connection = new mysqli('localhost', 'root', '', 'restaurant');
$cid=$_SESSION['cid'];
$q = "select * from bills WHERE c_id='$cid'";
$result = $connection->query($q);
if($result->num_rows > 0)
{
echo '<table border="1" align="center" cellpadding="10">';
echo '<tr>';
echo '<th>Bill No</th>';
echo '<th>SL No</th>';
echo '<th>Food Name</th>';
echo '<th>Quantity</th>';
echo '<th>Amount</th>';
echo '<th>Date</th>';
echo '<th>Tax</th>';
echo '<th>NET Amount</th>';
echo '</tr>';
while ($data = $result->fetch_array()) {
echo '<tr>';
echo '<td>' . $data[0] . '</td>';
echo '<td>' . $data[1] . '</td>';
echo '<td>' . $data[2] . '</td>';
echo '<td>' . $data[3] . '</td>';
echo '<td>' . $data[4] . '</td>';
echo '<td>' . $data[6] . '</td>';
echo '<td>' . $data[7] . '</td>';
echo '<td>' . $data[9] . '</td>';
echo '</tr>';
}
echo '</table>';
$connection->close();
}
else
{
?>
<script type="text/javascript">
alert("Customer order is not available");
document.location="customer.php";
</script>
<?php
}
?>
<?php
}
else
{
?>
<script>
document.location="index.php";
</script>
<?php
}
?>