0d93173ac57df4a879953c01eab3fdb07f84d96d_0.file.index.html.php 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480
  1. <?php
  2. /* Smarty version 3.1.30, created on 2018-05-07 00:09:40
  3. from "D:\phpStudy\WWW\workorder\application\views\templates\user\index.html" */
  4. /* @var Smarty_Internal_Template $_smarty_tpl */
  5. if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
  6. 'version' => '3.1.30',
  7. 'unifunc' => 'content_5aef28c4ccb558_18860172',
  8. 'has_nocache_code' => false,
  9. 'file_dependency' =>
  10. array (
  11. '0d93173ac57df4a879953c01eab3fdb07f84d96d' =>
  12. array (
  13. 0 => 'D:\\phpStudy\\WWW\\workorder\\application\\views\\templates\\user\\index.html',
  14. 1 => 1524911886,
  15. 2 => 'file',
  16. ),
  17. ),
  18. 'includes' =>
  19. array (
  20. ),
  21. ),false)) {
  22. function content_5aef28c4ccb558_18860172 (Smarty_Internal_Template $_smarty_tpl) {
  23. if (!is_callable('smarty_modifier_date_format')) require_once 'D:\\phpStudy\\WWW\\workorder\\application\\libraries\\smarty\\plugins\\modifier.date_format.php';
  24. ?>
  25. <!DOCTYPE html>
  26. <html lang="zh-CN">
  27. <head>
  28. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  29. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
  30. <meta name="robots" content="noindex,nofollow">
  31. <title><?php echo $_smarty_tpl->tpl_vars['sys_name']->value;?>
  32. </title>
  33. <base href="<?php echo base_url();?>
  34. "/>
  35. <link href="static/css/bootstrap.min.css" rel="stylesheet">
  36. <link href="static/css/bootstrap-table.min.css" rel="stylesheet">
  37. <link href="static/js/skins/all.css" rel="stylesheet">
  38. <link href="static/css/select2.min.css" rel="stylesheet">
  39. <link rel="stylesheet" href="static/css/style.css">
  40. <?php echo '<script'; ?>
  41. language="javascript" type="text/javascript"> var SITE_URL = "/";<?php echo '</script'; ?>
  42. >
  43. <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
  44. <!--[if lt IE 9]>
  45. <?php echo '<script'; ?>
  46. src="http://cdn.bootcss.com/html5shiv/3.7.0/html5shiv.js"><?php echo '</script'; ?>
  47. >
  48. <?php echo '<script'; ?>
  49. src="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"><?php echo '</script'; ?>
  50. >
  51. <![endif]-->
  52. </head>
  53. <body style="background: #fff;">
  54. <div style="padding:10px;">
  55. <div class="panel panel-default grid">
  56. <div class="panel-body">
  57. <form class="form-inline" role="form" method="get">
  58. <div class="pull-left">
  59. <div class="btn-group">
  60. <?php if (!array_key_exists('from',$_SESSION)) {?>
  61. <button type="button" class="add" id="add_user">
  62. 新增用户
  63. </button>
  64. <?php }?>
  65. <button type="button" class="delete_btn" id="delete_user" disabled>
  66. 批量删除
  67. </button>
  68. <span class="btn_line"></span>
  69. <button type="button" class="disable" id="disable_user" disabled>
  70. 批量禁用
  71. </button>
  72. <button type="button" class="enable" id="enable_user" disabled>
  73. 批量启用
  74. </button>
  75. <span class="btn_line"></span>
  76. <button type="button" class="refresh" onclick="window.location.reload();">
  77. 刷新
  78. </button>
  79. </div>
  80. </div>
  81. <div class="pull-right">
  82. <div class="form-group">
  83. <select class="form-control" name="user_type">
  84. <option value="">所有类型</option>
  85. <?php
  86. $_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['user_types']->value, 'val', false, 'k');
  87. if ($_from !== null) {
  88. foreach ($_from as $_smarty_tpl->tpl_vars['k']->value => $_smarty_tpl->tpl_vars['val']->value) {
  89. ?>
  90. <option value="<?php echo $_smarty_tpl->tpl_vars['k']->value;?>
  91. " <?php if ($_smarty_tpl->tpl_vars['user_type']->value == $_smarty_tpl->tpl_vars['k']->value) {?>selected<?php }?>><?php echo $_smarty_tpl->tpl_vars['val']->value;?>
  92. </option>
  93. <?php
  94. }
  95. }
  96. $_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl);
  97. ?>
  98. </select>
  99. </div>
  100. <div class="form-group">
  101. <select class="form-control" name="status">
  102. <option value="">所有状态</option>
  103. <?php
  104. $_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['user_status']->value, 'val', false, 'k');
  105. if ($_from !== null) {
  106. foreach ($_from as $_smarty_tpl->tpl_vars['k']->value => $_smarty_tpl->tpl_vars['val']->value) {
  107. ?>
  108. <option value="<?php echo $_smarty_tpl->tpl_vars['k']->value;?>
  109. " <?php if ($_smarty_tpl->tpl_vars['status']->value == $_smarty_tpl->tpl_vars['k']->value) {?>selected<?php }?>><?php echo $_smarty_tpl->tpl_vars['val']->value;?>
  110. </option>
  111. <?php
  112. }
  113. }
  114. $_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl);
  115. ?>
  116. </select>
  117. </div>
  118. <div class="form-group">
  119. <input class="form-control keyword" name="keyword" id="keyword" placeholder="筛选" type="text" value="<?php echo $_smarty_tpl->tpl_vars['keyword']->value;?>
  120. ">
  121. <button type="submit" class="search">
  122. <i class="glyphicon glyphicon-search"></i>
  123. </button>
  124. </div>
  125. </div>
  126. </form>
  127. </div>
  128. <table id="data_table" data-toggle="table" data-search="true" class="table<?php if ($_smarty_tpl->tpl_vars['count']->value) {?> table-hover<?php }?> table-bordered" style="display: none;">
  129. <thead>
  130. <tr>
  131. <th class="text-center" style="width: 40px"><input name="check_all" class="check_all" value="true" type="checkbox"></th>
  132. <th class="text-center">ID</th>
  133. <th class="text-center">用户名</th>
  134. <th class="text-center">姓名</th>
  135. <th class="text-center">电话</th>
  136. <th class="text-center">E-mail</th>
  137. <th class="text-center">用户类型</th>
  138. <th class="text-center">状态</th>
  139. <th class="text-center">创建时间</th>
  140. <th class="text-center">最后一次登录时间</th>
  141. <th class="text-center" style="width: 290px">操作</th>
  142. </tr>
  143. </thead>
  144. <tbody>
  145. <?php
  146. $_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['user_list']->value, 'val', false, 'k');
  147. if ($_from !== null) {
  148. foreach ($_from as $_smarty_tpl->tpl_vars['k']->value => $_smarty_tpl->tpl_vars['val']->value) {
  149. ?>
  150. <tr>
  151. <td class="text-center"><input name="ids[]" value="<?php echo $_smarty_tpl->tpl_vars['val']->value['user_id'];?>
  152. " type="checkbox" <?php if ($_smarty_tpl->tpl_vars['val']->value['user_id'] == 1) {?>disabled<?php }?>></td>
  153. <td><?php echo $_smarty_tpl->tpl_vars['val']->value['user_id'];?>
  154. </td>
  155. <td data-searchable="true"><?php echo $_smarty_tpl->tpl_vars['val']->value['username'];?>
  156. </td>
  157. <td data-searchable="true"><?php echo $_smarty_tpl->tpl_vars['val']->value['name'];?>
  158. </td>
  159. <td class="text-center" data-searchable="true"><?php echo $_smarty_tpl->tpl_vars['val']->value['mobile'];?>
  160. </td>
  161. <td class="text-left" data-searchable="true"><?php echo $_smarty_tpl->tpl_vars['val']->value['email'];?>
  162. </td>
  163. <td class="text-center" data-searchable="true"><?php echo $_smarty_tpl->tpl_vars['user_types']->value[$_smarty_tpl->tpl_vars['val']->value['user_type']];?>
  164. </td>
  165. <td class="text-center" data-searchable="true"><span class="status<?php echo $_smarty_tpl->tpl_vars['val']->value['status'];?>
  166. "><?php echo $_smarty_tpl->tpl_vars['user_status']->value[$_smarty_tpl->tpl_vars['val']->value['status']];?>
  167. </span></td>
  168. <td class="text-center"><?php echo smarty_modifier_date_format($_smarty_tpl->tpl_vars['val']->value['create_time']->toDateTime(),'%Y-%m-%d %H:%M:%S');?>
  169. </td>
  170. <td class="text-center"><?php if ($_smarty_tpl->tpl_vars['val']->value['last_login_time']) {
  171. echo smarty_modifier_date_format($_smarty_tpl->tpl_vars['val']->value['last_login_time']->toDateTime(),'%m-%d %H:%M:%S');
  172. }?></td>
  173. <td class="text-left">
  174. <a href="javascript:;" data-id="<?php echo $_smarty_tpl->tpl_vars['val']->value['user_id'];?>
  175. " class="view_info">
  176. 查看详情
  177. </a>
  178. <?php if (!array_key_exists('from',$_SESSION)) {?>
  179. <a href="javascript:;" data-id="<?php echo $_smarty_tpl->tpl_vars['val']->value['user_id'];?>
  180. " class="change_password">
  181. 修改密码
  182. </a>
  183. <?php }?>
  184. <?php if ($_smarty_tpl->tpl_vars['val']->value['status'] == "10" && $_smarty_tpl->tpl_vars['val']->value['user_id'] != 1) {?>
  185. <a href="javascript:;" data-id="<?php echo $_smarty_tpl->tpl_vars['val']->value['user_id'];?>
  186. " class="stop_use">
  187. 禁用
  188. </a>
  189. <?php }?>
  190. <?php if ($_smarty_tpl->tpl_vars['val']->value['status'] == "30" || $_smarty_tpl->tpl_vars['val']->value['status'] == "40") {?>
  191. <a href="javascript:;" data-id="<?php echo $_smarty_tpl->tpl_vars['val']->value['user_id'];?>
  192. " class="restore">
  193. 启用
  194. </a>
  195. <?php }?>
  196. <?php if ($_smarty_tpl->tpl_vars['val']->value['user_id'] != 1) {?>
  197. <a href="javascript:;" data-id="<?php echo $_smarty_tpl->tpl_vars['val']->value['user_id'];?>
  198. " class="delete">
  199. 删除
  200. </a>
  201. <?php }?>
  202. </td>
  203. </tr>
  204. <?php
  205. }
  206. }
  207. $_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl);
  208. ?>
  209. <?php if (!$_smarty_tpl->tpl_vars['count']->value) {?>
  210. <tr>
  211. <td colspan="11" class="empty_table"><img src="static/images/empty_table.png"><p>暂无符合条件的数据!</p></td>
  212. </tr>
  213. <?php }?>
  214. </tbody>
  215. </table>
  216. <div class="panel-footer clearfix">
  217. <div class="form-inline">
  218. <div class="pull-right">
  219. <div class="form-group count">总共<?php echo $_smarty_tpl->tpl_vars['count']->value;?>
  220. 条记录</div>
  221. <div class="form-group">
  222. <?php echo $_smarty_tpl->tpl_vars['page']->value;?>
  223. </div>
  224. <div class="form-group">
  225. <label for="page_size" class="form-control-static control-label">每页</label>
  226. <select class="form-control" id="page_size" name="page_size">
  227. <option value="10" <?php if ($_smarty_tpl->tpl_vars['page_size']->value == 10) {?>selected<?php }?>>10</option>
  228. <option value="20" <?php if ($_smarty_tpl->tpl_vars['page_size']->value == 20) {?>selected<?php }?>>20</option>
  229. <option value="50" <?php if ($_smarty_tpl->tpl_vars['page_size']->value == 50) {?>selected<?php }?>>50</option>
  230. <option value="100" <?php if ($_smarty_tpl->tpl_vars['page_size']->value == 100) {?>selected<?php }?>>100</option>
  231. </select>
  232. </div>
  233. </div>
  234. </div>
  235. </div>
  236. </div>
  237. </div>
  238. <?php echo '<script'; ?>
  239. type="text/javascript" charset="utf-8" src="static/js/jquery.js"><?php echo '</script'; ?>
  240. >
  241. <?php echo '<script'; ?>
  242. type="text/javascript" charset="utf-8" src="static/js/bootstrap.js"><?php echo '</script'; ?>
  243. >
  244. <?php echo '<script'; ?>
  245. type="text/javascript" charset="utf-8" src="static/js/bootstrap-table.min.js"><?php echo '</script'; ?>
  246. >
  247. <?php echo '<script'; ?>
  248. type="text/javascript" charset="utf-8" src="static/js/bootstrap-table-zh-CN.min.js"><?php echo '</script'; ?>
  249. >
  250. <?php echo '<script'; ?>
  251. type="text/javascript" charset="utf-8" src="static/js/icheck.min.js"><?php echo '</script'; ?>
  252. >
  253. <?php echo '<script'; ?>
  254. type="text/javascript" charset="utf-8" src="static/js/select2.full.min.js"><?php echo '</script'; ?>
  255. >
  256. <?php echo '<script'; ?>
  257. type="text/javascript" charset="utf-8" src="static/js/layer/layer.js"><?php echo '</script'; ?>
  258. >
  259. <?php echo '<script'; ?>
  260. language="javascript" type="text/javascript">
  261. var disabled_btn = "";
  262. $(".panel-body button:disabled").each(function () {
  263. disabled_btn +="#"+$(this).attr("id")+",";
  264. })
  265. disabled_btn = disabled_btn.substr(0,disabled_btn.length-1);
  266. $(function(){
  267. $("table").show();
  268. $('input').iCheck({
  269. cursor : true,
  270. checkboxClass : 'icheckbox_square-blue'
  271. });
  272. layer.config({
  273. extend: 'myskin/style.css', //加载新皮肤
  274. });
  275. $("#keyword").on('input',function () {
  276. $('#data_table').bootstrapTable('resetSearch', $(this).val());
  277. $('input').iCheck({
  278. cursor : true,
  279. checkboxClass : 'icheckbox_square-blue'
  280. });
  281. });
  282. $("select").select2({minimumResultsForSearch: -1});
  283. $("#add_user").click(function () {
  284. parent.$('#mainFrameTabs').bTabsAdd("tab11","新增用户","user/add");
  285. })
  286. $(".bootstrap-table").on('click',".delete",function () {
  287. var id = $(this).data("id");
  288. layer.confirm("确定要删除该用户吗?删除后该用户相关的工单也将被删除!", {skin: 'layer-ext-myskin',icon: 3, title:'提示'}, function(index){
  289. if(id != "" && id != undefined) {
  290. $.post(
  291. "user/delete/" + id,
  292. function (data) {
  293. layer.msg(data.msg, {icon: data.icon,time: 3000}, function () {
  294. window.location.reload();
  295. })
  296. }
  297. )
  298. }else{
  299. layer.alert("参数错误,请刷新后重试!",{skin: 'layer-ext-myskin',icon: 5, title:'错误提示'});
  300. }
  301. layer.close(index);
  302. })
  303. })
  304. $(".bootstrap-table").on('click',".stop_use",function () {
  305. var id = $(this).data("id");
  306. layer.confirm("确定要停用该用户吗?停用后该用户将不能登录!", {skin: 'layer-ext-myskin',icon: 3, title:'提示'}, function(index){
  307. if(id != "" && id != undefined) {
  308. $.post(
  309. "user/stopuse/" + id,
  310. function (data) {
  311. layer.msg(data.msg, {icon: data.icon,time: 3000}, function () {
  312. window.location.reload();
  313. })
  314. }
  315. )
  316. }else{
  317. layer.alert("参数错误,请刷新后重试!",{skin: 'layer-ext-myskin',icon: 5, title:'错误提示'});
  318. }
  319. layer.close(index);
  320. })
  321. })
  322. $(".bootstrap-table").on('click',".restore",function () {
  323. var id = $(this).data("id");
  324. if(id != "" && id != undefined) {
  325. $.post(
  326. "user/restore/" + id,
  327. function (data) {
  328. layer.msg(data.msg, {icon: data.icon,time: 3000}, function () {
  329. window.location.reload();
  330. })
  331. }
  332. )
  333. }else{
  334. layer.alert("参数错误,请刷新后重试!",{skin: 'layer-ext-myskin',icon: 5, title:'错误提示'});
  335. }
  336. })
  337. $(".bootstrap-table").on('click',".view_info",function(){
  338. var id = $(this).data("id");
  339. if(id != "" && id != undefined) {
  340. layer.open({
  341. type: 2,
  342. title: "用户详情",
  343. offset: 'auto',
  344. shade: [0.3],
  345. area: ['900px','400px'],
  346. anim: 0,
  347. shadeClose:false,
  348. content: 'user/view/'+id,
  349. end: function(){
  350. window.location.reload();
  351. }
  352. });
  353. }else{
  354. layer.alert("参数错误,请刷新后重试!",{skin: 'layer-ext-myskin',icon: 5, title:'错误提示'});
  355. }
  356. })
  357. $(".bootstrap-table").on('click',".change_password",function(){
  358. var id = $(this).data("id");
  359. if(id != "" && id != undefined) {
  360. layer.open({
  361. type: 2,
  362. title: "修改密码",
  363. offset: 'auto',
  364. shade: [0.3],
  365. area: ['500px','320px'],
  366. anim: 0,
  367. shadeClose:false,
  368. content: 'user/changepassword/'+id,
  369. });
  370. }else{
  371. layer.alert("参数错误,请刷新后重试!",{skin: 'layer-ext-myskin',icon: 5, title:'错误提示'});
  372. }
  373. })
  374. $("#page_size").change(function () {
  375. var page_size = $(this).val();
  376. window.location.href = "user/index?page_size="+page_size;
  377. })
  378. $(".bootstrap-table").on('ifChecked','.check_all',function () {
  379. $("input:checkbox").not(':disabled').iCheck('check');
  380. }).on('ifUnchecked','.check_all',function () {
  381. $("input:checkbox").not(':disabled').iCheck('uncheck');
  382. });
  383. $(".bootstrap-table").on('ifChanged','input:checkbox',function(){
  384. var ids ="";
  385. $("input:checkbox").each(function () {
  386. if($(this).not(":disabled").prop("checked")){
  387. ids += $(this).val()+",";
  388. }
  389. });
  390. if(ids != "" && ids != undefined){
  391. $(disabled_btn).removeAttr("disabled");
  392. }else{
  393. $(disabled_btn).attr("disabled","disabled");
  394. }
  395. })
  396. $(".form-inline select").on("change",function(e) {
  397. if($(this).attr("id") != "page_size") {
  398. $(".form-inline").submit();
  399. }
  400. })
  401. $("#delete_user").click(function () {
  402. var ids = "";
  403. $("input:checkbox").each(function () {
  404. if($(this).not(":disabled").prop("checked")){
  405. ids += $(this).val()+",";
  406. }
  407. })
  408. if(ids == ""){
  409. layer.alert("请选择要删除的用户!",{skin: 'layer-ext-myskin',icon: 3, title:'提示'});
  410. }else{
  411. layer.confirm('确定要删除选择的用户吗?', {skin: 'layer-ext-myskin',icon: 3, title:'提示'}, function(index){
  412. $.post(
  413. "user/deleteall",{'ids':ids},
  414. function (data) {
  415. layer.msg(data.msg, {icon: data.icon,time: 3000}, function () {
  416. window.location.reload();
  417. })
  418. }
  419. )
  420. layer.close(index);
  421. })
  422. }
  423. })
  424. $("#disable_user").click(function () {
  425. var ids = "";
  426. $("input:checkbox").each(function () {
  427. if($(this).not(":disabled").prop("checked")){
  428. ids += $(this).val()+",";
  429. }
  430. })
  431. if(ids == ""){
  432. layer.alert("请选择要禁用的用户!",{skin: 'layer-ext-myskin',icon: 3, title:'提示'});
  433. }else{
  434. layer.confirm('确定要禁用选择的用户吗?', {skin: 'layer-ext-myskin',icon: 3, title:'提示'}, function(index){
  435. $.post(
  436. "user/disableall",{'ids':ids},
  437. function (data) {
  438. layer.msg(data.msg, {icon: data.icon,time: 3000}, function () {
  439. window.location.reload();
  440. })
  441. }
  442. )
  443. layer.close(index);
  444. })
  445. }
  446. })
  447. $("#enable_user").click(function () {
  448. var ids = "";
  449. $("input:checkbox").each(function () {
  450. if($(this).not(":disabled").prop("checked")){
  451. ids += $(this).val()+",";
  452. }
  453. })
  454. if(ids == ""){
  455. layer.alert("请选择要启用的用户!",{skin: 'layer-ext-myskin',icon: 3, title:'提示'});
  456. }else{
  457. layer.confirm('确定要启用选择的用户吗?', {skin: 'layer-ext-myskin',icon: 3, title:'提示'}, function(index){
  458. $.post(
  459. "user/enableall",{'ids':ids},
  460. function (data) {
  461. layer.msg(data.msg, {icon: data.icon,time: 3000}, function () {
  462. window.location.reload();
  463. })
  464. }
  465. )
  466. layer.close(index);
  467. })
  468. }
  469. })
  470. })
  471. <?php echo '</script'; ?>
  472. >
  473. </body>
  474. </html><?php }
  475. }