?
Current Path : /home1/savoy/www/oscarerp.com/application/views/settings/ |
Linux gator3171.hostgator.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64 |
Current File : /home1/savoy/www/oscarerp.com/application/views/settings/permission_list_by_employee_profile.php |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); $this->load->view('documentreadyfunctions'); ?> <script> $(document).ready(function() { $('#selectall').click(function(event) { //on click if(this.checked) { // check select status $('.report_select').each(function() { //loop through each checkbox this.checked = false; //select all checkboxes with class "checkbox1" }); }else{ $('.report_select').each(function() { //loop through each checkbox this.checked = true; //deselect all checkboxes with class "checkbox1" }); } }); }); </script> <br/><br/> <div class="grid_12"> <div class="box"> <div class="content no-padding"> <div class="section _100"> <label for="data">Designation</label> <div> <?=$designation_name;?> </div> </div> </div> <table class="table"> <thead> <tr> <th>Module Name</th> <th><input style="width: 15px;" type="checkbox" id="view_check_all" onchange="check_all_view(this,'view_','')">View </th> <th><input style="width: 15px;" type="checkbox" id="add_check_all" onchange="check_all_view(this,'add_','')">Create </th> <th><input style="width: 15px;" type="checkbox" id="edit_check_all" onchange="check_all_view(this,'edit_','')"> Edit</th> <th><input style="width: 15px;" type="checkbox" id="delete_check_all" onchange="check_all_view(this,'delete_','')">Delete</th> <th><input style="width: 15px;" type="checkbox" id="delete_check_all" onchange="check_all_view(this,'homepage_','')">Home Page</th> </tr> </thead> <tbody> <?php $modname=""; $i=1; $j=0; $viewCount=0; $initialPermission=""; $moduleidList=""; $tmp = $viewinfo[0]; $homepage_list = $tmp['profile_modules_home_page']; $is_homepage = explode(',', $tmp['profile_modules_home_page']); $allowed=explode(",",$tmp['profile_modules']); $edit_del=explode(",",$tmp['profile_modules_permission']); foreach ($modules as $menulst) { $menuid=$menulst['menu_id']; $poss=''; for($i=1;$i<sizeof($allowed)+1;$i++) if($allowed[$i-1]==$menuid) $poss=$i; if($poss!='') $val=$edit_del[$poss-1]; else { $val=0; $val1=0; } $a=decbin($val); $d=sprintf('%04u',$a); $ar = str_split($d); $viewCount++; $initialPermission .= "0,"; $moduleidList .= $menulst['menu_id'].","; if($modname!=$menulst['module_name']) { $modname=$menulst['module_name']; ?> <tr> <th style="background-color:lavender;"><span><?=$menulst['module_title'];?></span></th> <th style="background-color:lavender;"><input style="width: 15px;" class="" type="checkbox" id="view_<?=$modname?>" onchange="check_module_view('view_','<?=$modname?>')"></th> <th style="background-color:lavender;"><input style="width: 15px;" class="" type="checkbox" id="add_<?=$modname?>" onchange="check_module_view('add_','<?=$modname?>')"></th> <th style="background-color:lavender;"><input style="width: 15px;" class="" type="checkbox" id="edit_<?=$modname?>" onchange="check_module_view('edit_','<?=$modname?>')"></th> <th style="background-color:lavender;"><input style="width: 15px;" class="" type="checkbox" id="delete_<?=$modname?>" onchange="check_module_view('delete_','<?=$modname?>')"></th> <th style="background-color:lavender;"><input style="width: 15px;" class="" type="checkbox" id="homepage_<?=$modname?>" onchange="check_module_view('homepage_','<?=$modname?>')"></th> </tr> <tr> <td><?=$menulst['caption']; ?></td> <td style="text-align:center;"><input class="" style="width: 15px;" onchange="check_all_view(this,'','view_')" name="view_<?=$modname?>[]" id="view_<?php echo $j;?>" value="8" type="checkbox" <?php if($ar[0]=="1"){ echo 'checked="checked"'; } ?>></td> <td style="text-align:center;"><input class="" style="width: 15px;" onchange="check_all_view(this,'','add_')" name="addt_<?=$modname?>[]" id="add_<?php echo $j;?>" value="4" type="checkbox" <?php if($ar[1]=="1"){ echo 'checked="checked"'; } ?>></td> <td style="text-align:center;"><input class="" style="width: 15px;" onchange="check_all_view(this,'','edit_')" name="edit_<?=$modname?>[]" id="edit_<?php echo $j;?>" value="2" type="checkbox" <?php if($ar[2]=="1"){ echo 'checked="checked"'; } ?>></td> <td style="text-align:center;"><input class="" style="width: 15px;" onchange="check_all_view(this,'','delete_')" name="delete_<?=$modname?>[]" id="delete_<?php echo $j;?>" value="1" type="checkbox" <?php if($ar[3]=="1"){ echo 'checked="checked"'; } ?>></td> <td style="text-align:center;"><input class="" style="width: 15px;" onchange="check_all_view(this,'','delete_')" name="homepage_<?=$modname?>[]" id="homepage_<?php echo $j;?>" value="1" type="checkbox" <?php if($is_homepage[$j] == 1) { echo "checked"; } ?>></td> </tr> <?php $i++; } else { ?> <tr> <td><?=$menulst['caption']; ?></td> <td style="text-align:center;"><input class="" style="width: 15px;" onchange="check_all_view(this,'','view_')" name="view_<?=$modname?>[]" id="view_<?php echo $j;?>" value="8" type="checkbox" <?php if($ar[0]=="1"){ echo 'checked="checked"'; } ?> ></td> <td style="text-align:center;"><input class="" style="width: 15px;" onchange="check_all_view(this,'','add_')" name="add_<?=$modname?>[]" id="add_<?php echo $j;?>" value="4" type="checkbox" <?php if($ar[1]=="1"){ echo 'checked="checked"'; } ?>></td> <td style="text-align:center;"><input class="" style="width: 15px;" onchange="check_all_view(this,'','edit_')" name="edit_<?=$modname?>[]" id="edit_<?php echo $j;?>" value="2" type="checkbox" <?php if($ar[2]=="1"){ echo 'checked="checked"'; } ?>></td> <td style="text-align:center;"><input class="" style="width: 15px;" onchange="check_all_view(this,'','delete_')" name="delete_<?=$modname?>[]" id="delete_<?php echo $j;?>" value="1" type="checkbox" <?php if($ar[3]=="1"){ echo 'checked="checked"'; } ?>></td> <td style="text-align:center;"><input class="" style="width: 15px;" onchange="check_all_view(this,'','homepage_')" name="homepage_<?=$modname?>[]" id="homepage_<?php echo $j;?>" value="1" type="checkbox" <?php if($is_homepage[$j] == 1) { echo "checked"; } ?>></td> </tr> <?php } $j++; } ?> </tbody> </table> </div> <div class="box"> <table class="table"> <thead> <tr> <th>Module Name</th> <th><input style="width: 15px;" type="checkbox" id="selectall"></th> </tr> </thead> <tbody> <?php $reports=$this->mastermodel->getdatas('report','report_module_id'); foreach($reports as $list) { ?> <tr> <td style="text-align:center;"><?=$list['report_label'];?></td> <th><input style="width: 15px;" type="checkbox" class="report_select" value="<?=$list['report_id'];?>" name="report_select[]"></th> </tr> <?php } ?> </tbody> </table> </div> </div> <input type="hidden" id="ViewCount" value='<?php echo $viewCount?>'/> <input type="hidden" id="TxtPermissionList" name="modules_permission" value='<?php echo $tmp['profile_modules_permission']?>'/> <input type="hidden" id="ModuleidList" name="user_modules" value="<?php echo $moduleidList?>"/> <input type="hidden" id="home_page_list" name="user_home_page" value="<?php echo $homepage_list?>"/> <div class="grid_12"> <div class="box"> <div class="actions"> <div class="actions-left"> <input type="reset"> <input type="hidden" name="resfunction" value="search_profile"/> </div> <div class="actions-right"> <button style="margin-left: 130px;" type="submit" id="submit" class="clickimage" onclick="addformdata('validateform')">Save</button> </div> </div> </div> </div>