card-notice.html 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. {php $newUI = true;}
  2. {template 'common/header'}
  3. {template 'mc/card-nav'}
  4. {if $op == 'post'}
  5. <div classs="clearfix">
  6. <form action="" class="form-horizontal form" method="post" enctype="multipart/form-data" id="form1">
  7. <input type="hidden" name="id" value="{$notice['id']}"/>
  8. <div class="panel panel-default">
  9. <div class="panel-heading">发布通知</div>
  10. <div class="panel-body">
  11. <div class="form-group">
  12. <label class="col-xs-12 col-sm-3 col-md-2 control-label">标题</label>
  13. <div class="col-sm-9 col-xs-12">
  14. <input type="text" class="form-control" name="title" value="{$notice['title']}"/>
  15. <div class="help-block">不超过30个字符</div>
  16. </div>
  17. </div>
  18. <div class="form-group">
  19. <label class="col-xs-12 col-sm-3 col-md-2 control-label">通知图片</label>
  20. <div class="col-sm-9 col-xs-12">
  21. {php echo tpl_form_field_image('thumb', $notice['thumb']);}
  22. </div>
  23. </div>
  24. <div class="form-group">
  25. <label class="col-xs-12 col-sm-3 col-md-2 control-label">通知会员组</label>
  26. <div class="col-sm-9 col-xs-12">
  27. <label class="radio-inline">
  28. <input type="radio" name="groupid" value="0" {if !$notice['groupid']}checked{/if}/> 全部会员
  29. </label>
  30. {loop $_W['account']['groups'] $group}
  31. <label class="radio-inline">
  32. <input type="radio" name="groupid" value="{$group['groupid']}" {if $notice['groupid'] == $group['groupid']}checked{/if}/> {$group['title']}
  33. </label>
  34. {/loop}
  35. </div>
  36. </div>
  37. <div class="form-group">
  38. <label class="col-xs-12 col-sm-3 col-md-2 control-label">通知内容</label>
  39. <div class="col-sm-9 col-xs-12">
  40. {php echo tpl_ueditor('content', $notice['content']);}
  41. </div>
  42. </div>
  43. </div>
  44. </div>
  45. <div class="form-group" style="margin-left:0px">
  46. <input type="hidden" name="token" value="{$_W['token']}"/>
  47. <input type="submit" name="submit" value="提交" class="btn btn-primary"/>
  48. </div>
  49. </form>
  50. </div>
  51. <script>
  52. $(function(){
  53. $('#form1').submit(function(){
  54. if(!$.trim($(':text[name="title"]').val())) {
  55. util.message('通知标题不能为空', '', 'error');
  56. return false;
  57. }
  58. });
  59. });
  60. </script>
  61. {else if $op == 'list'}
  62. <div class="clearfix">
  63. <form action="" method="post" class="form-horizontal" role="form">
  64. <div class="form-group">
  65. <div class="col-sm-8 col-lg-9 col-xs-12">
  66. <a href="{php echo url('mc/card/notice/', array('op' => 'post'));}" target="_blank" class="btn btn-success"><i class="fa fa-plus"></i> 发布通知</a>
  67. </div>
  68. </div>
  69. <div class="panel panel-default">
  70. <div class="panel-body table-responsive">
  71. <table class="table table-hover">
  72. <thead>
  73. <tr>
  74. <th>标题</th>
  75. <th>通知会员组</th>
  76. <th>添加时间</th>
  77. <th class="text-right">操作</th>
  78. </tr>
  79. </thead>
  80. <tbody>
  81. {loop $notices $notice}
  82. <tr>
  83. <td>
  84. {if !empty($notice['thumb'])}
  85. <img src="{php echo tomedia($notice['thumb']);}" alt="" width="40" border="1"/>
  86. {/if}
  87. {$notice['title']}
  88. </td>
  89. <td>
  90. {if !$notice['groupid']}
  91. <span class="label label-success">全部会员</span>
  92. {else}
  93. <span class="label label-danger">{$_W['account']['groups'][$notice['groupid']]['title']}</span>
  94. {/if}
  95. </td>
  96. <td>{php echo date('Y-m-d H:i', $notice['addtime']);}</td>
  97. <td class="text-right">
  98. <a href="{php echo url('mc/card/notice', array('op' => 'post', 'id' => $notice['id']));}" class="btn btn-default">编辑</a>
  99. <a href="{php echo url('mc/card/notice', array('op' => 'del', 'id' => $notice['id']));}" onclick="if(!confirm('确定删除吗')) return false;" class="btn btn-default">删除</a>
  100. </td>
  101. </tr>
  102. {/loop}
  103. </tbody>
  104. </table>
  105. </div>
  106. </div>
  107. {$pager}
  108. </form>
  109. </div>
  110. {/if}
  111. {template 'common/footer'}