📄 message.php
字号:
<?php
require_once("functions/login_flag.php");//是否已经登录
require_once("functions/class_mysql.php");//加载数据库类文件
include_once("configs/Configs.php");//加载配置文件;
include_once("all_processing.php");//加载所有进程;
//更新消息通知
if($_GET['e_type']=="2"){
$query=$db->query("select p_nickname from player_info where `u_id`='".$_COOKIE['UserId']."' ");
$nickname = $db->fetch_array($query);
$db->query("update e_mail set `notice`='1' where `e_username`='".$nickname['p_nickname']."'");
}
if( isset($_GET['page']) ){
$page = intval( $_GET['page'] );
}
else{
$page = 1;
}
$page_size = 20;
$pquery=$db->query("select count(*) as id from e_mail where `e_username` ='".$_COOKIE['NickName']."';");
$p_num=$db->fetch_array($pquery);
$amount=$p_num['id'];
if( $amount )
{
if( $amount < $page_size )
{
$page_count = 1;
}
if( $amount % $page_size )
{
$page_count = (int)($amount/$page_size) + 1;
}else
{
$page_count = $amount/$page_size;
}
}else
{
$page_count = 0;
}
?>
<!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="css/id.css" rel="stylesheet" type="text/css">
<link href="css/css.css" rel="stylesheet" type="text/css">
<link type="text/css" href="css/build.css" rel="stylesheet">
<style>
body{
margin-top:0px;
}
</style>
</head>
<body>
<script type="text/javascript">
<!-- // 说明:Javascript 控制 CheckBox 的全选与取消全选 // -->
function checkAll(name)
{
var el = document.getElementsByTagName('input');
var len = el.length;
for(var i=0; i<len; i++)
{
if((el[i].type=="checkbox") && (el[i].name==name))
{
el[i].checked = true;
}
}
}
function clearAll(name)
{
var el = document.getElementsByTagName('input');
var len = el.length;
for(var i=0; i<len; i++)
{
if((el[i].type=="checkbox") && (el[i].name==name))
{
el[i].checked = false;
}
}
}
function del(){
var name=confirm("确定要删除吗?")
if (name==true)
{
return true;
}
else
{
return false;
}
}
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
</script>
<!--导航-->
<?php require_once("diplomatism_daohang.htm");?>
<div id="mb_01">
<div class="page_build_title">讯息管理</div>
</div>
<div id="mb_04">
<!--替换区域开始-->
<table width="90%" align="center" style="margin-top:15px;">
<tr >
<td width="20%" height="25" ><span style="color:#ffffff; font-weight:bold;"><a href="?e_type=1"
<?php
if ($_GET['e_type']==1) {
echo 'style="color:RED;"';
}
?>
target="_self">任务信息</a></span></td>
<td width="20%" height="25" ><span style="color:#ffffff; font-weight:bold;"><a href="war_result_list.php?type=war" target="_self">战报信息</a></span></td>
<td width="20%" height="25" ><span style="color:#ffffff; font-weight:bold;"><a href="war_result_list.php?type=lurcher" target="_self">间谍信息</span></a></td>
<td width="20%" height="25"><span style="color:#ffffff; font-weight:bold;"><a href="?e_type=2" target="_self"
<?php
if ($_GET['e_type']==2) {
echo 'style="color:RED;"';
}
?>
>收 件 箱</a></span></td>
<td width="20%" height="25" ><span style="color:#ffffff; font-weight:bold;"><a href="message_put.php">写信</a></span></td>
</tr>
</table>
<table width="90%" border=1 cellpadding=1 cellspacing=0 style="margin-top:0px; border-collapse:collapse;border:1px solid threeddarkshadow" bordercolor="threeddarkshadow" align="center">
<tr>
<td width="6%" height="25" ><span class="STYLE1">标记</span></td>
<td width="41%" height="25" align="left"><span class="STYLE3">信件标题</span></td>
<td width="20%" height="25" ><span class="STYLE3">发 信 人</span></td>
<td width="18%" ><span class="STYLE3">时 间</span></td>
<td width="15%" height="25" ><span class="STYLE3">删 除</span></td>
</tr>
<?php
$query=$db->query("SELECT * FROM e_mail where `e_username` ='".$_COOKIE['NickName']."' order by `e_times` desc ,`e_read` desc limit ".($page-1)*$page_size.",".$page_size);
while ($list=$db->fetch_array($query)) {
$id=$list['id'];
?>
<form name="form1" method="POST" action="dele_message.php?type=all_del&e_type=<?php echo $_GET['e_type'];?>">
<tr>
<td height="25"><div align="center">
<input type="checkbox" name="item[]" value="<?php echo $id;?>" />
</div></td>
<td height="25" align="left"><a href="message_con.php?id=<?php echo $id;?>"><?php
if ($list['e_read']==0) {
echo "<font color=\"red\">[未读]</font>";
}else {
echo "[己读]";
}
?><?php echo $list['e_title'];?></a></td>
<td height="25"><?php echo $list['e_name'];?></td>
<td><?php echo date('Y-m-d H:i:s',$list['e_times']);?></td>
<td height="25"><a href="message_put.php?e_username=<?php echo $list['e_name'];?>&m_id=<?php echo $list['id'];?>"><img alt="回复发件人" src="images/yw/pub.gif" border="0"/></a> <a href="dele_message.php?id=<?php echo $id;?>&type=one_del" onclick="return del();"><img alt="删除信件" src="images/yw/del.gif" border="0"/></a> <a href="add_friend.php?e_name=<?php echo $list['e_name'];?>"><img alt="加为好友" src="images/yw/update.gif" border="0"/></a></td>
</tr>
<?php
}
?>
<tr>
<td height="30" colspan="6"><div align="right"><a href="javascript:checkAll('item[]')" >全选</a>/<a href="javascript:clearAll('item[]')" >取消</a> <input type="submit" value="删除所选信件" /> </div></td>
</tr>
</form>
</table>
<form name="form2" id="form2">
<?php
$page_string = '';
if( $page == 1 )
{
$page_string= '第一页|上一页|';
echo $page_string;
}else
{
$page_string= '<a href="message.php?page=1&e_type='.$_GET['e_type'].'">第一页</a>|<a href="message.php?page='.($page-1).'&e_type='.$_GET['e_type'].'">上一页</a>';
echo $page_string;
}
if( ($page == $page_count) || ($page_count == 0) )
{
$page_string= '下一页|尾页';
echo $page_string;
}else
{
$page_string= '<a href="message.php?page='.($page+1).'&e_type='.$_GET['e_type'].'">下一页</a>|<a href="message.php?page='.$page_count.'&e_type='.$_GET['e_type'].'">尾页</a>';
echo $page_string;
}
?>
<select name="menu1" onchange="MM_jumpMenu('self',this,0)">
<option value="?<?php
if ($_GET['e_type']==1) {
echo 'e_type=1';
}else
echo 'e_type=2';
?>">-</option>
<?php
$i=1;
while($i<=$page_count)
{?>
<option value="<?php echo "message.php?page=".$i."&e_type=".$_GET['e_type']; ?>"
<?php if ($_GET['page']==$i) {
echo 'selected="selected"';
}?>
><?php echo $i;?></option>
<?php
$i++;
}?>
</select>
</form>
<!--替换区域结束-->
<div style="padding-bottom:<?php echo 260-count($p_num)*20;?>px;"> </div>
</div>
</div>
<div id="mb_03"></div>
</body>
</html>
<?php
if($_GET['from']=="notice"){
echo "<script>";
echo "parent.function_area.refresh_area_page();";
echo "</script>";
}
$db->close();
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -