-
Notifications
You must be signed in to change notification settings - Fork 0
/
browseCards.php
41 lines (32 loc) · 967 Bytes
/
browseCards.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
<?php
session_start();
include('header.php');
?>
<html>
<body>
<?php
include('siteNavigator.php');
?>
<!-- Page info goes below-->
<h1>View Gift Cards</h1>
<h2>Below is a list of all the gift cards currently available for purchase</h2>
<?php
// change password, browse giftcards, update account information, place an order
$query = "SELECT * FROM giftCards ORDER BY vendor";
$result = mysqli_query($db, $query);
echo "<table>\n<tr><th><h3 style=\"text-align:left\">Card Name</h3></th><th><h3 style=\"text-align:left\">Cost</h3></th><th><h3 style=\"text-align:left\">Percent Awarded</h3></th></tr>\n\n";
while($row = mysqli_fetch_array($result))
{
$name = $row['vendor'];
$cost = $row['cost'];
$percent = $row['percent'];
echo "<tr><td width = 1000>$name</td><td width = 1000>\$$cost</td><td width = 800>$percent%</td><td width = 500></tr>\n";
}
echo "</table>\n";
?>
</div> <!-- Page info goes above-->
<?php
include('footer.php');
?>
</body>
</html>