<?php
/*
'**************************************************************************************************
' 程序名称: CCTVAI开源音乐管理系统
' 官方网站: http://www.cctvai.com
' 联系 Q Q: 1542367792
' QQ交流群：136687984
' 版本：(终结版)
' 备注：未经书面授权，不得向任何第三方提供本软件系统！
' 功能，模板，插件，扩展，定制请联系QQ：1542367792
'**************************************************************************************************
*/
error_reporting(0);
?>
<link type="text/css" rel="stylesheet" href="css/list.css" /> 
   <div class="tag-list"> 
    <div class="tag-section">
	<a href="index.php?ac=message" class="on tag-item"><span>全部通知</span></a>
	<a href="do.php?ac=delnotice&id=<?php echo $CcTvAi_com_userid?>" onClick="return confirm('确定要清空吗?');" class="tag-item"><span>清空通知</span></a>
    </div>  	
   </div> 
<div class="pm-notice">
<div class="head"><strong>全部通知</strong></div> 
<?php
$type = SafeRequest("type","get");
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);
if($result) {
    if($num > 0) {
        while($row=$db->fetch_array($result)) {
			$user=$db->getrow("select cd_nicheng from " . tname('user') . " where cd_id='" . $row['cd_uid'] . "'");
			if($row['cd_uid'] == 0) { $title= '<a style="color: #333;" href="javascript:;">系统提示：</a>';} else {$title= '<a style="color: #333;" href="../singer/index.php?id='.$row['cd_uid'].'">' . $user['cd_nicheng'] . '：</a>';}
			$row['cd_data']=str_replace(cd_webpath.'user/space.php?do=pm&view=msgDetail&day=','index.php?ac=pm&view=msgDetail&classid=',$row['cd_data']);
			$row['cd_data']=str_replace(cd_webpath.cd_webmlsinger.'/index.php?id=','../singer/index.php?id=',$row['cd_data']);
			$row['cd_data']=str_replace(cd_webpath.cd_webmlsinger.'/?id=','../singer/index.php?id=',$row['cd_data']);
			$row['cd_data']=str_replace(cd_webpath.cd_webmlsinger.'/','../singer/index.php?id=',$row['cd_data']);
			echo'<div class="list"><p><span>'.$title.'</span> ' . $row['cd_data'] . '</p><span>' . datetime($row['cd_addtime']) . '</span></div>';
			$db->query("update " . tname('notice') . " set cd_state='0' where cd_uids='" . $CcTvAi_com_userid . "'");
		}
    } else {
        echo '<center>没有通知</center>';
    }
}
?>
  <div class="page"><?php echo $Arr[0];?></div>
</div>