-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadmin.php
More file actions
73 lines (60 loc) · 2.01 KB
/
Copy pathadmin.php
File metadata and controls
73 lines (60 loc) · 2.01 KB
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
<?php
//require 'password.php';
require 'dbConfig.php';
$mysqli = new mysqli($dbIp, $dbUser, $dbPwd);
if ($mysqli->connect_errno) {
print('<p>连接数据库发生错误。</p>' . $mysqli->connect_error);
exit();
}
$mysqli->select_db($dbNm);
$mysqli->set_charset('utf8');
// $mysqli->query("SET timezone = '+8:00'");
// mysql_set_charset('utf8');
// $mysqli->select_db($dbNm);
$query = "SELECT A.avatar as avatar, A.name as name, A.realName as realName, B.checkinTime as checkinTime FROM $dbUserTbl as A, $dbChkinTbl as B WHERE A.id = B.userId order by B.checkinTime desc";
$result = $mysqli->query($query);
if (!$result) {
print('查询数据库失败。' . $mysqli->error);
$mysqli->close();
exit();
}
?>
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>签到情况</title>
</head>
<body>
<!--
<form id="loginForm" name="loginForm" action="" method="POST">
<fieldset>
<legend>登录</legend>
<div><?php echo $errorMessage ?></div>
<label for="userid">用户名</label><input type="text" id="userid" name="userid" value="<?php echo htmlspecialchars($_POST["userid"], ENT_QUOTES); ?>">
<br>
<label for="password">密码</label><input type="password" id="password" name="password" value="">
<br>
<input type="submit" id="login" name="login" value="登录">
</fieldset>
</form>
<a href="regist.html">注册用户</a>
-->
<table border="1" cellspacing="0" >
<tr><td>头像</td><td>昵称</td><td>真名</td><td>签到时间</td></tr>
<?php
while ($row = $result->fetch_assoc()) {
$imgSrc = "";
if($row['avatar'] != null || $row['avatar'] != ""){
$imgSrc = "<img width='30' height='30' src=". $row['avatar'] .">";
}
echo "<tr><td>" . $imgSrc . "</td><td>" . $row['name'] . "</td><td>" . $row['realName'] . "</td><td>". $row['checkinTime'] . "</td></tr>";
//echo $row['avatar'] . "-" . $row['name'] . "-" .$row['checkinTime'] . "-";
}
?>
</table>
</body>
</html>
<?php
$mysqli->close();
?>