-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathShop_info.php
131 lines (102 loc) · 3.95 KB
/
Shop_info.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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<?php
include("connection.php");
include("User_dashboard.php");
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>user's Orders</title>
<!--Font Awesome and online Links --->
<link rel="stylesheet" href="https://pro.fontawesome.com/releases/v5.10.0/css/all.css" integrity="sha384-AYmEC3Yw5cVb3ZcuHtOA93w35dYTsvhLPVnYs9eStHfGJvOvKxVfELGroGkvsg+p" crossorigin="anonymous"/>
<!--style1 css--->
<link rel="stylesheet" href="dash_css/style1.css">
<!--End Here--->
<body>
<div id="page-wrapper" class="gray-bg dashbard-1">
<div class="content-main">
<!--banner-->
<div class="banner">
<h2>
<a href="user_dash.php">Dashboard</a>
<i class="fa fa-angle-right"></i>
<span>Shopping Details</span>
</h2>
</div>
<!-- here -->
<div class="container">
<div class="row">
<div class="col-md-9 col-sm-8 ">
<h2 class="text-center" style="padding-top:20px;">Shopping Info</h2>
<div class="table-responsive">
<table id="mytable" class="table table-bordred table-striped">
<thead>
<th>S.NO</th>
<th>User Id</th>
<th>Username</th>
<th>Item</th>
<th>Price</th>
<th>Quantity</th>
<th>Order Date</th>
<th>Total</th>
</thead>
<tbody>
<tr>
<!--PHP Code -->
<?php
$username = $_SESSION['user'];
$query = "select * from user_info where username = '$username' ";
$run = mysqli_query($con,$query);
$user = mysqli_fetch_array($run);
//For Invoice
$username = $_SESSION['user'];
$query = "select * from invoice where username = '$username' ";
$run = mysqli_query($con,$query);
$invoice = mysqli_fetch_array($run);
//For
?>
<?php
$sr = 0;
$username = $_SESSION['user'];
$query = "select * from order_info where username = '$username' ";
$run = mysqli_query($con,$query);
while($row = mysqli_fetch_array($run))
{
$sr++;
echo "
<tr>
<td>$sr</td>
<td>$user[0]</td>
<td>$row[2]</td>
<td>$row[3]</td>
<td>$row[6]</td>
<td>$row[5]</td>
<td>$row[7]</td>
<td>$row[8]</td>
</tr>
";
}
$username = $_SESSION['user'];
$query = "select SUM(total_amount) from order_info where username = '$username' ";
$run = mysqli_query($con,$query);
while ($row = mysqli_fetch_array($run))
{
echo
"
<td align='center' colspan='7'><strong> Your Total Amount is:</strong></td>
<td><strong>Rs.".$row['SUM(total_amount)']."</strong></td>
";
}
?>
<!-- End Here -->
</tbody>
</table>
<!-- Print Button -->
<div class="text-center" style="float:right; margin-right:10px; margin-top:10px;">
<button onclick="window.print();" class="btn btn-danger" id="print-btn">Print</button>
</div>
<!-- Print Button-->
</body>
</html>