-
Notifications
You must be signed in to change notification settings - Fork 0
/
arama-detay.php
234 lines (151 loc) · 10.9 KB
/
arama-detay.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
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
<?php
require_once 'header.php';
?>
<?php require_once 'search.php' ?>
<div class="pagination-area bg-secondary">
<div class="container">
<div class="pagination-wrapper">
</div>
</div>
</div>
<!-- Inner Page Banner Area End Here -->
<!-- Product Page Grid Start Here -->
<div class="product-page-list bg-secondary section-space-bottom">
<div class="container">
<div class="row">
<div class="col-lg-9 col-md-8 col-sm-8 col-xs-12 col-lg-push-3 col-md-push-4 col-sm-push-4">
<div class="inner-page-main-body">
<div class="page-controls">
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-8">
<div class="page-controls-sorting">
<div class="dropdown">
<!--<button class="btn sorting-btn dropdown-toggle" type="button" data-toggle="dropdown">Default Sorting<i class="fa fa-sort" aria-hidden="true"></i></button>-->
<ul class="dropdown-menu">
<li><a href="#">Date</a></li>
<li><a href="#">Best Sale</a></li>
<li><a href="#">Rating</a></li>
</ul>
</div>
</div>
</div>
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-4">
<div class="layout-switcher">
<ul>
<!--<li><a href="#gried-view" data-toggle="tab" aria-expanded="false"><i class="fa fa-th-large"></i></a></li>-->
<li class="active"><a href="#list-view" data-toggle="tab" aria-expanded="true"><i class="fa fa-list"></i></a></li>
</ul>
</div>
</div>
</div>
</div>
<div class="tab-content">
<div role="tabpanel" class="tab-pane fade in active clear products-container" id="list-view">
<div class="product-list-view">
<?php
if (isset($_POST['searchsayfa'])) {
$searchkeyword=$_POST['searchkeyword'];
$sayfada = 5; // sayfada gösterilecek içerik miktarını belirtiyoruz.
$sorgu=$db->prepare("select * from urun where urun_ad LIKE ?");
$sorgu->execute(array(
"%$searchkeyword%"
));
$toplam_icerik=$sorgu->rowCount();
$toplam_sayfa = ceil($toplam_icerik / $sayfada);
// eğer sayfa girilmemişse 1 varsayalım.
$sayfa = isset($_GET['sayfa']) ? (int) $_GET['sayfa'] : 1;
// eğer 1'den küçük bir sayfa sayısı girildiyse 1 yapalım.
if($sayfa < 1) $sayfa = 1;
// toplam sayfa sayımızdan fazla yazılırsa en son sayfayı varsayalım.
if($sayfa > $toplam_sayfa) $sayfa = $toplam_sayfa;
$limit = ($sayfa - 1) * $sayfada;
//tüm tablo sütunlarının çekilmesi
$urunsor=$db->prepare("SELECT urun.*,kategori.*,kullanici.* FROM urun INNER JOIN kategori ON urun.kategori_id=kategori.kategori_id INNER JOIN kullanici ON urun.kullanici_id=kullanici.kullanici_id WHERE urun_durum=:urun_durum and urun.urun_ad LIKE '%$searchkeyword%' order by urun_zaman DESC limit $limit,$sayfada ");
$urunsor->execute(array(
'urun_durum' => 1
));
$say=$sorgu->rowCount();
if ($say==0) {
echo "Ürün Bulunamadı";
}
}
while($uruncek=$urunsor->fetch(PDO::FETCH_ASSOC)) {
?>
<div class="single-item-list">
<div class="item-img">
<img style="width: 238px; height: 178px;" src="<?php echo $uruncek['urunfoto_resimyol'] ?>" alt="<?php echo $uruncek['urun_ad'] ?>" class="img-responsive">
<!-- <div class="trending-sign" data-tips="Trending"><i class="fa fa-bolt" aria-hidden="true"></i></div>-->
</div>
<div class="item-content">
<div class="item-info">
<div class="item-title">
<h3><a href="urun-<?=seo($uruncek['urun_ad'])."-".$uruncek['urun_id'] ?>"><?php echo $uruncek['urun_ad'] ?></a></h3>
<span><?php echo $uruncek['kategori_ad'] ?></span>
</div>
<div class="item-sale-info">
<div class="price"><?php echo $uruncek['urun_fiyat'] ?> <span style="font-size:12px;">TL</span></div>
<div class="sale-qty">Satış ( 0 )</div>
</div>
</div>
<div class="item-profile">
<div class="profile-title">
<div class="img-wrapper"><img src="img\profile\1.jpg" alt="profile" class="img-responsive img-circle"></div>
<span><?php echo $uruncek['kullanici_ad']." ".substr($uruncek['kullanici_soyad'],0,1) ?>.</span>
</div>
<div class="profile-rating-info">
<ul>
<li>
<ul class="profile-rating">
<li><i class="fa fa-star" aria-hidden="true"></i></li>
<li><i class="fa fa-star" aria-hidden="true"></i></li>
<li><i class="fa fa-star" aria-hidden="true"></i></li>
<li><i class="fa fa-star" aria-hidden="true"></i></li>
<li><i class="fa fa-star" aria-hidden="true"></i></li>
<li>(<span> 05</span> )</li>
</ul>
</li>
<li><i class="fa fa-comment-o" aria-hidden="true"></i>( 10 )</li>
</ul>
</div>
</div>
</div>
</div>
<?php } ?>
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<ul class="pagination-align-left">
<?php
$s=0;
while ($s < $toplam_sayfa) {
$s++; ?>
<?php
if (!empty($_GET['kategori_id'])) {
if ($s==$sayfa) {?>
<li class="active"><a href="kategoriler-<?php echo $_GET['sef']; ?>-<?php echo $_GET['kategori_id'] ?>?sayfa=<?php echo $s; ?>"><?php echo $s; ?></a></li>
<?php } else {?>
<li><a href="kategoriler-<?php echo $_GET['sef']; ?>-<?php echo $_GET['kategori_id'] ?>?sayfa=<?php echo $s; ?>"><?php echo $s; ?></a></li>
<?php }
} else {
if ($s==$sayfa) {?>
<li><a style="background-color: #C84C3C; color:white;" href="kategoriler?sayfa=<?php echo $s; ?>"><?php echo $s; ?></a></li>
<?php } else {?>
<li><a href="kategoriler?sayfa=<?php echo $s; ?>"><?php echo $s; ?></a></li>
<?php }
}
}
?>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php require_once 'sidebar.php' ?>
</div>
</div>
</div>
<?php
require_once 'footer.php';
?>