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
107
108
109
110
<?php
$readonly = (strtolower(trim($groupById[0]['name'])) == 'dcv_super_admin') ? 'readonly' : null;
$input_name = array(
'name' => 'name',
'type' => 'text',
'value' => ($name) ? $name : $groupById[0]['name'],
'placeholder' => '',
'class' => '',
'style' => 'width: 100%'
);
$input_description = array(
'name' => 'description',
'type' => 'text',
'value' => ($description) ? $description : $groupById[0]['description'],
'placeholder' => '',
'class' => '',
'style' => 'width: 100%'
);
(strtolower(trim($groupById[0]['name'])) == 'dcv_super_admin') ? $input_name['readonly'] = true : null;
(strtolower(trim($groupById[0]['name'])) == 'dcv_super_admin') ? $input_description['readonly'] = true : null;
?>
<div class="row">
<div class="widget-box">
<div class="widget-header">
<p class="widget-title">Thêm mới nhóm quản trị</p>
</div>
<div class="widget-body">
<div class="widget-main">
<?php
$attributes = array('class' => 'form-horizontal', 'id' => 'myform');
echo form_open(base_url().'backend/cmsSetting/editGroup/'.$groupById[0]['id'], $attributes);
?>
<div class="form-group">
<label class="col-lg-3"></label>
<div class="col-lg-3">
<input type="hidden" name="id" value="<?php echo $groupById[0]['id']; ?>" />
<?php
if(validation_errors()){echo form_error('id', '<div class="error">', '</div>');}
?>
</div>
</div><div class="form-group">
<label class="col-lg-3">Mã nhóm (*)</label>
<div class="col-lg-3">
<?php
echo form_input($input_name);
if(validation_errors()){echo form_error('name', '<div class="error">', '</div>');}
?>
</div>
</div>
<div class="form-group">
<label class="col-lg-3">Mô tả nhóm (*)</label>
<div class="col-lg-3">
<?php
echo form_input($input_description);
if(validation_errors()){echo form_error('description', '<div class="error">', '</div>');}
?>
</div>
</div>
<div class="form-group">
<label class="col-lg-3">Kích hoạt</label>
<div class="col-lg-3">
<?php $isActive = ($is_active) ? $is_active : $groupById[0]['is_active'] ?>
<input name="is_active" type="checkbox" <?php if($isActive == 'on' || $isActive == 1) echo 'checked'; ?> <?php if(strtolower(trim($groupById[0]['name'])) == 'dcv_super_admin'){echo 'disabled';}?>>
</div>
</div>
<div class="form-group">
<label class="col-lg-3">Gán quyền Controller cho Nhóm</label>
<div class="col-lg-9">
<?php if(strtolower(trim($groupById[0]['name'])) != 'dcv_super_admin'): ?>
<div class="row">
<?php
$permissionListSelected = ($group_access_controller_submit) ? $group_access_controller_submit : $group_access_controller;
foreach($controllerList as $controllerItem): ?>
<div class="col-lg-6">
<label>
<input name="group_access_controller[]" type="checkbox" value="<?php echo $controllerItem['id']; ?>" <?php if($permissionListSelected && in_array($controllerItem['id'], $permissionListSelected)) echo ' checked ' ?>/>
<?php echo $controllerItem['name'].' ('.$controllerItem['description'].')'; ?>
</label>
</div>
<?php endforeach; ?>
</div>
<?php else: ?>
<div class="row">Full quyền truy cập.</div>
<?php endif; ?>
</div>
</div>
<div class="form-group">
<div class="col-lg-3">
<a href="<?php echo base_url().'backend/cmsSetting/listGroup'?>" onclick="return confirm('Bạn có chắc chắn muốn quay lại Danh sách không?')">
<button type="button" class="btn btn-sm btn-default">
<i class="ace-icon fa fa-arrow-left"></i>Quay lại
</button>
</a>
</div>
<?php if(strtolower(trim($groupById[0]['name'])) != 'dcv_super_admin'): ?>
<div class="col-lg-4">
<button class="btn btn-sm btn-primary" type="submit" name="btnSave">
<i class="ace-icon fa fa-check bigger-110"></i>Lưu lại
</button>
<button class="btn btn-sm" type="reset">
<i class="ace-icon fa fa-undo bigger-110"></i>Xóa form
</button>
</div>
<?php endif; ?>
</div>
<?php echo form_close(); ?>
</div>
</div>
</div>
</div><!-- /.row -->