-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathorderComplete.php
51 lines (48 loc) · 1 KB
/
orderComplete.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
<?php
session_start();
include('header.php');
?>
<html>
<body>
<?php
include('siteNavigator.php');
?>
<!-- Page info goes below-->
<!--orderComplete.php
need to further include:
viewing older orders
-->
<h1>Order Form History</h1>
<h2>View your transaction history</h2>
<table>
<tr>
<th>Date</th>
<th>Total Cost</th>
<th>Download</th>
</tr>
<?php
include "DB.php";
$userID = $_SESSION['familyID'];
$recentOrderQuery = "SELECT * FROM swimteam.order WHERE familyID = '$userID' AND totalPaid > 0 ORDER BY orderID DESC;";
$result = mysqli_query($db,$recentOrderQuery);
$name = $_SESSION['userLastName'];
while ($row = mysqli_fetch_array($result)){
$orderID = $row['orderID'];
$datePlaced = $row['datePlaced'];
$total = $row['totalPaid'];
echo "<tr>
<td>$datePlaced</td>
<td>$total</td>
<td>
<a href ='download.php?download_file=$name$orderID.csv'>$name$orderID.csv</a>
</td>
</tr>";
}
?>
</table>
<!-- Page info goes above-->
<?php
include('footer.php');
?>
</body>
</html>