<tr class="type-one-header"> <th width="7%" bgcolor="#D6D6D6">Date</th> <th width="7%" bgcolor="#D6D6D6"><strong>Employee No.</strong></th> <th width="18%" bgcolor="#D6D6D6"><strong>Employee Name</strong></th> <th width="8%" bgcolor="#D6D6D6">AM Login</th> <th width="9%" bgcolor="#D6D6D6">AM Logout </th> <th width="8%" bgcolor="#D6D6D6">PM Login</th> <th width="9%" bgcolor="#D6D6D6">PM Logout </th> <th width="9%" bgcolor="#D6D6D6">OT Login</th> <th width="8%" bgcolor="#D6D6D6">OT Logout </th> <th width="17%" bgcolor="#D6D6D6">OB/LEAVE</th> </tr> <?php $p = new Permission_m(); $permissions = $p->get_by_group_id(Session::get('group_id')); $read_only = FALSE; foreach ($permissions as $permission) { if ($permission->module == 'attendance') { $users_methods_access = json_decode($permission->roles); if (in_array('view_attendance_only', $users_methods_access)) { $read_only = TRUE; } } } ?> <?php //number of results $id = 1; $i = 1;
function print_user_access() { if ($this->ci->input->is_ajax_request()) { return; } return; $u = new User_m(); $u->get_by_username($this->ci->session->userdata('username')); $u->get(); $p = new Permission_m(); $permissions = $p->get_by_group_id($u->group_id); foreach ($this->permissions as $permission) { echo '<br>' . $permission->module; $methods = json_decode($permission->roles); $i = 0; if (is_array($methods)) { foreach ($methods as $method) { if ($i == 0) { echo '<br>----'; $i++; } echo $method . ', '; } } //print_r($methods); } //print_r( $this->user_access); }