No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.htm 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  1. {include file="public/layout" /}
  2. <style type="text/css">
  3. .layui-layer-btn .layui-layer-btn-star{
  4. color: #666 !important;
  5. background-color: #fff !important;
  6. }
  7. </style>
  8. <body class="bodystyle" style="cursor: default; -moz-user-select: inherit;">
  9. <div id="append_parent"></div>
  10. <div id="ajaxwaitid"></div>
  11. <div id="page_div" class="page">
  12. {empty name="$iframe"}
  13. {include file="form/bar" /}
  14. {/empty}
  15. <div class="flexigrid">
  16. <div class="mDiv pt0">
  17. {include file="form/index_bar" /}
  18. <form id="searchForm" class="navbar-form form-inline" action="{:url('Form/index')}" method="get" onsubmit="layer_loading('正在处理');">
  19. {$searchform.hidden|default=''}
  20. <div class="sDiv">
  21. <!-- <div class="sDiv2">
  22. <input type="text" name="add_time_begin" id="add_time_begin" value="{$Request.param.add_time_begin}" class="qsbox" autocomplete="off" placeholder="起始日期">
  23. </div>
  24. &nbsp;至&nbsp;
  25. <div class="sDiv2">
  26. <input type="text" name="add_time_end" id="add_time_end" value="{$Request.param.add_time_end}" class="qsbox" autocomplete="off" placeholder="结束日期">
  27. </div> -->
  28. <div class="sDiv2">
  29. <select name="count_type" class="select" style="margin: 0px 5px;" onchange="gbCountSubmit(this);">
  30. {volist name='$gbCountList' id='vo'}
  31. <option value="{$vo.type}" {eq name='$count_type' value='$vo.type'}selected{/eq}>{$vo.name}留言 ({$vo.count})</option>
  32. {/volist}
  33. </select>
  34. </div>
  35. <!-- <div class="sDiv2">
  36. <select name="source" class="select" style="margin:0px 5px;">
  37. <option value="">--全部来源--</option>
  38. <option value="1" {eq name="$source" value="1"}selected{/eq}>电脑端</option>
  39. <option value="2" {eq name="$source" value="2"}selected{/eq}>手机端</option>
  40. </select>
  41. </div> -->
  42. <div class="sDiv2">
  43. <input type="hidden" name="typeid" id="typeid" value="{$typeid|default=''}">
  44. <input type="hidden" name="form_type" id="form_type" value="{$form_type|default=''}">
  45. <!-- <input type="hidden" name="count_type" id="count_type" value="{$count_type|default=''}"> -->
  46. <input type="hidden" name="iframe" id="iframe" value="{$iframe|default=''}">
  47. <input type="text" size="30" name="keywords" value="{$Request.param.keywords}" class="qsbox" placeholder="模糊搜索..." autocomplete="off">
  48. <input type="submit" class="btn" value="搜索">
  49. <i class="iconfont e-sousuo"></i>
  50. </div>
  51. <!-- {eq name="'Guestbook@ajax_excel_export'|is_check_access" value="1"}
  52. <div class="fbutton ml10" style="float: right;">
  53. {if condition="$typeid > 0"}
  54. <a href="javascript:void(0);" onclick="excel_export(this, 'ids');" data-url="{:url('Guestbook/ajax_excel_export', ['form_type'=>'all','typeid'=>$typeid])}" class="bt-xin-xia">
  55. <i class="iconfont e-xiazai"></i>导出
  56. </a>
  57. {else /}
  58. <a href="javascript:void(0);" onclick="excel_export(this, 'ids');" data-url="{:url('Guestbook/ajax_excel_export', ['form_type'=>'all'])}" class="bt-xin-xia">
  59. <i class="iconfont e-xiazai"></i>导出
  60. </a>
  61. {/if}
  62. </div>
  63. {/eq} -->
  64. </div>
  65. </form>
  66. </div>
  67. <div class="hDiv" style="background-color: #fff;">
  68. <div class="hDivBox">
  69. {empty name="list"}
  70. <div class="no-data" >
  71. <div class="no_row">
  72. <div class="no_pic"><img src="__SKIN__/images/null-data.png"></div>
  73. </div>
  74. </div>
  75. {else/}
  76. <div class="guestbook-boxes jsGridView">
  77. {foreach name="list" item="vo" key="k" }
  78. <div class="guestbook-box-wrapper">
  79. <div class="guestbook-box">
  80. <div class="guestbook-box-header">
  81. <span>
  82. <a href="{:url('Form/index', ['typeid'=>$vo.typeid,'form_type'=>$vo['form_type']])}">{$vo.form_name|default='<i class="red">数据出错!</i>'}</a>
  83. </span>
  84. <div class="more-wrapper">
  85. <div id="td_is_read_{$vo.aid}">
  86. {eq name='$vo.is_read' value='1'}
  87. <div class="days-yes">已读</div>
  88. {else /}
  89. <div class="days-no">未读</div>
  90. {/eq}
  91. </div>
  92. <div class="is_star_tag {empty name='$vo.is_star'} none {/empty}" id="is_star_tag_{$vo.aid}"><i class="iconfont e-xingxing"></i></div>
  93. </div>
  94. </div>
  95. <div class="guestbook-box-content">
  96. {if condition="!empty($tab_list[$vo['typeid']])"}
  97. {for start="0" end="count($tab_list[$vo['typeid']])"}
  98. {if condition="$i lt 4" }
  99. <p>{$tab_list[$vo['typeid']][$i]['attr_name']}:{$vo['attr_list'][$i]['attr_value']}</p>
  100. {/if}
  101. {/for}
  102. {/if}
  103. </div>
  104. <div class="guestbook-box-footer">
  105. <div class="participants">
  106. <span>{$vo.add_time|date='Y-m-d H:i:s',###}</span>
  107. </div>
  108. <div class="guestbook-btn-more">
  109. <a href="javascript:void(0);" data-is_star="{$vo['is_star']}" data-btn1="{empty name='$vo.is_star'}设为星标{else /}取消星标{/empty}" data-href="{:url('Guestbook/details', ['aid'=>$vo['aid'],'form_type'=>$vo['form_type']])}" onclick="openDetails(this, {$vo.aid});">查看</a>
  110. {eq name="'Guestbook@del'|is_check_access" value="1"}
  111. <i></i>
  112. <a href="javascript:void(0);" data-url="{:url('Guestbook/del',['form_type'=>$vo['form_type']])}" data-id="{$vo.aid}" onClick="delfun(this);">删除</a>
  113. {/eq}
  114. </div>
  115. </div>
  116. </div>
  117. </div>
  118. {/foreach}
  119. </div>
  120. {/empty}
  121. </div>
  122. </div>
  123. {notempty name="list"}
  124. <div class="tDiv nobdb">
  125. <div class="tDiv2">
  126. {include file="public/page" /}
  127. </div>
  128. <div style="clear:both"></div>
  129. </div>
  130. {/notempty}
  131. </div>
  132. </div>
  133. <script type="text/javascript">
  134. $(function(){
  135. $('input[name*=ids]').click(function(){
  136. if ($('input[name*=ids]').length == $('input[name*=ids]:checked').length) {
  137. $('.checkAll').prop('checked','checked');
  138. } else {
  139. $('.checkAll').prop('checked', false);
  140. }
  141. });
  142. $('input[type=checkbox].checkAll').click(function(){
  143. $('input[type=checkbox]').prop('checked',this.checked);
  144. });
  145. $('#searchForm select[name=source]').change(function(){
  146. $('#searchForm').submit();
  147. });
  148. });
  149. function gbCountSubmit(obj, count_type) {
  150. $('input[name=count_type]').val(count_type);
  151. layer_loading('正在处理');
  152. $('#searchForm').submit();
  153. }
  154. layui.use('laydate', function(){
  155. var laydate = layui.laydate;
  156. //执行一个laydate实例
  157. laydate.render({
  158. elem: '#add_time_begin' //指定元素
  159. });
  160. laydate.render({
  161. elem: '#add_time_end' //指定元素
  162. });
  163. });
  164. $(document).ready(function(){
  165. // 表格行点击选中切换
  166. $('#flexigrid > table>tbody >tr').click(function(){
  167. $(this).toggleClass('trSelected');
  168. });
  169. // 点击刷新数据
  170. $('.fa-refresh').click(function(){
  171. location.href = location.href;
  172. });
  173. });
  174. function excel_export(obj,name) {
  175. var url = $(obj).attr('data-url');
  176. var aid = [];
  177. var typeid = $('input[name=typeid]').val();
  178. var start_time = $('input[name=add_time_begin]').val();
  179. var end_time = $('input[name=add_time_end]').val();
  180. $('input[name^='+name+']').each(function(i,o){
  181. if($(o).is(':checked')){
  182. aid.push($(o).val());
  183. }
  184. });
  185. url = url+"&aid="+aid+"&typeid="+typeid+"&start_time="+start_time+"&end_time="+end_time;
  186. window.location.href = url;
  187. }
  188. //留言详情
  189. function openDetails(obj,aid) {
  190. var btn1 = $(obj).attr('data-btn1');
  191. var is_star = $(obj).attr('data-is_star');
  192. is_star = (is_star == 1) ? 0 : 1;
  193. var iframes = layer.open({
  194. type: 2
  195. ,title: '查看详情'
  196. ,fixed: true //不固定
  197. ,shadeClose: false
  198. ,shade: layer_shade
  199. ,offset: 'auto'
  200. // ,maxmin: true //开启最大化最小化按钮
  201. ,area: ['800px','80%']
  202. ,anim: 5
  203. ,content: $(obj).data('href')
  204. ,btn: ['加载中','关闭']
  205. ,yes: function(index, layero){ // 设置/取消星标
  206. layer_loading('正在处理');
  207. $.ajax({
  208. type : 'post',
  209. url : "{:url('Guestbook/ajax_set_star', ['_ajax'=>1])}",
  210. data : {aid:aid, is_star:is_star},
  211. dataType : 'json',
  212. success : function(res){
  213. layer.closeAll();
  214. if(res.code == 1){
  215. if (is_star == 1) {
  216. $(obj).attr('data-is_star', '1');
  217. $(obj).attr('data-btn1', '取消星标');
  218. $('#is_star_tag_'+aid).show();
  219. } else {
  220. $(obj).attr('data-is_star', '0');
  221. $(obj).attr('data-btn1', '设为星标');
  222. $('#is_star_tag_'+aid).hide();
  223. }
  224. showSuccessMsg(res.msg, 1000);
  225. }else{
  226. showErrorMsg(res.msg);
  227. }
  228. },
  229. error: function(e){
  230. layer.closeAll();
  231. showErrorAlert(e.responseText);
  232. }
  233. });
  234. }
  235. ,btn2: function(index, layero){
  236. }
  237. ,end: function() {
  238. }
  239. ,success: function(layero, index){
  240. $('#td_is_read_'+aid).html('<div class=\'days-yes\'>已读</div>');
  241. if (is_star == 1) {
  242. $('.layui-layer-btn0').html(btn1).removeClass('layui-layer-btn-star');
  243. } else {
  244. $('.layui-layer-btn0').html(btn1).addClass('layui-layer-btn-star');
  245. }
  246. }
  247. });
  248. }
  249. </script>
  250. {include file="public/footer" /}