-
Notifications
You must be signed in to change notification settings - Fork 1
/
my_item.php
865 lines (790 loc) · 44.7 KB
/
my_item.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
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
<?php include "header.php"?>
<style>
.nft_tabs table {
width: 100%;
}
.nft_tabs tbody tr td {
border-bottom: 1px solid #cbcbcb;
line-height: 46px;
font-size: 17px;
}
.nft_tabs table tbody,
td,
tfoot,
th,
thead,
tr {
border: 1px solid #cbcbcb;
padding: 8px 20px;
}
.users_name {
padding-top: 50px;
}
button.btn-con {
background: #d91c5c;
border: none;
border-radius: 5px;
color: #fff;
line-height: 34px;
}
.tree-dit {
position: relative;
left: 0;
}
</style>
<!-- End Header -->
<div class="collectible">
<div class="container">
<div class="row">
<div class="col-md-12">
<h2>My items</h2>
</div>
</div>
</div>
</div>
<section class="my_items_srt py-4">
<div class="container">
<div class="row">
<div class="col-xl-12 col-lg-12 col-sm-12 col-sm-12 col-12">
<div class="main_items_area">
<div class="back_ground_area">
<div class="user_imgs" id="image">
</div>
<div class="users_name text-center mt-5">
<h3 class="font-weight-normal mt-3" id="username">
<font style="vertical-align: inherit;">
<font style="vertical-align: inherit;">Testname 1</font>
</font>
</h3>
</div>
</div>
<div class="row my-4">
<div class="col-md-5 col-12 m-auto">
<div class="address_boxs text-center" data-toggle="tooltip" data-placement="top" title=""
data-original-title="">
<a class="text-decoration-none px-3 py-1 rounded-pill bg-light text-dark"
rel="noopener noreferrer" id="currentAddress">
<font style="vertical-align: inherit;">
<font style="vertical-align: inherit;"></font>
</font>
</a>
</div>
</div>
<div
class="col-md-12 m-auto has_id_area text-center d-md-flex d-block align-item-center justify-content-center">
<div class="icons_box d-flex">
<span class="" target="_blank" data-toggle="tooltip" data-placement="top" title="" data-original-title="twitter">
<a href="https://twitter.com/defichainnfts" target="_blank" class="text-decoration-none "
id="tweeterurl"><i class="fab fa-twitter"></i>
</a>
</span>
<span class="" target="_blank" data-toggle="tooltip" data-placement="top" title="" data-original-title="instagram">
<a href="#" target="_blank" class="text-decoration-none "
id="instaurl"><i class="fab fa-instagram"></i></a>
</span>
</div>
</div>
<div class="col-md-12 col-12 m-auto mb-3">
<div class="text-center mt-1">
<font style="vertical-align: inherit;" class="text-capitalized" id="userbio">This Is My Bio </font>
</div>
</div>
<div class="col-md-12 m-auto text-center py-4">
<a href="./edit-profile.php?v=<?php echo rand();?>"
class="connect_wa_llets my-2 my-sm-0 mr-2 px-3" ><i class="fal fa-user-edit"></i> <span
class=" ">
<font style="vertical-align: inherit;">
<font style="vertical-align: inherit;">Edit Profile</font>
</font>
</span></a>
<!--<button class="connect_wa_llets my-2 my-sm-0 px-md-3 px-3">0.00% <span class=" ">Average Will Go To Tree Plant</span></button> -->
</div>
</div>
<div class="container mt-3">
<div class="my_tabs">
<!-- Nav pills -->
<div class="d-flex m-auto align-item-center justify-content-center">
<ul class="nav nav-pills" role="tablist">
<li class="nav-item">
<a class="nav-link active" data-bs-toggle="pill" href="#menu3">My Collection</a>
</li>
<li class="nav-item">
<a class="nav-link" data-bs-toggle="pill" href="#menu1">Owned</a>
</li>
<li class="nav-item">
<a class="nav-link" data-bs-toggle="pill" href="#home">On Sale</a>
</li>
<li class="nav-item">
<a class="nav-link" data-bs-toggle="pill" href="#menu2">Created</a>
</li>
<!--<li class="nav-item">-->
<!-- <a class="nav-link" data-bs-toggle="pill" href="#menu4">Liked</a>-->
<!--</li>-->
<li class="nav-item">
<a class="nav-link" data-bs-toggle="pill" href="#menu5">Activity</a>
</li>
<li class="nav-item">
<a class="nav-link" data-bs-toggle="pill" href="#menu6">Accept</a>
</li>
<li class="nav-item">
<a class="nav-link" data-bs-toggle="pill" href="#menu7">Recevied</a>
</li>
</ul>
</div>
<!-- Tab panes -->
<div class="tab-content">
<div id="home" class="container tab-pane "><br>
<div class="explore_star">
<div class="row" id="Sale">
</div>
</div>
</div>
<div id="menu1" class="container tab-pane fade"><br>
<div class="explore_star">
<div class="row" id="owned">
</div>
</div>
</div>
<div id="menu2" class="container tab-pane fade"><br>
<div class="explore_star">
<div class="row" id="created">
</div>
</div>
</div>
<div id="menu3" class="container tab-pane fade active">
<br>
<div class="explore_star">
<div class="row" id="collection">
</div>
</div>
</div>
<div id="menu4" class="container tab-pane fade">
<br>
<div class="explore_star">
<div class="row">
<div class="col-lg-3 col-md-6 mb-5">
<div class="inner_explore">
<div class="tp_pht">
<a href="#" data-toggle="tooltip" data-placement="top"
title="my name any" tabindex="0">
<img src="assets/img/img1.jpg" class="ico">
</a>
<a href="#" data-toggle="tooltip" data-placement="top"
title="my name any" tabindex="0">
<img src="assets/img/img2.jpg" class="ico01">
</a>
<a href="#" data-toggle="tooltip" data-placement="top"
title="Galaxy collection" tabindex="0">
<img src="assets/img/img1.jpg" class="ico02">
</a>
</div>
<a href="buy-description.html" class="text-decoration-none"
tabindex="0">
<img src="assets/img/03.jpg" 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">NFT open for bid token</h6>
</div>
<div class="nft-card-assets">
<img src="assets/img/img1.jpg" width="20"
height="20" alt="Asset logo">
</div>
</div>
<small class="hig_bg">Highest Bid: 0.0007 AMB</small>
</div>
</div>
<div
class="trx_price_heart d-flex align-items-center justify-content-between">
<a href="#" class="by_nw" tabindex="0">
Buy Now
</a>
<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>
</div>
</div>
</div>
<div id="menu5" class="container tab-pane fade">
<div class="py-3">
<div class="row">
<div class="col-md-12">
<div class="filter mb-md-4 mb-3">
<h4>Filter</h4>
<div class="d-flex align-items-center flex-wrap" style="gap:10px">
<button onclick="filterAll()" class="btn px-md-4 px-3 text-center" style="background-color:var(--text-primary-color);">
All
</button>
<button onclick="filter('Minted')" class="btn px-md-4 px-3 text-center" style="background-color:var(--text-primary-color);">
Minted
</button>
<button onclick="filter('Bought')" class="btn px-md-4 px-3 text-center" style="background-color:var(--text-primary-color);">
Bought
</button>
<button onclick="filter('Bid')" class="btn px-md-4 px-3 text-center" style="background-color:var(--text-primary-color);">
Bid
</button>
<button onclick="filter('Sold')" class="btn px-md-4 px-3 text-center" style="background-color:var(--text-primary-color);">
Sold
</button>
</div>
</div>
</div>
<div class="col-md-12">
<div class="nft_tabs">
<table>
<tr>
<th>NFT ID</th>
<th>Image</th>
<th>item</th>
<th>Price</th>
<th>Time</th>
</tr>
<tbody id="activity">
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div id="menu6" class="container tab-pane fade">
<br>
<div class="nft_tabs">
<table>
<tr>
<th>NFT ID</th>
<th>Image</th>
<th>Item</th>
<th>Quantity</th>
<th>Price</th>
<th>Time</th>
</tr>
<tbody id="accpect">
</tbody>
</table>
</div>
</div>
<div id="menu7" class="container tab-pane fade">
<br>
<div class="nft_tabs">
<table>
<tr>
<th>NFT ID</th>
<th>Image</th>
<th>Item</th>
<th>Quantity</th>
<th>Price</th>
<th>Time</th>
</tr>
<tbody id="recive">
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
<script>
let myInterval = setInterval(showdata, 3000);
document.getElementById("loadingdivnew").className = "d-block";
async function showdata() {
var wallet_address = selectedAccount;
if (wallet_address == '' || wallet_address == undefined) {
document.getElementById("loadingdivconnect").className = "d-block"
} else {
clearInterval(myInterval);
document.getElementById("currentAddress").innerHTML = wallet_address;
var formdata = new FormData();
formdata.append("address", wallet_address);
formdata.append("type", "owned");
var requestOptions = {
method: "POST",
body: formdata,
redirect: "follow",
};
fetch("./itemsdata.php", requestOptions)
.then((response) => response.json())
.then((ownednft) => {
var ownedtab = "";
for (i = 0; i < ownednft.length; i++) {
ownedtab += `
<div class="col-lg-3 col-md-6 mb-5">
<div class="inner_explore position-relative">
<div class="d-flex align-items-center justify-content-between">
<div class="tree-dit">
<div class="dropdown">
<button class="dropdown-toggle btn p-0" type="button" id="dropdownMenuButton1" data-bs-toggle="dropdown" aria-expanded="false" style="color: var(--secondary-color);">
<i class="bi bi-three-dots-vertical"></i>
</button>
<ul class="dropdown-menu" aria-labelledby="dropdownMenuButton1">
<li><a class="dropdown-item" href="Sell.php?id=${ownednft[i].NFT_id}&v=${Math.floor((Math.random() * 1000000) + 1)}">Edit NFT</a></li>
</ul>
</div>
</div>
`;
if(ownednft[i].last_price>0 && ownednft[i].NFT_resell == "on"){
ownedtab += `<div>
<div class="">
<p class="m-0" style="color:var(--text-pink)">Last Price</p>
<h6 class="m-0">${ownednft[i].last_price} ${ownednft[i].last_buy_currency}</h6>
</div>
</div>`;
}
ownedtab += `</div>`;
ownedtab += `<a href="buy-description.php?id=${ownednft[i].NFT_id}&v=${Math.floor((Math.random() * 1000000) + 1)}" class="text-decoration-none" tabindex="0">`
ownedtab += `<img src="${ownednft[i].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">${ownednft[i].NFT_name}</h6>
</div>
</div>
<div class="w-100">
<a href="./collection.php?collection=${ownednft[i].NFT_collection}&v=${Math.floor((Math.random() * 1000000) + 1)}" style="color:var(--text-pink)"><span class="iwMhCq">${ownednft[i].NFT_collection}</span></a>
</div>
`;
if(ownednft[i].NFT_resell == "on"){
ownedtab += `<small class="hig_bg">Current Price: ${ownednft[i].NFT_price} ${ownednft[i].NFT_payment}</small>`;
}
ownedtab +=`</div>
</div>
</div>
</div>
</div>
`;
}
if (ownedtab == '') {
ownedtab += `<p>No NFTS Found</p>`;
}
document.getElementById("owned").innerHTML = ownedtab;
document.getElementById("loadingdivnew").className = "d-none";
});
/*************************** created functionality **************************/
var formdata = new FormData();
formdata.append("address", wallet_address);
formdata.append("type", "created");
var requestOptions = {
method: "POST",
body: formdata,
redirect: "follow",
};
fetch("./itemsdata.php", requestOptions)
.then((response) => response.json())
.then((createnft) => {
var createdtab = "";
for (i = 0; i < createnft.length; i++) {
createdtab += `
<div class="col-lg-3 col-md-6 mb-5">
<div class="inner_explore">
`;
if(createnft[i].last_price>0 && createnft[i].NFT_resell == "on"){
createdtab += `
<div class="d-flex align-items-center justify-content-end">
<div class="">
<p class="m-0" style="color:var(--text-pink)">Last Price</p>
<h6 class="m-0">${createnft[i].last_price} ${createnft[i].last_buy_currency}</h6>
</div>
</div>
`;
}
createdtab += `<a href="buy-description.php?id=${createnft[i].NFT_id}&v=${Math.floor((Math.random() * 1000000) + 1)}" class="text-decoration-none" tabindex="0">`
createdtab += `
<img src="${createnft[i].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">${createnft[i].NFT_name}</h6>
</div>
</div>
<div class="w-100">
<a href="./collection.php?collection=${createnft[i].NFT_collection}&v=${Math.floor((Math.random() * 1000000) + 1)}" style="color:var(--text-pink)"><span class="iwMhCq">${createnft[i].NFT_collection}</span></a>
</div>
`;
if(createnft[i].NFT_resell == "on"){
createdtab += `<small class="hig_bg">Current Price: ${createnft[i].NFT_price} ${createnft[i].NFT_payment}</small>`;
}
createdtab +=`</div>
</div>
</div>
</div>
</div>
`;
}
if (createdtab == '') {
createdtab += `<p>No NFTS Found</p>`;
}
document.getElementById("created").innerHTML = createdtab;
document.getElementById("loadingdivnew").className = "d-none";
});
/*************************** Collection functionality **************************/
var formdata = new FormData();
formdata.append("address", wallet_address);
formdata.append("type", "collections");
var requestOptions = {
method: "POST",
body: formdata,
redirect: "follow",
};
fetch("./itemsdata.php", requestOptions)
.then((response) => response.json())
.then((collectiondata) => {
let collectiontab = "";
for (let i = 0; i < collectiondata.length; i++) {
collectiontab += `
<div class="col-lg-3 col-md-6 mb-5">
<div class="inner_explore position-relative">
<div class="tree-dit">
<div class="dropdown">
<button class="dropdown-toggle btn p-0" type="button" id="dropdownMenuButton1" data-bs-toggle="dropdown" aria-expanded="false" style="color: var(--secondary-color);">
<i class="bi bi-three-dots-vertical"></i>
</button>
<ul class="dropdown-menu" aria-labelledby="dropdownMenuButton1">
<li><a class="dropdown-item" href="./edit-collections.php?id=${collectiondata[i].id}">Edit Collection</a></li>
</ul>
</div>
</div>
<a href="./collection.php?collection=${collectiondata[i].collection_name}&v=${Math.floor((Math.random() * 1000000) + 1)}" class="text-decoration-none" tabindex="0">
<img src="${collectiondata[i].collection_logo}" 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">${collectiondata[i].collection_name}</h6>
</div>
</div>
</div>
</div>
<div class="trx_price_heart d-flex align-items-center justify-content-between">
<a href="./collection.php?collection=${collectiondata[i].collection_name}&v=${Math.floor((Math.random() * 1000000) + 1)}" class="by_nw" tabindex="0">
View Collection
</a>
</div>
</div>
</div>
</div>`;
} if (collectiontab == '') {
collectiontab += `<p>No Collections Found</p>`;
}
document.getElementById("collection").innerHTML = collectiontab;
document.getElementById("loadingdivnew").className = "d-none";
});
/*************************** Sale functionality **************************/
var formdata = new FormData();
formdata.append("address", wallet_address);
formdata.append("type", "Sale");
var requestOptions = {
method: "POST",
body: formdata,
redirect: "follow",
};
fetch("./itemsdata.php", requestOptions)
.then((response) => response.json())
.then((Salenft) => {
var Saletab = "";
for (i = 0; i < Salenft.length; i++) {
Saletab += `
<div class="col-lg-3 col-md-6 mb-5">
<div class="inner_explore position-relative">
<div class="d-flex align-items-center justify-content-between">
<div class="tree-dit">
<div class="dropdown">
<button class="dropdown-toggle btn p-0" type="button" id="dropdownMenuButton1" data-bs-toggle="dropdown" aria-expanded="false" style="color: var(--secondary-color);">
<i class="bi bi-three-dots-vertical"></i>
</button>
<ul class="dropdown-menu" aria-labelledby="dropdownMenuButton1">
<li><a class="dropdown-item" href="Sell.php?id=${Salenft[i].NFT_id}&v=${Math.floor((Math.random() * 1000000) + 1)}">Edit NFT</a></li>
</ul>
</div>
</div>
`;
if(Salenft[i].last_price>0 && Salenft[i].NFT_resell == "on"){
Saletab += `<div>
<div class="">
<p class="m-0" style="color:var(--text-pink)">Last Price</p>
<h6 class="m-0">${Salenft[i].last_price} ${Salenft[i].last_buy_currency}</h6>
</div>
</div>`;
}
Saletab += `</div>`;
Saletab += `<a href="buy-description.php?id=${Salenft[i].NFT_id}&v=${Math.floor((Math.random() * 1000000) + 1)}" class="text-decoration-none" tabindex="0">`
Saletab += `
<img src="${Salenft[i].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">${Salenft[i].NFT_name}</h6>
</div>
</div>
<div class="w-100">
<a href="./collection.php?collection=${Salenft[i].NFT_collection}&v=${Math.floor((Math.random() * 1000000) + 1)}" style="color:var(--text-pink)"><span class="iwMhCq">${Salenft[i].NFT_collection}</span></a>
</div>
<small class="hig_bg">Current Price: ${Salenft[i].NFT_price} ${Salenft[i].NFT_payment}</small>
</div>
</div>
</div>
</div>
</div>
`;
} if (Saletab == '') {
Saletab += `<p>No Collections Found</p>`;
}
document.getElementById("Sale").innerHTML = Saletab;
document.getElementById("loadingdivnew").className = "d-none";
});
/*************************** userInfo functionality **************************/
var formdata = new FormData();
formdata.append("address", wallet_address);
formdata.append("type", "userdetails");
var requestOptions = {
method: "POST",
body: formdata,
redirect: "follow",
};
fetch("./itemsdata.php", requestOptions)
.then((response) => response.json())
.then((userData) => {
let imagedata = '';
let t_name;
let i_name;
if(userData[0].Usertwitname==null){
t_name=''
}else{
t_name=userData[0].Usertwitname;
}
if(userData[0].Userinstaname==null){
i_name=''
}else{
i_name=userData[0].Userinstaname;
}
imagedata = `<div class="user_imgs">
<img class="rounded-pill art_imsss" width="120px" height="120px" src="${userData[0].Userimage}" alt="Card image cap">
</div>`;
document.getElementById("image").innerHTML = imagedata;
document.getElementById("username").innerHTML = userData[0].Username;
document.getElementById("userbio").innerHTML = userData[0].Userbio;
document.getElementById("tweeterurl").setAttribute("href", `https://twitter.com/${t_name}`);
document.getElementById("instaurl").setAttribute("href", `https://www.instagram.com/${i_name}`);
document.getElementById("loadingdivnew").className = "d-none";
});
/*************************** Activity functionality **************************/
var formdata = new FormData();
formdata.append("address", wallet_address);
formdata.append("type", "activity");
var requestOptions = {
method: "POST",
body: formdata,
redirect: "follow",
};
fetch("./itemsdata.php", requestOptions)
.then((response) => response.json())
.then((activitynft) => {
var Activitytab = "";
let payment = '';
for (i = 0; i < activitynft[0].length; i++) {
if (activitynft[1][i] == null) {
payment = "BNB";
} else {
payment = activitynft[1][i].NFT_payment;
}
Activitytab += `<tr>
<td>${activitynft[0][i].Nft_id}</td>
<td><a href="./buy-description.php?id=${activitynft[0][i].Nft_id}"><img src="${activitynft[0][i].Nft_image}" style="width:50px" alt=""></a></td>
<td>${activitynft[0][i].nft_type}</td>
<td>${activitynft[0][i].Nft_price} ${payment}</td>
<td style="color:rgb(52, 199, 123);">${activitynft[0][i].Date}</td></tr>
`;
} if (Activitytab == '') {
Activitytab += `<p>No Activity Found</p>`;
}
document.getElementById("activity").innerHTML = Activitytab;
document.getElementById("loadingdivnew").className = "d-none";
});
/*************************** Accpect functionality **************************/
var formdata = new FormData();
formdata.append("address", wallet_address);
formdata.append("type", "accpect");
var requestOptions = {
method: "POST",
body: formdata,
redirect: "follow",
};
fetch("./itemsdata.php", requestOptions)
.then((response) => response.json())
.then((accpect) => {
var accpecttab = "";
for (i = 0; i < accpect.length; i++) {
accpecttab += `<tr>
<td>${accpect[i].NFT_id}</td>
<td><img src="${accpect[i].NFT_image}" style="width:50px" alt=""></td>
<td>${accpect[i].NFT_name}</td>
<td>${accpect[i].Nft_quantity}</td>
<td>${accpect[i].NFT_bid} ${accpect[i].NFT_payment}</td>
<td style="color:rgb(52, 199, 123);">${accpect[i].Date}</td>
<td> <a href="./onlybid.php?id=${accpect[i].NFT_id}&v=${Math.floor((Math.random() * 1000000) + 1)}"><button class="btn-con">Claim</button></a> </td>
</tr>
`;
} if (accpecttab == '') {
accpecttab += `<p>No Offers Found</p>`;
}
document.getElementById("accpect").innerHTML = accpecttab;
document.getElementById("loadingdivnew").className = "d-none";
});
/*************************** Recevied functionality **************************/
var formdata = new FormData();
formdata.append("address", wallet_address);
formdata.append("type", "receive");
var requestOptions = {
method: "POST",
body: formdata,
redirect: "follow",
};
fetch("./itemsdata.php", requestOptions)
.then((response) => response.json())
.then((recive) => {
var recivetab = "";
for (i = 0; i < recive.length; i++) {
recivetab += `<tr>
<td>${recive[i].NFT_id}</td>
<td><img src="${recive[i].NFT_image}" style="width:50px" alt=""></td>
<td>${recive[i].NFT_name}</td>
<td>${recive[i].Nft_quantity}</td>
<td>${recive[i].NFT_bid} ${recive[i].NFT_payment}</td>
<td style="color:rgb(52, 199, 123);">${recive[i].Date}</td>
<td> <button class="btn-con" onclick="accpectOffer(${recive[i].NFT_bid},${recive[i].Nft_quantity},${recive[i].NFT_id},'${recive[i].NFT_bidder}',${recive[i].Multistatus})">Accpect</button> </td>
</tr>
`;
} if (recivetab == '') {
recivetab += `<p>No Offers Found</p>`;
}
document.getElementById("recive").innerHTML = recivetab;
document.getElementById("loadingdivnew").className = "d-none";
});
}
}
function filter(action){
var formdata = new FormData();
formdata.append("address", selectedAccount);
formdata.append("type", "activity");
var requestOptions = {
method: "POST",
body: formdata,
redirect: "follow",
};
fetch("./itemsdata.php", requestOptions)
.then((response) => response.json())
.then((activitynft) => {
var Activitytab = "";
let payment = '';
for (i = 0; i < activitynft[0].length; i++) {
if(activitynft[0][i].nft_type==action){
if (activitynft[1][i] == null) {
payment = "BNB";
} else {
payment = activitynft[1][i].NFT_payment;
}
Activitytab += `<tr>
<td>${activitynft[0][i].Nft_id}</td>
<td><a href="./buy-description.php?id=${activitynft[0][i].Nft_id}"><img src="${activitynft[0][i].Nft_image}" style="width:50px" alt=""></a></td>
<td>${activitynft[0][i].nft_type}</td>
<td>${activitynft[0][i].Nft_price} ${payment}</td>
<td style="color:rgb(52, 199, 123);">${activitynft[0][i].Date}</td></tr>
`;
}
} if (Activitytab == '') {
Activitytab += `<p>No Activity Found</p>`;
}
document.getElementById("activity").innerHTML = Activitytab;
document.getElementById("loadingdivnew").className = "d-none";
});
}
function filterAll(){
var formdata = new FormData();
formdata.append("address", selectedAccount);
formdata.append("type", "activity");
var requestOptions = {
method: "POST",
body: formdata,
redirect: "follow",
};
fetch("./itemsdata.php", requestOptions)
.then((response) => response.json())
.then((activitynft) => {
var Activitytab = "";
let payment = '';
for (i = 0; i < activitynft[0].length; i++) {
if (activitynft[1][i] == null) {
payment = "BNB";
} else {
payment = activitynft[1][i].NFT_payment;
}
Activitytab += `<tr>
<td>${activitynft[0][i].Nft_id}</td>
<td><a href="./buy-description.php?id=${activitynft[0][i].Nft_id}"><img src="${activitynft[0][i].Nft_image}" style="width:50px" alt=""></a></td>
<td>${activitynft[0][i].nft_type}</td>
<td>${activitynft[0][i].Nft_price} ${payment}</td>
<td style="color:rgb(52, 199, 123);">${activitynft[0][i].Date}</td></tr>
`;
} if (Activitytab == '') {
Activitytab += `<p>No Activity Found</p>`;
}
document.getElementById("activity").innerHTML = Activitytab;
document.getElementById("loadingdivnew").className = "d-none";
});
}
</script>
<script>
function accpectOffer(bid, quantity, id, address, status) {
if (status == 0) {
var formdata = new FormData();
formdata.append("Tid", id);
formdata.append("address", address);
formdata.append("price", bid);
formdata.append("quantity", "1");
var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};
fetch("./accpectOffer.php", requestOptions)
.then(response => response.text())
.then(result => {console.log(result)
swal("You Accpected That Bid");
})
.catch(error => console.log('error', error));
} else {
}
}
</script>
<?php include "footer.php"?>