-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsearch.php
285 lines (255 loc) · 16.4 KB
/
search.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
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
<?php include("header.php");
/************************** pages no ***********************/
$per_page_record = 12;
if (isset($_GET["page"])) { $page = $_GET["page"]; } else { $page=1; }
$start_from = ($page-1) * $per_page_record;
/*****************************page end *****************************/
// $sql="SELECT * FROM `NFT_info` ORDER BY id DESC limit ".$start_from.",". $per_page_record;
$sql="SELECT * FROM `NFT_info` where (NFT_name like'%".$_GET['data']."%' || NFT_price like '%".$_GET['data']."%' || NFT_payment like '%".$_GET['data']."%' || NFT_paymentcurrency like '%".$_GET['data']."%' || NFT_owner_address like '%".$_GET['data']."%' || NFT_discription like '%".$_GET['data']."%' || NFT_id like '%".$_GET['data']."%' || NFT_collection like '%".$_GET['data']."%' ) ORDER BY id limit ".$start_from.",". $per_page_record;
$data=mysqli_query($link,$sql);
$sqluser="SELECT * FROM `nft_user` where (Username like'%".$_GET['data']."%') ORDER BY Id limit ".$start_from.",". $per_page_record;
$datauser=mysqli_query($link,$sqluser);
$sqlcollection="SELECT * FROM `nft_collections` where (collection_name like'%".$_GET['data']."%' || collection_symbol like'%".$_GET['data']."%') ORDER BY id limit ".$start_from.",". $per_page_record;
$datacollection=mysqli_query($link,$sqlcollection);
?>
<section class="py-5">
<div class="container">
<div class="row py-5">
<div class="col-md-12">
<div class="text-center">
<h1 class="section-title">Searched NFT</h1>
</div>
</div>
</div>
<div class="row">
<?php while($hotBids_row=mysqli_fetch_assoc($data)){
?>
<div class="col-lg-3 col-md-6 mb-5">
<div class="inner_explore">
<div class="d-flex align-items-center justify-content-between">
<div class="tp_pht">
<?php
$dataOwner=mysqli_query($link,"SELECT * FROM `nft_user` WHERE Useraddress= '".$hotBids_row['NFT_owner_address']."'");
$rowOwner=mysqli_fetch_assoc($dataOwner);
?>
<a href="./profile.php?address=<?php echo $hotBids_row['NFT_owner_address'] ?>&v=<?php echo rand();?>" data-toggle="tooltip" data-placement="top" title="Owner:<?php echo $rowOwner['Username'] ?>" tabindex="-1">
<img src="<?php echo $rowOwner['Userimage'] ?>" class="ico" />
</a>
<?php
$dataOwner=mysqli_query($link,"SELECT * FROM `nft_user` WHERE Useraddress= '".$hotBids_row['NFT_creator_add']."'");
$rowOwner=mysqli_fetch_assoc($dataOwner);
?>
<a href="./profile.php?address=<?php echo $hotBids_row['NFT_creator_add'] ?>&v=<?php echo rand();?>" data-toggle="tooltip" data-placement="top" title="Creator:<?php echo $rowOwner['Username'] ?>" tabindex="-1">
<img src="<?php echo $rowOwner['Userimage'] ?>" class="ico01" />
</a>
<?php
$dataOwner = mysqli_query($link, "SELECT * FROM `nft_collections` WHERE collection_name= '" . $hotBids_row['NFT_collection'] . "'");
$rowOwner = mysqli_fetch_assoc($dataOwner);
?>
<a href="./collection.php?name=<?php echo $hotBids_row['NFT_collection'] ?>&v=<?php echo rand(); ?>" data-toggle="tooltip" data-placement="top" title="Collection:<?php echo $rowOwner['collection_name'] ?>" tabindex="-1">
<img src="<?php echo $rowOwner['collection_logo'] ?>" class="ico02" />
</a>
</div>
<?php
if($hotBids_row['last_price']>0 && $hotBids_row['NFT_resell'] == "on"){
?>
<div class="last__prices">
<p class="m-0 hig_bg" style="color: var(--text-pink)">Last Price</p>
<h6><?php echo $hotBids_row['last_price']; ?> <?php echo $hotBids_row['last_buy_currency']; ?></h6>
</div>
<?php } ?>
</div>
<?php
if($hotBids_row['NFT_auction']==0){
?>
<a href="./buy-description.php?id=<?php echo $hotBids_row['NFT_id']; ?>&v=<?php echo rand();?>" class="text-decoration-none" tabindex="0">
<?php }else{?>
<a href="./bid-description.php?id=<?php echo $hotBids_row['NFT_id']; ?>&v=<?php echo rand();?>" class="text-decoration-none" tabindex="0">
<?php }?>
<img src="<?php echo $hotBids_row['NFT_image']; ?>" class="mai_pht rounded w-100">
</a>
<div class="user_name_hakf mt-1">
<div class="d-flex mb-1 align-items-center justify-content-between">
<div class="hajaj_user text-left">
<div class="d-flex align-items-center justify-content-between">
<div>
<h6 class="iwMhCq"><?php echo $hotBids_row['NFT_name']; ?></h6>
<p><?php echo $hotBids_row['NFT_collection']; ?></p>
</div>
<!--<div class="nft-card-assets">-->
<!-- <span class="limits"> <?php echo $hotBids_row['start_id']-$hotBids_row['NFT_id']+1; ?>/<?php echo $hotBids_row['end_id']-$hotBids_row['NFT_id']+1; ?> </span>-->
<!--</div>-->
</div>
<?php
if($hotBids_row['NFT_auction']>0)
{
?>
<small class="hig_bg">Highest Bid: <?php echo $hotBids_row['NFT_highest_bid']; ?> <?php echo $hotBids_row['NFT_payment']; ?></small>
<?php }
else{ ?>
<small class="hig_bg">Price: <?php echo $hotBids_row['NFT_price']; ?> <?php echo $hotBids_row['NFT_payment']; ?></small>
<?php }?>
</div>
</div>
<div class="trx_price_heart d-flex align-items-center justify-content-between">
<?php
if($hotBids_row['Type']==1||$hotBids_row['Type']==2||$hotBids_row['Type']==3)
{
?>
<a href="./bid-description.php?id=<?php echo $hotBids_row['NFT_id']; ?>&v=<?php echo rand();?>" class="by_nw" tabindex="0">
Bid Now
</a>
<?php }
else{ ?>
<a href="./buy-description.php?id=<?php echo $hotBids_row['NFT_id']; ?>&v=<?php echo rand();?>" class="by_nw" tabindex="0">
Buy Now
</a>
<?php }?>
<!--<div class="like_save">-->
<!-- <span class="heart_class">-->
<!-- <i class="fal fa-heart heart-black" aria-hidden="true"></i> -->
<!-- </span>-->
<!-- <span id="like3625775082284">2 </span>-->
<!--</div>-->
</div>
</div>
</div>
</div>
<?php }?>
</div>
</div>
</section>
<hr>
<!-- Top seller Page Start -->
<section class="top-seller-area black-bg py-5 ">
<div class="container">
<div class="row">
<div class="text-center" data-wow-duration="2000ms" data-wow-delay="100ms">
<h1 class="section-title">Top Collection </span></h1>
</div>
</div>
<div class="row pt-5 wow animated fadeInUp animated" data-wow-duration="2000ms" data-wow-delay="400ms">
<?php
$i=1;
while($resss= mysqli_fetch_assoc($datacollection)){
?>
<div class="col-xl-3 col-md-6 col-sm-6">
<a href="./collection.php?collection=<?php echo $resss['collection_name']; ?>&v=<?php echo rand();?>" class="single-top-seller">
<div class="single-top-seller-border d-flex align-items-center">
<div class="seller-rank-wrapper">
<span class="seller-rank-number"><?php echo $i;?></span>
</div>
<div class="seller-author-img">
<img src="<?php echo $resss['collection_logo'] ;?>" alt="">
<span class="seller-author-badge"><i class="fas fa-check"></i></span>
</div>
<div class="seller-author-info">
<span class="seller-autor-name"><?php echo $resss['collection_name'];?></span>
<!--<span class="seller-author-sell-amount">$2500,000</span>-->
</div>
</div>
</a>
</div>
<?php $i++;}?>
</div>
</div>
</section>
<hr>
<!-- Top seller Page Start -->
<section class="top-seller-area black-bg py-5 ">
<div class="container">
<div class="row">
<div class="text-center" data-wow-duration="2000ms" data-wow-delay="100ms" >
<h1 class="section-title">Top Buyer </span></h1>
</div>
</div>
<div class="row pt-5 wow animated fadeInUp animated" data-wow-duration="2000ms" data-wow-delay="400ms">
<?php
$i=1;
while($ress= mysqli_fetch_assoc($datauser)){
?>
<div class="col-xl-3 col-md-6 col-sm-6">
<a href="./profile.php?address=<?php echo $ress['Useraddress'] ?>&v=<?php echo rand();?>" class="single-top-seller">
<div class="single-top-seller-border d-flex align-items-center">
<div class="seller-rank-wrapper">
<span class="seller-rank-number"><?php echo $i;?></span>
</div>
<div class="seller-author-img">
<img src="<?php echo $ress['Userimage'] ;?>" alt="">
<span class="seller-author-badge"><i class="fas fa-check"></i></span>
</div>
<div class="seller-author-info">
<span class="seller-autor-name"><?php echo $ress['Username'] ;?></span>
<!--<span class="seller-author-sell-amount">$2500,000</span>-->
</div>
</div>
</a>
</div>
<?php $i++;}?>
</div>
</div>
</section>
<!-- Top seller Page End -->
<style>
.inline {
display: inline-block;
position: absolute;
margin: 24px 0px;
}
input,
button {
height: 45px;
}
.pagination {
width: 100%;
display: flex;
justify-content: center;
margin-bottom: 20px;
}
.pagination a {
font-weight: bold;
font-size: 18px;
color: var(--secondary-color);
float: left;
padding: 8px 16px;
text-decoration: none;
border: 1px solid var(--text-opcity);
}
.pagination a.active {
background-color: var(--text-pink);
color: var(--secondary-color);
}
.pagination a:hover:not(.active) {
background-color: var(--text-primary-color);
color: var(--secondary-color);
}
</style>
<div class="pagination">
<?php
$query = "SELECT COUNT(*) FROM `NFT_info`";
$rs_result = mysqli_query($link, $query);
$row = mysqli_fetch_row($rs_result);
$total_records = $row[0];
echo "";
// Number of pages required.
$total_pages = ceil($total_records / $per_page_record);
$pagLink = "";
if($page>=2){
echo "<a href='load-more.php?v=".rand()."&page=".($page-1)."'> Prev </a>";
}
for ($i=1; $i<=3; $i++) {
if ($i == $page) {
$pagLink .= "<a class = 'active' href='load-more.php?v=".rand()."&page="
.$i."'>".$i." </a>";
}
else {
$pagLink .= "<a href='load-more.php?v=".rand()."&page=".$i."'>".$i." </a>";
}
};
echo $pagLink;
if($page<$total_pages){
echo "<a href='load-more.php?v=".rand()."&page=".($page+1)."'> Next </a><a href='load-more.php?v=".rand()."&page=".$total_pages."'> Last </a>";
}
?>
</div>
<?php include("footer.php"); ?>