-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshowuserinfo.php
63 lines (60 loc) · 2.25 KB
/
showuserinfo.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<link rel="stylesheet" type="text/css" href="/assets/bootstrap.min.css" />
<title>用户信息展示</title>
<style type="text/css"></style>
<?php
session_start();
include_once "/common/strap.php";
include_once "/common/conn.php";
if (empty($_SESSION['username'])){
echo"<script type="."\""."text/javascript"."\"".">"."window.location="."\""."../index.php"."\""."</script>";
}
else{
$username = $_SESSION['username'];
$sqlpass="SELECT password from userinfo where username='{$username}'";
foreach($pdo->query($sqlpass) as $row)
{
$password = base64_decode($row['password']);
break;
}
}
?>
<script>
</script>
</head>
<body>
<br><br><br>
<div class="page" width="50%">
<div text-align:right;>
<span class='label label-success' name="username" id="username">当前用户:<?php echo $username; ?></span>
</div>
<br><br>
<table width="50%" cellspacing="0" cellpadding="0" border="1" style="width:50%;table-layout:fixed">
<tr height="40px" bgcolor="#0099FF">
<th style='width:200px;'>账户</th>
<th style='width:200px;'>密码</th>
<th style='width:200px;'>操作</th>
</tr>
<?php
$sql = "SELECT `uid`, `username`, `password` FROM `userinfo` WHERE 1";
foreach ($pdo->query($sql) as $row){
echo "<tr height='50px'>";
echo "<td>{$row['username']}</td>";
echo "<td>{$row['password']}</td>";
echo "<td style='width:6%;table-layout:fixed'>
<a href='edit.php?uid={$row['uid']}'>修改</a>
<a href='drop.php?uid={$row['uid']}'>删除</a>
</td>";
echo "</tr>";
}
?>
</table>
</div>
<script type="text/javascript" src="/assets/jquery.min.js"></script>
<script type="text/javascript" src="/assets/bootstrap.min.js"></script>
</body>
</html>