123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334 |
- <script src="/js/xsgl.js"></script>
- <script>
- $(function(){
- //全选
- $(".selectAll").click(function(){
- if ($(this).prop("checked")) {
- $(".myselect").prop("checked",true);
- } else {
- $(".myselect").prop("checked",false);
- }
- });
- //删除
- $(".delClass").click(function(){
- // 判断是否有选中
- var n_id;
- n_id=$(this).attr('id');
- layer.msg('删除后未收到通知的用户将不会再收到该通知,\n' +
- '\n' +
- '确定删除吗?', {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index){
- layer.close(index);
- n_id
- var data={id:n_id};
- $.post("<?php echo Yii::app()->createUrl('notification/deleteNo') ?>", data, function(flags) {
- var m = JSON.parse(flags);
- if(m.status)
- {
- layer.msg('操作成功',{time:2000,icon:1},function(){
- window.location.reload()
- });
- }else
- {
- layer.msg('删除失败');
- }
- });
- }
- });
- });
- $("#btnClose").click(function(){
- $(this).parents(".ttd").fadeOut();
- location.reload();
- });
- $(".info").click(function () {
- var data={
- id:$(this).attr('id'),
- };
- $.post("<?php echo Yii::app()->createUrl('notification/ajaxGetData') ?>", data, function(flags) {
- var m = JSON.parse(flags);
- if(m)
- {
- if(m.status==1){
- $('.title').html(m.data.title);
- $('.content').html(m.data.content+'<br>'+m.data.files);
- $(".ttd").fadeIn();
- }
- }else
- {
- layer.msg('数据有误');
- }
- });
- });
- $(".push").click(function () {
- obj=$(this);
- var data={
- id:$(this).attr('id'),
- };
- layer.msg('发布后通知内容将在所有用户登录后展示,\n' +
- '\n' +
- '确定发布吗?', {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index){
- layer.close(index);
- $.post("<?php echo Yii::app()->createUrl('notification/push') ?>", data, function(flags) {
- var m = JSON.parse(flags);
- if(m)
- {
- if(m.status==1){
- layer.msg('操作成功',{time:2000,icon:1},function(){
- window.location.reload()
- });
- }
- }else
- {
- layer.msg('数据有误');
- }
- });
- }
- });
- });
- $('#addNew').click(function(){
- window.location.href='<?php echo $this->createUrl('notification/edit')?>';
- });
- $('.edit').click(function(){
- var id=$(this).attr('id');
- window.location.href='<?php echo $this->createUrl('notification/edit')?>?id='+id;
- });
- $('.close-tips').click(function () {
- $(this).parents(".ttd").fadeOut();
- location.reload();
- })
- $('.content').on('click','.atta',function(){
- url=$(this).attr('href');
- title=$(this).attr('title');
- window.location.href='<?php echo $this->createUrl('notification/download')?>?url='+url+'&title='+title;
- })
- });
- </script>
- <style>
- a.atta{color:#2977ff}
- a{color: #ffffff}
- a:hover a:active{color: #ffffff}
- *{padding:0px;margin:0px;font-family:微软雅黑}
- ul,li,ol{list-style-type:none;}
- .clearfix:after{clear:both;overflow:hidden;content:"";display:block;}
- input ,button{outline:none;}
- .position-r{position:relative}
- .fl{float:left;}
- .fr{float:right;}
- .mt5{margin-top:5px;}
- .mt10{margin-top:10px;}
- .mt20{margin-top:20px;}
- .ml15{margin-left:15px;}
- .mr15{margin-right:15px;}
- .font_bold{font-weight:bold;}
- .choseImg{cursor:pointer;}
- .ttd{background:url(/images/back-d.png) center repeat;width:100%;height:100%;position:fixed;top:0px;z-index:999}
- .s-state{width:780px;background:#fff;height:500px;margin-top: 100px;}
- .hint_size{height:45px;width:100%;color:#fff;line-height:45px;margin:0px auto;border-bottom:1px solid #ccc;background-color:#2977ff;}
- .mistake_character{text-align:left;color:#606060;font-size:14px;padding:0px 0px 28px 0px;width:90%;margin-bottom:-20px;}
- .roger{width:100px;height:35px;border:1px solid #2977ff;background:#2977ff;color:#fff;font-size:16px;cursor:pointer;margin-top: 15px;}
- .rogergb{background:#ccc;border:1px solid #ccc;text-align: center}
- .allTeacher{width:164px;height:30px;border:1px solid #ccc;border-radius:6px;margin-top:10px;}
- button.wordBtn{background:#2977ff;color:#fff;width:120px;height:30px;border:1px solid #2977ff;cursor:pointer;border-radius:4px;margin-left: 15px;}
- .gray{
- background-color: #999;
- color:#fff;
- width:60px;
- line-height:25px;
- text-align: center;
- display: inline-block;
- }
- .green_status{
- background-color: #2977ff;
- color:#fff;
- width:60px;
- line-height:25px;
- text-align: center;
- display: inline-block;
- }
- .pushed{
- background-color: #f0ad4e;
- color:#fff;
- width:60px;
- line-height:25px;
- text-align: center;
- display: inline-block;
- }
- .content{
- width:100%;
- height:390px;
- overflow: auto;
- padding:15px;
- word-wrap:break-word;
- }
- .close-tips{
- margin-right: 15px;
- cursor: pointer;
- }
- .atta_list p{padding: 0;margin:0;line-height: 20px;}
- .atta{display: inline-block;margin-left:20px;cursor: pointer}
- .red-tips{
- color: red;
- }
- </style>
- <div class="main-content-inner">
- <div class="page-content">
- <div class="row" style="margin:0px;">
- <div class="col-xs-12">
- <!-- PAGE CONTENT BEGINS -->
- <div id="dynamic-table_wrapper" class="dataTables_wrapper form-inline no-footer">
- <div class="col-xs-7">
- <form method="get" id="form1" action="<?php echo $this->createUrl("notification/list");?>">
- <div class="col-xs-12 fl">
- <div class="dataTables_length margin-zy">
- <input type="text" class="form-control input-sm" placeholder="请输入标题" name="title" >
- <button class="label-primary-s bth-s" id="search" style="padding:4px 12px;">搜索</button>
- </div>
- </div>
- </form>
- </div>
- <?php if(isset(Yii::app()->session['testFlag']) && (Yii::app()->session['testFlag']==1)){?>
- <div class="col-xs-3 fl" style="margin: 10px;text-align: right;width:40%"> <button id="addNew" class="label-primary-s bth-s" style="padding:4px 12px;">新建通知</button></div>
- <?php }?>
- <table id="dynamic-table" class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable">
- <thead>
- <tr>
- <th>序号</th>
- <th>标题</th>
- <th>发布时间</th>
- <th>状态</th>
- <th>操作</th>
- </tr>
- </thead>
- <tbody>
- <?php
- if(isset($list) && !empty($list)){
- foreach ($list as $k=>$v){
- ?>
- <tr>
- <td><?php echo ($_page*10)-(10-$k-1)?></td>
- <td><?php echo $v->title?></td>
- <td><?php
- if($v->status==2){
- echo date('Y-m-d H:i:s',$v->create_time);
- }else{
- echo '-';
- }
- ?></td>
- <td class="status">
- <?php
- if($v->status==0){
- echo '<span class="gray">已删除</span>';
- }elseif($v->status==1){
- echo '<span class="green_status">已保存</span>';
- }elseif($v->status==2){
- echo '<span class="pushed">已发布</span>';
- }
- ?>
- </td>
- <td>
- <span class="iconfont click-sc addbx info" id="<?php echo $v->id?>" aria-hidden="true" title="查看"><img src="/images/view.png" width="24" ></span>
- <?php if(isset(Yii::app()->session['testFlag']) && (Yii::app()->session['testFlag']==1)){?>
- <?php if($v->status==1):?>
- <span class="iconfont click-sc addbx edit" id="<?php echo $v->id?>" aria-hidden="true" title="编辑"></span>
- <span class="iconfont click-sc addbx push" id="<?php echo $v->id?>" aria-hidden="true" title="发布"><img src="/images/send.png" width="24" ></span>
- <?php endif;?>
- <?php if($v->status!=0):?>
- <span class="iconfont addbx click-delete delClass" id="<?php echo $v->id?>" aria-hidden="true" title="删除"></span>
- <?php endif;?>
- <?php }?>
- </td>
- </tr>
- <?php
- }}else{?>
- <tr><td colspan="7">暂无数据!</td></tr>
- <?php }?>
- </tbody>
- </table>
- <?php if(isset($page)&&!empty($page)):?>
- <div class="row">
- <div class="col-xs-7">
- <!-- <div class="dataTables_info" id="dynamic-table_info" role="status" aria-live="polite">Showing 1 to 10 of 23 entries</div> -->
- </div>
- <div class="col-xs-5">
- <div class="dataTables_paginate paging_simple_numbers">
- <?php
- $this->widget('CLinkPager', array(
- 'header' => '',
- //'selectedPageCssClass' => 'active2', //当前页的class
- //'hiddenPageCssClass' => 'disabled2', //禁用页的class
- 'firstPageLabel' => '首页',
- 'lastPageLabel' => '末页',
- 'prevPageLabel' => '上一页',
- 'nextPageLabel' => '下一页',
- 'pages' => $page,
- 'maxButtonCount'=> 5,
- ));
- ?><?php echo '共:'.$page_total.'条';?>
- </div>
- </div>
- </div>
- <?php endif;?>
- </div>
- <!-- PAGE CONTENT ENDS -->
- </div>
- </div>
- </div>
- </div>
- <div class="ttd" style="display: none;">
- <div class="s-state clearfix posirela">
- <div class="hint_size clearfix">
- <span class="fl ml15 title" >系统通知</span>
- <span class="fr close-tips">X</span>
- </div>
- <div class="mistake_character clearfix content" style="padding-top: 10px; padding-bottom: 0;">
- </div>
- <div class="mistake_character clearfix">
- <div class="clearfix" style="width:300px;margin:0px auto;text-align: center">
- <button class="roger shut" id="btnClose">知道了</button>
- </div>
- </div>
- </div>
- </div>
|