Repository navigation
Expand file tree
/
Copy pathindex.php
More file actions
106 lines (105 loc) · 2.59 KB
/
Copy pathindex.php
File metadata and controls
106 lines (105 loc) · 2.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<?php
require('../../global.php');
//验证是否登入
if(!checkLogin()){
redirect('../error.php?code='.$errorcode['noLogin']);
}
//验证是否为管理员
else if(!checkAdmin()){
redirect('../error.php?code='.$errorcode['noAdmin']);
}
//验证是否有权限
else if(!checkPermissions(5)){
redirect('../error.php?code='.$errorcode['noPermissions']);
}
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>类目管理</title>
<?php include('sysapp/global_css.php'); ?>
<style>
body{
margin: 0 10px;
}
</style>
</head>
<body>
<div id="toorbar">
<a class="btn btn-primary" href="javascript:openDetailIframe('detail.php');"><i class="glyphicon glyphicon-plus"></i> 创建新类目</a>
</div>
<table id="table"></table>
<?php include('sysapp/global_module_detailIframe.php'); ?>
<?php include('sysapp/global_js.php'); ?>
<script>
$(function(){
$('#table').bootstrapTable({
height : $(window).height(),
url : 'index.ajax.php',
queryParams : function(params){
params['ac'] = 'getList';
return params;
},
columns : [
{
title : '类目名称',
field : 'name',
halign : 'left',
valign : 'middle',
sortable : true,
},
{
title : '操作',
field : 'do',
align : 'center',
valign : 'middle',
width : 150
}
],
striped : true, // 开启隔行换色
showRefresh : true, // 显示刷新按钮
// 工具栏
toolbar : '#toorbar',
// 搜索
search : true,
// 分页
pagination : true, // 开启分页
sidePagination : 'server', // 在服务器进行分页
paginationPreText : '上一页',
paginationNextText : '下一页',
});
//删除
$('#table').on('click', '.do-del', function(){
var id = $(this).data().id;
var name = $(this).data().name;
swal({
type : 'warning',
title : '删除 “' + name + '” 类目',
text : '删除类目的同时会将该类目下的所有应用归类到「未分类」<br />确认要删除么?',
html : true,
showCancelButton : true,
confirmButtonText : '确认删除',
cancelButtonText : '我点错了',
closeOnConfirm : false,
showLoaderOnConfirm : true
}, function(){
$.ajax({
type : 'POST',
url : 'index.ajax.php',
data : 'ac=del&id=' + id
}).done(function(){
swal({
type: 'success',
title: '操作成功',
timer: 2000,
showConfirmButton: false
});
$('#table').bootstrapTable('refresh');
});
});
});
});
</script>
</body>
</html>