<?php
require "../e/class/connect.php";
require "../e/class/db_sql.php";
require "../e/member/class/user.php";
$link=db_connect();
$empire=new mysqlquery;
require "class/fun.php";
$ur=user_returnlogin();
$userid=$ur[userid];
$usercheck=checklogin($userid);
$username=$ur[username];
$nickname=getnickname($ur[userid]);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>我的短消息 - 会员中心 -<?=$public_r[sitename]?></title>
<script type="text/javascript">
		function setupLabel(){
            if($('.label-checkbox input').length) {
                $('.label-checkbox').each(function(){
                    $(this).removeClass('label-checkbox-on');
                });
                $('.label-checkbox input:checked').each(function(){
                    $(this).parent('label').addClass('label-checkbox-on');
                });
            };
            if($('.label-radio input').length) {
                $('.label-radio').each(function(){
                    $(this).removeClass('label-radio-on');
                });
                $('.label-radio input:checked').each(function(){
                    $(this).parent('label').addClass('label-radio-on');
                });
            };
        }  
	</script>
</head>
<body>
<? include_once "temp/header.php"; ?>
<div id="content" class="layout">
  <div class="ui-box ui-qire fn-clear" id="i-box">
 <? include_once "temp/left.php"; ?>
    <div class="i-box-cnt" id="i-cnt">
      <div id="i-subscribe">
        <div class="ui-title i-tab-nav-box fn-clear">
          <ul class="i-tab-nav">
            <li class="current"><a href="#" hidefocus>我的私信</a></li>
            <!--<li class="line"></li>-->
            <!--<li><a href="#slum" hidefocus>我的发件箱</a></li>-->
          </ul>
        </div>
        <div class="ui-cnt">
          <form id="delcomm" method="post">
            <ul class="user-txt-list mymsg-list fn-clear" id="xlist">
              <li class="loading"><img src="temp/images/loading.gif"/>正在努力为您加载中... </li>
            </ul>
          </form>
          <!-- // i-list End -->
          <div class="user-opera fn-clear">
            <div class="check-del">
              <div class="check-del">
                <label class="label-checkbox" for="del-comment" hidefocus>
                  <input type="checkbox" id="del-comment"  class="delcheckall" />
                  全选</label>
                <a class="ui-edit ui-edit-short cleanup" href="javascript:void(0);" data="/user-Center-xxx">删除</a></div>
            </div>
            <div id="xpage" class="fav-pic-page"></div>
          </div>
        </div>
      </div>
      <!-- // ui-box End -->
    </div>
    <!-- // i-cnt End -->
    <!-- bigbox-->
    <!-- bigbox end-->
    <script language="javascript" src="temp/css/colorbox.js" type="text/javascript"></script>
    <link href="temp/css/colorbox.css" type="text/css" rel="stylesheet" />
    <script type="text/javascript">		function pagegoo(url){
			//$("#xlist").html('<img src="/static/images/loading.gif"/>');
			$.ajax({ url: url,  success: function(data){
		      if('' != data.ajaxtxt)
			  {
				$("#xlist").html(data.ajaxtxt);
				$(".i-message-tt h5 a").click(function(){
					var $con = $(this).parent().parent().next(".i-message-cnt");	
					if($con.is(":visible")){		
						$con.hide();
					}else{
					var dmsg=$(this).attr('data');
						$con.show();
					   if(0 == parseInt(dmsg[0]))
					   {
					    var ddmsg=dmsg.split('-');
						var	 dddmsg='1-'+ddmsg[1];
					    $(this).attr('data',dddmsg);
                         $.ajax({url: "class/iajax.php?action=upmsg",
						   data:{msg: ddmsg[1]},
						   type:"POST",
						   dataType:'json',
						   success: function(data){
						  	  return false;
						  }});
					 }
					}	
				});

				$(".delcheckall").click(function(){
					checkAll('');
				});
				$(".delcheckall").attr('checked',false);
				$(".fav-cancel").click(function(event){
					$.showfloatdiv({
						wantclose:2,
						succdo:function(r){
							if(parseInt(r.rcode)==1){
								pagegoo("class/iajax.php?action=getmsg");
							}
						},txt:'确认删除?'
					});
				});
		     	}
			 else
			 {
			   $("#xlist").html('<li class="kong">您当前没有私信，朋友之间要多联系哦!</li>');
			   $('.i-do').hide();
			 }
			},dataType:'json'});
			return false;				
		}
		
		pagegoo("class/iajax.php?action=getmsg");
		
		$(".cleanup").click(function(e){
			$.showfloatdiv({
				wantclose:2,
				ispost:1,
				formid:'delcomm',
				url:'class/iajax.php?action=delmsg',
				succdo:function(r){
					if(parseInt(r.rcode)==1){
					pagegoo("class/iajax.php?action=getmsg");	
					}
				},txt:'确认删除?'
			});
		});
		</script>
  </div>
  <!-- // maxBox End -->
</div>
<? include_once "temp/footer.php"; ?>
</body>
</html>