<?php error_reporting(0);?>
  <div class="user"> 
   <div class="user_center"> 
<?php
include_once('source/space_menu.php');
$type = SafeRequest("type","get");
?>
    <div class="user_main"> 
     <div class="uMain_content"> 
      <div class="main_nav"> 
       <ul> 
        <li class="message"> <a href="<?php echo rewrite_url('space.php?do=message');?>" class="on">我的通知</a> </li> 
       </ul> 
      </div> 
      <div class="big_list"> 
       <ul> 
        <li><a <?php if($type == ""){echo " class=\"current\"";} ?> href="<?php echo rewrite_url('space.php?do=message'); ?>">全部通知</a></li>
        <li><a <?php if($type == "dance"){echo " class=\"current\"";} ?> href="<?php echo rewrite_url('space.php?do=message&type=dance'); ?>">影音</a></li>
        <li><a <?php if($type == "miniblog"){echo " class=\"current\"";} ?> href="<?php echo rewrite_url('space.php?do=message&type=miniblog'); ?>">说说</a></li>
        <li><a <?php if($type == "album"){echo " class=\"current\"";} ?> href="<?php echo rewrite_url('space.php?do=message&type=album'); ?>">图片</a></li>
        <li><a <?php if($type == "wall"){echo " class=\"current\"";} ?> href="<?php echo rewrite_url('space.php?do=message&type=wall'); ?>">留言</a></li>
        <li><a <?php if($type == "message"){echo " class=\"current\"";} ?> href="<?php echo rewrite_url('space.php?do=message&type=message'); ?>">私信</a></li>
        <li><a <?php if($type == "fans"){echo " class=\"current\"";} ?> href="<?php echo rewrite_url('space.php?do=message&type=fans'); ?>">关注</a></li>
        <li><a <?php if($type == "praise"){echo " class=\"current\"";} ?> href="<?php echo rewrite_url('space.php?do=message&type=praise'); ?>">赞扬</a></li>
        <li><a <?php if($type == "account"){echo " class=\"current\"";} ?> href="<?php echo rewrite_url('space.php?do=message&type=account'); ?>">账户</a></li>
        <li><a <?php if($type == "activity"){echo " class=\"current\"";} ?> href="<?php echo rewrite_url('space.php?do=message&type=activity'); ?>">活动</a></li>
		<li><a <?php if($type == "payvip"){echo " class=\"current\"";} ?> href="<?php echo rewrite_url('space.php?do=message&type=payvip'); ?>">VIP充值</a></li>
		<li><a <?php if($type == "paypoints"){echo " class=\"current\"";} ?> href="<?php echo rewrite_url('space.php?do=message&type=paypoints'); ?>">金币充值</a></li>
       </ul> 
       <div id="tooltip" class="refresh"> 
       </div> 
      </div> 
      <div id="notification" class="minHeight500"> 
<?php
global $db;
if($type) {
    $sql="select * from " . tname('notice') . " where cd_uids='$CcTvAi_com_userid' and cd_icon='$type' order by cd_addtime desc";
} else {
    $sql="select * from " . tname('notice') . " where cd_uids='$CcTvAi_com_userid' order by cd_addtime desc";
}
$Arr=getuserpage($sql, 25); //sql,每页显示条数
$result=$db->query($Arr[2]);
$num=$db->num_rows($result);
$a=0;
if($result) {
    if($num > 0) {
        echo '<div class="Ignore02">';
        if($type) {
            echo '<span id="delall" onclick="messageLib.notificationAllDel(' . $CcTvAi_com_userid . ', \'' . $type . '\', \'\', \'delall\');">清空该类全部通知</span>';
            echo '<span class="no">|&nbsp;|</span>';
            echo '<span id="delall2" onclick="messageLib.notificationAllDel(' . $CcTvAi_com_userid . ', \'' . $type . '\', \'month\', \'delall2\');">删除该类一个月前通知</span>';
        } else {
            echo '<span id="delall" onclick="messageLib.notificationAllDel(' . $CcTvAi_com_userid . ', \'\', \'\', \'delall\');">清空全部通知</span>';
            echo '<span class="no">|&nbsp;|</span>';
            echo '<span id="delall2" onclick="messageLib.notificationAllDel(' . $CcTvAi_com_userid . ', \'\', \'month\', \'delall2\');">删除一个月前通知</span>';
        }
        echo '</div>';
        echo '<div class="notification">';
        echo '<ul>';
        while($row=$db->fetch_array($result)) {
            $a=$a+1;
            $user=$db->getrow("select cd_nicheng from " . tname('user') . " where cd_id='" . $row['cd_uid'] . "'");
            echo '<li>';
            echo '<span class="icon_mini_' . $row['cd_icon'] . '" style="margin-top: 9px;"></span>';
            echo '<span class="content">';
            if($row['cd_uid'] == 0) {
                echo '<a href="javascript:;">系统提示：</a>';
            } else {
                echo '<a href="' . linkweburl($row['cd_uid'], $row['cd_uname']) . '" target="_blank">' . $user['cd_nicheng'] . '</a>';
            }
            echo '&nbsp;' . $row['cd_data'] . '&nbsp;';
            if($row['cd_state'] == 1) {
                echo '&nbsp;&nbsp;<img src="' . cd_webpath . 'user/static/space/images/icon/new.gif" />';
            }
            echo '</span>';
            echo '<span id="' . $row['cd_id'] . '" class="ndel"  title="删除"></span>';
            echo '<span class="mtime">' . datetime($row['cd_addtime']) . '</span>';
            echo '</li>';
        }
        echo '</ul>';
        echo '</div>';
        $db->query("update " . tname('notice') . " set cd_state='0' where cd_uids='" . $CcTvAi_com_userid . "'");
    } else {
        echo '<div class="nothing">暂未收到任何通知!</div>';
    }
}
?>
<?php if($num>0){?>
<div class="page"><div class="pages"><?php echo $Arr[0]; ?><input type="text" maxlength="5" onkeydown="function c(event,val){e = event ? event :(window.event ? window.event : null);if(e.keyCode==13){val = parseInt(val);val=isNaN(val)||(val<=0)?1:val;window.location.href='<?php echo cd_webpath?>user/space.php?do=message&type=<?php echo SafeRequest("type","get"); ?>&pages='+val+'';return false;}else{return true;}};if(!c(event,this.value))return false;" title="输入页码，按回车快速跳转"/></div></div><div id="currPage"><?php echo SafeRequest("pages","get"); ?></div><?php } ?>
<div id="type" style="display: none"><?php echo $type; ?></div>
      </div> 
     </div> 
    </div> 
   </div> 
  </div> 
  <script type="text/javascript" src="<?php echo cd_webpath?>user/static/js/jquery/jquery.min.js"></script> 
  <script type="text/javascript" src="<?php echo cd_webpath?>user/static/js/core.js"></script> 
  <script type="text/javascript" src="<?php echo cd_webpath?>user/static/js/card.js"></script> 
  <script type="text/javascript" src="<?php echo cd_webpath?>user/static/js/dialog.js"></script> 
  <script type="text/javascript" src="<?php echo cd_webpath?>user/static/js/jquery/jquery.plugins.js"></script> 
  <script type="text/javascript" src="<?php echo cd_webpath?>user/static/space/js/common.js"></script> 
  <script type="text/javascript">listenMsg.start();nav.init();nav.userMenu();nav.helpNoticeInit();</script> 
  <script type="text/javascript" src="<?php echo cd_webpath?>user/static/space/js/message.js"></script>
  <script type="text/javascript">nav.helpNoticeInit();messageLib.notificationDelInit(); </script>
<?php include_once('source/space_footer.php');?>
 </body>
</html>