?? showmyguestbook.php
字號:
<?
session_start();
if(!session_is_registered("Useres")){
echo"<SCRIPT language=JavaScript>\n".
"location.replace('/userlogin.php');".
"</SCRIPT>";
exit;
}
include ("setup.php");
include ("$db_class.php");
$db_class = "".$db_class."_access";
$db = new $db_class;
$ret = $db->DB_connect();
$action=trim($action);
$ddate=strftime("%Y-%m-%d %H:%M:%S");
$sql="select customers_id,customers_gender,customers_firstname,customers_lastname,customers_email_address,customers_password,customers_dob,customers_telephone,Address,byear,bm,bd,edu,projob,wherel,zip,nickname,desc1 from customers where customers_firstname='$Useres'";
$result1=$db->DB_query($sql);
list($customers_id,$customers_gender,$customers_firstname,$customers_lastname,$customers_email_address,$customers_password,$customers_dob,$customers_telephone,$Address,$byear,$bm,$bd,$edu,$projob,$wherel,$zip,$nickname,$desc)=$db->DB_fetch_row($result1);
if($action=="delete"){
if(trim($pid)<>""){
$sql="delete from memberguest where id=$pid and owner='$customers_id'";
$result1=$db->DB_query($sql);
}
echo"<SCRIPT language=JavaScript>\n".
"location.replace('showmyguestbook.php?pageno=$pageno');".
"</SCRIPT>";
exit;
}
?>
<html>
<head>
<title>虞城購物網(wǎng)</title>
<?
include ("top.php");
?>
<table width="778" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td width="12" background="images/csshopleftbg.gif"> </td>
<td width="766">
<table width="766" border="0" cellspacing="1" cellpadding="0" bgcolor="#000000">
<tr>
<td bgcolor="#FFFFFF">
<table width="766" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="200" valign="top">
<table width="200" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
</table>
<?
include ("userleft.php");
?>
</td>
<td width="1" background="images/csshopdotbg.gif"><img src="images/aihuabox.gif" width="1" height="1"></td>
<td width="565" valign=top>
<table width="565" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="images/aihuabox.gif" width="1" height="6"></td>
</tr>
<tr>
<td> 您現(xiàn)在的位置:<a href="/">首頁</a>><a href="/customedit.php">會員中心</a>><a href="/showmyguestbook.php">查看給我的留言</a></td>
</tr>
<tr>
<td><img src="images/aihuabox.gif" width="1" height="6"></td>
</tr>
</table>
<br>
<table border="0" width="100%" cellspacing="1" cellpadding="3" bgcolor="#cccccc" align="center">
<?
$pagesize=10;
if($action=="search"){
$sql1="select id,addtime,isshow,message,username from memberguest where owner=$customers_id and (message like '%$key%' or username like '%$key%') order by id desc";
}else{
$sql1="select id,addtime,isshow,message,username from memberguest where owner=$customers_id order by id desc";
}
$result1=$db->DB_query($sql1);
$rowcount = $db->DB_num_rows($result1);
$pagecount = intval(($rowcount+$pagesize-1)/$pagesize);
if(!isset($pageno)){
$pageno=1;
}
if($pageno<1) $pageno = 1;
if($pageno>$pagecount) $pageno = $pagecount;
$start=($pageno-1)*$pagesize+1;
$end=$pageno*$pagesize;
if($end>$rowcount){
$end=$rowcount;
}
if($start<1){
$start=0;
}
echo" <tr bgcolor=#cccccc>".
" <td colspan=5 valign=TOP>";
echo" 共".$rowcount."個 本頁顯示第$start-".$end."個</font></td> </tr>";
?>
<tr bgcolor='#EFF3F9'>
<form action="showmyguestbook.php?action=search" method="POST">
<td colspan=5 >搜索:<input type=text name=key size=47 value="<?=$key?>"><input type=submit value=提交 name=sendadd></td>
</form>
</tr>
<tr bgcolor="#60718B"><td><font color=white>編號</font></td>
<td><font color=white>內(nèi)容</font></td><td><font color=white>日期</font></td><td><font color=white>發(fā)布人</font></td><td> </td></tr>
<?
if($pageno>0){
$db->DB_data_seek($result1,($pageno-1)*$pagesize) or die("無法定位數(shù)據(jù)!");
$i=0;
$j=$start;
while(($i<$pagesize) and (list($id1,$addtime,$isshow,$message,$username)=$db->DB_fetch_row($result1))){
$i++;
?>
<tr bgcolor='#EFF3F9'><td><?=$j?></td><td><?=$message?></td><td><?=$addtime?></td><td><a href="/entertain/friendlist.php?id=<?=$username?>&action=new"><?=$username?></a></td><td><a href='showmyguestbook.php?pageno=<?=$pageno?>&&action=delete&pid=<?=$id1?>'>刪除</a></td></tr>
<?
$j++;
}
echo" <tr bgcolor=#D9EEE4>".
" <td colspan=8 valign=TOP><p align=CENTER>";
if($pageno>1){
echo "<a href=\"showmyguestbook.php?key=$key&pageno=1\"><font color='000000'>第一頁</font></a> ";
echo "<a href=\"showmyguestbook.php?key=$key&pageno=".($pageno-1)."\"><font color='000000'>上一頁</font></a> ";
}
if($pageno<$pagecount){
echo "<a href=\"showmyguestbook.php?key=$key&pageno=".($pageno+1)."\"><font color='000000'>下一頁</font></a> ";
echo "<a href=\"showmyguestbook.php?key=$key&pageno=".$pagecount."\"><font color='000000'>最后一頁</font></a> ";
}
echo"</td>".
}
$db->DB_close();
?>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<?
include ("bottom.php");
?>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -