forked from omermaksutii/olux
-
Notifications
You must be signed in to change notification settings - Fork 1
/
divPage9.php
167 lines (156 loc) · 6.72 KB
/
divPage9.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
<?php
ob_start();
session_start();
date_default_timezone_set('UTC');
include "includes/config.php";
if (!isset($_SESSION['sname']) and !isset($_SESSION['spass'])) {
header("location: ../");
exit();
}
$usrid = mysqli_real_escape_string($dbcon, $_SESSION['sname']);
?>
<ul class="nav nav-tabs">
<li class="active"><a href="#filter" data-toggle="tab">Filter</a></li>
</ul>
<div id="myTabContent" class="tab-content">
<div class="tab-pane active in" id="filter">
<table class="table">
<thead>
<tr>
<th>Scam Name</th>
<th>Description</th>
<th>Seller</th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td>
<input class='filterinput form-control input-sm' name="scam_name" size='3'>
</td>
<td>
<input class='filterinput form-control input-sm' name="scam_info" size='3'>
</td>
<td>
<select class='filterselect form-control input-sm' name="scam_seller">
<option value="">ALL</option>
<?php
$query = mysqli_query($dbcon, "SELECT DISTINCT(`resseller`) FROM `scampages` WHERE `sold` = '0' or `sold` = '1' ORDER BY resseller ASC");
while($row = mysqli_fetch_assoc($query)){
$qer = mysqli_query($dbcon, "SELECT DISTINCT(`id`) FROM resseller WHERE username='".$row['resseller']."' ORDER BY id ASC")or die(mysql_error());
while($rpw = mysqli_fetch_assoc($qer))
$SellerNick = "seller".$rpw["id"]."";
echo '<option value="'.$SellerNick.'">'.$SellerNick.'</option>';
}
?>
</select>
</td>
<td>
<button id='filterbutton' class="btn btn-primary btn-sm" disabled>Filter <span class="glyphicon glyphicon-filter"></span></button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<table width="100%" class="table table-striped table-bordered table-condensed sticky-header" id="table">
<thead>
<tr>
<th scope="col">Scampage Name</th>
<th scope="col">Description</th>
<th scope="col">Seller</th>
<th scope="col">Price</th>
<th scope="col">Added on </th>
<th scope="col">Buy</th>
</tr>
</thead>
<tbody>
<?php
$q = mysqli_query($dbcon, "SELECT * FROM scampages WHERE sold='0' or sold='1' ORDER BY RAND()")or die(mysqli_error());
while($row = mysqli_fetch_assoc($q)){
$qer = mysqli_query($dbcon, "SELECT * FROM resseller WHERE username='".$row['resseller']."'")or die(mysql_error());
while($rpw = mysqli_fetch_assoc($qer))
$SellerNick = "seller".$rpw["id"]."";
echo "
<tr>
<td id='scam_name'> ".htmlspecialchars($row['scamname'])." </td>
<td id='scam_info'> ".htmlspecialchars($row['infos'])." </td>
<td id='scam_seller'> ".htmlspecialchars($SellerNick)."</td>
<td> ".htmlspecialchars($row['price'])."</td>
<td> ".$row['date']."</td>";
echo '
<td>
<span id="scam'.$row['id'].'" title="buy" type="scam"><a onclick="javascript:buythistool('.$row['id'].')" class="btn btn-primary btn-xs"><font color=white>Buy</font></a></span><center>
</td>
</tr>
';
}
?>
<script type="text/javascript">
$('#filterbutton').click(function() {
$("#table tbody tr").each(function() {
var ck1 = $.trim($(this).find("#scam_name").text().toLowerCase());
var ck2 = $.trim($(this).find("#scam_info").text().toLowerCase());
var ck3 = $.trim($(this).find("#scam_seller").text().toLowerCase());
var val1 = $.trim($('input[name="scam_name"]').val().toLowerCase());
var val2 = $.trim($('input[name="scam_info"]').val().toLowerCase());
var val3 = $.trim($('select[name="scam_seller"]').val().toLowerCase());
if ((ck1 != val1 && val1 != '') || ck2.indexOf(val2) == -1 || (ck3 != val3 && val3 != '')) {
$(this).hide();
} else {
$(this).show();
}
});
$('#filterbutton').prop('disabled', true);
});
$('.filterselect').change(function() {
$('#filterbutton').prop('disabled', false);
});
$('.filterinput').keyup(function() {
$('#filterbutton').prop('disabled', false);
});
function buythistool(id){
bootbox.confirm("Are you sure?", function(result) {
if(result ==true){
$.ajax({
method:"GET",
url:"buyscam.php?id="+id+"&t=scampages",
dataType:"text",
success:function(data){
if(data.match(/<button/)){
$("#scam"+id).html(data).show();
}else{
bootbox.alert('<center><img src="files/img/balance.png"><h2><b>No enough balance !</b></h2><h4>Please refill your balance <a class="btn btn-primary btn-xs" href="addBalance.html" onclick="window.open(this.href);return false;" >Add Balance <span class="glyphicon glyphicon-plus"></span></a></h4></center>')
}
},
});
;}
});
}
function openitem(order){
$("#myModalLabel").text('Order #'+order);
$('#myModal').modal('show');
$.ajax({
type: 'GET',
url: 'showOrder'+order+'.html',
success: function(data)
{
$("#modelbody").html(data).show();
}});
}
</script>
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="myModalLabel"></h4>
</div>
<div class="modal-body" id="modelbody">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>