westdc-zf1/application/admin/views/scripts/sys/message.phtml

101 lines
3.9 KiB
PHTML

<?php
$this->headTitle($this->config->title->site);
$this->headTitle('后台管理');
$this->headTitle()->setSeparator(' - ');
$this->headLink()->appendStylesheet('/css/admin.css');
$this->headScript()->appendFile('/js/jquery-1.7.min.js');
$this->headScript()->appendFile('/static/js/jquery.jgrowl_minimized.js');
$this->headLink()->appendStylesheet('/static/css/jquery.jgrowl.css');
$this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/admin">后台首页</a>');
$this->breadcrumb('<a href="/admin/sys">系统管理</a>');
$this->breadcrumb('邮件模板管理');
$this->breadcrumb()->setSeparator(' > ');
?>
<div id="leftPanel">
<?= $this->partial('sys/left.phtml'); ?>
</div>
<div id="rightPanel">
<div class="ctrlplan">
<a href="/admin/sys/message/do/listall">查看所有消息</a>
<a href="/admin/sys/message/">查看新消息</a>
</div>
<div class="search">
<form action="" method="get">
<input type="hidden" name="search" value='1' />
<input type="hidden" name="id" value='<?php echo $this->id;?>' />
<label>搜索关键字</label><input type="text" class="q" name="q" value="<?php echo $this->q; ?>" />
<input type="submit" class="btn" value="搜索" />
</form>
</div>
<?php if($this->totle > 0) echo '共 <strong style="font-weight:bold;color:red;">'.$this->totle.'</strong> 条未读消息';?>
<form id="messages">
<table class="stylized">
<thead>
<tr>
<td width='20'>选择</td>
<td width='380'>标题</td>
<td width="120">时间</td>
<td width='180'>操作</td>
</tr>
</thead>
<?php if (count($this->paginator)): ?>
<tbody id="list">
<?php foreach ($this->paginator as $item): ?>
<tr>
<td><input type="checkbox" name="id[]" value="<?php echo $item['id'];?>" /></td>
<td><a href="/admin/sys/message/do/read/id/<?php echo $item['id'];?>" <?php if (empty($item['uid'])) echo ' style="font-weight:bold"';?>><?php if(!empty($item['title'])) echo $item['title']; else echo "无标题"; ?></a></td>
<td><?php echo date("Y-m-d H:i",strtotime($item['sendtime'])); ?></td>
<td>[<a href="/admin/sys/message/do/read/id/<?php echo $item['id'];?>">查看</a>] <?php if (empty($item['uid'])) echo '[<a href="/admin/sys/message/do/close/id/'.$item['id'].'">标记为已读</a>]'; ?></td>
</tr>
<?php endforeach; ?>
</tbody>
<?php endif; ?>
</table>
</form>
<button class="btn" onclick="selall();">全选</button>
<button class="btn" onclick="unsel();">反选</button>
<button class="btn" onclick='unselall();'>全部取消</button>
<button class="btn" onclick="oversel();">标记为已处理</button>
<div class="pagenavi"><?= $this->paginator; ?></div>
</div><script>$("#list tr").mouseover(function(){$(this).addClass("high")}).mouseout(function(){$(this).removeClass("high")})
function selall(){
$("#messages :checkbox").attr('checked',true);
}
function unselall(){
$("#messages :checkbox").attr('checked',false);
}
function unsel(){
$("#messages :checkbox").each(function () {
$(this).attr("checked", !$(this).attr("checked"));
});
}
function getsel(){
var ids=new Array();
$("#messages :checkbox").each(function(){
if($(this).attr('checked')==true||$(this).attr('checked')=="checked")
{
ids.push($(this).val());
}
});
var allid=ids.join(',');
return allid;
}
function oversel(){
var id=getsel();if (id==null||id==''){alert('没有选择任何一项');return false;}
var d = confirm('确实要标记为已处理吗?标记后其他管理员将收不到该消息');
if(d==true){
$.ajax({
'type':"POST",
'url':"/admin/sys/message/do/over",
'data':'id='+id,
'success':function(html){
$.jGrowl(html, {"life":5000 });
}
});}
}
</script>