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
function searchMyUser() {
document.my_user_list.submit();
}
function searchOceanUser() {
document.ocean_user_list.submit();
}
function searchUserUseCoupon() {
document.user_use_coupon_list.submit();
}
function doSendPoint() {
//积分判断
var point = $("[name=point]").val();
if(point.length<1) {
alert ("积分不能为空!");
return false;
}
//数字
if(!checknum(point)) {
alert ("积分必须为整数数字!");
return false;
}
//范围
if(point < 1 || point > 10000) {
alert ("积分范围异常!");
return false;
}
document.user_send_point.submit();
}
function doSendCoupon() {
document.user_send_coupon.submit();
}
function doUseCouponExec() {
//必须添加备注
var comment = $("[name=comment]").val();
if(comment.length<1) {
alert ("备注不能为空!");
return false;
}
document.user_use_coupon.submit();
}
function dateToUnixTime(date){
var f = date.split(' ', 2);
var d = (f[0] ? f[0] : '').split('-', 3);
var t = (f[1] ? f[1] : '').split(':', 3);
return (new Date(
parseInt(d[0], 10) || null,
(parseInt(d[1], 10) || 1) - 1,
parseInt(d[2], 10) || null,
parseInt(t[0], 10) || null,
parseInt(t[1], 10) || null,
parseInt(t[2], 10) || null
)).getTime() / 1000;
}
var tempUserId;
var nickname;
function getAgent(id,nickname){
tempUserId=id;
nickname=nickname;
$('#nickname').text(nickname);
}
$(function () {
$('.go').colorbox({inline:true, width:"50%"});
})
function updateParent() {
if($.trim($('#parentId').val())==''){
alert('请输入上级ID!');
return;
}
if($('#parentId').val()==tempUserId){
alert('上级不能为自己!');
return;
}
var appid = $("*[name='appid']").val();
console.log('appid:'+appid);
$.post('/miniplay_set_parent.php',{appid:appid,userId:tempUserId,parentUserId:$('#parentId').val()},function (resp) {
console.log(resp);
var data = JSON.parse(resp);
if(data.status=='OK'){
alert('提交成功!');
}else{
alert(data.message);
}
})
}