-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.php
126 lines (118 loc) · 5.2 KB
/
index.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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<?php include 'config.php'; //include config
// set dynamic title
$db = new Database();
$db->select('options','site_title',null,null,null,null);
$result = $db->getResult();
if(!empty($result)){
$title = $result[0]['site_title'];
}else{
$title = "Online Shopping";
}
?>
<!DOCTYPE html>
<html>
<head>
<link rel="shortcut icon" href="images/e-commercelogo.jpg">
</head>
<body>
</body>
</html>
<?php
// include header
include 'header.php'; ?>
<div id="banner">
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<div class="banner-content">
<video autoplay muted loop id="myVideo" width="100%" height="auto">
<source src="images/video-ecom.mp4" type="video/mp4">
Your browser does not support HTML5 video.
</video>
</div>
</div>
</div>
</div>
<div class="product-section popular-products">
<div class="container">
<div class="row">
<div class="col-md-12">
<h2 class="section-head">Popular Products</h2>
<div class="popular-carousel owl-carousel owl-theme">
<?php
$db->select('products','*',null,'product_views > 0','product_views DESC',10);
$result = $db->getResult();
if(count($result) > 0){
foreach($result as $row){ ?>
<div class="product-grid latest item">
<div class="product-image popular">
<a class="image" href="single_product.php?pid=<?php echo $row['product_id']; ?>">
<img class="pic-1" src="product-images/<?php echo $row['featured_image']; ?>">
</a>
<div class="product-button-group">
<a href="single_product.php?pid=<?php echo $row['product_id']; ?>" ><i class="fa fa-eye"></i></a>
<a href="" class="add-to-cart" data-id="<?php echo $row['product_id']; ?>"><i class="fa fa-shopping-cart"></i></a>
<a href="" class="add-to-wishlist" data-id="<?php echo $row['product_id']; ?>"><i class="fa fa-heart"></i></a>
</div>
</div>
<div class="product-content">
<h3 class="title">
<a href="single_product.php?pid=<?php echo $row['product_id']; ?>"><?php echo substr($row['product_title'],0,25),'...'; ?></a>
</h3>
<div class="price"><?php echo $cur_format; ?> <?php echo $row['product_price']; ?></div>
</div>
</div>
<?php }
}else{
} ?>
</div>
</div>
</div>
</div>
</div>
<div class="product-section">
<div class="container">
<div class="row">
<div class="col-md-12">
<h2 class="section-head">Latest Products</h2>
<div class="latest-carousel owl-carousel owl-theme">
<?php
$db = new Database();
$db->select('products','*',null,null,'product_id DESC',6);
$result = $db->getResult();
if(count($result) > 0){
foreach($result as $row){ ?>
<div class="product-grid latest item">
<div class="product-image popular">
<a class="image" href="single_product.php?pid=<?php echo $row['product_id']; ?>">
<img class="pic-1" src="product-images/<?php echo $row['featured_image']; ?>">
</a>
<div class="product-button-group">
<a href="single_product.php?pid=<?php echo $row['product_id']; ?>" ><i class="fa fa-eye"></i></a>
<a href="" class="add-to-cart" data-id="<?php echo $row['product_id']; ?>"><i class="fa fa-shopping-cart"></i></a>
<a href="" class="add-to-wishlist" data-id="<?php echo $row['product_id']; ?>"><i class="fa fa-heart"></i></a>
</div>
</div>
<div class="product-content">
<h3 class="title">
<a href="single_product.php?pid=<?php echo $row['product_id']; ?>"><?php echo substr($row['product_title'],0,25),'...'; ?></a>
</h3>
<div class="price"><?php echo $cur_format; ?> <?php echo $row['product_price']; ?></div>
</div>
</div>
<?php }
}?>
</div>
</div>
</div>
</div>
</div>
<style>
#banner .banner-content{
/*margin: 0 -15px;*/
margin-bottom: 0;
height: auto;
overflow: hidden;
}
</style>
<?php include 'footer.php'; ?>