-
Notifications
You must be signed in to change notification settings - Fork 3
/
tea_info.php
executable file
·83 lines (83 loc) · 2.71 KB
/
tea_info.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
<?php
if (!$userid) Header("Location:".$web_root."/?url=user_login");
if (!$usersort) Header("Location:".$web_root."/");
$infors=$mysqli->query("select * from phpcj_user where id=$userid");
$info=$infors->fetch_array();
if (!$info['username']) {echo "<script>window.location='".$web_root."/'</script>";}
$userclass=$info['mainteacher'];
if (!$userclass) $userclass='否';
else $userclass.='班';
$usergrade=$info['usergrade'];
if ($usergrade) $usergrade=num2text($usergrade);
$logrs=$mysqli->query("select * from phpcj_userlog where username='".$info['username']."' order by id desc limit 1,2");
$log=$logrs->fetch_array();
include("17monipdb/IP.class.php");
$lastip=new IP();
if ($log['username']) {
$logintime=$log['logintime'];
$loginip=$log['loginip'];
if ($loginip=='127.0.0.1') $ipshow='内网';
else {
$ipshow=$lastip->find($loginip);
$ipshow=$ipshow[0].$ipshow[1].$ipshow[2].$ipshow[3];
}
} else {
$logintime='无';
$loginip='无';
$ipshow='无';
}
echo '
<div class="content-wrapper">
<section class="content-header">
<h1>用户信息</h1>
</section>
<section class="content">
<div class="row">
<div class="col-lg-12">
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title"><b>'.$username.'</b> 的个人信息 <a class="btn btn-primary" href="'.$web_root.'/?url=user_password">修改密码</a></h3>
</div>
<div class="box-body">
<div class="col-lg-6">
<div class="table-responsive">
<table class="table table-bordered table-hover">
<tr>
<td>帐号</td>
<td>'.$info['username'].'</td>
</tr>
<tr>
<td>学科</td>
<td>'.$info['usersubject'].'</td>
</tr>
<tr>
<td>年级</td>
<td>'.$usergrade.'</td>
</tr>
<tr>
<td>班主任</td>
<td>'.$userclass.'</td>
</tr>
<tr>
<td>上次登录时间</td>
<td>'.$logintime.'</td>
</tr>
<tr>
<td>上次登录地点</td>
<td>'.$ipshow.'</td>
</tr>
<tr>
<td>上次登录IP</td>
<td>'.$loginip.'</td>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</div>
';
$pagename='用户信息';