<!--<?php
print <<<EOT
-->
<div id='hiddenMessage' style="display:none"></div>
<div class="contUser" id="content">
<table width="100%"><tr><td height="600" valign="top">
	<div class="p15">
	<h4 class="site mb5"><span>通知</span>(共{$noticeAllCount}條，<a href="$normalUrl&action=unread"><b>{$notReadCount}</b>條未讀通知</a>)</h4> 
<!--
EOT;
if ($action == 'info' || $action == 'next' || $action == 'previous') {
$map = array(
	$messageServer->getConst('notice_system')=>'system',
	$messageServer->getConst('notice_postcate')=>'postcate',
	$messageServer->getConst('notice_active')=>'active',
	$messageServer->getConst('notice_apps')=>'apps'
);
$upaction=$map[$smstype];
$deltype = $redirect ? '' : $upaction;
$message['content'] = convert($message['content'],$db_windpost);
print <<<EOT
--> 
<script type="text/javascript">
function getpage(act){
    ajax.send("$normalUrl&action=checkover&page=$page&smstype=$smstype&mid={$message[mid]}&rid={$message[rid]}&dir="+act,'',function(){
         var rText = ajax.request.responseText.split('\t');
         if (rText[0] == 'success'){
             location.href = "$normalUrl&action="+act+"&page=$page&smstype=$smstype&mid={$message[mid]}&rid={$message[rid]}&redirect=$redirect";
         }else{
             showDialog('warning',(act == "next") ? "已經是最後一條！" : "已經是第一條！",3);return false;
         }
         return false;
    });
    return false;
}
var db_bbsurl = '$db_bbsurl';
var db_urlcheck = '$db_urlcheck';
</script>
<script type="text/javascript" src="js/pw_lwd.js"></script>
 		<div class="mb10">
			<a href="$normalUrl&page=$page&action=$upaction&redirect=$redirect" class="mr20">&lt;&lt;返回</a>
			<a href="javascript:;" onclick="getpage('previous')">上一條</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="javascript:;" onclick="getpage('next')">下一條</a>
		</div>
    <div id="showmessage"></div>
<!--
EOT;
require messageEot('notice_info');
} else { print <<<EOT
-->
<form action="$normalUrl" method="post" name="FORM">
<input type="hidden" name="ajax" value="1"/>
       <div class="mb10 cc">
           <span class="mr5"><label><input name="" type="checkbox" value="" onclick="MC.CheckAll(this.form,this)">&nbsp;全選</label></span>
           <span class="bt2"><span><button onclick="MC.mSubmit(this.form,'mark','notice','$action','$page')" type="button">標記已讀</button></span></span>
           <span class="bt2"><span><button onclick="MC.mSubmit(document.FORM,'del','notice','$action','$page')"  type="button">刪除</button></span></span>
					 <span style="margin:0 6px;">篩選︰<span class="dropdown"><select onchange="MC.getTypeList('notice',this.value)" id="alltype">
						<option value="" $selected>全部</option>
							<option value="system" $selected[system]>系統通知</option>
							<option value="postcate" $selected[postcate]>團購通知</option>
							<option value="active" $selected[active]>活動通知</option>
							<option value="apps" $selected[apps]>應用通知</option>
							<option value="comment" $selected[comment]>評論通知</option>
							<option value="guestbook" $selected[guestbook]>留言通知</option>
					</select></span></span>
       </div><div id="showmessage"></div>
       <table width="100%" class="mb10 z2">
<!--
EOT;
if($noticeCount == 0){
print <<<EOT
-->
		<tr><td class="tac p15 f14">暫無任何{$chineseName[$smstype]}</td></tr>
<!--
EOT;
}else{
$_unReadCol = getUnReadHtml();
print <<<EOT
-->
		{$_unReadCol}
<!--
EOT;
foreach($noticeList as $key => $value){
$typeid = $value[typeid];
$typeName =	$chineseName["$typeid"];
list($_img,$_b,$_tip) = getMessageIconByStatus($value);
$_col = getSubListHtml($value);
$content = stripWindCode($value['content']);
print <<<EOT
-->			
		
				{$_col}
				<tr class="tr3">
            	<td class="pick"><input name="rids" type="checkbox" value="{$value[rid]}" /></td>
							<td class="icon"><img src="u/images/message/{$_img}"/></td>
                <td width="100" style="vertical-align:middle;">
                	<p>$typeName</p>
                    <em class="gray">{$value[modified_time_format]}</em>
                </td>
                <td class="value">
                	<h4 $_b><a class="mr5" href="$normalUrl&action=info&page=$page&smstype=$value[typeid]&rid={$value[rid]}&mid={$value[mid]}&redirect={$redirect}">{$value[title]}</a><em class="s2 fn">{$_tip}</em></h4>  	
                    <p class="lh_18">{$content}</p>
                </td>
                <td class="del"><a id="del_{$value[rid]}" href="javascript:;" onclick="pwConfirm('確定要刪除該消息?', this, function(){MC.del('$value[rid]','notice','$action','$page')})" class="adel">刪除</a></td>
			</tr>
<!--
EOT;
}}print <<<EOT
-->           	
		</table>
<!--
EOT;
if(count($noticeList) >= $perpage){
print <<<EOT
-->
        <div id="showmessageTip"></div>
        <div class="mb10">
           <span class="mr5"><label><input name="" type="checkbox" value="" onclick="MC.CheckAll(this.form,this)">&nbsp;全選</label></span>
           <span class="bt2"><span><button onclick="MC.mSubmit(this.form,'mark','notice','$action','$page','showmessageTip')" type="button">標記已讀</button></span></span>
           <span class="bt2"><span><button onclick="MC.mSubmit(document.FORM,'del','notice','$action','$page','showmessageTip')"  type="button">刪除</button></span></span>
       </div>
<!--
EOT;
}print <<<EOT
-->
</form>
        <div class="mb10">
            <div class="fr" style="_width:500px;">
            	$pages
            </div>
            <div class="c"></div>
        </div>                                       
<!--
EOT;
}print <<<EOT
-->    
        </div>
</td></tr></table>
    </div>
<script type="text/javascript" src="js/select.js"></script>
<script type="text/javascript">
var ld=window.onload;
window.onReady(function(){
	new sSelect(getObj('alltype'));
});
</script>
<!--
EOT;
if(!defined('AJAX')){
	require_once(uTemplate::printEot('footer'));
}
?>-->