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
112
113
<?php
$id = $this->session->userdata['logged_in']['user_type'];
?>
<div class="content-wrapper" >
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
Role Management
</h1>
<ol class="breadcrumb">
<li><a href="#"><i class="fa fa-male"></i>Home</a></li>
<li class="active"> Role Management</li>
</ol>
</section>
<!-- Main content -->
<section class="content">
<div class="row">
<div class="col-xs-12">
<div class="result-role" style="display:none;background-color: white;width: 100%;height: 50px;color: green;font-size: 18px">
</div>
</div>
<!-- form -->
<div class="col-md-12">
<!-- general form elements -->
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">Role Management</h3>
</div><!-- /.box-header -->
<!-- form start -->
<form class="form-horizontal" method="post" data-parsley-validate="" class="validate" id="permission">
<?php
$count =0;
?>
<table class="table">
<?php
foreach ($newarray as $rs) {
if($count%3==0){?>
<tr>
<?php }
++$count;
?>
<td>
<div class="box-body" style="padding-left: 80px;width: 280px">
<label><input type="checkbox" <?php foreach($rs->functions as $res){if(in_array($res->id, $access)) { echo "checked";}break;} ?> id="<?php echo $rs->controller_name ;?>" onclick="check_fun($(this));"> <?php echo $rs->controller_name ;?></label>
<?php
foreach ($rs->functions as $res) {
?>
<div class="form-group">
<div class="col-sm-10">
<div class="checkbox">
<label>
<input type="checkbox" <?php if(in_array($res->id, $access)) { echo "checked";} ?> id="<?php echo $rs->controller_name ;?><?php echo $res->id;?>" class="<?php echo $rs->controller_name;?>" name="<?php echo $rs->controller_name ;?>[]" value="<?php echo $res->id;?>" onclick="check_sub($(this));" > <?php echo $res->label;?> </label>
</div>
</div>
</div>
<?php }?>
</div> </td>
<?php
if($count%3==0){?>
</tr>
<?php }
?>
<?php
}
?>
<?php
if($count%3!=0){?>
</tr>
<?php } ?>
</table>
<div class="box-footer">
<div class="col-sm-6">
<button type="submit" class="btn btn-info pull-right">Submit</button>
</div>
</div>
</form>
</div><!-- /.box -->
</div>
<!-- form -->
</div>
<!-- /.row -->
</section>
<!-- /.content -->
</div>