杏林同学录(九)

班级成员留言簿管理: class/notebook/delnote.php

1   
2session_start();   
3if(!session_is_registered("superlogin"))//检查是否注册   
4{   
5echo "

<a href="../../superadmin.php">请重新进行管理员登陆<br/>";
exit;
}
include ("../config.php");
if($del==1){ //判断是否要删除
mysql_query("delete from notebook where time='$time'",$db); //以留言时间为删除标志
echo "删除成功!";
}

 1<html>
 2<head>
 3<meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
 4<title>删除留言</title>
 5<style type="text/css">   
 6<!--   
 7.blue9 { font-size: 9pt; color: #0099FF; text-decoration: none}   
 8.black9 { font-size: 9pt; text-decoration: none}   
 9.purple10 { font-size: 10pt; color: #9900FF; text-decoration: none}   
10.white12 { font-size: 12pt; color: #FFFFFF; text-decoration: none}   
11a:visited { color: #FFFFFF}   
12a:link { color: #FFFFFF}   
13\-->   
14</style>
15</head>
16<body bgcolor="#FFFFFF">   

$result = mysql_query("SELECT * FROM notebook",$db);
$row=mysql_num_rows($result);//查看结果有多少行
$max=$row; //帖子总数
//设每页显示10篇,$p总页数,$page第几页,$low 从第几行开始读,$x 读取几行
if (!$page){$page=1;}
$p=ceil($max/10);
$low=10*($page-1);
if($page==$p&amp;&amp;($max%10)&lt;&gt;0){$x=($max%10);} else {$x=10;}//如果是最后一页,且不是10的整倍数,读取$max除以10的余数,否则取10
if($max==0){$x=0;}//如果没有帖子,$x取0
$result = mysql_query("select * from notebook ORDER BY time DESC limit $low,$x",$db);

 1<table border="0" cellpadding="0" cellspacing="0" height="61" width="98%">
 2<tr>
 3<td height="62" width="34%"><img border="0" height="60" src="../image/classlogo.gif" width="224"/></td>
 4<td height="62" width="66%">
 5<div align="center"><img height="60" src="../image/note.gif" width="410"/><img height="60" src="../image/y1.gif" width="60"/></div>
 6</td>
 7</tr>
 8</table>
 9<table align="center" border="1" bordercolordark="#FFFFFF" bordercolorlight="#003399" cellpadding="0" cellspacing="0" height="253" width="95%">
10<tr>
11<td height="250">
12<table bgcolor="#3366FF" border="0" cellpadding="0" cellspacing="0" height="32" width="95%">
13<tr>
14<td class="white12" width="28%"><a class="white12" href="../guest.php">首页</a>   
15&gt; <a class="white12" href="index.php">留言簿</a></td>
16<td class="white12" width="56%">   

echo "帖子总数:  ",$max,"   第";
for ($n=1;$n&lt;=$p;$n++){
echo "<a href="index.php?page=$n">$n</a> ";
}
echo "页";

1</td>
2<td width="16%"><a class="white12" href="index.php">查看留言</a></td>
3</tr>
4</table>   

for ($i=0;$i&lt;=($x-1);$i++) {
$user=mysql_result($result,$i,'user');
$time=mysql_result($result,$i,'time');
$ip=mysql_result($result,$i,'ip');
$title=mysql_result($result,$i,'title');
$nnote=mysql_result($result,$i,'nnote');
$yresult = mysql_query("SELECT * FROM user where user='$user'",$db);//读取成员数据库
$name=mysql_result($yresult,0,'name');
$signature=mysql_result($yresult,0,'signature');//读取个人签名
$email=mysql_result($yresult,0,'email');
$face=mysql_result($yresult,0,'face');
$face='../image/face/icon'.$face;
echo "<table border="0" bordercolor="#FFFFFF" cellpadding="0" cellspacing="0" height="107'" width="100%"> <tr bgcolor="#eeeeee">";
echo "<td bgcolor="#eeeeee" class="blue9" height="33" width="10%"> <img height="32" src="$face.gif" width="32"/></td>";
echo "<td bgcolor="#eeeeee" class="blue9" height="33" width="16%">留言人:$name</td>";
echo "<td bgcolor="#eeeeee" class="blue9" height="33" width="41%">发表于:$time</td>";
echo "<td bgcolor="#eeeeee" class="blue9" height="33" width="12%"><a href="mailto:$email"><img border="0" height="16" src="../image/email.gif" width="16"/></a></td>";
echo "<td class="blue9" height="33" width="21%"><img height="15" src="../image/ip.gif" width="13"/>  $ip <a href="$PHP_SELF?del=1&amp;time=$time"><img border="0" height="16" src="../image/del.gif" width="16"/></a></td> </tr> <tr>";
echo "<td class="purple10" colspan="5" height="33">标题:$title</td> </tr>";
echo "<tr bgcolor="#ffffff"><td class="black9" colspan="5" height="37">留言内容:$nnote</td></tr></table>";
}
mysql_close($db);

1</td>
2</tr>
3</table>
4</body>
5</html>   
6客人留言簿管理: class/notebookg/delnote.php   

session_start();
if(!session_is_registered("superlogin"))//检查是否注册
{
echo "<a href="../../superadmin.php">请重新进行管理员登陆<br/>";
exit;
}
include ("../config.php");
if($del==1){ //判断是否要删除
mysql_query("delete from notebookg where time='$time'",$db); //以留言时间为删除标志
echo "删除成功!";
}

 1<html>
 2<head>
 3<meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
 4<title>删除留言</title>
 5<style type="text/css">   
 6<!--   
 7.blue9 { font-size: 9pt; color: #0099FF; text-decoration: none}   
 8.black9 { font-size: 9pt; text-decoration: none}   
 9.purple10 { font-size: 10pt; color: #9900FF; text-decoration: none}   
10.white12 { font-size: 12pt; color: #FFFFFF; text-decoration: none}   
11a:visited { color: #FFFFFF}   
12a:link { color: #FFFFFF}   
13\-->   
14</style>
15</head>
16<body bgcolor="#FFFFFF">   

$result = mysql_query("SELECT * FROM notebookg ",$db);
$row=mysql_num_rows($result);//查看结果有多少行
$max=$row; //帖子总数
//设每页显示10篇,$p总页数,$page第几页,$low 从第几行开始读,$x 读取几行
if (!$page){$page=1;}
$p=ceil($max/10);
$low=10*($page-1);
if($page==$p&amp;&amp;($max%10)&lt;&gt;0){$x=($max%10);} else {$x=10;}//如果是最后一页,且不是10的整倍数,读取$max除以10的余数,否则取10
if($max==0){$x=0;}//如果没有帖子,$x取0
$result = mysql_query("select * from notebookg ORDER BY time DESC limit $low,$x",$db);

 1<table border="0" cellpadding="0" cellspacing="0" height="61" width="98%">
 2<tr>
 3<td height="62" width="34%"><img border="0" height="60" src="../image/classlogo.gif" width="224"/></td>
 4<td height="62" width="66%">
 5<div align="center"><img height="60" src="../image/note.gif" width="410"/><img height="60" src="../image/y1.gif" width="60"/></div>
 6</td>
 7</tr>
 8</table>
 9<table align="center" border="1" bordercolordark="#FFFFFF" bordercolorlight="#003399" cellpadding="0" cellspacing="0" height="253" width="95%">
10<tr>
11<td height="250">
12<table bgcolor="#3366FF" border="0" cellpadding="0" cellspacing="0" height="32" width="95%">
13<tr>
14<td class="white12" width="28%"><a class="white12" href="../guest.php">首页</a>   
15&gt; <a class="white12" href="index.php">留言簿</a></td>
16<td class="white12" width="56%">   

echo "帖子总数:  ",$max,"   第";
for ($n=1;$n&lt;=$p;$n++){
echo "<a href="index.php?page=$n">$n</a> ";
}
echo "页";

1</td>
2<td width="16%"><a class="white12" href="index.php">查看留言</a></td>
3</tr>
4</table>   

for ($i=0;$i&lt;=($x-1);$i++) {
$email=mysql_result($result,$i,'email');
$face=mysql_result($result,$i,'face');
$face='../image/face/icon'.$face;
$name=mysql_result($result,$i,'name');
$time=mysql_result($result,$i,'time');
$ip=mysql_result($result,$i,'ip');
$title=mysql_result($result,$i,'title');
$nnote=mysql_result($result,$i,'nnote');
echo "<table border="0" bordercolor="#FFFFFF" cellpadding="0" cellspacing="0" height="107'" width="100%"> <tr bgcolor="#eeeeee">";
echo "<td bgcolor="#eeeeee" class="blue9" height="33" width="10%"> <img height="32" src="$face.gif" width="32"/></td>";
echo "<td bgcolor="#eeeeee" class="blue9" height="33" width="16%">留言人:$name</td>";
echo "<td bgcolor="#eeeeee" class="blue9" height="33" width="41%">发表于:$time</td>";
echo "<td bgcolor="#eeeeee" class="blue9" height="33" width="12%"><a href="mailto:$email"><img border="0" height="16" src="../image/email.gif" width="16"/></a></td>";
echo "<td class="blue9" height="33" width="21%"><img height="15" src="../image/ip.gif" width="13"/>  $ip <a href="$PHP_SELF?del=1&amp;time=$time"><img border="0" height="16" src="../image/del.gif" width="16"/></a></td> </tr> <tr>";
echo "<td class="purple10" colspan="5" height="33">标题:$title</td> </tr>";
echo "<tr bgcolor="#ffffff"><td class="black9" colspan="5" height="37">留言内容:$nnote</td></tr></table>";
}
mysql_close($db);

1</td>
2</tr>
3</table>
4</body>
5</html></a></a>
Published At
Categories with Web编程
Tagged with
comments powered by Disqus