-
Notifications
You must be signed in to change notification settings - Fork 1
/
load-more.php
199 lines (183 loc) · 9.97 KB
/
load-more.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
<?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;
$data = mysqli_query($link, $sql);
?>
<section class="py-5">
<div class="container">
<div class="row py-5">
<div class="col-md-12">
<div class="text-center">
<h1><b>Explore all NFTs </b></h1>
</div>
</div>
</div>
<div class="row py-5">
<?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>
<a href="./collection.php?collection=<?php echo $hotBids_row['NFT_collection']; ?>"><p><?php echo $hotBids_row['NFT_collection']; ?></p></a>
</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_resell']=="on"){
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>
<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"); ?>