-
Notifications
You must be signed in to change notification settings - Fork 0
/
history.php
47 lines (47 loc) · 1.35 KB
/
history.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 require_once("db_connection.php"); ?>
<?php require_once("session.php"); ?>
<?php require_once("functions.php"); ?>
<?php include("./layouts/header.php"); ?>
<?php
if (!isset($_SESSION['id'])) { // if logged in , can't register (add flash message)
redirect_to("index.php");
}
?>
<!DOCTYPE html>
<html>
<head>
<!-- <link rel="stylesheet" href="stylesheets/index.css"> -->
<title> eShop | Purchase History </title>
</head>
<body>
<table id="history">
<tr>
<th id="login-p" style="font-weight: bold">Product Name</th>
<th id="login-p" style="font-weight: bold">Product Price</th>
<th id="login-p" style="font-weight: bold">Product Quantity</th>
<th id="login-p" style="font-weight: bold">Purchase Time</th>
</tr>
<?php
$results = show_history($_SESSION['id']);
while($record = mysqli_fetch_row($results))
{
echo "<tr>";
echo "<td id='purchase'>";
echo "<p id=\"login-p\">".$record[2]."</p>";
echo "</td>";
echo "<td id='purchase'>";
echo "<p id=\"login-p\">".$record[3]."</p>";
echo "</td>";
echo "<td id='purchase'>";
echo "<p id=\"login-p\">".$record[4]."</p>";
echo "</td>";
echo "<td id='purchase'>";
echo "<p id=\"login-p\">".$record[5]."</p>";
echo "</td>";
echo "</tr>";
}
?>
</table>
<?php include("./layouts/footer.php"); ?>
</body>
</html>