<?php
if(!defined('InEmpireCMS'))
{
	exit();
}
?>
<?php
$public_diyr['pagetitle']='消息列表';
$url="<a href=../../../>首页</a>&nbsp;>&nbsp;<a href=../cp/>会员中心</a>&nbsp;>&nbsp;消息列表&nbsp;&nbsp;(<a href='AddMsg/?enews=AddMsg'>发送消息</a>)";
require(ECMS_PATH.'e/template/incfile/header.php');
?>
<script>
function CheckAll(form)
  {
  for (var i=0;i<form.elements.length;i++)
    {
    var e = form.elements[i];
    if (e.name != 'chkall')
       e.checked = form.chkall.checked;
    }
  }
</script> 
<h1 class="head"><a href="<?=$public_r['newsurl']?>e/member/msg/AddMsg/?enews=AddMsg"><span>发送消息</span></a><a href="<?=$public_r['newsurl']?>e/member/msg/"><span>收件箱</span></a>收件箱管理</h1>
        <div class="clear"></div>
     
        <table cellpadding="0" cellspacing="0" width="100%" class="list_table">
        	<thead>
            	<tr>
                	<th colspan="2" align="left">标题</th>
                    <th width="60">发件人</th>
                    <th width="60">状态</th>
                    <th width="60">时间</th>
                </tr>
            </thead>
          <form name="listmsg" method="post" action="../doaction.php" onsubmit="return confirm('确认要删除?');">  <tbody>
            	            
                          <?php
			while($r=$empire->fetch($sql))
			{
				$img="haveread";
				if(!$r[haveread])
				{$img="nohaveread";}
				//后台管理员
				if($r['isadmin'])
				{
					$from_username="<a title='后台管理员'><b>".$r[from_username]."</b></a>";
				}
				else
				{
					$from_username="<a href='../ShowInfo/?userid=".$r[from_userid]."' target='_blank'>".$r[from_username]."</a>";
				}
				//系统信息
				if($r['issys'])
				{
					$from_username="<b>系统消息</b>";
					$r[title]="<b>".$r[title]."</b>";
				}
			?>
            <tr> 
              <td> <div align="center"> 
                  <input name="mid[]" type="checkbox" id="mid[]2" value="<?=$r[mid]?>">
                </div></td>
              <td><a href="ViewMsg/?mid=<?=$r[mid]?>"><?=stripSlashes($r[title])?></a></td>
              <td><div align="center"> 
                  <?=$from_username?>
                </div></td>
                <td><?=$img?></td>
              <td><div align="center"> 
                  <?=$r[msgtime]?>
                </div></td>
             
            </tr>
            <?php
			}
			?>   
            <tr bgcolor="#FFFFFF"> 
            
              <td colspan="6"><input type=checkbox name=chkall value=on onclick=CheckAll(this.form)> <input type="submit" name="Submit2" class="sbtn" value="删除"> 
                <input name="enews" type="hidden" value="DelMsg_all">              </td>
            </tr>
            </tbody>
            <tfoot>
             </form>
            	<tr>
                	<td colspan="20" align="right"><?=$returnpage?>&nbsp;</td>
                </tr>
            </tfoot>
        </table>
   
      
<?php
require(ECMS_PATH.'e/template/incfile/footer.php');
?>