-
Notifications
You must be signed in to change notification settings - Fork 0
/
add_group.php
111 lines (105 loc) · 4.78 KB
/
add_group.php
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
111
<?php $title = 'Add Group'; ?>
<?php
include_once 'includes/includes.php';
$session = new Session();
$functions = new Functions();
if($session->isUserLoggedIn() == false){
$functions->redirect('index.php');
}
$functions->edit_add_permission_access('create');
?>
<style>
.card{
width:100% !important;
}
</style>
</head>
<body>
<?php include 'includes/layout/topBar.php' ?>
<div class="row" style="margin-top:30px">
<div class="col-md-12 col-lg-2">
<?php include 'includes/layout/sidebar.php' ?>
</div>
<div class="col-md-10 main-content">
<div class="ui breadcrumb">
<a class="section">Home</a>
<div class="divider"> / </div>
<a class="section" href="groups.php">Groups</a>
<div class="divider"> / </div>
<div class="active section">Add Group</div>
</div>
<div class="html ui top attached segment">
<div class="ui top attached label">Add Group</div>
<div class="content">
<form action="?" method="post">
<div class="form-group">
<label>Group Name</label>
<div class="ui input">
<input type="text" name="group_name" id="group_name" placeholder="Group Name" required>
</div>
</div>
<div class="form-group">
<label>Permissions</label>
</div>
<table id="example2" class="table table-striped " style="width:100%">
<thead>
<tr>
<th></th>
<th>Create</th>
<th>View</th>
<th>Update</th>
<th>Delete</th>
</thead>
<tbody>
<?php foreach ($menus as $menu):?>
<?php
if($menu->label == "Manage stock"){
$menu->label = "Stock";
}
?>
<?php if($menu->label != "Logout"): ?>
<tr id="<?php echo $menu->label ?>" class="modules">
<td><?php echo $menu->label ?></td>
<td>
<?php if(in_array("create",$menu->permissions)):?>
<input onclick="toggle_permission('<?php echo $menu->label; ?>','create')" id="<?php echo $menu->label.'_create'; ?>" type="checkbox" name="example">
<?php else:?>
-
<?php endif?>
</td>
<td>
<?php if(in_array("view",$menu->permissions)):?>
<input onclick="toggle_permission('<?php echo $menu->label; ?>','view')" id="<?php echo $menu->label.'_view'; ?>" type="checkbox" name="example">
<?php else:?>
-
<?php endif?>
</td>
<td>
<?php if(in_array("update",$menu->permissions)):?>
<input onclick="toggle_permission('<?php echo $menu->label; ?>','update')" id="<?php echo $menu->label.'_update'; ?>" type="checkbox" name="example">
<?php else:?>
-
<?php endif?>
</td>
<td>
<?php if(in_array("delete",$menu->permissions)):?>
<input onclick="toggle_permission('<?php echo $menu->label; ?>','delete')" id="<?php echo $menu->label.'_delete'; ?>" type="checkbox" name="example">
<?php else:?>
-
<?php endif?>
</td>
</tr>
<?php endif ?>
<?php endforeach?>
</tbody>
</table>
<button name="submit" type="button" onclick="function_add_group('insert')" class="ui small primary labeled icon button">
<i class="add icon"></i> Save
</button>
</form>
</div>
</div>
</div>
</div>
</div>
<?php include_once 'includes/layout/footer.php'?>