www.gusucode.com > 仿51.com的php源码 1.1 > User/LeaveWordToOther.php

    <?php
include("CheckLogined.php");
include("../include/dbclass.php");
include("../include/global.php");
require_once "../include/page.php";
$dbc=new DbConn();
$uid=$_COOKIE["uid"];
$page=(int)$_GET["page"];
$key=$_GET["key"];
$maxline = 10;
$deferentparameter="&key=".$key;
//删除
if($_GET["action"]=="delComment")
{
$id=$_GET["id"];
$key=$_GET["key"];
$page=$_GET["page"];

if(strlen(strrchr(strtolower($id), ','))>0)
{
	$split_img = explode(',',$id);
	$extcount = count($split_img);
		for($i=0;$i<$extcount;$i++)
		{
		$newid=$split_img[$i];
		//echo $newid;
		$sql="delete from guestbook where User_Account='$uid' and id='$newid'";
		$dbc->Execute($sql);
		}
header("Location:LeaveWordToOther.php?page=$page&key=$key");
}
else
{
$sql="delete from guestbook where User_Account='$uid' and id='$id'";
$dbc->Execute($sql);
header("Location:LeaveWordToOther.php?page=$page&key=$key");
}
}
//单独删除个别
if($_GET["action"]=="del")
{
$id=$_GET["id"];
$page=$_GET["page"];
$sql="delete from guestbook where User_Account='$uid' and id='$id'";
$dbc->Execute($sql);
header("Location:LeaveWordToOther.php?page=$page&key=$key");
}


?>
<!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=gb2312" />
<title>档案管理中心- 留言</title>
<link href="../images/User_Main.css" rel="stylesheet" type="text/css" />
<script>
try{
	if(top!=window){
		document.domain	="www.wu-liao.com";		
	}else{
		top.location.href="/webin.php?refer=%2FUser%2FLeaveWordToOther.php";
	}
}catch(e){}
function showNewMessage(user){
	top.showNewMessage(user);
}

</script>
<script language="JavaScript">
function setopen(v)
{


location.href="LeaveWordToOther.php?action=setopen&value="+v;


}
function selectItem(obj,s){
if(s){
obj.parentElement.bgColor="#ffcc00";
}
else{
obj.parentElement.bgColor="#efefef";
}
}
function selectAll()
{
var acb_status = document.all("acb").checked;
var cbs=document.all("cb");
if(!cbs) return;
if(cbs.length)
{
for(var i=0;i<cbs.length;i++)
{
cbs.item(i).checked = acb_status;
}
}
else
document.all("cb").checked = acb_status;
}
function joinValue()
{
var cbs=document.all("cb");
if(!cbs) return;
document.all("arg").value="";
//alert(cbs.length);
if(cbs.length)
{
for(var i=0;i<cbs.length;i++)
if(cbs.item(i).checked)
{
document.all("arg").value+=(cbs.item(i).value+",");
}
document.all("arg").value=document.all("arg").value.substring(0,document.all("arg").value.length-1);
}
else
{
if(cbs.checked)
{
document.all("arg").value=cbs.value;
}
}
}
function init()
{
var cbs=document.all("cb");
if(!cbs) return;
if(!cbs.length && document.all("acb"))
{
document.all("acb").disabled=true;
}
}
function delList()
{
	if(document.all("acb").disabled==true) return;
		joinValue();
	if(document.all("arg").value)
	{
		if(confirm("确认删除所选的评论么?"))
		{
			window.self.location="?action=delComment&id=" + document.all("arg").value + "&page=<?php echo $page; ?>&key=<?php echo $key; ?>";
		}
	}
	else
	{
		alert('选择不能为空!');
	}
	return false;
}
</script>
<script src="../js/global.js" language="javascript"></script>
<div id="face" style="display:none; position:absolute; width:260px; height:276px;"></div>
</head>
<body>
<div id="top">
<div id="logo"><a href="/User/Main.php"></a></div>
<div id="topr">
<div id="exit"><?php require("../menu.php"); ?>
<div id="menu">
<div class="m2">
<div class="mg"><a href="/User/Main.php">用户管理中心</a></div>
<div class="mh"><a href="/Diary/DiaryList.php">日记文集</a></div>
<div class="ma"><a href="/Photo/PhotoList.php">相册</a></div>
<div class="ma"><a href="/Image/ImageList.php">图库</a></div>
<div class="mb"><a href="/Music/MusicList.php">音乐</a></div>
<div class="mc"><div id="ms"><a href="/Memo/MemoList.php"><img src="../images/suo2.gif" width="10" height="12" />&nbsp;秘密记事本</a></div>
</div>
<div class="me"><a href="/Fav/FavList.php">网址收藏夹</a></div>
<div class="mf"><a href="/Addr/AddrList.php">通讯录</a></div>
</div>
</div>
</div>
<div id="nav">
<div id="navt"></div>
</div>
<div id="mjx"></div>
<div id="main">
<div id=left>
<div id=leph>
<div class=phff>
<div class=phtt>收件箱</div>
<?php include("../ToMeMenu.php"); ?>
</div>
</div>
</div>

<div id="right">
<div id="a4n">

<script src="../js/face.js" language="JavaScript"></script>
<div class="anphg">
<div class="a5"><a href="LeaveWordToMe.php">别人给我的留言</a><?php
$sql="select id from guestbook where Readed='0' and UserName='$uid'";
$rs=$dbc->getRs($sql);
if ($rs !=null)
{
?>
<span style='margin-left:2px;color:red'>(新)</span><?php } ?></div>
<div class="a5" id="l">我给别人的留言</div>
</div>
<div id="txss">
<form>
<div class="txyy">用户名:
<input name="key" type="text" class="text" value="<?php echo $key; ?>" />
<input name="Submit" type="submit" class="btn" value="搜 索" />
</div>
</form>
</div>
</div>
<div id="fenle">

<script language="javascript">
function deleteItemConfirm(id, msg)
{
	if(confirm(msg))
	{
		window.self.location="?action=del&id=" + id+"&page=<?php echo $page; ?>";
	}
}
</script>
<div id="fenle">
<div class="olcz"><a href="MyAccessRight.php">如何防骚扰?点此查看</a><br/>提示:留言人有权删除他给您的留言.所以,当您看到留言减少时,属正常现象.</div>
<form name="form1" method="post" action="?action=dellist&page=">
<input type="Hidden" name="arg">
</form>
<!-- BEGIN FieldView:UcLeaveWordToOther -->


<?php
//更新数据库把没有看的都设为看了
$sqlread="update guestbook set Replayed='0' where User_Account='$uid'";
$dbc->Execute($sqlread);

if($key=="")
{
$sql="select * from guestbook where User_Account='$uid' order by Guest_AddDate desc";
}
else
{
$sql="select * from  guestbook where UserName like '%$key%' and User_Account='$uid' order by Guest_AddDate desc";
}

$news = $dbc->getGopageRs($sql,$maxline);
  //echo "$sql";
$gopage = new GoPage($dbc->tpages,$dbc->total);//建立翻页程序
$backurl = "LeaveWordToOther.php?".$dbc->getParameter();
for($i=0;$i<$dbc->num_rows;$i++)
{?>
<script src='../1e/<?php echo $news[$i]["UserName"]; ?>/<?php echo $news[$i]["UserName"]; ?>.js'></script>

	<script>
	var ImgShow='<img src=../images/loadface.gif border=0 width=80 height=90>';
	if(typeof(<?php echo $news[$i]["UserName"]; ?>_photo)!='undefined')
	{
		var ImgShow='<img src='+<?php echo $news[$i]["UserName"]; ?>_photo+' border=0 class=photo width=80 onLoad=reloadImage(this)>';
	}
	</script>
	
<table width="570" border="0" cellpadding="0" cellspacing="0" class="lyts">
<tr>
<td height="30" colspan="3" class="lyjp" style="border-bottom:1px dashed #cccccc"><div class="stlya">
<input type="checkbox" onclick='selectItem(this.parentElement,this.checked)' name='cb' value='<?php echo $news[$i]["id"]; ?>' />
<a target='_blank' href='/home.php?user=<?php echo $news[$i]["UserName"]; ?>' title='点击查看<?php echo $news[$i]["UserName"]; ?>的个人主页'><?php echo $news[$i]["UserName"]; ?></a>&nbsp;</div>
<div class="stlyc"></div>
<div class="stlyb"></div>
<div class="stlyd"><span  class="stlyc"><?php echo $news[$i]["Guest_AddDate"]; ?>&nbsp;&nbsp;</span>&nbsp;
<a style='font-size:9pt' onclick="deleteItemConfirm('<?php echo $news[$i]["id"]; ?>', '确定要删除这条留言么?');" href='#no' style="color:#0000cc;font-weight:bold">[删除]</a>
&nbsp;&nbsp;
</div>
</td>
</tr>
<tr id="div0">
<td width="114" height="120">
<a href='/home.php?user=<?php echo $news[$i]["UserName"]; ?>' target='_blank' title='点击查看<?php echo $news[$i]["UserName"]; ?>的个人主页'><script>document.write(ImgShow);</script></a>
</td>
<td width="356"><div class="mebao"><?php echo ubb($news[$i]["Guest_Memo"]); ?><?php if ($news[$i]["Replay_Memo"]!=null){?><hr noshade size=1 width='50%' align='left'><strong><?php echo $news[$i]["UserName"]; ?> 回复:</strong><?php echo ubb($news[$i]["Replay_Memo"]); ?><?php }?></div></td>
<td width="100">
<a href="#" onclick="window.open('AddFriend.php?user=<?php echo $news[$i]["UserName"]; ?>', 'AddFriend', 'height=200, width=350, left=100, top=150, screenX=200, screenY=200, toolbar=no, menubar=no, scrollbars=yes, resizable=no, location=no, status=no, z-look=yes');return false;">加为好友</a><br />
<a onclick="return confirm('确定要将【<?php echo $news[$i]["UserName"]; ?>】列入黑名单吗?以后将不能接收到此会员发送的消息和留言!')" href='?action=stop&to=<?php echo $news[$i]["UserName"]; ?>' style='font-size:9pt'>阻止此人</a></td>
</tr>
</table>
<div class="plhf" id="reform_<?php echo $news[$i]["id"]; ?>" style="display:none;"></div>

<?php }?>
<!-- END FieldView:UcLeaveWordToOther -->


<div class="qlcz">
<input type='Checkbox' name='acb' onclick='selectAll()' id="selectall" />
<label for="selectall">全选</label>&nbsp;&nbsp;
<a href="###" onclick='delList()'>删除所选留言</a>
</div>


</div>
<!-- 分页 -->
<div class="stsc">
<div class="fenye">
<?=$gopage->style(3)?>  &nbsp;&nbsp;&nbsp; </div>
</div>

</div>
</div>
</div>
<div id="bottom">
<div id="baidu" style="color:#a0a0a0;"><?php require("../foot.php"); ?></div>
</div>

</body>
</html>