-
Notifications
You must be signed in to change notification settings - Fork 0
/
user.php
275 lines (244 loc) · 11.1 KB
/
user.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
<?php
require_once("includes/conn.php");
require_once("checkuser.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>会员中心 - 天天创客</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="mobileoptimized" content="0" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1, user-scalable=no">
<meta http-equiv="Expires" content="-1">
<meta http-equiv="pragram" content="no-cache">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no">
<meta name="browsermode" content="application">
<link rel="stylesheet" href="Static/css/pintuer.css?d=20150710">
<link rel="stylesheet" href="Static/css/style.css?d=20150710">
<script type="text/javascript" src="Static/js/jquery.min.js"></script>
<script type="text/javascript" src="Static/js/pintuer.js?d=20150710"></script>
<script type="text/javascript" src="Static/js/respond.js"></script></head>
<body>
<?
if($_POST['action']=="resetpwd")
{
$sql='UPDATE users SET pwd1="'.md5("123456").'" WHERE id="'.$_POST["id"].'" and rid="'.$rowuser['id'].'" ';
mysql_query($sql);
echo "<script>alert('重置成功,密码为123456,请及时通知用户自行更改!');window.parent.location.href='user.php';</script>";
exit();
}
?>
<div class="container">
<?php
require_once("top.php");
?> <div class="udd-body">
<div class="panel">
<div class="panel-body bg-white">
<span class="text-yellow icon-bell-o" style="color:#ffae31; font-size:16px">
您目前是【<?php echo userjibiename($rowuser['standardlevel'])?>】<?php if($rowuser['standardlevel']<9){?>,如需升级请点击“申请升级”按钮,升级后您将会结交更多朋友。<?php }?>
</span>
</div>
</div>
<br />
<div class="panel">
<div class="panel-head"><strong>会员资料</strong></div>
<div class="panel-body bg-white">
<table class="table table-bordered">
<tr class="blue">
<td width="30%" class="text-right">我的昵称</td>
<td><?php echo $rowuser['nickname']?></td>
</tr>
<tr class="white">
<td width="30%" class="text-right">我的微信</td>
<td><?php echo $rowuser['wechat']?></td>
</tr>
<tr class="blue">
<td width="30%" class="text-right">我的手机</td>
<td><?php echo $rowuser['loginname']?></td>
</tr>
<tr class="white">
<td class="text-right">我的级别</td>
<td><div class='level_icon tips'><div class='left'></div><div class='right'></div><span><?php echo $rowuser['standardlevel']?></span></div><div class='icons'><img src='Static/images/levels/<?php echo $rowuser['standardlevel']?>.png' /></div> <?php echo userjibiename($rowuser['standardlevel'])?></td>
</tr>
</table>
<br />
<div class="text-center"><?php if($rowuser['standardlevel']<9){?><button class="button bg-yellow" type="button" onclick="location.href='upgrade.php'">申请升级</button> <?php }?><button class="button" type="button" onclick="location.href='editinfo.php'">修改资料</button></div>
</div>
</div>
<br />
<div class="panel">
<div class="panel-head"><strong>好友状况</strong></div>
<div class="panel-body bg-white">
<table class="table table-bordered">
<?php
$sql="select count(*) as alluu from users where rid= '".$rowuser['id']."' ";
$query=$db->query($sql);
$rowtj=$db->fetch_array($query);
$sql="select count(*) as alluu2 from users where pid= '".$rowuser['id']."' ";
$query=$db->query($sql);
$rownext=$db->fetch_array($query);
$sql="select count(distinct userid) as alluu3 from shengji where jieuserid= '".$rowuser['id']."' and passed=1 ";
$query=$db->query($sql);
$row3=$db->fetch_array($query);
$sql="select count(0) as usernum from users where find_in_set('".$rowuser['id']."', ppath) and states=1 ";
$query=$db->query($sql);
$rowallbao=$db->fetch_array($query);
$zuigao1=0;
$zuigao2=0;
$zuigao3=0;
//关联1
$sqluser11="select * from users where pid=".$_SESSION["uuserid"]." and area=1 and states=1 ";
$queryuser11=$db->query($sqluser11);
$rowuser11=$db->fetch_array($queryuser11);
if(is_array($rowuser11))
{
$sql="select standardlevel from users where (find_in_set('".$rowuser11['id']."', ppath) or id=".$rowuser11['id'].") and states=1 order by standardlevel desc limit 1 ";
$query=$db->query($sql);
$rowgg=$db->fetch_array($query);
if(is_array($rowgg))
{
$zuigao1=$rowgg['standardlevel'];
}
else
{
$zuigao1=0;
}
}
//关联1
//关联2
$sqluser22="select * from users where pid=".$_SESSION["uuserid"]." and area=2 and states=1 ";
$queryuser22=$db->query($sqluser22);
$rowuser22=$db->fetch_array($queryuser22);
if(is_array($rowuser22))
{
$sql="select standardlevel from users where (find_in_set('".$rowuser22['id']."', ppath) or id=".$rowuser22['id'].") and states=1 order by standardlevel desc limit 1 ";
$query=$db->query($sql);
$rowgg=$db->fetch_array($query);
if(is_array($rowgg))
{
$zuigao2=$rowgg['standardlevel'];
}
else
{
$zuigao2=0;
}
}
//关联2
//关联3
$sqluser33="select * from users where pid=".$_SESSION["uuserid"]." and area=3 and states=1 ";
$queryuser33=$db->query($sqluser33);
$rowuser33=$db->fetch_array($queryuser33);
if(is_array($rowuser33))
{
$sql="select standardlevel from users where (find_in_set('".$rowuser33['id']."', ppath) or id=".$rowuser33['id'].") and states=1 order by standardlevel desc limit 1 ";
$query=$db->query($sql);
$rowgg=$db->fetch_array($query);
if(is_array($rowgg))
{
$zuigao3=$rowgg['standardlevel'];
}
else
{
$zuigao3=0;
}
}
//关联3
?>
<tr class="white">
<td class="text-right">邀请好友</td>
<td><font color="#FF0000"><?php echo $rowtj['alluu']?>个</font></td>
</tr>
<tr class="white">
<td class="text-right">直接好友</td>
<td><font color="#FF0000"><?php echo $rownext['alluu2']?>个</font></td>
</tr>
<tr class="white">
<td width="30%" class="text-right">已加好友</td>
<td><font color="#FF0000"><?php echo $row3['alluu3']?>个</font></td>
</tr>
<tr class="white">
<td width="30%" class="text-right">关联好友</td>
<td><font color="#FF0000"><?php echo $rowallbao['usernum']?>个</font> <br />
<span class="text-blue">(最高<?php echo $zuigao1?>星)</span> <br />
<span class="text-blue" style="color:#C6F">(最高<?php echo $zuigao2?>星)</span> <br />
<span class="text-blue" style="color:#063">(最高<?php echo $zuigao3?>星)</span></td>
</tr>
</table>
<br />
<div class="text-center"><button class="button bg-yellow" type="button" onclick="location.href='reg.php?ic=<?php echo $rowuser['suijima']?>'">我要邀请好友</button></div>
</div>
</div>
<br />
<div class="panel">
<div class="panel-head"><strong>邀请的好友</strong></div>
<div class="panel-body bg-white">
<table class="table table-bordered">
<tr class="blue">
<th class="text-center">会员</th>
<th width="45%" class="text-center">微信/手机</th>
<th width="80" class="text-center">操作</th>
</tr>
<?
$sql="select * from users where rid='".$rowuser['id']."' order by id desc";
$query=$db->query($sql);
while($row=$db->fetch_array($query))
{
?>
<tr class="white">
<td class=" text-gray" style="padding:0px"><?php echo $row['nickname']?><br /><font class="text-yellow">(<?php echo userjibiename($row['standardlevel'])?>)</font></td>
<td class=" text-gray" style="padding:0px"><font class="text-yellow"><?php echo $row['wechat']?></font><br /><font class="text-blue"><?php echo $row['loginname']?></font></td>
<td class=" text-gray" style="padding:0px">
<form method="post" class="form form-block" target="formprocess">
<input type="hidden" value="resetpwd" name="action" />
<input type="hidden" value="<?php echo $row['id']?>" name="id" />
<button type="submit" class="button button-small button-reset" >重置密码</button>
</form>
</td>
</tr>
<?php }?>
</table>
</div>
</div>
<br />
<div class="panel">
<div class="panel-head"><strong>直接好友</strong></div>
<div class="panel-body bg-white">
<table class="table table-bordered">
<tr class="blue">
<th class="text-center">会员</th>
<th width="30%" class="text-center">微信号</th>
<th width="40%" class="text-center">手机号</th>
</tr>
<?
$sql="select * from users where pid='".$rowuser['id']."' order by id desc";
$query=$db->query($sql);
while($row=$db->fetch_array($query))
{
?>
<tr class="white">
<td class="" style="padding:0px"><?php echo $row['nickname']?><br /><font class="text-yellow"><?php echo userjibiename($row['standardlevel'])?></font><? if($row['pid']!=$row['rid']){?><br /><span class="tag bg-yellow">自动</span><? }?></td>
<td class="" style="padding:0px" align="center"><font class="text-yellow"><?php echo $row['wechat']?></font></td>
<td class="" style="padding:0px"><font class="text-blue"><?php echo $row['loginname']?></font></td>
</tr>
<?php }?>
</table>
</div>
</div>
</div>
<iframe src="null.html" name="formprocess" style="display:none;"></iframe>
<br />
<?php
require_once("foot.php");
?>
</div>
<script>
$('.button-reset').click(function(){
return confirm('确定要重置该会员的密码吗?');
});
</script>
</body>
</html>