File manager - Edit - /home/autoph/public_html/tasks/role_action_new.php.tar
Back
home/autoph/public_html/connectv1/role_action_new.php 0000644 00000573250 15025005275 0017073 0 ustar 00 <?php include('cfg/db.php'); // include('app/security/security.php'); // include('api/controllers/utility.php'); if (!isset($_SESSION['user']['id'])) { header('location:signin.php'); } if (!(isset($global_action_permissions['4']['6']) && in_array("1", $global_action_permissions['4']['6']))) { header('location:signin.php'); } /* NOTES: id="" data-relative="" auto hceck dashboard after clicking save // */ /* JSON ROLE GUIDE { "1": { //first level "1": ["1", "2", "3"], //2nd level "2": { //3rd level "1": ["1", "2"], "2": ["1", "2"], "3": { //4th level "1": ["1", "2"], "2": ["1", "2"] }, "4": {} } } } */ // if(!(isset($_SESSION['user']['action_permissions']['4']['sub_6_1']) && // $_SESSION['user']['action_permissions']['4']['sub_6_1'])){ // header('location:signin.php'); // } // $check_page = new CheckPage(); // $utility_class = new Utility(); // $check_page->start($db); $action = isset($_REQUEST['q']) ? $_REQUEST['q'] : ''; if (!$utility_class->isNotEmpty($action)) { header('location:role.php'); } $page_title = ""; $role_id = 0; if (trim($_REQUEST['q']) == 'new') { header('location:role.php'); //temporary $page_title = "Add Role"; } else { $page_title = "Update Role"; $role_id = $db->escape($_REQUEST['q']); $company_name = $db->select("SELECT name FROM `employee_role` WHERE status = 1 AND id = $role_id /*AND id <> 1*/"); if (!$utility_class->isNotEmpty($company_name)) { header('location:role.php'); } } $hasAccess = $db->select("SELECT action_permissions FROM `employee_role_access` WHERE status = 1 AND employee_role_id = '$role_id'"); if ($utility_class->isNotEmpty($hasAccess)) { $hasAccessArray = (json_decode($hasAccess, true)); } else { $hasAccessArray = array(); } // print_r($hasAccessArray); // echo $hasAccessArray['dashboard_permission']['dashboard_view_page']; // exit; ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title><?php echo $variable['site_name']; ?> | <?php echo $page_title; ?></title> <!-- Google Font: Source Sans Pro --> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700&display=fallback"> <!-- Font Awesome --> <link rel="stylesheet" href="plugins/fontawesome-free/css/all.min.css"> <!-- Theme style --> <link rel="stylesheet" href="dist/css/adminlte.min.css"> <!-- overlayScrollbars --> <link rel="stylesheet" href="plugins/overlayScrollbars/css/OverlayScrollbars.min.css"> <!-- Default style --> <link rel="stylesheet" href="dist/css/default.css"> <!-- Toastr --> <link rel="stylesheet" href="plugins/toastr/toastr.min.css"> <link href="dist/img/<?php echo $variable['logo']; ?>" rel="icon" /> </head> <body class="hold-transition sidebar-mini text-sm layout-fixed"> <div class="wrapper"> <!-- INCLUDE HEADER --> <?php include('include/header.php'); ?> <?php include('include/sidebar.php'); ?> <!-- /.navbar --> <!-- Content Wrapper. Contains page content --> <div class="content-wrapper"> <!-- Content Header (Page header) --> <section class="content-header"> <div class="container-fluid"> <div class="row mb-2"> <div class="col-sm-6"> <h1><?php echo $page_title; ?></h1> </div> <!-- <div class="col-sm-6"> <ol class="breadcrumb float-sm-right"> <li class="breadcrumb-item"><a href="home.php">Home</a></li> <li class="breadcrumb-item active"><?php echo $page_title; ?></li> </ol> </div> --> </div> </div><!-- /.container-fluid --> </section> <!-- Main content --> <section class="content"> <div class="container-fluid"> <div class="row"> <!-- left column --> <div class="col-md"> <!-- general form elements --> <div class="card card-primary"> <div class="card-header"> <h3 class="card-title"><button class="btn btn-tool" title="Go to Vehicle table list" type="button" onclick="back()"><i class="fas fa-arrow-alt-circle-left fa-2x"></i></button> Update <?php echo $company_name; ?> Role </h3> </div><!-- /.card-header --> <div class="card-body"> <div class="row my-0 mx-0"> <div class="col-md-3 pl-0"> <!-- text input --> <div class="form-group"> <div class="form-group dropdown-input"> <input style="text-transform: uppercase;" type="text" value="<?php echo $company_name; ?>" name="role" id="role" class="form-control form-control-sm" placeholder="Role name" maxlength="30"> </div> <!--form-group dropdown--> </div> <!--form-group--> </div> </div> <!--row--> <div class="col-12"> <div class="card collapsed-card mb-2"> <div class="card-header bg-light pl-2 pt-1 pb-1"> <h3 class="card-title text-md pt-1">DATA MANAGEMENT</h3> <div class="card-tools"> <button type="button" class="btn btn-tool role-toggle text-dark" data-card-widget="collapse"> <i class="fas fa-plus"></i> </button> </div> </div> <!-- /.card-header pl-2 pt-1 pb-1 --> <div class="card-body p-0"> <table id="role-table" class="table table-bordered table-sm"> <thead> <tr> <th class="">Feature</th> <th class="">Capabilities</th> </tr> </thead> <tbody> <tr> <td>Dashboard</td> <td> <div class="checkbox"> <!-- level-id underscore data-access --> <input data-check-ids="" data-uncheck-ids="" id="1_1" data-access="1" level-one="1" type="checkbox" <?php echo isset($hasAccessArray['1']) && in_array("1", $hasAccessArray['1']) ? 'checked' : ''; ?>> <span class="mb-0" for="">View Page</span> </div> </td> </tr> <tr> <td>Import</td> <td> <div class="checkbox"> <input id="" data-check-ids="" data-uncheck-ids="" data-access="1" level-one="2" level-two="1" level-three="2" type="checkbox" <?php if (isset($hasAccessArray['2']['1']['2'])) { echo (in_array("1", $hasAccessArray['2']['1']['2'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> New Template Import</span> </div> <div class="checkbox"> <input id="" data-check-ids="" data-uncheck-ids="" data-access="1" level-one="2" level-two="1" level-three="3" type="checkbox" <?php if (isset($hasAccessArray['2']['1']['3'])) { echo (in_array("1", $hasAccessArray['2']['1']['3'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> Old Template (DMS)</span> </div> <div class="checkbox"> <input id="" data-check-ids="" data-uncheck-ids="" data-access="1" level-one="2" level-two="1" level-three="4" type="checkbox" <?php if (isset($hasAccessArray['2']['1']['4'])) { echo (in_array("1", $hasAccessArray['2']['1']['4'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> FNI Excel</span> </div> <div class="checkbox"> <input id="" data-check-ids="" data-uncheck-ids="" data-access="1" level-one="2" level-two="1" level-three="5" type="checkbox" <?php if (isset($hasAccessArray['2']['1']['5'])) { echo (in_array("1", $hasAccessArray['2']['1']['5'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> FNI Excel (PDC)</span> </div> <div class="checkbox"> <input id="" data-check-ids="" data-uncheck-ids="" data-access="1" level-one="2" level-two="1" level-three="6" type="checkbox" <?php if (isset($hasAccessArray['2']['1']['6'])) { echo (in_array("1", $hasAccessArray['2']['1']['6'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> Bank Excel</span> </div> </td> </tr> <!-- IMPORT PAGE --> <!-- CUSTOMER PAGE --> <tr> <td>Customer</td> <td> <div class="checkbox"> <!-- level-id underscore data-access --> <input id="2_3_1" data-check-ids="" data-uncheck-ids="2_3_2,2_3_3,2_3_4,2_3_5" data-access="1" level-one="2" level-two="3" type="checkbox" <?php if (isset($hasAccessArray['2']['3'])) { echo (in_array("1", $hasAccessArray['2']['3'])) ? 'checked' : ''; } ?>> <span class="mb-0" for="">View Page</span> </div> <div class="checkbox"> <input id="2_3_2" data-check-ids="2_3_1" data-uncheck-ids="" data-access="2" level-one="2" level-two="3" type="checkbox" <?php if (isset($hasAccessArray['2']['3'])) { echo (in_array("2", $hasAccessArray['2']['3'])) ? 'checked' : ''; } ?>> <span class="mb-0" for="">Create</span> </div> <div class="checkbox"> <input id="2_3_3" data-check-ids="2_3_1" data-uncheck-ids="" data-access="3" level-one="2" level-two="3" type="checkbox" <?php if (isset($hasAccessArray['2']['3'])) { echo (in_array("3", $hasAccessArray['2']['3'])) ? 'checked' : ''; } ?>> <span class="mb-0" for="">Edit</span> </div> <div class="checkbox"> <input id="2_3_4" data-check-ids="2_3_1" data-uncheck-ids="" data-access="4" level-one="2" level-two="3" type="checkbox" <?php if (isset($hasAccessArray['2']['3'])) { echo (in_array("4", $hasAccessArray['2']['3'])) ? 'checked' : ''; } ?>> <span class="mb-0" for="">Force Create/Edit Duplicate mobile & email</span> </div> <div class="checkbox"> <input id="2_3_5" data-check-ids="2_3_1" data-uncheck-ids="" data-access="5" level-one="2" level-two="3" type="checkbox" <?php if (isset($hasAccessArray['2']['3'])) { echo (in_array("5", $hasAccessArray['2']['3'])) ? 'checked' : ''; } ?>> <span class="mb-0" for="">Delete</span> </div> </td> </tr> <!-- CUSTOMER PAGE --> <!-- VEHICLE PAGE --> <tr> <td>Vehicle</td> <td> <div class="checkbox"> <input id="2_4_1" data-check-ids="" data-uncheck-ids="2_4_2,2_4_3,2_4_4" data-access="1" level-one="2" level-two="4" type="checkbox" <?php if (isset($hasAccessArray['2']['4'])) { echo (in_array("1", $hasAccessArray['2']['4'])) ? 'checked' : ''; } ?>> <span class="mb-0" for="">View Page</span> </div> <div class="checkbox"> <input id="2_4_2" data-check-ids="2_4_1" data-uncheck-ids="" data-access="2" level-one="2" level-two="4" type="checkbox" <?php if (isset($hasAccessArray['2']['4'])) { echo (in_array("2", $hasAccessArray['2']['4'])) ? 'checked' : ''; } ?>> <span class="mb-0" for="">Create</span> </div> <div class="checkbox"> <input id="2_4_3" data-check-ids="2_4_1" data-uncheck-ids="" data-access="3" level-one="2" level-two="4" type="checkbox" <?php if (isset($hasAccessArray['2']['4'])) { echo (in_array("3", $hasAccessArray['2']['4'])) ? 'checked' : ''; } ?>> <span class="mb-0" for="">Edit</span> </div> <div class="checkbox"> <input id="2_4_4" data-check-ids="2_4_1" data-uncheck-ids="" data-access="4" level-one="2" level-two="4" type="checkbox" <?php if (isset($hasAccessArray['2']['4'])) { echo (in_array("4", $hasAccessArray['2']['4'])) ? 'checked' : ''; } ?>> <span class="mb-0" for="">Delete</span> </div> </td> </tr> <!-- VEHICLE PAGE --> <!-- SERVICE PAGE --> <tr> <td>Service</td> <td> <div class="checkbox"> <input id="2_2_1" data-check-ids="" data-uncheck-ids="2_2_2,2_2_3" data-access="1" level-one="2" level-two="2" type="checkbox" <?php if (isset($hasAccessArray['2']['2'])) { echo (in_array("1", $hasAccessArray['2']['2'])) ? 'checked' : ''; } ?>> <span class="mb-0" for="">View Page</span> </div> <div class="checkbox"> <input id="2_2_2" data-check-ids="2_2_1" data-uncheck-ids="" data-access="2" level-one="2" level-two="2" type="checkbox" <?php if (isset($hasAccessArray['2']['2'])) { echo (in_array("2", $hasAccessArray['2']['2'])) ? 'checked' : ''; } ?>> <span class="mb-0" for="">Create</span> </div> <div class="checkbox"> <input id="2_2_3" data-check-ids="2_2_1" data-uncheck-ids="" data-access="3" level-one="2" level-two="2" type="checkbox" <?php if (isset($hasAccessArray['2']['2'])) { echo (in_array("3", $hasAccessArray['2']['2'])) ? 'checked' : ''; } ?>> <span class="mb-0" for="">Edit</span> </div> </td> </tr> <!-- SERVICE PAGE --> <!-- SALES PAGE --> <tr> <td>Sales</td> <td> <div class="checkbox"> <input id="" data-check-ids="" data-uncheck-ids="" data-access="1" level-one="2" level-two="5" type="checkbox" <?php if (isset($hasAccessArray['2']['5'])) { echo (in_array("1", $hasAccessArray['2']['5'])) ? 'checked' : ''; } ?>> <span class="mb-0" for="">View Page</span> </div> </td> </tr> <!-- SALRES PAGE --> <!-- FINANCE --> <tr> <td>Finance</td> <td> <div class="checkbox"> <input id="" data-check-ids="" data-uncheck-ids="" data-access="1" level-one="2" level-two="42" level-three="7" type="checkbox" <?php if (isset($hasAccessArray['2']['42']['7'])) { echo (in_array("1", $hasAccessArray['2']['42']['7'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> FNI Dashboard</span> </div> <div class="checkbox"> <input id="2_42_8_1" data-check-ids="" data-uncheck-ids="2_42_8_2,2_42_8_3,2_42_8_4" data-access="1" level-one="2" level-two="42" level-three="8" type="checkbox" <?php if (isset($hasAccessArray['2']['42']['8'])) { echo (in_array("1", $hasAccessArray['2']['42']['8'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> FNI List</span> </div> <div class="checkbox pl-3"> <input id="2_42_8_2" data-check-ids="2_42_8_1" data-uncheck-ids="" data-access="2" level-one="2" level-two="42" level-three="8" type="checkbox" <?php if (isset($hasAccessArray['2']['42']['8'])) { echo (in_array("2", $hasAccessArray['2']['42']['8'])) ? 'checked' : ''; } ?>> <span class="mb-0" for="">Create</span> </div> <div class="checkbox pl-3"> <input id="2_42_8_3" data-check-ids="2_42_8_1" data-uncheck-ids="" data-access="3" level-one="2" level-two="42" level-three="8" type="checkbox" <?php if (isset($hasAccessArray['2']['42']['8'])) { echo (in_array("3", $hasAccessArray['2']['42']['8'])) ? 'checked' : ''; } ?>> <span class="mb-0" for="">Edit</span> </div> <div class="checkbox pl-3"> <input id="2_42_8_4" data-check-ids="2_42_8_1" data-uncheck-ids="" data-access="4" level-one="2" level-two="42" level-three="8" type="checkbox" <?php if (isset($hasAccessArray['2']['42']['8'])) { echo (in_array("4", $hasAccessArray['2']['42']['8'])) ? 'checked' : ''; } ?>> <span class="mb-0" for="">Delete</span> </div> <div class="checkbox"> <input id="2_42_9_1" data-check-ids="" data-uncheck-ids="2_42_9_2,2_42_9_3,2_42_9_4" data-access="1" level-one="2" level-two="42" level-three="9" type="checkbox" <?php if (isset($hasAccessArray['2']['42']['9'])) { echo (in_array("1", $hasAccessArray['2']['42']['9'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> FNI PDC List</span> </div> <div class="checkbox pl-3"> <input id="2_42_9_2" data-check-ids="2_42_9_1" data-uncheck-ids="" data-access="2" level-one="2" level-two="42" level-three="9" type="checkbox" <?php if (isset($hasAccessArray['2']['42']['9'])) { echo (in_array("2", $hasAccessArray['2']['42']['9'])) ? 'checked' : ''; } ?>><span class="mb-0" for="">Create</span> </div> <div class="checkbox pl-3"> <input id="2_42_9_3" data-check-ids="2_42_9_1" data-uncheck-ids="" data-access="3" level-one="2" level-two="42" level-three="9" type="checkbox" <?php if (isset($hasAccessArray['2']['42']['9'])) { echo (in_array("3", $hasAccessArray['2']['42']['9'])) ? 'checked' : ''; } ?>><span class="mb-0" for="">Edit</span> </div> <div class="checkbox pl-3"> <input id="2_42_9_4" data-check-ids="2_42_9_1" data-uncheck-ids="" data-access="4" level-one="2" level-two="42" level-three="9" type="checkbox" <?php if (isset($hasAccessArray['2']['42']['9'])) { echo (in_array("4", $hasAccessArray['2']['42']['9'])) ? 'checked' : ''; } ?>><span class="mb-0" for="">Delete</span> </div> </td> </tr> <tr> <td>Bank Database</td> <td> <div class="checkbox"> <input id="2_49_10_1" data-check-ids="" data-uncheck-ids="2_49_10_2,2_49_10_3" data-access="1" level-one="2" level-two="49" level-three="10" type="checkbox" <?php if (isset($hasAccessArray['2']['49']['10'])) { echo (in_array("1", $hasAccessArray['2']['49']['10'])) ? 'checked' : ''; } ?>> <span class="mb-0" for=""> Bank List</span> </div> <div class="checkbox pl-3"> <input id="2_49_10_2" data-check-ids="2_49_10_1" data-uncheck-ids="" data-access="2" level-one="2" level-two="49" level-three="10" type="checkbox" <?php if (isset($hasAccessArray['2']['49']['10'])) { echo (in_array("2", $hasAccessArray['2']['49']['10'])) ? 'checked' : ''; } ?>> <span class="mb-0" for="">Create</span> </div> <div class="checkbox pl-3"> <input id="2_49_10_3" data-check-ids="2_49_10_1" data-uncheck-ids="" data-access="3" level-one="2" level-two="49" level-three="10" type="checkbox" <?php if (isset($hasAccessArray['2']['49']['10'])) { echo (in_array("3", $hasAccessArray['2']['49']['10'])) ? 'checked' : ''; } ?>> <span class="mb-0" for="">Edit</span> </div> </td> </tr> <tr> <td>Car Club Database</td> <td> <div class="checkbox"> <input id="" data-check-ids="" data-uncheck-ids="" data-access="1" level-one="2" level-two="52" level-three="1" type="checkbox" <?php if (isset($hasAccessArray['2']['52']['1'])) { echo (in_array("1", $hasAccessArray['2']['52']['1'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> Car Club List</span> </div> <div class="checkbox"> <input id="" data-check-ids="" data-uncheck-ids="" data-access="1" level-one="2" level-two="52" level-three="23" type="checkbox" <?php if (isset($hasAccessArray['2']['52']['23'])) { echo (in_array("1", $hasAccessArray['2']['52']['23'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> Car Club (Customer Affiliation)</span> </div> </td> </tr> </tbody> </table> </div> <!-- /.card-body --> </div> <div class="card collapsed-card mb-2"> <div class="card-header bg-light pl-2 pt-1 pb-1"> <h3 class="card-title text-md pt-1">DATABASE COMPLIANCE</h3> <div class="card-tools"> <button type="button" class="btn btn-tool role-toggle text-dark" data-card-widget="collapse"> <i class="fas fa-plus"></i> </button> </div> </div> <!-- /.card-header pl-2 pt-1 pb-1 --> <div class="card-body p-0"> <table id="" class="table table-bordered table-sm"> <thead> <tr> <th class="">Feature</th> <th class="">Capabilities</th> </tr> </thead> <tbody> <tr> <td>Executive Report</td> <td> <div class="checkbox"> <input id="" data-check-ids="" data-uncheck-ids="" data-access="1" level-one="7" level-two="33" type="checkbox" <?php if (isset($hasAccessArray['7']['33'])) { echo (in_array("1", $hasAccessArray['7']['33'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> View Page</span> </div> </td> </tr> <!-- SC COMPLIANCE PAGE --> <!-- SC COMPLIANCE PAGE --> <tr> <td>SC Compliance</td> <td> <div class="checkbox"> <input id="7_34_1" data-check-ids="" data-uncheck-ids="7_34_2,7_34_3,7_34_4" data-access="1" level-one="7" level-two="34" type="checkbox" <?php if (isset($hasAccessArray['7']['34'])) { echo (in_array("1", $hasAccessArray['7']['34'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> View Page</span> </div> <div class="checkbox"> <input id="7_34_2" data-check-ids="7_34_1" data-uncheck-ids="" data-access="2" level-one="7" level-two="34" type="checkbox" <?php if (isset($hasAccessArray['7']['34'])) { echo (in_array("2", $hasAccessArray['7']['34'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> Can Hold Commission</span> </div> <div class="checkbox"> <input id="7_34_3" data-check-ids="7_34_1" data-uncheck-ids="" data-access="3" level-one="7" level-two="34" type="checkbox" <?php if (isset($hasAccessArray['7']['34'])) { echo (in_array("3", $hasAccessArray['7']['34'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> Can For Release Commission</span> </div> <div class="checkbox"> <input id="7_34_4" data-check-ids="7_34_1" data-uncheck-ids="" data-access="4" level-one="7" level-two="34" type="checkbox" <?php if (isset($hasAccessArray['7']['34'])) { echo (in_array("4", $hasAccessArray['7']['34'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> Can Released Commission</span> </div> </td> </tr> <tr> <td>Compliance Status</td> <td> <div class="checkbox"> <input id="" data-check-ids="" data-uncheck-ids="" data-access="1" level-one="7" level-two="36" type="checkbox" <?php if (isset($hasAccessArray['7']['36'])) { echo (in_array("1", $hasAccessArray['7']['36'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> View Page</span> </div> </td> </tr> </tbody> </table> </div> <!-- /.card-body --> </div> <div class="card collapsed-card mb-2"> <div class="card-header bg-light pl-2 pt-1 pb-1"> <h3 class="card-title text-md pt-1">LTO</h3> <div class="card-tools"> <button type="button" class="btn btn-tool role-toggle text-dark" data-card-widget="collapse"> <i class="fas fa-plus"></i> </button> </div> </div> <!-- /.card-header pl-2 pt-1 pb-1 --> <div class="card-body p-0"> <table id="" class="table table-bordered table-sm"> <thead> <tr> <th class="">Feature</th> <th class="">Capabilities</th> </tr> </thead> <tbody> <tr> <td>LTO ORCR/Plate</td> <td> <div class="checkbox"> <!-- level-id underscore data-access --> <input data-check-ids="" data-uncheck-ids="" id="" data-access="1" level-one="10" type="checkbox" <?php echo isset($hasAccessArray['10']) && in_array("1", $hasAccessArray['10']) ? 'checked' : ''; ?>> <span class="mb-0" for="">View Page</span> </div> </td> </tr> </tbody> </table> </div> <!-- /.card-body --> </div> <div class="card collapsed-card mb-2"> <div class="card-header bg-light pl-2 pt-1 pb-1"> <h3 class="card-title text-md pt-1">INDUSTRY</h3> <div class="card-tools"> <button type="button" class="btn btn-tool role-toggle text-dark" data-card-widget="collapse"> <i class="fas fa-plus"></i> </button> </div> </div> <!-- /.card-header pl-2 pt-1 pb-1 --> <div class="card-body p-0"> <table id="" class="table table-bordered table-sm"> <thead> <tr> <th class="">Feature</th> <th class="">Capabilities</th> </tr> </thead> <tbody> <tr> <td>Home</td> <td> <div class="checkbox"> <!-- level-id underscore data-access --> <input data-check-ids="" data-uncheck-ids="" id="" data-access="1" level-one="11" type="checkbox" <?php echo isset($hasAccessArray['11']) && in_array("1", $hasAccessArray['11']) ? 'checked' : ''; ?>> <span class="mb-0" for="">View Page</span> </div> </td> </tr> </tbody> </table> </div> <!-- /.card-body --> </div> <div class="card collapsed-card mb-2"> <div class="card-header bg-light pl-2 pt-1 pb-1"> <h3 class="card-title text-md pt-1">EMPLOYEES</h3> <div class="card-tools"> <button type="button" class="btn btn-tool role-toggle text-dark" data-card-widget="collapse"> <i class="fas fa-plus"></i> </button> </div> </div> <!-- /.card-header pl-2 pt-1 pb-1 --> <div class="card-body p-0"> <table id="" class="table table-bordered table-sm"> <thead> <tr> <th class="">Feature</th> <th class="">Capabilities</th> </tr> </thead> <tbody> <tr> <td>Employees</td> <td> <div class="checkbox"> <input id="" data-check-ids="" data-uncheck-ids="" data-access="1" level-one="3" type="checkbox" <?php echo isset($hasAccessArray['3']) && in_array("1", $hasAccessArray['3']) ? 'checked' : ''; ?>> <span class="mb-0" for="">View Page</span> </div> </td> </tr> </tbody> </table> </div> <!-- /.card-body --> </div> <div class="card collapsed-card mb-2"> <div class="card-header bg-light pl-2 pt-1 pb-1"> <h3 class="card-title text-md pt-1">SMS SERVICE</h3> <div class="card-tools"> <button type="button" class="btn btn-tool role-toggle text-dark" data-card-widget="collapse"> <i class="fas fa-plus"></i> </button> </div> </div> <!-- /.card-header pl-2 pt-1 pb-1 --> <div class="card-body p-0"> <table id="" class="table table-bordered table-sm"> <thead> <tr> <th class="">Feature</th> <th class="">Capabilities</th> </tr> </thead> <tbody> <tr> <td>Automated Services</td> <td> <div class="checkbox"> <input id="" data-check-ids="" data-uncheck-ids="" data-access="1" level-one="6" level-two="29" type="checkbox" <?php if (isset($hasAccessArray['6']['29'])) { echo (in_array("1", $hasAccessArray['6']['29'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> View Page</span> </div> <div class="checkbox pl-3"> <input id="" data-check-ids="" data-uncheck-ids="" data-access="2" level-one="6" level-two="29" type="checkbox" <?php if (isset($hasAccessArray['6']['29'])) { echo (in_array("2", $hasAccessArray['6']['29'])) ? 'checked' : ''; } ?>> <span class="mb-0" for=""> Mobile view unmasking</span> </div> </td> </tr> <tr> <td>Text Blast</td> <td> <div class="checkbox"> <input id="" data-check-ids="" data-uncheck-ids="" data-access="1" level-one="6" level-two="35" type="checkbox" <?php if (isset($hasAccessArray['6']['35'])) { echo (in_array("1", $hasAccessArray['6']['35'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> View Page</span> </div> </td> </tr> <tr> <td>For Approval (SMS Service)</td> <td> <div class="checkbox"> <input id="" data-check-ids="" data-uncheck-ids="" data-access="1" level-one="6" level-two="37" type="checkbox" <?php if (isset($hasAccessArray['6']['37'])) { echo (in_array("1", $hasAccessArray['6']['37'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> View Page</span> </div> </td> </tr> </tbody> </table> </div> <!-- /.card-body --> </div> <div class="card collapsed-card mb-2"> <div class="card-header bg-light pl-2 pt-1 pb-1"> <h3 class="card-title text-md pt-1">REPORTS</h3> <div class="card-tools"> <button type="button" class="btn btn-tool role-toggle text-dark" data-card-widget="collapse"> <i class="fas fa-plus"></i> </button> </div> </div> <!-- /.card-header pl-2 pt-1 pb-1 --> <div class="card-body p-0"> <table id="" class="table table-bordered table-sm"> <thead> <tr> <th class="">Feature</th> <th class="">Capabilities</th> </tr> </thead> <tbody> <tr> <td>Data Reports</td> <td> <div class="checkbox"> <input id="5_40_11_1" data-check-ids="5_40_13_1" data-uncheck-ids="" data-access="1" level-one="5" level-two="40" level-three="11" type="checkbox" <?php if (isset($hasAccessArray['5']['40']['11'])) { echo (in_array("1", $hasAccessArray['5']['40']['11'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> Create New Report</span> </div> <div class="checkbox"> <input id="" data-check-ids="" data-uncheck-ids="" data-access="1" level-one="5" level-two="40" level-three="12" type="checkbox" <?php if (isset($hasAccessArray['5']['40']['12'])) { echo (in_array("1", $hasAccessArray['5']['40']['12'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> Reports for Approval</span> </div> <div class="checkbox"> <input id="5_40_13_1" data-check-ids="" data-uncheck-ids="5_40_11_1" data-access="1" level-one="5" level-two="40" level-three="13" type="checkbox" <?php if (isset($hasAccessArray['5']['40']['13'])) { echo (in_array("1", $hasAccessArray['5']['40']['13'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> Report List</span> </div> </td> </tr> <tr> <td>Future Vehicle</td> <td> <div class="checkbox"> <input id="5_41_1" data-check-ids="" data-uncheck-ids="5_41_2,5_41_3,5_41_4,5_41_5" data-access="1" level-one="5" level-two="41" type="checkbox" <?php if (isset($hasAccessArray['5']['41'])) { echo (in_array("1", $hasAccessArray['5']['41'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> View Page</span> </div> <div class="checkbox"> <input id="5_41_2" data-check-ids="5_41_1" data-uncheck-ids="" data-access="2" level-one="5" level-two="41" type="checkbox" <?php if (isset($hasAccessArray['5']['41'])) { echo (in_array("2", $hasAccessArray['5']['41'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> Generate Report</span> </div> <div class="checkbox"> <input id="5_41_3" data-check-ids="5_41_1" data-uncheck-ids="" data-access="3" level-one="5" level-two="41" type="checkbox" <?php if (isset($hasAccessArray['5']['41'])) { echo (in_array("3", $hasAccessArray['5']['41'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> Show/Hide Contact Info</span> </div> <div class="checkbox"> <input id="5_41_4" data-check-ids="5_41_1" data-uncheck-ids="" data-access="4" level-one="5" level-two="41" type="checkbox" <?php if (isset($hasAccessArray['5']['41'])) { echo (in_array("4", $hasAccessArray['5']['41'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> Groups Filter</span> </div> <div class="checkbox"> <input id="5_41_5" data-check-ids="5_41_1" data-uncheck-ids="" data-access="5" level-one="5" level-two="41" type="checkbox" <?php if (isset($hasAccessArray['5']['41'])) { echo (in_array("5", $hasAccessArray['5']['41'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> View Others Tagging</span> </div> </td> </tr> <tr> <td>SMS Reports</td> <td> <!-- Birthday Greetings --> <div class="checkbox"> <input id="5_38_14_1" data-check-ids="" data-uncheck-ids="5_38_14_2,5_38_14_3" data-access="1" level-one="5" level-two="38" level-three="14" type="checkbox" <?php if (isset($hasAccessArray['5']['38']['14'])) { echo (in_array("1", $hasAccessArray['5']['38']['14'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> Birthday Greetings</span> </div> <div class="checkbox pl-3"> <input id="5_38_14_2" data-check-ids="5_38_14_1" data-uncheck-ids="" data-access="2" level-one="5" level-two="38" level-three="14" type="checkbox" <?php if (isset($hasAccessArray['5']['38']['14'])) { echo (in_array("2", $hasAccessArray['5']['38']['14'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> Generate Reports</span> </div> <div class="checkbox pl-3"> <input id="5_38_14_3" data-check-ids="5_38_14_1" data-uncheck-ids="" data-access="3" level-one="5" level-two="38" level-three="14" type="checkbox" <?php if (isset($hasAccessArray['5']['38']['14'])) { echo (in_array("3", $hasAccessArray['5']['38']['14'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> Mobile Unmasking</span> </div> <!-- Insurance Expiration --> <div class="checkbox"> <input id="5_38_15_1" data-check-ids="" data-uncheck-ids="5_38_15_2,5_38_15_3" data-access="1" level-one="5" level-two="38" level-three="15" type="checkbox" <?php if (isset($hasAccessArray['5']['38']['15'])) { echo (in_array("1", $hasAccessArray['5']['38']['15'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> Insurance Expiration</span> </div> <div class="checkbox pl-3"> <input id="5_38_15_2" data-check-ids="5_38_15_1" data-uncheck-ids="" data-access="2" level-one="5" level-two="38" level-three="15" type="checkbox" <?php if (isset($hasAccessArray['5']['38']['15'])) { echo (in_array("2", $hasAccessArray['5']['38']['15'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> Generate Reports</span> </div> <div class="checkbox pl-3"> <input id="5_38_15_3" data-check-ids="5_38_15_1" data-uncheck-ids="" data-access="3" level-one="5" level-two="38" level-three="15" type="checkbox" <?php if (isset($hasAccessArray['5']['38']['15'])) { echo (in_array("3", $hasAccessArray['5']['38']['15'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> Mobile Unmasking</span> </div> <!-- PDC Expiration --> <div class="checkbox"> <input id="5_38_24_1" data-check-ids="" data-uncheck-ids="5_38_24_2,5_38_24_3" data-access="1" level-one="5" level-two="38" level-three="24" type="checkbox" <?php if (isset($hasAccessArray['5']['38']['24'])) { echo (in_array("1", $hasAccessArray['5']['38']['24'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> PDC Expiration</span> </div> <div class="checkbox pl-3"> <input id="5_38_24_2" data-check-ids="5_38_24_1" data-uncheck-ids="" data-access="2" level-one="5" level-two="38" level-three="24" type="checkbox" <?php if (isset($hasAccessArray['5']['38']['24'])) { echo (in_array("2", $hasAccessArray['5']['38']['24'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> Generate Reports</span> </div> <div class="checkbox pl-3"> <input id="5_38_24_3" data-check-ids="5_38_24_1" data-uncheck-ids="" data-access="3" level-one="5" level-two="38" level-three="24" type="checkbox" <?php if (isset($hasAccessArray['5']['38']['24'])) { echo (in_array("3", $hasAccessArray['5']['38']['24'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> Mobile Unmasking</span> </div> <!-- Thank You Message --> <div class="checkbox"> <input id="5_38_16_1" data-check-ids="" data-uncheck-ids="5_38_16_2,5_38_16_3" data-access="1" level-one="5" level-two="38" level-three="16" type="checkbox" <?php if (isset($hasAccessArray['5']['38']['16'])) { echo (in_array("1", $hasAccessArray['5']['38']['16'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> Thank You Message</span> </div> <div class="checkbox pl-3"> <input id="5_38_16_2" data-check-ids="5_38_16_1" data-uncheck-ids="" data-access="2" level-one="5" level-two="38" level-three="16" type="checkbox" <?php if (isset($hasAccessArray['5']['38']['16'])) { echo (in_array("2", $hasAccessArray['5']['38']['16'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> Generate Reports</span> </div> <div class="checkbox pl-3"> <input id="5_38_16_3" data-check-ids="5_38_16_1" data-uncheck-ids="" data-access="3" level-one="5" level-two="38" level-three="16" type="checkbox" <?php if (isset($hasAccessArray['5']['38']['16'])) { echo (in_array("3", $hasAccessArray['5']['38']['16'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> Mobile Unmasking</span> </div> <!-- Text Blast --> <div class="checkbox"> <input id="" data-check-ids="" data-uncheck-ids="" data-access="1" level-one="5" level-two="38" level-three="17" type="checkbox" <?php if (isset($hasAccessArray['5']['38']['17'])) { echo (in_array("1", $hasAccessArray['5']['38']['17'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> Text Blast</span> </div> </td> </tr> <tr> <td>Released Car Clubs</td> <td> <div class="checkbox"> <input id="" data-check-ids="" data-uncheck-ids="" data-access="1" level-one="5" level-two="44" type="checkbox" <?php if (isset($hasAccessArray['5']['44'])) { echo (in_array("1", $hasAccessArray['5']['44'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> View Page</span> </div> </td> </tr> <tr> <td>Subscription</td> <td> <div class="checkbox"> <input id="" data-check-ids="" data-uncheck-ids="" data-access="1" level-one="5" level-two="45" type="checkbox" <?php if (isset($hasAccessArray['5']['45'])) { echo (in_array("1", $hasAccessArray['5']['45'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> View Page</span> </div> <div class="checkbox pl-3"> <input id="" data-check-ids="" data-uncheck-ids="" data-access="2" level-one="5" level-two="45" type="checkbox" <?php if (isset($hasAccessArray['5']['45'])) { echo (in_array("2", $hasAccessArray['5']['45'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> Generate Reports</span> </div> <div class="checkbox pl-3"> <input id="" data-check-ids="" data-uncheck-ids="" data-access="3" level-one="5" level-two="45" type="checkbox" <?php if (isset($hasAccessArray['5']['45'])) { echo (in_array("3", $hasAccessArray['5']['45'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> Mobile Unmasking</span> </div> </td> </tr> <tr> <td>FNI Report</td> <td> <div class="checkbox"> <input id="" data-check-ids="" data-uncheck-ids="" data-access="1" level-one="5" level-two="46" type="checkbox" <?php if (isset($hasAccessArray['5']['46'])) { echo (in_array("1", $hasAccessArray['5']['46'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> View Page</span> </div> <div class="checkbox pl-3"> <input id="" data-check-ids="" data-uncheck-ids="" data-access="2" level-one="5" level-two="46" type="checkbox" <?php if (isset($hasAccessArray['5']['46'])) { echo (in_array("2", $hasAccessArray['5']['46'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> Generate Reports</span> </div> <div class="checkbox pl-3"> <input id="" data-check-ids="" data-uncheck-ids="" data-access="3" level-one="5" level-two="46" type="checkbox" <?php if (isset($hasAccessArray['5']['46'])) { echo (in_array("3", $hasAccessArray['5']['46'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> Mobile Unmasking</span> </div> </td> </tr> <tr> <td>Bank Report</td> <td> <div class="checkbox"> <input id="" data-check-ids="" data-uncheck-ids="" data-access="1" level-one="5" level-two="51" type="checkbox" <?php if (isset($hasAccessArray['5']['51'])) { echo (in_array("1", $hasAccessArray['5']['51'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> View Page</span> </div> </td> </tr> <tr> <td>Nature of Business</td> <td> <div class="checkbox"> <!-- //sample id:parent_child_1_child_2_access_code --> <input id="5_53_25_1" data-check-ids="" data-uncheck-ids="5_53_25_2,5_53_25_3" data-access="1" level-one="5" level-two="53" level-three="25" type="checkbox" <?php if (isset($hasAccessArray['5']['53']['25'])) { echo (in_array("1", $hasAccessArray['5']['53']['25'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> Top Nature Business</span> </div> <div class="checkbox pl-3"> <input id="5_53_25_2" data-check-ids="5_53_25_1" data-uncheck-ids="" data-access="2" level-one="5" level-two="53" level-three="25" type="checkbox" <?php if (isset($hasAccessArray['5']['53']['25'])) { echo (in_array("2", $hasAccessArray['5']['53']['25'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> Show Mobile</span> </div> <div class="checkbox pl-3"> <input id="5_53_25_3" data-check-ids="5_53_25_1" data-uncheck-ids="" data-access="3" level-one="5" level-two="53" level-three="25" type="checkbox" <?php if (isset($hasAccessArray['5']['53']['25'])) { echo (in_array("3", $hasAccessArray['5']['53']['25'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> Show Email</span> </div> <div class="checkbox"> <input id="5_53_27_1" data-check-ids="" data-uncheck-ids="5_53_27_2,5_53_27_3" data-access="1" level-one="5" level-two="53" level-three="27" type="checkbox" <?php if (isset($hasAccessArray['5']['53']['27'])) { echo (in_array("1", $hasAccessArray['5']['53']['27'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> Summary Report</span> </div> </td> </tr> </tbody> </table> </div> <!-- /.card-body --> </div> <div class="card collapsed-card mb-2"> <div class="card-header bg-light pl-2 pt-1 pb-1"> <h3 class="card-title text-md pt-1">CONFIGURATIONS</h3> <div class="card-tools"> <button type="button" class="btn btn-tool role-toggle text-dark" data-card-widget="collapse"> <i class="fas fa-plus"></i> </button> </div> </div> <!-- /.card-header pl-2 pt-1 pb-1 --> <div class="card-body p-0"> <table id="" class="table table-bordered table-sm"> <thead> <tr> <th class="">Feature</th> <th class="">Capabilities</th> </tr> </thead> <tbody> <tr> <td>Website</td> <td> <div class="checkbox"> <input id="" data-check-ids="" data-uncheck-ids="" data-access="1" level-one="4" level-two="7" type="checkbox" <?php if (isset($hasAccessArray['4']['7'])) { echo (in_array("1", $hasAccessArray['4']['7'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> View Page</span> </div> </td> </tr> <tr> <td>Roles</td> <td> <div class="checkbox"> <input id="" data-check-ids="" data-uncheck-ids="" data-access="1" level-one="4" level-two="6" type="checkbox" <?php if (isset($hasAccessArray['4']['6'])) { echo (in_array("1", $hasAccessArray['4']['6'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> View Page</span> </div> </td> </tr> <tr> <td>Email</td> <td> <div class="checkbox"> <input id="" data-check-ids="" data-uncheck-ids="" data-access="1" level-one="4" level-two="9" type="checkbox" <?php if (isset($hasAccessArray['4']['9'])) { echo (in_array("1", $hasAccessArray['4']['9'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> View Page</span> </div> </td> </tr> <tr> <td>Report Approver</td> <td> <div class="checkbox"> <input id="" data-check-ids="" data-uncheck-ids="" data-access="1" level-one="4" level-two="17" type="checkbox" <?php if (isset($hasAccessArray['4']['17'])) { echo (in_array("1", $hasAccessArray['4']['17'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> View Page</span> </div> </td> </tr> <tr> <td>DMS Settings</td> <td> <div class="checkbox"> <input id="" data-check-ids="" data-uncheck-ids="" data-access="1" level-one="4" level-two="24" type="checkbox" <?php if (isset($hasAccessArray['4']['24'])) { echo (in_array("1", $hasAccessArray['4']['24'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> View Page</span> </div> </td> </tr> <tr> <td>Company & Dealer</td> <td> <div class="checkbox"> <input id="" data-check-ids="" data-uncheck-ids="" data-access="1" level-one="4" level-two="19" type="checkbox" <?php if (isset($hasAccessArray['4']['19'])) { echo (in_array("1", $hasAccessArray['4']['19'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> View Page</span> </div> </td> </tr> <tr> <td>Department / Position</td> <td> <div class="checkbox"> <input id="" data-check-ids="" data-uncheck-ids="" data-access="1" level-one="4" level-two="21" type="checkbox" <?php if (isset($hasAccessArray['4']['21'])) { echo (in_array("1", $hasAccessArray['4']['21'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> View Page</span> </div> </td> </tr> <tr> <td>Brand & Model</td> <td> <div class="checkbox"> <input id="" data-check-ids="" data-uncheck-ids="" data-access="1" level-one="4" level-two="22" type="checkbox" <?php if (isset($hasAccessArray['4']['22'])) { echo (in_array("1", $hasAccessArray['4']['22'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> View Page</span> </div> </td> </tr> <tr> <td>Affiliation Category</td> <td> <div class="checkbox"> <input id="" data-check-ids="" data-uncheck-ids="" data-access="1" level-one="4" level-two="23" type="checkbox" <?php if (isset($hasAccessArray['4']['23'])) { echo (in_array("1", $hasAccessArray['4']['23'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> View Page</span> </div> </td> </tr> <tr> <td>Nature of Business</td> <td> <div class="checkbox"> <input id="" data-check-ids="" data-uncheck-ids="" data-access="1" level-one="4" level-two="25" type="checkbox" <?php if (isset($hasAccessArray['4']['25'])) { echo (in_array("1", $hasAccessArray['4']['25'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> View Page</span> </div> </td> </tr> <tr> <td>Sales Group</td> <td> <div class="checkbox"> <input id="" data-check-ids="" data-uncheck-ids="" data-access="1" level-one="4" level-two="26" type="checkbox" <?php if (isset($hasAccessArray['4']['26'])) { echo (in_array("1", $hasAccessArray['4']['26'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> View Page</span> </div> </td> </tr> <tr> <td>SMS Settings</td> <td> <div class="checkbox"> <input id="" data-check-ids="" data-uncheck-ids="" data-access="1" level-one="4" level-two="48" level-three="18" type="checkbox" <?php if (isset($hasAccessArray['4']['48']['18'])) { echo (in_array("1", $hasAccessArray['4']['48']['18'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> SMS Setup</span> </div> <div class="checkbox"> <input id="" data-check-ids="" data-uncheck-ids="" data-access="1" level-one="4" level-two="48" level-three="19" type="checkbox" <?php if (isset($hasAccessArray['4']['48']['19'])) { echo (in_array("1", $hasAccessArray['4']['48']['19'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> SMS Approver</span> </div> <div class="checkbox"> <input id="" data-check-ids="" data-uncheck-ids="" data-access="1" level-one="4" level-two="48" level-three="20" type="checkbox" <?php if (isset($hasAccessArray['4']['48']['20'])) { echo (in_array("1", $hasAccessArray['4']['48']['20'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> Automated Service</span> </div> </td> </tr> <tr> <td>DMS Settings</td> <td> <div class="checkbox"> <input id="" data-check-ids="" data-uncheck-ids="" data-access="1" level-one="4" level-two="43" level-three="21" type="checkbox" <?php if (isset($hasAccessArray['4']['43']['21'])) { echo (in_array("1", $hasAccessArray['4']['43']['21'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> DMS Fields</span> </div> <div class="checkbox"> <input id="" data-check-ids="" data-uncheck-ids="" data-access="1" level-one="4" level-two="43" level-three="22" type="checkbox" <?php if (isset($hasAccessArray['4']['43']['22'])) { echo (in_array("1", $hasAccessArray['4']['43']['22'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> DMS Fields (New)</span> </div> </td> </tr> <tr> <td>System Settings</td> <td> <div class="checkbox"> <input id="" data-check-ids="" data-uncheck-ids="" data-access="1" level-one="4" level-two="28" type="checkbox" <?php if (isset($hasAccessArray['4']['28'])) { echo (in_array("1", $hasAccessArray['4']['28'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> View Page</span> </div> </td> </tr> <tr> <td>FNI Settings</td> <td> <div class="checkbox"> <input id="" data-check-ids="" data-uncheck-ids="" data-access="1" level-one="4" level-two="47" type="checkbox" <?php if (isset($hasAccessArray['4']['47'])) { echo (in_array("1", $hasAccessArray['4']['47'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> View Page</span> </div> </td> </tr> <tr> <td>Bank Settings</td> <td> <div class="checkbox"> <input id="" data-check-ids="" data-uncheck-ids="" data-access="1" level-one="4" level-two="50" type="checkbox" <?php if (isset($hasAccessArray['4']['50'])) { echo (in_array("1", $hasAccessArray['4']['50'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> View Page</span> </div> </td> </tr> </tbody> </table> </div> <!-- /.card-body --> </div> </div> <!-- CUSTOMER UPDATE --> <div class="card collapsed-card mb-2"> <div class="card-header bg-light pl-2 pt-1 pb-1"> <h3 class="card-title text-md pt-1">COSTUMER UPDATE</h3> <div class="card-tools"> <button type="button" class="btn btn-tool role-toggle text-dark" data-card-widget="collapse"> <i class="fas fa-plus"></i> </button> </div> </div> <!-- /.card-header pl-2 pt-1 pb-1 --> <div class="card-body p-0"> <div class="card-body p-0"> <table id="" class="table table-bordered table-sm"> <thead> <tr> <th class="">Feature</th> <th class="">Capabilities</th> </tr> </thead> <tbody> <tr> <td>Inactive Customer</td> <td> <div class="checkbox"> <input id="" data-check-ids="" data-uncheck-ids="" data-access="1" level-one="11" level-two="54" type="checkbox" <?php if (isset($hasAccessArray['11']['54'])) { echo (in_array("1", $hasAccessArray['11']['54'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> View Page</span> </div> </td> </tr> <tr> <td>Dealer Assignment</td> <td> <div class="checkbox"> <input id="" data-check-ids="" data-uncheck-ids="" data-access="1" level-one="11" level-two="55" type="checkbox" <?php if (isset($hasAccessArray['11']['55'])) { echo (in_array("1", $hasAccessArray['11']['55'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> View Page</span> </div> </td> </tr> <tr> <td>User Assignment</td> <td> <div class="checkbox"> <input id="" data-check-ids="" data-uncheck-ids="" data-access="1" level-one="11" level-two="56" type="checkbox" <?php if (isset($hasAccessArray['11']['56'])) { echo (in_array("1", $hasAccessArray['11']['56'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> View Page</span> </div> </td> </tr> <tr> <td>Assinged user</td> <td> <div class="checkbox"> <input id="" data-check-ids="" data-uncheck-ids="" data-access="1" level-one="11" level-two="57" type="checkbox" <?php if (isset($hasAccessArray['11']['57'])) { echo (in_array("1", $hasAccessArray['11']['57'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> View Page</span> </div> </td> </tr> <tr> <td>Customer List</td> <td> <div class="checkbox"> <input id="" data-check-ids="" data-uncheck-ids="" data-access="1" level-one="11" level-two="58" type="checkbox" <?php if (isset($hasAccessArray['11']['58'])) { echo (in_array("1", $hasAccessArray['11']['58'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> View Page</span> </div> </td> </tr> <tr> <td>Customer update list</td> <td> <div class="checkbox"> <input id="" data-check-ids="" data-uncheck-ids="" data-access="1" level-one="11" level-two="59" type="checkbox" <?php if (isset($hasAccessArray['11']['59'])) { echo (in_array("1", $hasAccessArray['11']['59'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> View Page</span> </div> </td> </tr> <tr> <td>Dealer User Management</td> <td> <div class="checkbox"> <input id="" data-check-ids="" data-uncheck-ids="" data-access="1" level-one="11" level-two="60" type="checkbox" <?php if (isset($hasAccessArray['11']['60'])) { echo (in_array("1", $hasAccessArray['11']['60'])) ? 'checked' : ''; } ?>><span class="mb-0" for=""> View Page</span> </div> </td> </tr> </tbody> </table> </div> </div> <!-- /.card-body --> </div> <!-- END CUSTOMER UPDATE --> <!--employee-list--> <div class="col-12"> <!-- <span onclick="back()" href="#" class="btn btn-secondary">Back</span> --> <input type="submit" name="submit" id="submit" value="Save" class="btn btn-success float-right"> </div> </div><!-- /.card-body --> </div> </div><!-- /.col-md --> </div><!-- /.row --> </div><!-- /.container-fluid --> </section> <!-- /.content --> <!-- /.content-wrapper --> <!-- INSERT FOOTER --> </div><!-- ./cointent-wrapper --> <?php include('include/footer.php'); ?> <!-- Control Sidebar --> <aside class="control-sidebar control-sidebar-dark"> <!-- Control sidebar content goes here --> </aside> <!-- /.control-sidebar --> </div><!-- ./wrapper --> <!-- jQuery --> <script src="plugins/jquery/jquery.min.js"></script> <!-- overlayScrollbars --> <script src="plugins/overlayScrollbars/js/jquery.overlayScrollbars.min.js"></script> <!-- Bootstrap 4 --> <script src="plugins/bootstrap/js/bootstrap.bundle.min.js"></script> <!-- bs-custom-file-input --> <script src="plugins/bs-custom-file-input/bs-custom-file-input.min.js"></script> <!-- AdminLTE App --> <script src="dist/js/adminlte.min.js"></script> <!-- Toastr --> <script src="plugins/toastr/toastr.min.js"></script> <!-- Navigation Highlight --> <script src="dist/js/main.js"></script> <script> var current_obj = {}; $(document).ready(function() { $("#submit").click(function() { //check dashboard automatically $('#1').prop('checked', true); current_obj = {}; $("[data-access]").each(function() { if ($(this).is(':checked')) { var data_access = $(this).attr('data-access'); var level_one = $(this).attr('level-one'); var level_two = $(this).attr('level-two'); var level_three = $(this).attr('level-three'); if (!isEmpty(level_one)) { // has 1st level if (typeof current_obj[level_one] == "undefined") { current_obj[level_one] = {}; } if (!isEmpty(level_two)) { //has 2nd level if (!isEmpty(level_three)) { //has 3rd level if (typeof current_obj[level_one][level_two] == "undefined") { current_obj[level_one][level_two] = {}; } if (typeof current_obj[level_one][level_two][level_three] == "undefined" || !Array.isArray(current_obj[level_one][level_two][level_three])) { current_obj[level_one][level_two][level_three] = []; } current_obj[level_one][level_two][level_three].push(data_access); } else { //no 3rd level if (typeof current_obj[level_one][level_two] == "undefined" || !Array.isArray(current_obj[level_one][level_two])) { current_obj[level_one][level_two] = []; } current_obj[level_one][level_two].push(data_access); } } else { //no 2nd level if (typeof current_obj[level_one] == "undefined" || !Array.isArray(current_obj[level_one])) { current_obj[level_one] = []; } current_obj[level_one].push(data_access); } } } }); if (isEmpty($('#role').val())) { $('#role').focus(); // sweetAlertSimple('error', 'Oops...', 'Firstname can\'t be left blank') toastr.error('Role name can\'t be left blank') return; } roleActionAccess(); }); $("[data-access]").each(function() { $(this).on('change', function() { if ($(this).is(':checked')) { //read all check ids var check_ids = $(this).attr('data-check-ids'); if (typeof check_ids !== 'undefined' && check_ids !== false) { var check_ids_arr = check_ids.split(","); $.each(check_ids_arr, function(i) { if (!isEmpty(check_ids_arr[i])) { $('#' + check_ids_arr[i]).prop('checked', true); } }); } } else { //read all uncheck ids var uncheck_ids = $(this).attr('data-uncheck-ids'); if (typeof uncheck_ids !== 'undefined' && uncheck_ids !== false) { var uncheck_ids_arr = uncheck_ids.split(","); $.each(uncheck_ids_arr, function(i) { if (!isEmpty(uncheck_ids_arr[i])) { $('#' + uncheck_ids_arr[i]).prop('checked', false); } }); } } }); }); }); // alert('sd') // $(this).on('change',function (){ // alert('dsd') // }) // // $(this).change( // // function(){ // // if ($(this).is(':checked')) { // // //read all check ids // // alert($(this).attr('data-check-ids')); // // }else{ // // //read all uncheck ids // // } // // }); // }); function roleActionAccess() { var new_role_name = $('#role').val().trim(); // console.log(getAllData()); $.ajax({ url: "api/role/role.php", method: "GET", dataType: 'json', data: { apiKey: '9808804351241327', name: new_role_name, role_id: <?php echo $role_id; ?>, role_access: JSON.stringify(current_obj) }, beforeSend: function() { toastr.remove(); toastr.info('Updating access role...') $('#submit').attr('disabled', true); }, success: function(result) { if (parseInt(result.status) === 1) { // sweetAlertSimple('success', 'Nice...', result.message); toastr.success(result.message) } else if (parseInt(result.status) === 0) { // sweetAlertSimple('error', 'Oops...', result.message); toastr.error(result.message) } $('#submit').attr('disabled', false); }, error: handleError }); } function handleError(xhr, status, error) { //hide loader // sweetAlertSimple('error', 'Oops...', 'Error has occurred, Try again...'); toastr.error('Error has occurred, Try again...') $('#submit').attr('disabled', false); // $('.customer-modal-overlay').hide(); } function getAllData() { var /* Create an object. */ obj = {}, /* Create a variable that references the current object (default → obj). */ ref = obj; /* Iterate over every input. */ $("#role-table :input").each(function() { /* Cache the id of the input. */ var id = this.id; var value = this.value; /* Check whether the nodetype attribute is set to 'parent'. */ if (this.getAttribute("nodetype") == "parent") { /* Set a new object to the property and set ref to refer to it. */ ref = obj[value] = {}; } else { /* Set the value of the input to the referred object. */ if (this.getAttribute("nodetype") == "child") { // ref[id] = $(this).val(); ref[id] = $(this).is(':checked') } } }); /* Stringify the object and return it. */ return JSON.stringify(obj); } function isEmpty(string) { // alert(string) var flag = false; try { if (string == null) { flag = true; } else if (typeof string === 'undefined') { flag = true; } else if (string.trim() == '') { flag = true; } } catch (err) { console.log(err); flag = true; } return flag; } function back() { window.history.back(); } $('#sub_46_1').on('click', function() { // fni report if (!$('#sub_46_1').is(':checked')) { if ($('#sub_46_2').is(':checked')) { $('#sub_46_2').prop('checked', false); } if ($('#sub_46_3').is(':checked')) { $('#sub_46_3').prop('checked', false); } } }) $('#sub_46_2').on('click', function() { // fni email and mobile if ($('#sub_46_2').is(':checked')) { $('#sub_46_3').prop('checked', true); } if (!$('#sub_46_1').is(':checked')) { $('#sub_46_1').prop('checked', true); } }) $('#sub_46_3').on('click', function() { // fni generate report if ($('#sub_46_2').is(':checked')) { $('#sub_46_2').prop('checked', false); } }) $('#sub_38_1').on('click', function() { // sms report if (!$('#sub_38_1').is(':checked')) { if ($('#sub_38_2').is(':checked')) { $('#sub_38_2').prop('checked', false); } if ($('#sub_38_3').is(':checked')) { $('#sub_38_3').prop('checked', false); } if ($('#sub_38_4').is(':checked')) { $('#sub_38_4').prop('checked', false); } if ($('#sub_38_5').is(':checked')) { $('#sub_38_5').prop('checked', false); } if ($('#sub_38_6').is(':checked')) { $('#sub_38_6').prop('checked', false); } if ($('#sub_38_7').is(':checked')) { $('#sub_38_7').prop('checked', false); } } }) $('#sub_38_2').on('click', function() { // bg generate report if ($('#sub_38_3').is(':checked')) { $('#sub_38_3').prop('checked', false); } if (!$('#sub_38_1').is(':checked')) { $('#sub_38_1').prop('checked', true); } }) $('#sub_38_3').on('click', function() { // bg mobile unmasking if ($('#sub_38_3').is(':checked')) { if (!$('#sub_38_2').is(':checked')) { $('#sub_38_2').prop('checked', true); } if (!$('#sub_38_1').is(':checked')) { $('#sub_38_1').prop('checked', true); } } }) $('#sub_38_4').on('click', function() { // ins generate report if ($('#sub_38_5').is(':checked')) { $('#sub_38_5').prop('checked', false); } if (!$('#sub_38_1').is(':checked')) { $('#sub_38_1').prop('checked', true); } }) $('#sub_38_5').on('click', function() { // ins mobile unmasking if ($('#sub_38_5').is(':checked')) { if (!$('#sub_38_4').is(':checked')) { $('#sub_38_4').prop('checked', true); } if (!$('#sub_38_1').is(':checked')) { $('#sub_38_1').prop('checked', true); } } }) $('#sub_38_6').on('click', function() { // ty generate report if ($('#sub_38_7').is(':checked')) { $('#sub_38_7').prop('checked', false); } if (!$('#sub_38_1').is(':checked')) { $('#sub_38_1').prop('checked', true); } }) $('#sub_38_7').on('click', function() { // ty mobile unmasking if ($('#sub_38_7').is(':checked')) { if (!$('#sub_38_6').is(':checked')) { $('#sub_38_6').prop('checked', true); } if (!$('#sub_38_1').is(':checked')) { $('#sub_38_1').prop('checked', true); } } }) $('#sub_45_1').on('click', function() { // subscription report if (!$('#sub_45_1').is(':checked')) { if ($('#sub_45_2').is(':checked')) { $('#sub_45_2').prop('checked', false); } if ($('#sub_45_3').is(':checked')) { $('#sub_45_3').prop('checked', false); } } }) $('#sub_45_2').on('click', function() { // subscription generate report if (!$('#sub_45_1').is(':checked')) { $('#sub_45_1').prop('checked', true); } if ($('#sub_45_3').is(':checked')) { $('#sub_45_3').prop('checked', false); } }) $('#sub_45_3').on('click', function() { // subscription contact unmasking if ($('#sub_45_3').is(':checked')) { if (!$('#sub_45_2').is(':checked')) { $('#sub_45_2').prop('checked', true); } if (!$('#sub_45_1').is(':checked')) { $('#sub_45_1').prop('checked', true); } } }) </script> <!-- Page specific script --> </body> </html>