forked from MuWinds/intlnocloud
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Notify.php
286 lines (272 loc) · 8.5 KB
/
Notify.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
<?php
// +----------------------------------------------------------------------
// | Quotes [ 只为给用户更好的体验]**[我知道发出来有人会盗用,但请您留版权]
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 零度 盗用不留版权,你就不配拿去!
// +----------------------------------------------------------------------
// | Date: 2019年08月20日
// +----------------------------------------------------------------------
/**
* 收款记录
**/
$title='收款记录';
include './Head.php';
?>
<?php
echo '<div class="panel panel-primary">
<div class="panel-heading"><h3 class="panel-title">操作中心</h3></div>
<div class="panel-body"><form action="" method="GET" class="form-inline"><input type="hidden" name="my" value="search">
<div class="form-group">
<label>条件搜索</label>
<select name="column" class="form-control"><option value="id">ID</option></select>
</div>
<div class="form-group">
<input type="text" class="form-control" name="value" placeholder="搜索内容">
</div>
<button type="submit" class="btn btn-primary">搜索</button>
</form>';
if($_GET['my']=='search'||$_GET['value']) {
$sql=" `{$_GET['column']}`='{$_GET['value']}'";
$numrows=$DB->query("SELECT * from pay_notify WHERE{$sql}")->rowCount();
$con='包含 '.$_GET['value'].' 的共有 <b>'.$numrows.'</b> 个二维码';
}else{
$numrows=$DB->query("SELECT * from pay_notify")->rowCount();
$nums=$DB->query("SELECT * from pay_notify WHERE status='1'")->rowCount();
$sql=" 1";
//$con='系统共有 <b>'.$numrows.'</b> 个收款记录,已经自动回调:<b>'.$nums.'</b>个';
$con='系统共有 <b>'.$numrows.'</b> 个收款记录';
}
echo '<br>'.$con;
?>
</div>
</div>
</div>
<div class="panel">
<div class="panel-control"><h3 class="panel-title"><?php echo $title?></h3></div>
<form name="form1" id="form1">
<div class="table-responsive">
<?php echo $con?>
<table class="table table-striped table-bordered table-vcenter"><thead>
<tr>
<th>ID</th>
<th>商户PID</th>
<th>二维码</th>
<th>二维码备注</th>
<th>收款金额</th>
<!--th>回调状态</th>
<th>回调返回数据</th-->
<th>收款时间(系统检测时间)</th>
</tr>
</thead>
<tbody>
<?php
$pagesize=30;
$pages=intval($numrows/$pagesize);
if ($numrows%$pagesize)
{
$pages++;
}
if (isset($_GET['page'])){
$page=intval($_GET['page']);
}
else{
$page=1;
}
$offset=$pagesize*($page - 1);
function notify_zt($status)//出码状态
{
if($status==1)
return '<font color=green>回调成功</font>';
elseif($status==2)
return '<font color=red>回调失败</font>';
else
return '<font color=red>暂未回调</font>';
}
$rs=$DB->query("SELECT * FROM pay_notify WHERE{$sql} order by addtime desc limit $offset,$pagesize");
while($res = $rs->fetch())
{
$row=$DB->query("select * from pay_qrlist where id='{$res['qr_id']}' limit 1")->fetch();
echo '<tr><td>'.$res['id'].'</td>
<td>'.$res['pid'].'</td>
<td>'.$res['qr_id'].'->'.($row['type']?'<img src="/Core/Assets/Icon/'.$row['type'].'.ico" width="16" onerror="this.style.display=\'none\'">'.pay_type($row['type']):'此码已被删除').'</td>
<td>'.($res['qr_beizhu']?$res['qr_beizhu']:'无备注').'</td>
<td><b>¥ '.$res['money'].'</b></td>
<!--td>'.notify_zt($res['status']).'</td>
<td>'.$res['pay_msg'].'</td-->
<td>'.$res['addtime'].'</td>
</tr>';
}
?>
</tbody>
</table>
</div>
<?php
echo'<ul class="pagination">';
$first=1;
$prev=$page-1;
$next=$page+1;
$last=$pages;
if ($page>1)
{
echo '<li><a href="?page='.$first.$link.'">首页</a></li>';
echo '<li><a href="?page='.$prev.$link.'">«</a></li>';
} else {
echo '<li class="disabled"><a>首页</a></li>';
echo '<li class="disabled"><a>«</a></li>';
}
for ($i=1;$i<$page;$i++)
echo '<li><a href="?page='.$i.$link.'">'.$i .'</a></li>';
echo '<li class="disabled"><a>'.$page.'</a></li>';
for ($i=$page+1;$i<=$pages;$i++)
echo '<li><a href="?page='.$i.$link.'">'.$i .'</a></li>';
echo '';
if ($page<$pages)
{
echo '<li><a href="?page='.$next.$link.'">»</a></li>';
echo '<li><a href="?page='.$last.$link.'">尾页</a></li>';
} else {
echo '<li class="disabled"><a>»</a></li>';
echo '<li class="disabled"><a>尾页</a></li>';
}
echo'</ul>';
#分页
?>
</div>
</div>
<script type="text/javascript">
function del_user(id){//删除用户
if(id==''){layer.alert('请确保各项不能为空!');return false;}
var ii = layer.load(3, {shade:[0.1,'#fff']});
$.ajax({
type : "POST",
url : "Ajax.php?act=Del_Qrlist",
data : {id:id},
dataType : 'json',
timeout:10000,
success : function(data) {
layer.close(ii);
layer.msg(data.msg);
if(data.code==1){
setTimeout(function () {
location.href="?";
}, 1000); //延时1秒跳转
}
},
error:function(data){
layer.close(ii);
layer.msg('服务器错误');
}
});
}
function add_user(){//添加用户
var beizhu= $("#beizhu").val();
var qr_url= $("#qr_url").val();
var cookie= $("#cookie").val();
var xm_alipay= $("#xm_alipay").val();
var zh_alipay= $("#zh_alipay").val();
if(qr_url=='' || beizhu=='' || cookie=='' || xm_alipay=='' || zh_alipay==''){layer.alert('必填项不能为空!');return false;}
var ii = layer.load(3, {shade:[0.1,'#fff']});
$.ajax({
type : "POST",
url : "Ajax.php?act=Add_Qrlist",
data : {beizhu,cookie,xm_alipay,zh_alipay},
dataType : 'json',
timeout:10000,
success : function(data) {
layer.close(ii);
layer.msg(data.msg);
if(data.code==1){
setTimeout(function () {
location.href="?";
}, 1000); //延时1秒跳转
}
},
error:function(data){
layer.close(ii);
layer.msg('服务器错误');
}
});
}
function edit_user(){//修改用户
var id= $("#id").val();
var id= $("#id").val();
var cookie= $("#cookie").val();
if(cookie==''){layer.alert('必填项不能为空!');return false;}
var ii = layer.load(3, {shade:[0.1,'#fff']});
$.ajax({
type : "POST",
url : "Ajax.php?act=Edit_Qrlist",
data : {id,cookie},
dataType : 'json',
timeout:10000,
success : function(data) {
layer.close(ii);
layer.msg(data.msg);
if(data.code==1){
setTimeout(function () {
location.href="?";
}, 1000); //延时1秒跳转
}
},
error:function(data){
layer.close(ii);
layer.msg('服务器错误');
}
});
}
$(document).ready(function() {
QrCode_id = 0;//登陆二维码识别ID
Update_Get_File= 0;//判断是否成功上传二维码
Update_Get_QrUrl= 0;//判断是否成功提交获取登陆二维码申请
Update_QrUrl= 0;//判断是否已经获取到登陆二维码
Update_Get_Cookie = 0;//判断是否已经获取到COOKIE
$('.picurl > input').bind('focus mouseover', function() {
if (this.value) {
this.select()
}
});
$("input[type='file']").change(function(e) {
$('#qr_url').val('解码中');
Upload(this.files)
});
});
function Upload() {
var ii = layer.load(3, {shade:[0.1,'#fff']});
var file = document.getElementById("imgfile").files[0];
var formData = new FormData();
formData.append('image_field', file);
$.ajax({
url : "Ajax.php?act=Add_Qrcode",
type: "POST",
data: formData,
contentType: false,
processData: false,
mimeType: "multipart/form-data",
dataType:'json',
success: function (data) {
/*layer.close(ii);
$('#qr_url').val(data.qr_url);
*/
if(data.code==1){
layer.close(ii);
$('#qr_url').val(data.qrcode);
}else{
layer.close(ii);
layer.msg(data.msg);
setTimeout(function () {
location.href="?";
}, 3000); //延时1秒跳转
}
},
error:function(data){
layer.close(ii);
layer.msg('请剪切边框或更换其他二维码重试');
setTimeout(function () {
location.href="?";
}, 3000); //延时1秒跳转
}
});
}
</script>