-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprofilehis.php
142 lines (109 loc) · 4.15 KB
/
profilehis.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
132
133
134
135
136
137
138
139
140
141
142
<!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>Order History | K-Tech</title>
<link rel="icon" href="images/icon.png">
<link rel="stylesheet" href="Style.css">
</head>
<body>
<!--Header-->
<div class="container">
<?php include('partials-front/navbar.php')?>
<?php
if(!isset($_SESSION['id']))
{
header('location:Account.php');
}
?>
</div>
<!-- My Account -->
<div class="profile">
<div class="small-container">
<div class="row3">
<div class="items">
<a href="Profile.php" ><div id="" class="item">Overview</div></a>
<a href="profilehis.php"><div id="item" class="item">Purchese History</div></a>
<a href="Profiletra.php"><div id="" class="item">Order Tracking </div></a>
</div>
<?php
$image= $_SESSION['image_name'];
$first = $_SESSION['first_name'] ;
$last = $_SESSION['last_name'] ;
?>
<div class="row4">
<div class="col-7 c">
<img src="<?php echo 'images/users/'.trim($image);?>" alt="">
<h3><?php echo $first.' '.$last?></h3>
</div>
<div class="profile">
<h3>Purchese History</h3>
<hr>
<!--------cart item------->
<div class="small-container cart-page">
<table>
<tr>
<th>Product</th>
<th>Order Date</th>
<th>Subtotal</th>
</tr>
<?php
$id = $_SESSION['id'];
$sql = "SELECT * FROM order1 WHERE userid = '$id' ORDER BY id DESC";
$res = mysqli_query($conn,$sql);
while($row= mysqli_fetch_assoc($res))
{
$proid = $row['productid'];
$date = $row['date'];
$subtotal = $row['subtotal'];
$sql2 = "SELECT * FROM product WHERE id = '$proid'";
$res2 = mysqli_query($conn,$sql2);
while($row2=mysqli_fetch_assoc($res2))
{
$image = $row2['image_name1'];
$title = $row2['title'];
$price = $row2['price'];
?>
<tr>
<td>
<div class="cart-info">
<a href="product-details.php?id=<?php echo $proid?>"><img src="<?php echo SITEURL; ?>images/product/<?php echo $image?>"></a>
<div class="">
<p><?php echo $title;?></p>
<small>Price: Rs.<?php echo $price;?></small>
</div>
</div>
</td>
<td><?php echo $date?></td>
<td>Rs.<?php echo $subtotal?></td>
</tr>
<?php
}
}
?>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<!----------Footer--------->
<?php include('partials-front/footer.php')?>
<!--js for menu toggle-->
<script>
var MenuItem = document.getElementById("MenuItem");
MenuItem.style.maxHeight="0px";
function menutoggle(){
if(MenuItem.style.maxHeight=="0px"){
MenuItem.style.maxHeight="200px";
}
else{
MenuItem.style.maxHeight="0px";
}
}
</script>
</body>
</html>