-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
204 lines (163 loc) · 6.47 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
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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Home | K-Tech</title>
<link rel="icon" href="images/icon.png">
<link rel="stylesheet" href="Style.css">
</head>
<body>
<!--Header-->
<div class="header">
<div class="container">
<?php include('partials-front/navbar.php')?>
<?php include('partials-front/serachbar.php')?>
<div class="row">
<div class="col-2">
<h1>The Largest Laptop Store in<br>Sri Lanka!</h1>
<p>Success isn't always about greatness. It's about consistent<br>
hard work gains success. Greatness will come.</p>
<a href="product.php" class="btn">All Product
➜</a>
</div>
<div class="col-2">
<!-- Slideshow container -->
<div class="slideshow-container">
<!-- Full-width images with number and caption text -->
<div class="mySlides fade">
<img src="images/1.png" style="width:100%">
</div>
<div class="mySlides fade">
<img src="images/4.png" style="width:100%">
</div>
</div>
</div>
</div>
</div>
</div>
<!--featured categories-->
<div class="categories">
<div class="small-container">
<div class="row">
<?php
$sql = "SELECT * FROM brand WHERE featured = 'Yes' AND active = 'Yes' LIMIT 5";
$res = mysqli_query($conn,$sql);
$count = mysqli_num_rows($res);
if($count>0)
{
while($row=mysqli_fetch_assoc($res))
{
$id = $row['id'];
$image_name = $row['image_name'];
$title = $row['title'];
?>
<div class="col-3"><a href="brand.php?id=<?php echo $id?>&brand=<?php echo $title?>"><img src="<?php echo SITEURL; ?>images/brand/<?php echo $image_name?>" ><h4><?php echo $title?></h4></a></div>
<?php
}
}
else
{
echo "<div class='col-3'><h1>NO Brand Added</h1></div>";
}
?>
</div>
</div>
<!--featured Product-->
<div class="small-container"><br>
<h2 class="title" >Featured Product</h2>
<div class="row">
<?php
$sql = "SELECT * FROM product WHERE featured = 'Yes' AND active = 'Yes'";
$res = mysqli_query($conn,$sql);
$count = mysqli_num_rows($res);
if($count>0)
{
while($row=mysqli_fetch_assoc($res))
{
$id = $row['id'];
$image_name = $row['image_name1'];
$title = $row['title'];
$price =$row['price'];
$stock = $row['stock'];
?>
<div class="col-4">
<h4><?php echo $title?></h4>
<?php
if($stock==0)
{
?>
<a href="product-details.php?id=<?php echo $id?>"><img class="stock" src="images/Stock.png" alt=""></a>
<?php
}
else
{
?>
<img class="stock2" src="images/Stock2.png" alt="">
<?php
}
?>
<a href="product-details.php?id=<?php echo $id?>"><img src="<?php echo SITEURL; ?>images/product/<?php echo $image_name?>"></a>
<h2>Rs.<?php echo $price?></h2>
</div>
<?php
}
}
else
{
echo "<div class='col-3'><h1>NO Product Added</h1></div>";
}
?>
</div>
</div>
</div>
<!------Offer----->
<div class="offer">
<div class="small-container">
<div class="row">
<div class="col-2"><img src="images/offer-Lenovo-IdeaPad-Slim-3.png" alt=""></div>
<div class="col-2"><h1>Lenovo IdeaPad Slim 3 – 15ITL6</h1> <br> <small>– Intel Core i5 1135G7 Processor<br>– 8GB DDR4 RAM
<br>– 512GB M.2 NVMe SSD
<br>– 15.6″ FHD, (1920×1080), IPS Display
<br>– 2GB NVIDIA GeForce MX350 Graphics
<br>– Integrated 45Wh Battery
<br>– Windows 10 Home</small>
<br><a href="" class="btn">Buy Now</a>
</div>
</div>
</div>
</div>
<!----------Footer--------->
<?php include('partials-front/footer.php')?>
<!--js for menu toggle-->
<script>
var MenuItem = document.getElementById("MenuItem");
MenuItem.style.maxHeight="0px";
function menutoggle(){
if(MenuItem.style.maxHeight=="0px"){
MenuItem.style.maxHeight="200px";
}
else{
MenuItem.style.maxHeight="0px";
}
}
</script>
<!--Js for slideshow-->
<script>
let slideIndex = 0;
showSlides();
function showSlides() {
let i;
let slides = document.getElementsByClassName("mySlides");
for (i = 0; i < slides.length; i++) {
slides[i].style.display = "none";
}
slideIndex++;
if (slideIndex > slides.length) {slideIndex = 1}
slides[slideIndex-1].style.display = "block";
setTimeout(showSlides, 5000); // Change image every 2 seconds
}
</script>
</body>
</html>