<?php 
$bt="用户管理 - 一线印象";
include("../head.php");
include("../conn.php");
include_once("../function.php");
$sid = sqlstr($_COOKIE['dl']);
$uin=mysql_fetch_array(mysql_query("select * from user where sid='$sid'"));
$id=$uin['id'];
if($id!=1){
header("Location:/m/diary/index.php");
exit;
}
$page=sqlstr($_GET['page']);
$max=mysql_num_rows(mysql_query("SELECT * FROM user"));
$p=ceil($max/20);
if(!$page or $page>$p){
$page=1;
}
$low=20*($page-1);//开始查询的条数
$pagesize=20;//每页查询的条数
$rs=mysql_query("SELECT * FROM user ORDER BY id DESC LIMIT {$low},{$pagesize}");//列出最新公开的日记

while($uinfo=mysql_fetch_array($rs)){
$id=$uinfo['id'];
$name=$uinfo['name']; 
echo '<div id="main">ID: '.$id.'<br/>用户名: '.$name.'<br/>邮箱: '.$uinfo["email"].'<br/>QQ: '.$uinfo[qq].'<br/>手机号：'.$uinfo["phone"].'<br/>密码: '.$uinfo["password"].'<br/>注册日期: '.ctime($uinfo["time"]).'<br/>　　<a href="dele.php?id='.$id.'">删除用户！</a></div><br/>';
}

echo '<br/><div class="hui"><center>';
if($max){
if($page>1){
$pag=$page-1;
echo '<center><a href="user.php?page='.$pag.'">上一页</a>　';
} if($page<$p){
$page=$page+1;
echo  '　<a href="user.php?page='.$page.'">下一页</a>';
}
$pa=$page-1;
echo '</center>';
echo '共'.$p.'页/第'.$pa.'页/'.$max.'个用户</div>';
}else{
echo '还没有人注册<br/>';
}




?>

<div id="libbottom" class="ll"><a href="../out.php">登出</a> | <a href="../about.php">关于印象</a><br />浏览：<a href="/">桌面版(开发中)</a><br /><?php echo $showtime=date("m月d日 H:i:s");?><br />© 2013 一线印象</div>



