-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathuser_bill.php
94 lines (78 loc) · 2.86 KB
/
user_bill.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
<?php
session_start();
$_SESSION['start']=1;
$start=$_SESSION['start'];
include 'database.php';
$bd = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
$query="SELECT * FROM shop where idd='$start'";
$result=$bd->query($query);
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>User Account</title>
<!-- Tell the browser to be responsive to screen width -->
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<link href='https://fonts.googleapis.com/css?family=Source+Sans+Pro' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
<link rel="stylesheet" href="css/style.css">
<script type="text/javascript" src="js/script.js"></script>
<style type="text/css">
</style>
</head>
<body>
<!-- <div class="modal" id="#myModal">
<div class="inner">
<h2>Do you want to confirm the order</h2>
<p><strong>Note : </strong>The order will be non-cancellable after this step.</p>
<button>Submit</button>
</div>
</div> -->
<div class="navbar">
<a href="">ShopLite <strong>/ INVOICE</strong> </a>
</div>
<div class="container">
<div class="card" id="card1"> <!-- Requires ID -->
<h3>Customer Id -<strong>ANK8447JA08</strong></h3>
<p><strong>Customer Name- </strong>Ankit Jain</p>
<p><strong>Phone No- </strong>8447269408</p>
<div id="total" style="border-top :2px solid darkgreen; ">
<table cellspacing="10">
<tr><th>Product Id</th>
<th>Price</th>
</tr>
<?php
$count=$result->num_rows;
while($count!=0)
{
$row=$result->fetch_assoc();
?>
<tr>
<th><?php echo $row['p_code']; ?></th>
<th><?php echo $row['price']; ?></th>
</tr>
<?php
$count=$count-1;
}
?>
</table>
<?php
$query="SELECT SUM(price) FROM shop WHERE idd='$start'";
$res=$bd->query($query);
$ro=$res->fetch_assoc();
//var_dump($ro);
$price=$ro['SUM(price)'];
?>
<h2>Total Bill : Rs. <?php echo $price; ?></h2>
<h2 id="tot"></h2>
</div>
</div>
<form action="">
<input type="hidden" id="counter">
<input type="submit" id="submit_btn" value="Done Shopping" name="submit" onclick="send_count();showModal();">
</form>
</div>
</body>
</html>