This repository has been archived by the owner on Oct 9, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
153 lines (139 loc) · 6.05 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
<?php
$activepage='home';
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>GadgetsGarage :: Home</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<!-- Latest compiled JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<!--Design-->
<link rel="stylesheet" href="style/style.css" type="text/css">
<script>
$(function () {
$("#search").keyup(function () {
$s = $(this).val();
if($s == ''){
$("#result").html('');
$("#result").css("background-color", "#E6E6E6");
}
else {
$.ajax({
url: 'searchAction.php',
data: {q: $s},
success: function (r) {
$("#result").css("background-color", "white");
$("#result").html(r);
}
});
}
});
$("#search").keyup(function () {
$s = $(this).val();
if($s == '')
$("#resultTwo").html('');
else {
$.ajax({
url: 'searchActionTwo.php',
data: {q: $s},
success: function (r) {
$("#resultTwo").html(r);
}
});
}
});
});
</script>
</head>
<body>
<?php include_once 'includers/header.php';?>
<div class="container-fluid">
<div class="row">
<div id="myCarousel" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
<li data-target="#myCarousel" data-slide-to="1"></li>
<li data-target="#myCarousel" data-slide-to="2"></li>
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner">
<div class="item active">
<!--Image Size 1200px*400px-->
<img src="https://wpblink.com/sites/default/files/wallpaper/sports/73637/david-silva-wallpapers-hd-73637-4298222.png" alt="Chania" style="width: 100%">
<div class="carousel-caption">
<h3>First Image</h3>
<p>Description Here</p>
</div>
</div>
<div class="item">
<!--Image Size 1200px*400px-->
<img src="https://wpblink.com/sites/default/files/wallpaper/sports/73637/david-silva-wallpapers-hd-73637-4298222.png" alt="Chicago" style="width: 100%">
<div class="carousel-caption">
<h3>Second Image</h3>
<p>Description Here</p>
</div>
</div>
<div class="item">
<!--Image Size 1200px*400px-->
<img src="https://wpblink.com/sites/default/files/wallpaper/sports/73637/david-silva-wallpapers-hd-73637-4298222.png" alt="New York" style="width: 100%">
<div class="carousel-caption">
<h3>Third Image</h3>
<p>Description Here</p>
</div>
</div>
</div>
<!-- Left and right controls -->
<a class="left carousel-control" href="#myCarousel" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#myCarousel" data-slide="next">
<span class="glyphicon glyphicon-chevron-right"></span>
<span class="sr-only">Next</span>
</a>
</div>
</div>
<div class="row product-list">
<div class="col-sm-12" id="resultTwo">
</div>
<div class="col-sm-12">
<h3 style="border-bottom: 1px solid #ddd; padding-bottom: 5px;">Latest Product</h3>
</div>
<?php require_once 'config.php';
$query = "SELECT * FROM `products` order by productID DESC LIMIT 20";
$result = mysqli_query($link, $query);
if(!$result)
echo mysqli_error($link);
else{
while ($row = mysqli_fetch_array($result)){
echo "<div class='col-sm-2 product'>
<div class='product-details'>
<div class='img-thumbnail'>
<a href='admin/" . $row['productImage'] . "'><img src='admin/" . $row['productImage'] . "'alt='' width='100%'></a>
</div>
<div class='product-name'>
<a href='#' title='" . $row['productName'] . "'><h4>" . $row['productName'] . "</h4></a>
</div>
<div class='product-price'>
<p>" . $row['productPrice'] . "$</p>
</div>
<div class='product-add-to-cart'>
<a href='#' onclick=''><span class='glyphicon glyphicon-shopping-cart'></span> Add To Cart</a>
</div>
</div>
</div>";
}
}
?>
</div>
</div>
<?php include_once 'includers/footer.php';?>
</body>
</html>