<?php include_once '../stuservice.class.php'; session_start(); $name = $_session['admin_name']; if($name == "") { header("location: admin_login.php?error=1"); exit(); } $pagesize = 12; $pagenow = 1; $pagecount = 0; $service = new stuservice(); $pagecount = $service->getpagecount($pagesize); if(!empty($_get['pagenow'])) { $pagenow=$_get['pagenow']; } $stulist = $service->getstulist($pagesize, $pagenow); ?> <!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> </head> <body background="../pic/bg.gif"> <form action="adminstudentlist.php" method="get"> <table width="767" height="644" border="0" align="center"> <tr> <td height="228" colspan="5" background="../pic/top.gif" /> </tr> <tr> <td height="22" colspan="5" background="../pic/in_01.gif" /> </tr> <tr> <td height="28" background="../pic/in_20.gif" /> <td background="../pic/in_20.gif">学生id号</td> <td background="../pic/in_20.gif">学生姓名</td> <td background="../pic/in_20.gif">学生密码</td> <td background="../pic/in_20.gif">修改用户</td> <td background="../pic/in_20.gif">删除用户</td> </tr> <?php for($i = 0; $i < count($stulist); ++$i) { $row=$stulist[$i]; //取出第i行数据,显示出来 $id = $row['stu_id']; $passwd = $row['stu_password']; //学生进来不能看到密码 ?> <tr> <td background="../pic/in_20.gif"></td> <td background="../pic/in_20.gif"><?php echo stripslashes($row['stu_id']);?></td> <td background="../pic/in_20.gif"><?php echo stripslashes($row['stu_name']);?></td> <td background="../pic/in_20.gif"><?php echo stripslashes($passwd); ?></td> <td background="../pic/in_20.gif"><a href="<?php echo "updateuser.php?id=".$id; ?>">修改用户</a></td> <td background="../pic/in_20.gif"><a href="<?php echo "deleteuser.php?id=".$id; ?>">删除用户</a></td> </tr> <?php } echo "<tr>"; echo "<td background='../pic/in_20.gif' />"; echo "<td background='../pic/in_20.gif'>"; //显示上一页和下一页 if($pagenow > 1) { $prepage=$pagenow - 1; echo "<a href='adminstudentlist.php?pagenow=$prepage'>上一页</a> "; echo "<a href='adminstudentlist.php?pagenow=$prepage'>《《</a> "; } echo "</td>"; echo "<td background='../pic/in_20.gif'>"; //中间打印10页选择 for($i=$pagenow; $i < $pagenow+10; ++$i) { if($i <= $pagecount) { echo "<a href='adminstudentlist.php?pagenow=$i'>$i</a> "; } } echo "</td>"; echo "<td background='../pic/in_20.gif'>"; //下一页 if($pagenow < $pagecount) { $nextpage=$pagenow+1; echo "<a href='adminstudentlist.php?pagenow=$nextpage'>》》</a> "; echo "<a href='adminstudentlist.php?pagenow=$nextpage'>下一页</a> "; } echo "</td>"; echo "<td background='../pic/in_20.gif'>"; echo "当前页$pagenow/共{$pagecount}页面"; echo "</td>"; echo "<td background='../pic/in_20.gif'>"; echo "</td>"; echo "</tr>"; ?> <tr> <td background="../pic/in_20.gif"></td> <td background='../pic/in_20.gif'> 跳转到:<input type="text" name="pagenow" /></td> <td background='../pic/in_20.gif'><input type="submit" value="go" /></td> <td background="../pic/in_20.gif"></td> <td background="../pic/in_20.gif"></td> <td background="../pic/in_20.gif"></td> </tr> </table> </form> </body> </html>
预览:
以上就介绍了【php】7、学生管理系统-管理员查看用户,包括了方面的内容,希望对php教程有兴趣的朋友有所帮助。