forked from omermaksutii/olux
-
Notifications
You must be signed in to change notification settings - Fork 1
/
divPage7.php
135 lines (123 loc) · 5.94 KB
/
divPage7.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
<?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>Country</th>
<th>Site Name</th>
<th>Seller</th>
<th></th></tr></thead><tbody><tr><td><select class='filterselect form-control input-sm' name="account_country"><option value="">ALL</option>
<?php
$query = mysqli_query($dbcon, "SELECT DISTINCT(`country`) FROM `accounts` WHERE `sold` = '0' ORDER BY country ASC");
while($row = mysqli_fetch_assoc($query)){
echo '<option value="'.$row['country'].'">'.$row['country'].'</option>';
}
?>
</select></td><td><input class='filterinput form-control input-sm' name="account_sitename" size='3'></td><td><select class='filterselect form-control input-sm' name="account_seller"><option value="">ALL</option>
<?php
$query = mysqli_query($dbcon, "SELECT DISTINCT(`resseller`) FROM `accounts` WHERE `sold` = '0' 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" >Country</th>
<th scope="col">Site Name</th>
<th scope="col">Available Information</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
include("cr.php");
$q = mysqli_query($dbcon, "SELECT * FROM accounts WHERE sold='0' ORDER BY RAND()")or die(mysqli_error());
while($row = mysqli_fetch_assoc($q)){
$countryfullname = $row['country'];
$code = array_search("$countryfullname", $countrycodes);
$countrycode = strtolower($code);
$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='account_country'><i class='flag-icon flag-icon-$countrycode'></i> ".htmlspecialchars($row['country'])." </td>
<td id='account_sitename'> ".htmlspecialchars($row['sitename'])." </td>
<td> ".htmlspecialchars($row['infos'])." </td>
<td id='account_seller'> ".htmlspecialchars($SellerNick)."</td>
<td> ".htmlspecialchars($row['price'])."</td>
<td> ".$row['date']."</td>";
echo '
<td>
<span id="premium'.$row['id'].'" title="buy" type="premium"><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("#account_country").text().toLowerCase() );var ck2 = $.trim( $(this).find("#account_sitename").text().toLowerCase() );var ck3 = $.trim( $(this).find("#account_seller").text().toLowerCase() ); var val1 = $.trim( $('select[name="account_country"]').val().toLowerCase() );var val2 = $.trim( $('input[name="account_sitename"]').val().toLowerCase() );var val3 = $.trim( $('select[name="account_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:"buytool.php?id="+id+"&t=accounts",
dataType:"text",
success:function(data){
if(data.match(/<button/)){
$("#account"+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>