-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
183 lines (170 loc) · 8.16 KB
/
index.php
File metadata and controls
183 lines (170 loc) · 8.16 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
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
<?php
include "includes/header.php";
include "includes/navbar.php";
// print_r(getMinMaxProductPriceById(10))
?>
<div class="container-fluid" style="background-color:rgba(236, 233, 233, 0.938);">
<?php if($getUserSetting['website_status']=="Close"){?>
<h5 class="text-center pt-2"><?php echo $getUserSetting['website_close_message'] ?></h5>
<?php } ?>
<div class="container pt-2" id="slider">
<!-- container Begin -->
<div class="col-md-12">
<!-- col-md-12 Begin -->
<div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel">
<ol class="carousel-indicators">
<?php
$get_carousel="select * from carousel limit 0,1";
$res=mysqli_query($conn,$get_carousel);
if(mysqli_num_rows($res)>0)
{
echo '<li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"></li>';
}
?>
<?php
$get_carousel="select * from carousel limit 1,4";
$res=mysqli_query($conn,$get_carousel);
if(mysqli_num_rows($res)>0)
{
for($i=1;$i<=mysqli_fetch_assoc($res);$i++)
{
echo '<li data-target="#carouselExampleIndicators" data-slide-to="'.$i.'"></li>';
}
}
?>
</ol>
<div class="carousel-inner">
<?php
$get_carousel="select * from carousel limit 0,1";
$res=mysqli_query($conn,$get_carousel);
if(mysqli_num_rows($res)>0)
{
$row=mysqli_fetch_assoc($res);
$car_img=$row['carousel_img'];
echo '<div class="carousel-item active">
<img src="img/slides_images/'.$car_img.'" height="500" class="d-block w-100" alt="...">
</div>';
}
?>
<?php
$get_carousel2="select * from carousel limit 1,5";
$res2=mysqli_query($conn,$get_carousel2);
while($row2=mysqli_fetch_assoc($res2))
{
$car_img=$row2['carousel_img'];
echo '<div class="carousel-item">
<img src="img/slides_images/'.$car_img.'" height="500" class="d-block w-100" alt="...">
</div>';
}
?>
</div>
<a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
</div><!-- col-md-12 Finish -->
</div><!-- container Finish -->
<!-- advantage field -->
<div class="advantage mt-3">
<div class="container my-5">
<div class="row">
<div class="col-md-4">
<div class="same-ht card">
<div class="card-body" style="text-align:center;">
<div class="icon">
<i class="fa fa-heart"></i>
</div>
<h3 style="text-transform:uppercase;"><a href="">best prices</a></h3>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Atque, perferendis.</p>
</div>
</div>
</div>
<div class="col-md-4">
<div class="same-ht card">
<div class="card-body" style="text-align:center;">
<div class="icon">
<i class="fa fa-heart"></i>
</div>
<h3 style="text-transform:uppercase;"><a href="">100% satisfaction guranted from us</a></h3>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit.</p>
</div>
</div>
</div>
<div class="col-md-4">
<div class="same-ht card">
<div class="card-body" style="text-align:center;">
<div class="icon">
<i class="fa fa-heart"></i>
</div>
<h3 style="text-transform:uppercase;"><a href="">we love out customers</a></h3>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Atque, perferendis.</p>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- lastest week box -->
<div class="col-md-12 card my-5">
<div class="card-body w-100 text-center h1 text-primary" style="text-transform:uppercase;font-weight:100;">
latest this week
</div>
</div>
<!-- products -->
<div class="container">
<div class="row">
<?php
$getUserSetting=getUserSetting();
$get_prod="select * from products order by product_id desc limit 0,4";
$res=mysqli_query($conn,$get_prod);
if(mysqli_num_rows($res)>0){
while($row=mysqli_fetch_assoc($res)){
$product_id=$row['product_id'];
$product_name=$row['product_name'];
$product_img=$row['product_img1'];
$product_price=$row['product_price'];
$product_keyword=$row['product_keyword'];
?>
<div class="col col-lg-3 col-md-4 col-sm-6 mb-4">
<div class="card shadow-sm">
<div class="card-img-top">
<a href="details.php?pro_id=<?php echo $product_id; ?>"><img src="<?php echo CUSTOMER_PRODUCT_IMG_PATH.$product_img; ?>" alt="" id="main_pro" class="responsive-img img-thumbnail" style="width:253px;height:290px;"></a>
</div>
<div class="card-body p-1 py-3" style="text-align:center;">
<a href="details.php?pro_id=<?php echo $product_id ?>" class="text-dark"><h5><?php echo substr($product_name,0,20)."...";?></h5></a>
<h5 style="color:blue;"><?php echo getMinMaxProductPriceById($product_id); ?></h5>
</div>
<div class="card-action pl-3 pb-2 ml-3">
<a href="details.php?pro_id=<?php echo $product_id;?>" class="btn btn-sm <?php if($getUserSetting['website_status']!='Open'){echo "w-75";} ?>"
style="border:1px solid black">view details</a>
<?php
$getUserSetting=getUserSetting();
if($getUserSetting['website_status']=="Open"){?>
<a href="" class="btn btn-sm"
style="background-color:rgb(17, 235, 206);color:white;border:1px solid rgb(14, 207, 182)"><i class="fa fa-shopping-cart mr-2"></i>Add to cart</a>
<?php } ?>
</div>
</div>
</div>
<?php
}
}else{ ?>
<div class="col-md-12 mb-3">
<div class="card">
<div class="card-body h4 text-center">
No any Products In the Database.
</div>
</div>
</div>
<?php } ?>
</div>
</div>
</div>
<?php
include "includes/footer.php";
?>