forked from phongdong/match-all
-
Notifications
You must be signed in to change notification settings - Fork 0
/
outproduct.php
95 lines (69 loc) · 3.13 KB
/
outproduct.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
<?php require_once('config.php'); ?>
<!DOCTYPE html>
<html lang="en">
<head>
</head>
<body>
<!-- include header navigation -->
<?php $current_page = "outproduct.php"; ?>
<?php include 'out_inc.php'; ?>
<!-- Page Content -->
<div class="container">
<div class="row">
<div class="col-md-10">
<h3>Auto Car</h3>
<div class="row" class='table-responsive'">
<?php
try
{
$conn = getConnectionPDO();
$query = " select * from Product order by id ";
$params = null;
$ps = $conn->prepare($query);
$ps->execute($params);
$data = $ps->fetchAll(PDO::FETCH_ASSOC);
foreach ($data as $row) {
print " <div class='col-sm-4 col-lg-4 col-md-4'> \n";
print " <div class='thumbnail'> \n";
print " <img src='photo\\" . $row["image"] . "' alt='' style='width:256px;height:200px;'> \n";
print " <div class='caption'> \n";
print " <h5><a href='detail.php?id=" . $row["id"] ."'>" . $row["title"] . "</a></h5> \n";
print " <h5>$ " . $row["price"] . "</h5> \n";
print " <h5>" . $row["location"] . "</h5> \n";
print " <div class='ratings'> \n";
print " <p class='pull-right'>" . getCountRatingById($row["id"]) ." reviews</p>";
print "<p>";
drawStars(getAvgRatingById($row["id"]));
print " " . getAvgRatingById($row["id"]) . " stars";
print "</p>";
print " </div> \n";
print " </div> \n";
print " </div> \n";
print " </div> \n";
}
}
catch (PDOException $ex)
{
echo 'ERROR: ' . $ex->getMessage();
}
catch (Exception $ex)
{
echo 'ERROR: ' . $ex->getMessage();
}
?>
</div>
</div>
</div>
</div>
<!-- /.container -->
<div class="container">
<!-- Footer -->
<?php include 'footer.inc.php';?>
</div>
<!-- /.container -->
<!-- jQuery -->
<script src="js/jquery.js"></script>
<!-- Bootstrap Core JavaScript -->
<script src="js/bootstrap.min.js"></script>
</body>
</html>