forked from rakirizu/QuanAuth
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
323 lines (301 loc) · 11.7 KB
/
index.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
<?php include 'function/function_core.php';
if (!$G['config']['xtsy']) die(); ?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-title" content="Material Design Lite">
<title>授权在线开通 - <?php echo $G['config']['sitename'] ?></title>
<link rel="stylesheet" href="./mdl/material.min.css">
<?php include './function/color.inc.html' ?>
</head>
<style>
.demo-card-square.mdl-card {
-webkit-transition: all .4s;
width: 350px;
height: 350px;
margin-left: auto;
margin-right: auto;
}
</style>
<body class="flat-blue landing-page">
<!-- Always shows a header, even in smaller screens. -->
<div class="mdl-layout mdl-js-layout mdl-layout--fixed-header" id="content">
<header class="mdl-layout__header">
<div class="mdl-layout__header-row">
<!-- Title -->
<span class="mdl-layout-title">授权在线开通 - <?php echo $G['config']['sitename'] ?></span>
<!-- Add spacer, to align navigation to the right -->
<div class="mdl-layout-spacer"></div>
<!-- Navigation. We hide it in small screens. -->
<nav class="mdl-navigation mdl-layout--large-screen-only">
<?php echo $G['config']['mainnav'] ?>
</nav>
</div>
</header>
<div class="mdl-layout__drawer">
<span class="mdl-layout-title"><?php echo $G['config']['sitename'] ?></span>
<nav class="mdl-navigation">
<?php echo $G['config']['mainnav'] ?>
</nav>
</div>
<center>
<main class="mdl-layout__content" style="width: 100%;">
<div style="display: inline;">
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label" style="width: 95%">
<select class="mdl-textfield__input" style="width: 100%" id="applist" onchange="loadbuylist();">
<option value="0">请选择一个应用</option>
</select>
<label class="mdl-textfield__label" for="sample3">选择您需要购买的应用</label>
</div>
</div>
<div style="width:100%; " id="buylist">
数据正在等待中
</div>
</main>
</center>
<!-- <footer class="mdl-mini-footer" id="footer" >
<div class="mdl-mini-footer__left-section">
<ul class="mdl-mini-footer__link-list">
<li>©<?php /*echo $G['config']['sitename']*/ ?> </li>
<?php /*if (!empty($G['config']['beian'])) echo '<li><a href="http://www.miitbeian.gov.cn" target="_blank">'.$G['config']['beian'].'</a></li>'*/ ?>
</ul>
</div>
<div class="mdl-mini-footer__right-section">
<ul class="mdl-mini-footer__link-list">
<li>客服QQ:<a href="http://wpa.qq.com/msgrd?v=3&uin=<?php /*echo $G['config']['adminqq']*/ ?>&site=qq&menu=yes" target="_blank"><?php /*echo $G['config']['adminqq']*/ ?></a></li>
<li>客服邮箱:<a href="http://wpa.qq.com/msgrd?v=3&uin=<?php /*echo $G['config']['adminmail']*/ ?>&site=qq&menu=yes" target="_blank"><?php /*echo $G['config']['adminmail']*/ ?></a></li>
</ul>
</div>
</footer>-->
</div>
<script src="./static/jquery-3.3.1.js"></script>
<script type="text/javascript" src="./static/frame/layui/layui.js"></script>
<script src="./mdl/material.min.js"></script>
<script>
layui.use(['layer'], function () {
window.layer = layui.layer;
var loading = layer.load();
var loading2 = layer.load();
$.ajax({
url: 'ajax.php?mod=buy_applist',
type: 'POST',
dataType: 'html',
data: '',
success: function (data) {
layer.close(loading);
if (data === '' || data === null) {
layer.open({
type: 1
,
title: false
,
closeBtn: false
,
area: '300px;'
,
shade: 0.8
,
id: 'sitenotice'
,
resize: false
,
btn: ['确定']
,
btnAlign: 'c'
,
moveType: 1
,
content: '<div style="padding: 20px; line-height: 22px; background-color: #393D49; color: #fff; font-weight: 300;">站长没有添加任何应用</div>'
,
success: function (layero) {
}
});
} else {
$('#applist').html(data);
if (getQueryVariable('appid') !== false) {
$("#applist").val(getQueryVariable('appid'));
}
}
},
error: function (data) {
layer.close(loading);
layer.msg('请求失败' + data);
}
});
if (getQueryVariable('appid') !== false) {
var loadbuylist = 'loadbuylist=' + getQueryVariable('appid');
} else {
var loadbuylist = '';
}
$.ajax({
url: 'ajax.php?mod=loadbuylist',
type: 'POST',
dataType: 'html',
data: loadbuylist,
success: function (data) {
layer.close(loading2);
if (data === '' || data === null) {
layer.open({
type: 1
,
title: false
,
closeBtn: false
,
area: '300px;'
,
shade: 0.8
,
id: 'sitenotice'
,
resize: false
,
btn: ['确定']
,
btnAlign: 'c'
,
moveType: 1
,
content: '<div style="padding: 20px; line-height: 22px; background-color: #393D49; color: #fff; font-weight: 300;">站长没有添加任何应用</div>'
,
success: function (layero) {
}
});
} else {
$('#buylist').html(data);
//footerchange();
}
},
error: function (data) {
layer.close(loading2);
layer.msg('请求失败' + data);
}
})
});
function loadbuylist() {
var loadbuylist = $("#applist").val();
var loading = layer.load();
$.ajax({
url: 'ajax.php?mod=loadbuylist',
type: 'POST',
dataType: 'html',
data: 'loadbuylist=' + loadbuylist,
success: function (data) {
layer.close(loading);
if (data === '' || data === null) {
layer.msg('没有数据');
} else {
$('#buylist').html(data);
//footerchange();
}
},
error: function (data) {
layer.close(loading);
layer.msg('请求失败' + data);
}
})
}
/*function footerchange() {
var _ch =document.getElementById("footer").scrollHeight;//这个就是你中间内容div的高度
var _wh = $(window).height();//整个窗口的高度
var _bd = $("#content").height();
if (_ch > _wh - _bd){
$("#footer").css("margin-top","1px");
}else{
$("#footer").css("margin-top",(_wh - _bd -_ch)+"px");
}
}*/
function buy(id) {
layer.open({
type: 2,
title: '开通授权(商品ID:' + id + ')',
shadeClose: true,
shade: 0.8,
area: ['90%', '90%'],
content: 'ajax.php?mod=buy_first&fid=' + id //iframe的url
});
}
function buy_submit(id, type) {
var loading = layer.load();
if (type === 1) {
//账号密码登陆
var kt_user = $("#kt_user").val();
var kt_pass = $("#kt_pass").val();
var kt_varinfo = '&kt_user=' + encodeURI(kt_user) + '&kt_pass=' + kt_pass;
} else if (type === 2) {
//卡密授权
var kt_kami = $("#kt_user").val();
var kt_varinfo = '&kt_user=' + encodeURI(kt_kami);
var kt_kaminum = $("#kt_keysnum").val();
} else if (type === 3) {
//检查绑定
var kt_robotqq = $("#kt_robotqq").val();
var kt_mac = $("#kt_mac").val();
var kt_ip = $("#kt_ip").val();
var kt_varinfo = '&kt_robotqq=' + kt_robotqq + '&kt_mac=' + kt_mac + '&kt_ip=' + encodeURI(kt_ip);
}
var kt_num = $("#kt_num").val();
var kt_adminqq = $("#kt_adminqq").val();
var kt_mail = $("#kt_mail").val();
var zffs = $('input:radio[name="zffs"]:checked').val();
var zxzffs = $('input:radio[name="zxzffs"]:checked').val();
var kt_key = $("#kt_key").val();
$.ajax({
url: 'ajax.php?mod=buy_submit',
type: 'POST',
dataType: 'json',
data: 'id=' + id + kt_varinfo + '&kt_num=' + kt_num + '&kt_mail=' + kt_mail + '&zffs=' + zffs + '&zxzffs=' + zxzffs + '&kt_key=' + kt_key + '&type=' + type + '&kt_adminqq=' + kt_adminqq,
success: function (data) {
layer.close(loading);
if (data.code === '1') {
layer.confirm(data.info, {
btn: ['立即付款', '关闭'] //按钮
}, function () {
window.open('payment.php?tradeno=' + data.tradeno);
layer.closeAll();
layer.confirm('请在新打开的窗口中进行付款!', {
btn: ['已付款', '关闭'] //按钮
}, function () {
window.open('payresult.php?tradeno=' + data.tradeno);
});
});
} else {
layer.msg(data.msg);
}
},
error: function (data) {
layer.close(loading);
layer.msg('请求失败' + data);
}
})
}
function info(id) {
layer.open({
type: 2,
title: '应用详情(应用ID:' + id + ')',
shadeClose: true,
shade: 0.8,
area: ['90%', '90%'],
content: 'ajax.php?mod=introduce&appid=' + id //iframe的url
});
}
function getQueryVariable(variable) {
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i = 0; i < vars.length; i++) {
var pair = vars[i].split("=");
if (pair[0] == variable) {
return pair[1];
}
}
return (false);
}
</script>
</body>
</html>