-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhome.php
More file actions
72 lines (63 loc) · 1.89 KB
/
Copy pathhome.php
File metadata and controls
72 lines (63 loc) · 1.89 KB
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
<?php
// Title: home.php
// Desc: Main display for logged in users.
// Date: March 22, 2014
// Version: 1.0
// Author: John Meanor
require_once("inc/header.php");
checkPermissions();
?>
<div class="container">
<div class="jumbotron hero-spacer">
<h1>Welcome to eAuction!</h1>
<p>We're the most user-friendly auction website there is since 2014. Search for what you want to buy above, <a href="shop/results.php">shop by category</a>, or check out the featured items below. </p>
</div>
<hr>
<div class="row">
<div class="col-lg-12">
<h3>Featured auctions</h3>
</div>
</div>
<!-- /.row -->
<div class="row text-center">
<?php
$query = "SELECT item_id, name, description
FROM items
ORDER BY start_time DESC
LIMIT 4";
try
{
// Execute the query against the database
$stmt = $db->prepare($query);
$result = $stmt->execute();
}
catch(PDOException $ex)
{
die($ex);
}
$data = $stmt->fetchAll();
foreach($data as $row)
{
$pics = getPics($row['item_id'], $db);
?>
<div class="col-lg-3 col-md-6 hero-feature">
<div class="thumbnail">
<?php if($pics['success'] == true)
{
echo "<img src='" . $pics['picture_data'][0]['url'] . "' alt=''>\n";
}
?>
<div class="caption">
<h3><?php echo $row['name'] ?></h3>
<p><?php echo $row['description'] ?></p>
<p><a class="btn btn-default btn-xs" href="shop/item.php?id=<?php echo $row['item_id']?>" name="option1" role="button">View details »</a>
</p>
</div>
</div>
</div>
<?php
}
?>
</div>
<!-- /.row -->
<?php require_once("inc/footer.php"); ?>