<?php
/*
 * 注意：此文件由tpl_engine编译型模板引擎编译生成。
 * 如果您的模板要进行修改，请修改 templates/default/modules/msgscrip/moutbox.html
 * 如果您的模型要进行修改，请修改 models/modules/msgscrip/moutbox.php
 *
 * 修改完成之后需要您进入后台重新编译，才会重新生成。
 * 如果您开启了debug模式运行，那么您可以省去上面这一步，但是debug模式每次都会判断程序是否更新，debug模式只适合开发调试。
 * 如果您正式运行此程序时，请切换到service模式运行！
 * 
 * 如有您有问题请到官方论坛（http://tech.jooyea.com/bbs/）提问，谢谢您的支持。
 */
?><?php
	//引入模块公共权限过程文件
	require("foundation/module_scrip.php");
	require("foundation/fpages_bar.php");
	
	//引入语言包
	$m_langpackage=new msglp;
	
	//变量获得
	$user_id=get_sess_userid();
	
	//当前页面参数
	$page_num=trim(get_argg('page'));
		
	//定义数据表
	$t_msg_outbox = $tablePreStr."msg_outbox";

	$dbo = new dbex;
	//读写分离定义函数
	dbtarget('r',$dbServs);

	$sql="select * from $t_msg_outbox where user_id='$user_id' order by mess_id desc";
	$dbo->setPages($set_page_data_num,$page_num);//设置分页
	$msg_outbox_rs = $dbo ->getRs($sql);
	$page_total=$dbo->totalPage;//分页总数
	
	$isNull=0;
	$show_data="";
	$content_data_none="content_none";
	if(empty($msg_outbox_rs)){
		$isNull=1;
		$show_data="content_none";
		$content_data_none="";		
	}
?>
<!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=utf-8">
<title></title>
<link rel="stylesheet" type="text/css" href="skin/<?php echo $skinUrl;?>/css/row_menus.css">
<link rel="stylesheet" type="text/css" href="skin/<?php echo $skinUrl;?>/css/iframe.css">
<script language=JavaScript src="skin/default/js/jooyea.js"></script>
<script type='text/javascript'>
	function check_form(){
		var mail_array=document.getElementsByName('attach[]');
		var num=mail_array.length;
		var check_num=0;
		for(array_length=0;array_length<num;array_length++){
			if(mail_array[array_length].checked==true){
				check_num++;
			}
		}
		if(check_num==0){
			parent.Dialog.alert('<?php echo $m_langpackage->m_none_wrong;?>');
		}else{
			parent.Dialog.confirm('<?php echo $m_langpackage->m_del_ask;?>',function(){document.forms[0].submit();});
		}
	}

</script>
</head>
<body>
<div class="main_right_title">
   <span class="main_title_dot4"></span>
   <span class="main_title_txt"><?php echo $m_langpackage->m_title;?></span>
</div>
<div id="tabsB">
  <ul>
    <li><a href="?app=msg_minbox" title="<?php echo $m_langpackage->m_in;?>"><span><?php echo $m_langpackage->m_in;?></span></a></li>
    <li><a href="javascript:void(0)" title="<?php echo $m_langpackage->m_out;?>" class="nowbutl"><span class="nowbutr"><?php echo $m_langpackage->m_out;?></span></a></li>
  </ul>
  <div class="div_but" onclick="location.href='?app=msg_creator'"><?php echo $m_langpackage->m_creat;?></div>
</div>

<form action='do.php?act=msg_del&t=1' method='post' onsubmit='check_form()'>
<table class="<?php echo $show_data;?> msg_table" cellspacing="0" cellpadding="0">
	<thead>
		<tr class="mag_tr">
			<td></td>
			<td><?php echo $m_langpackage->m_state;?></td>
			<td><?php echo $m_langpackage->m_ico;?></td>
			<td><?php echo $m_langpackage->m_to_user;?></td>
			<td><?php echo $m_langpackage->m_tit;?></td>
			<td><?php echo $m_langpackage->m_time;?></td>
			<td><?php echo $m_langpackage->m_del;?></td>
		</tr>
	</thead>
<?php foreach($msg_outbox_rs as $key => $val){?>
		<?php readStr($val["state"]);?>
	   <tr class="loop_tr">
	   <td><input name="attach[]" type="checkbox" value="<?php echo $val["mess_id"];?>" /></td>
		 <td><img title="<?php echo $readStr;?>" src='skin/<?php echo $skinUrl;?>/images/messend_<?php echo $val["state"];?>.gif' /></td>
		 <td><img src="<?php echo $val["to_user_ico"];?>" width="43px" /></td>
		 <td><a target="_blank" href='home.php?h=<?php echo $val['to_user_id'];?>'><?php echo $val["to_user"];?></a></td>
		 <td><a title='<?php echo $val["mess_title"];?>' href='?app=msg_rpshow&id=<?php echo $val["mess_id"];?>&t=1'><?php echo $val["mess_title"];?></a></td>
		 <td><?php echo $val["add_time"];?></td>
		 <td><a href='do.php?act=msg_del&id=<?php echo $val["mess_id"];?>&t=1' onclick='return confirm("<?php echo $m_langpackage->m_del_ask;?>");'><img title="<?php echo $m_langpackage->m_del;?>" src="skin/<?php echo $skinUrl;?>/images/del.png" /></a></td>
	  </tr>
	  <tr><td class='line' colspan='7'>&nbsp</td></tr>
<?php }?>
<tr align="left" height="25px"><td colspan="6"><?php echo $m_langpackage->m_choose;?><a href="javascript:select_attach(1);"><?php echo $m_langpackage->m_all;?></a> - <a href="javascript:select_attach(0);"><?php echo $m_langpackage->m_b_can;?></a> &nbsp <a href="javascript:document.forms[0].onsubmit();"><?php echo $m_langpackage->m_del;?></a> &nbsp <?php echo str_replace("{num}",$dbo->rowCount,$m_langpackage->m_num_mail);?> </td></tr>
</table>
</form>
<?php echo page_show($isNull,$page_num,$page_total);?>
<div class="guide_info <?php echo $content_data_none;?>">
  <?php echo $m_langpackage->m_out_none;?>
</div>
</body>
</html>