-
Notifications
You must be signed in to change notification settings - Fork 0
/
searchres.php
157 lines (140 loc) · 6 KB
/
searchres.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
<?php
session_start();
if (isset($_SESSION['username'])) {
$login = "<i class=\"fas fa-sign-out-alt\" ></i>";
$loglink = "logout.php";
$signup = "<i class=\"fa fa-user\"></i>";
$siglink = "Profile.php";
} else {
$login = "connexion";
$loglink = "login.php";
$signup = "inscription";
$siglink = "register.php";
}
?>
<!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" />
<link rel="stylesheet" href="./css/style.css" />
<link rel="stylesheet" href="./css/slide.css" />
<link rel="stylesheet" href="./css/profile.css" />
<link rel="stylesheet" href="./css/bootstrap.min.css" />
<link rel="stylesheet" href="./css/css2.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.8.2/css/all.css" />
<title>store</title>
</head>
<body>
<!--Nav Bar-->
<div class="navbar navbar-expand-md bg-dark navbar-dark sticky-top">
<div class="container">
<a href="index.php" class="logo"><span style="color: #f7941d">DARIRSETTAF </span>STORE</a>
<buttond class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#forcola">
<span class="navbar-toggler-icon"></span>
</buttond>
<div class="collapse navbar-collapse" id="forcola">
<ul class="navbar-nav ms-auto">
<li class="nav-item">
<a href="index.php" class="nav-link">Accueil</a>
</li>
<li class="nav-item">
<a href="store.php" class="nav-link" id="active">boutique</a>
</li>
<li class="nav-item">
<a href="FAQ.php" class="nav-link">FAQ</a>
</li>
<li class="nav-item">
<a href="contacter.php" class="nav-link">contactez-nous</a>
</li>
<li class="nav-item">
<a href="<?php echo $siglink; ?>" class="nav-link"><?php echo $signup; ?></a>
</li>
<li class="nav-item">
<a href="<?php echo $loglink; ?>" class="nav-link"><?php echo $login; ?></a>
</li>
<li class="nav-item">
<a href="cart.php" class="nav-link"><i class="fas fa-shopping-cart"></i><span>
<?php
if (isset($_SESSION['cart'])) {
$count = count($_SESSION['cart']);
echo "<span id=\"cart_count\" class=\"text-warning bg-light\">$count</span>";
} else {
echo "<span id=\"cart_count\" class=\"text-warning bg-light\">0</span>";
} ?>
</a></span>
</li>
</ul>
</div>
</div>
</div>
<!--End Nav Bar-->
<!-- inner page section -->
<section class="inner_page_head">
<div class="container_fuild">
<div class="row">
<div class="col-md-12">
<div class="full">
<h3>le resultat de votre recherche</h3>
</div>
</div>
</div>
</div>
</section>
<!-- product section -->
<section class="product_section layout_padding">
<div class="container">
<div class="row">
<?php
include('config.php');
@$searchkey = $_POST['search'];
$darir = "SELECT * FROM produit WHERE Pname LIKE '%$searchkey%'";
$record = mysqli_query($conn, $darir);
while ($row = mysqli_fetch_array($record)) {
$check_page = $row['Pcategorie'];
$you = 19;
echo '
<div class="col-sm-6 col-md-4 col-lg-4">
<div class="box">
<div class="option_container">
<div class="options">
<form action="sproduct.php" method="POST">
<input type="hidden" value ="' . $row['Id'] . '" name="Pid">
<input type="hidden" value ="' . $row['Pname'] . '" name="Pname">
<input type="hidden" value ="' . $row['Pprice'] . '" name="Pprice">
<input type="hidden" value ="' . $row['Pdescription'] . '" name="Pdescription">
<button id="option1" class="btn btn-dark my-3 " type="submit" name="acheter">Détail <i class="fas fa-info"></i></button>
</form>
<form action="addCart.php" method="POST">
<button id="option1"class="btn btn-warning my-3"type="submit" name="PaddCart">Carte<i class="fas fa-shopping-cart"></i></button>
<input type="hidden" value ="' . $row['Pname'] . '" name="Pname">
<input type="hidden" value ="' . $row['Pprice'] . '" name="Pprice">
<input type="hidden" value ="' . $row['Id'] . '" name="Id">
</div>
</div>
<div class="img-box">
<img src="./admin/' . $row['Pimage'] . '" />
</div>
<div class="detail-box">
<h5>' . $row['Pname'] . '</h5>
<h5>
<small><s class="text-secondary">$' . ($row['Pprice'] + $you) . '</s></small>
<span> <h6>$' . $row['Pprice'] . '</h6></span> </h5>
</div>
</div>
</form>
</div>
';
}
echo '<div class="text-center alert alert-danger"><h1>le produit n\'existe pas</h1</div>';
?>
</div>
</div>
</section>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<!-- end product section -->
<?php include('./footer.php'); ?>
<script src="./js/bootstrap.bundle.min.js"></script>
</body>
</html>