This repository has been archived by the owner on Aug 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlisting.php
157 lines (108 loc) · 4.35 KB
/
listing.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
//require_once 'apiconn.php';
require_once 'partials/config.php';
$header = array(
'page'=>'listing',
'title'=>'Listing'
);
require_once 'partials/header.php';
//for univrsal search
if( !empty($search) && !empty($category) )
{
?>
<?php
$response = json_encode( $client->category($category)->search($search) );
$response = json_decode($response, true);
if( $response["Items"]["Request"]["IsValid"] ) {
$Keywords_uni = $response["Items"]["Request"]["ItemSearchRequest"]["Keywords"];
$SearchIndex_uni = $response["Items"]["Request"]["ItemSearchRequest"]["SearchIndex"];
$TotalResults_uni = $response["Items"]["TotalResults"];
$TotalPages_uni = $response["Items"]["TotalPages"];
$Item = $response["Items"]["Item"];
if (is_array($Item)) {
$count = 1;
// print $TotalPages_uni;
?>
<?php
?>
<section class="maincontent listing">
<?php include_once 'partials/bar.inc.php'; ?>
<div class="row">
<div class="container"> <div class="bxslider" style="display: none;">
<?php
foreach (array_slice($Item, 0, 4) as $key => $value) {
if (is_array($value)) {
$ASIN = $response["Items"]["Item"][$key]["ASIN"];
$MediumImageURL = $response["Items"]["Item"][$key]["MediumImage"]["URL"];
$LargeImageURL = $response["Items"]["Item"][$key]["LargeImage"]["URL"];
$Title = $response["Items"]["Item"][$key]["ItemAttributes"]["Title"];
}
?>
<div><img src="<?php print $LargeImageURL;?>" title="<?php print $Title;?>"></div>
<?php
//print $ASIN;
}?>
</div>
</div>
</div>
<?php }
?>
<div class="list">
<div class="container">
<div class="list-title">
<!-- Pay with lipa Na Mpesa online -->
<h2>Showing results for '<?php print $Keywords_uni; ?>'<span> <?php echo $TotalResults_uni;?> results</span></h2>
</div>
<?php } } ?>
<?php include_once 'partials/list.inc.php'; ?>
<span class="clearfix"></span>
</div>
</div>
<?php if(isset($_SESSION['user_id'])){?>
<div class="related my_history">
<div class="container">
<br> <br>
<ul>
<li class="main2">
<div>
<h2>My Search History </h2>
<br>
<ul>
<?php
if(isset($_SESSION['user_id'])){
$project_desc1 = $mysqli->query("SELECT * from lbs_history WHERE lbs_bill_shipping_id=".$_SESSION['user_id']." LIMIT 15")or die('Error : ('. $mysqli->errno .') '. $mysqli->error);
while($obj_ona1= $project_desc1->fetch_object()){
print '<li><i class="fas fa-check"></i> '.$obj_ona1->lbs_history_term.' searched on '.date("jS F, Y", strtotime("$obj_ona1->lbs_history_date")).'</li>';
}
}else{
print '<li><i class="fas fa-exclamation-circle" style="font-weight:bold"></i> Login to see your search history</li>';
}
?>
</ul>
<span class="clearfix"></span>
</div>
</li>
</ul>
<span class="clearfix"></span>
</div>
</div>
<?php } ?>
</section>
<?php require_once 'partials/footer.php'; ?>
<script>
$(document).ready(function(){$('#qView').on('show.bs.modal', function (e) {
var rowid = $(e.relatedTarget).data('id');
$(".loading").show();
$(".modal-dialog").hide();
$.ajax({
type : 'post',
url : 'cart_process.php',
data : 'rowid='+ rowid,
success : function(data){
$('.fetched-data').html(data);//Show fetched data from database
$(".loading").hide();
$(".modal-dialog").show();
}
});
});});
</script>