ok
Direktori : /proc/thread-self/root/home2/selectio/www/lilyexpresslive/software/admin/ |
Current File : //proc/thread-self/root/home2/selectio/www/lilyexpresslive/software/admin/role-edit.php |
<?php require_once('header.php'); ?> <style> .switch { position: relative; display: inline-block; width: 45px; height: 25px; } .switch input { opacity: 0; width: 0; height: 0; } .slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; -webkit-transition: .4s; transition: .4s; } .slider:before { position: absolute; content: ""; height: 16px; width: 16px; left: 4px; bottom: 4px; background-color: white; -webkit-transition: .4s; transition: .4s; } input:checked + .slider { background-color: #4caf50; padding-right: 50px; } input:focus + .slider { box-shadow: 0 0 1px #4caf50; } input:checked + .slider:before { -webkit-transform: translateX(26px); -ms-transform: translateX(26px); transform: translateX(26px); } /* Rounded sliders */ .slider.round { border-radius: 34px; } .slider.round:before { border-radius: 30%; } h4{ color:blue; } </style> <?php if(isset($_POST['submits'])){ $valid = 1; $rolename=$_POST['role_name']; $branch=$_POST['branch_ids']; if($rolename==""){ $valid = 0; $error_message .= "This role name isCan't Be Empty.<br>"; } if($branch==""){ $valid = 0; $error_message .= "Select Branch is Can't Be Empty.<br>"; } if($valid == 1){ $permissions['branch'] = array("create" => isset($_POST['add_branch']) ? 1 : 0,"read" => isset($_POST['view_branch']) ? 1 : 0, "update" => isset($_POST['edit_branch']) ? 1 : 0,"delete" => isset($_POST['delete_branch']) ? 1 : 0); $permissions['role'] = array("create" => isset($_POST['add_role']) ? 1 : 0,"read" => isset($_POST['view_role']) ? 1 : 0, "update" => isset($_POST['edit_role']) ? 1 : 0,"delete" => isset($_POST['delete_role']) ? 1 : 0); $permissions['client'] = array("create" => isset($_POST['add_client']) ? 1 : 0,"read" => isset($_POST['view_client']) ? 1 : 0, "update" => isset($_POST['edit_client']) ? 1 : 0,"delete" => isset($_POST['delete_client']) ? 1 : 0); $permissions['system_user'] = array("create" => isset($_POST['add_system_user']) ? 1 : 0,"read" => isset($_POST['view_system_user']) ? 1 : 0, "update" => isset($_POST['edit_system_user']) ? 1 : 0,"delete" => isset($_POST['delete_system_user']) ? 1 : 0); $permissions['awb_count_details'] = array("create" => isset($_POST['add_awb_count_details']) ? 1 : 0,"read" => isset($_POST['view_awb_count_details']) ? 1 : 0, "update" => isset($_POST['edit_awb_count_details']) ? 1 : 0,"delete" => isset($_POST['delete_awb_count_details']) ? 1 : 0); $permissions['awb_number_details'] = array("create" => isset($_POST['add_awb_number_details']) ? 1 : 0,"read" => isset($_POST['view_awb_number_details']) ? 1 : 0); $permissions['awb_list'] = array("create" => isset($_POST['add_awb_list']) ? 1 : 0,"read" => isset($_POST['view_awb_list']) ? 1 : 0, "delete" => isset($_POST['delete_awb_list']) ? 1 : 0); $permissions['logistics'] = array("create" => isset($_POST['add_logistics']) ? 1 : 0,"read" => isset($_POST['view_logistics']) ? 1 : 0, "update" => isset($_POST['edit_logistics']) ? 1 : 0,"delete" => isset($_POST['delete_logistics']) ? 1 : 0); $permissions['pin_code'] = array("create" => isset($_POST['add_pin_code']) ? 1 : 0,"read" => isset($_POST['view_pin_code']) ? 1 : 0, "update" => isset($_POST['edit_pin_code']) ? 1 : 0,"delete" => isset($_POST['delete_pin_code']) ? 1 : 0,"bulkupload" => isset($_POST['bulk_upload_pin_code']) ? 1 : 0); $permissions['customer'] = array("create" => isset($_POST['add_customer']) ? 1 : 0,"read" => isset($_POST['view_customer']) ? 1 : 0, "update" => isset($_POST['edit_customer']) ? 1 : 0,"bulkupload" => isset($_POST['bulk_upload_customer']) ? 1 : 0); $permissions['one_time_customer'] = array("create" => isset($_POST['add_onetime_customer']) ? 1 : 0); $permissions['add_pickup_entry'] = array("create" => isset($_POST['add_add_pickup_entery']) ? 1 : 0); $permissions['manifest'] = array("create" => isset($_POST['add_manifest']) ? 1 : 0,"read" => isset($_POST['view_manifest']) ? 1 : 0, "update" => isset($_POST['edit_manifest']) ? 1 : 0,"delete" => isset($_POST['delete_manifest']) ? 1 : 0); $permissions['tracking'] = array("read" => isset($_POST['view_tracking']) ? 1 : 0); $permissions['reports'] = array("read" => isset($_POST['view_reports']) ? 1 : 0); $permissions['transports'] = array("create" => isset($_POST['add_transport']) ? 1 : 0,"read" => isset($_POST['view_transport']) ? 1 : 0, "update" => isset($_POST['edit_transport']) ? 1 : 0,"delete" => isset($_POST['delete_transport']) ? 1 : 0); $permissions['contents'] = array("create" => isset($_POST['add_contents']) ? 1 : 0,"read" => isset($_POST['view_contents']) ? 1 : 0, "update" => isset($_POST['edit_contents']) ? 1 : 0,"delete" => isset($_POST['delete_contents']) ? 1 : 0); $permissions['backups'] = array("read" => isset($_POST['view_backup']) ? 1 : 0); /* $permissions['gold_account_report'] = array("read" => isset($_POST['view_gold_account_report']) ? 1 : 0); $permissions['customer_report'] = array("read" => isset($_POST['view_customer_report']) ? 1 : 0); $permissions['scheme_completed_report'] = array("read" => isset($_POST['view_scheme_completed_report']) ? 1 : 0); $permissions['pending_payment_report'] = array("read" => isset($_POST['view_pending_payment_report']) ? 1 : 0); $permissions['employee_collection_report'] = array("read" => isset($_POST['view_employee_collection_report']) ? 1 : 0); $permissions['overall_collection_report'] = array("read" => isset($_POST['view_overall_collection_report']) ? 1 : 0); $permissions['administrator_backup'] = array("read" => isset($_POST['view_administrator_backup']) ? 1 : 0);*/ $permissions = json_encode($permissions); $branch_ids=""; if(isset($_POST['branch_ids'])){ $branch_ids = implode(',', $_POST['branch_ids']); } $statement = $pdo->prepare("UPDATE tbl_role SET role_name=?, roles=?, status=?,branch_id=? WHERE id=?"); $result=$statement->execute(array($_POST['role_name'],$permissions,$_POST['status'],$branch_ids,$_POST['ids'])); $success_message = 'New role is added successfully!'; // unset($_POST['role_name']); // header("Location:listroles.php"); } } ?> <?php $statement = $pdo->prepare("SELECT * FROM tbl_role where id=?"); $statement->execute([$_REQUEST['id']]); $result = $statement->fetchAll(PDO::FETCH_ASSOC); if (!empty($result) && isset($result[0]['roles'])) { $resPerm= json_decode($result[0]['roles'], true); $roleName=$result[0]['role_name']; $roleStatus=$result[0]['status']; $branch_idss = explode(',', $result[0]['branch_id']); } else { return 0; } ?> <section class="content-header" style="background-color: white;"> <div class="row"> <div class="col-md-12" style="text-align: center;"> <h4><i class="fa fa-user-plus"></i> Edit Roles</h4> </div> </div> </section> <section class="content" style="background-color: white;"> <div class="row"> <!-- left column --> <div class="col-md-12"> <?php if($error_message): ?> <div class="callout callout-danger"> <p> <?php echo $error_message; ?> </p> </div> <?php endif; ?> <?php if($success_message): ?> <div class="callout callout-success"> <p><?php echo $success_message; ?></p> </div> <?php endif; ?> <div> <!-- form start --> <form role="form" method="post" action="" enctype="multipart/form-data"> <div class="box-body"> <div class="form-group col-sm-4"> <label for="exampleInputEmail1" class="required">Role Name</label> <input type='hidden' name="ids" value="<?=$_REQUEST['id']?>" > <input type="text" class="form-control" id="txtuppercase" name="role_name" placeholder="Enter the Role Name" value="<?php if(isset($roleName)){echo $roleName;} ?>" required="Please enter the Role Name"> </div> <div class="col-md-8"> <label for="exampleInputEmail1" class="required">Branch Name</label> <select name="branch_ids[]" class="form-control select2" style="width:100%" id="branch_ids" multiple> <?php $statement = $pdo->prepare("SELECT * FROM `tbl_branch` where status='ACTIVE'"); $statement->execute(); $location_result = $statement->fetchAll(PDO::FETCH_ASSOC); foreach ($location_result as $result) { ?> <option value="<?=$result['id']?>" <?php if(in_array($result['id'], $branch_idss)){ echo "selected";} ?>><?=$result['branch_name']?></option> <?php } ?> </select> </div> <table style="width:100%"> <tr> <th>Access Name</th> <th>Select All</th> <th>View</th> <th>Add</th> <th>Edit</th> <th>Delete</th> <th>Bulk Upload</th> <th>Easy Edit</th> </tr> <tr> <td> <i class="fa fa-users"></i><span> BRANCH</span> </td> <td> <label class="switch"> <input type="checkbox" class="master_child" name="child_branch"> <span class="slider round"></span> </label> </td> <td> <label class="switch"> <input type="checkbox" class="child_branch" value="0" name="view_branch" <?php if($resPerm['branch']['read']=="1"){ echo"checked"; }?>> <span class="slider round"></span> </label> </td> <td> <label class="switch"> <input type="checkbox" class="child_branch" value="0" name="add_branch" <?php if($resPerm['branch']['create']=="1"){ echo"checked"; }?>> <span class="slider round"></span> </label> </td> <td> <label class="switch"> <input type="checkbox" class="child_branch" value="0" name="edit_branch" <?php if($resPerm['branch']['update']=="1"){ echo"checked"; }?>> <span class="slider round"></span> </label> </td> <td> <label class="switch"> <input type="checkbox" class="child_branch" value="0" name="delete_branch" <?php if($resPerm['branch']['delete']=="1"){ echo"checked"; }?>> <span class="slider round"></span> </label> </td> </tr> <tr> <td> <i class="fa fa-users"></i><span> Role</span> </td> <td> <label class="switch"> <input type="checkbox" class="master_child" name="child_role"> <span class="slider round"></span> </label> </td> <td> <label class="switch"> <input type="checkbox" class="child_role" value="0" name="view_role" <?php if($resPerm['role']['read']=="1"){ echo"checked"; }?>> <span class="slider round"></span> </label> </td> <td> <label class="switch"> <input type="checkbox" class="child_role" value="0" name="add_role" <?php if($resPerm['role']['create']=="1"){ echo"checked"; }?>> <span class="slider round"></span> </label> </td> <td> <label class="switch"> <input type="checkbox" class="child_role" value="0" name="edit_role" <?php if($resPerm['role']['update']=="1"){ echo"checked"; }?>> <span class="slider round"></span> </label> </td> <td> <label class="switch"> <input type="checkbox" class="child_role" value="0" name="delete_role" <?php if($resPerm['role']['delete']=="1"){ echo"checked"; }?>> <span class="slider round"></span> </label> </td> </tr> <tr> <td> <i class="fa fa-users"></i><span> Client</span> </td> <td> <label class="switch"> <input type="checkbox" class="master_child" name="child_client"> <span class="slider round"></span> </label> </td> <td> <label class="switch"> <input type="checkbox" class="child_client" value="0" name="view_client" <?php if($resPerm['client']['read']=="1"){ echo"checked"; }?>> <span class="slider round"></span> </label> </td> <td> <label class="switch"> <input type="checkbox" class="child_client" value="0" name="add_client" <?php if($resPerm['client']['create']=="1"){ echo"checked"; }?>> <span class="slider round"></span> </label> </td> <td> <label class="switch"> <input type="checkbox" class="child_client" value="0" name="edit_client" <?php if($resPerm['client']['update']=="1"){ echo"checked"; }?>> <span class="slider round"></span> </label> </td> <td> <label class="switch"> <input type="checkbox" class="child_client" value="0" name="delete_client" <?php if($resPerm['client']['delete']=="1"){ echo"checked"; }?>> <span class="slider round"></span> </label> </td> </tr> <tr> <td> <i class="fa fa-users"></i><span> System User</span> </td> <td> <label class="switch"> <input type="checkbox" class="master_child" name="child_system_user"> <span class="slider round"></span> </label> </td> <td> <label class="switch"> <input type="checkbox" class="child_system_user" value="0" name="view_system_user" <?php if($resPerm['system_user']['read']=="1"){ echo"checked"; }?>> <span class="slider round"></span> </label> </td> <td> <label class="switch"> <input type="checkbox" class="child_system_user" value="0" name="add_system_user" <?php if($resPerm['system_user']['create']=="1"){ echo"checked"; }?>> <span class="slider round"></span> </label> </td> <td> <label class="switch"> <input type="checkbox" class="child_system_user" value="0" name="edit_system_user" <?php if($resPerm['system_user']['update']=="1"){ echo"checked"; }?>> <span class="slider round"></span> </label> </td> <td> <label class="switch"> <input type="checkbox" class="child_system_user" value="0" name="delete_system_user" <?php if($resPerm['system_user']['delete']=="1"){ echo"checked"; }?>> <span class="slider round"></span> </label> </td> </tr> <tr> <td> <i class="fa fa-users"></i><span> AWB Count Details</span> </td> <td> <label class="switch"> <input type="checkbox" class="master_child" name="child_awb_count_details"> <span class="slider round"></span> </label> </td> <td> <label class="switch"> <input type="checkbox" class="child_awb_count_details" value="0" name="view_awb_count_details" <?php if($resPerm['awb_count_details']['read']=="1"){ echo"checked"; }?>> <span class="slider round"></span> </label> </td> <td>-</td> <td>-</td> <td>-</td> </tr> <tr> <td> <i class="fa fa-users"></i><span> AWB Number Details</span> </td> <td> <label class="switch"> <input type="checkbox" class="master_child" name="child_awb_number_details" > <span class="slider round"></span> </label> </td> <td> <label class="switch"> <input type="checkbox" class="child_awb_number_details" value="0" name="view_awb_number_details" <?php if($resPerm['awb_number_details']['read']=="1"){ echo"checked"; }?>> <span class="slider round"></span> </label> </td> <td> <label class="switch"> <input type="checkbox" class="child_awb_number_details" value="0" name="add_awb_number_details" <?php if($resPerm['awb_number_details']['create']=="1"){ echo"checked"; }?>> <span class="slider round"></span> </label> </td> <td>-</td> <td>-</td> </tr> <tr><td> <i class='fa fa-user-tie '></i> <span>AWB List</span> </td> <td> <label class="switch"> <input type="checkbox" class="master_child" name="child_awb_list"> <span class="slider round"></span> </label> </td> <td> <label class="switch"> <input type="checkbox" class="child_awb_list" value="0" name="view_awb_list" <?php if($resPerm['awb_list']['read']=="1"){ echo"checked"; }?>> <span class="slider round"></span> </label> </td> <td> <label class="switch"> <input type="checkbox" class="child_awb_list" value="0" name="add_awb_list" <?php if($resPerm['awb_list']['create']=="1"){ echo"checked"; }?>> <span class="slider round"></span> </label> </td> <td> - </td> <td> <label class="switch"> <input type="checkbox" class="child_awb_list" value="0" name="delete_awb_list" <?php if($resPerm['awb_list']['delete']=="1"){ echo"checked"; }?>> <span class="slider round"></span> </label> </td> </tr> <tr> <td> <i class="fa fa-users"></i><span> Logistics</span> </td> <td> <label class="switch"> <input type="checkbox" class="master_child" name="child_logistics"> <span class="slider round"></span> </label> </td> <td> <label class="switch"> <input type="checkbox" class="child_logistics" value="0" name="view_logistics" <?php if($resPerm['logistics']['read']=="1"){ echo"checked"; }?>> <span class="slider round"></span> </label> </td> <td> <label class="switch"> <input type="checkbox" class="child_logistics" value="0" name="add_logistics" <?php if($resPerm['logistics']['create']=="1"){ echo"checked"; }?>> <span class="slider round"></span> </label> </td> <td> <label class="switch"> <input type="checkbox" class="child_logistics" value="0" name="edit_logistics" <?php if($resPerm['logistics']['update']=="1"){ echo"checked"; }?>> <span class="slider round"></span> </label> </td> <td> <label class="switch"> <input type="checkbox" class="child_logistics" value="0" name="delete_logistics" <?php if($resPerm['logistics']['delete']=="1"){ echo"checked"; }?>> <span class="slider round"></span> </label> </td> </tr> <tr> <td> <i class="fa fa-users"></i><span> Pin Code</span> </td> <td> <label class="switch"> <input type="checkbox" class="master_child" name="child_pin_code"> <span class="slider round"></span> </label> </td> <td> <label class="switch"> <input type="checkbox" class="child_pin_code" value="0" name="view_pin_code" <?php if($resPerm['pin_code']['read']=="1"){ echo"checked"; }?>> <span class="slider round"></span> </label> </td> <td> <label class="switch"> <input type="checkbox" class="child_pin_code" value="0" name="add_pin_code" <?php if($resPerm['pin_code']['create']=="1"){ echo"checked"; }?>> <span class="slider round"></span> </label> </td> <td> <label class="switch"> <input type="checkbox" class="child_pin_code" value="0" name="edit_pin_code" <?php if($resPerm['pin_code']['update']=="1"){ echo"checked"; }?>> <span class="slider round"></span> </label> </td> <td> <label class="switch"> <input type="checkbox" class="child_pin_code" value="0" name="delete_pin_code" <?php if($resPerm['pin_code']['delete']=="1"){ echo"checked"; }?>> <span class="slider round"></span> </label> </td> <td> <label class="switch"> <input type="checkbox" class="child_pin_code" value="0" name="bulk_upload_pin_code" <?php if($resPerm['pin_code']['bulkupload']=="1"){ echo"checked"; }?>> <span class="slider round"></span> </label> </td> </tr> <tr> <td> <i class="fa fa-users"></i><span>Customer</span> </td> <td> <label class="switch"> <input type="checkbox" class="master_child" name="child_customer"> <span class="slider round"></span> </label> </td> <td> <label class="switch"> <input type="checkbox" class="child_customer" value="0" name="view_customer" <?php if($resPerm['customer']['read']=="1"){ echo"checked"; }?>> <span class="slider round"></span> </label> </td> <td> <label class="switch"> <input type="checkbox" class="child_customer" value="0" name="add_customer" <?php if($resPerm['customer']['create']=="1"){ echo"checked"; }?>> <span class="slider round"></span> </label> </td> <td> <label class="switch"> <input type="checkbox" class="child_customer" value="0" name="edit_customer" <?php if($resPerm['customer']['update']=="1"){ echo"checked"; }?>> <span class="slider round"></span> </label> </td> <td>-</td> <td> <label class="switch"> <input type="checkbox" class="child_customer" value="0" name="bulk_upload_customer" <?php if($resPerm['customer']['bulkupload']=="1"){ echo"checked"; }?>> <span class="slider round"></span> </label> </td> </tr> <tr><td colspan="8" style="text-align:center;color:green;font-weight:bolder;"><h4 style="color:green;font-weight:bolder;">POD DETAILS</h4></td></tr> <tr> <td> <i class="fa fa-users"></i><span>One Time Customer</span> </td> <td> <label class="switch"> <input type="checkbox" class="master_child" name="child_onetime_customer"> <span class="slider round"></span> </label> </td> <td> - </td> <td> <label class="switch"> <input type="checkbox" class="child_onetime_customer" value="0" name="add_onetime_customer" <?php if($resPerm['one_time_customer']['create']=="1"){ echo"checked"; }?>> <span class="slider round"></span> </label> </td> <td>-</td> <td>-</td> <td>-</td> </tr> <tr><td> <i class='fa fa-user-tie '></i> <span>Add Pickup Enter</span> </td> <td> <label class="switch"> <input type="checkbox" class="master_child" name="child_add_pickup_entery"> <span class="slider round"></span> </label> </td> <td>-</td> <td> <label class="switch"> <input type="checkbox" class="child_add_pickup_entery" value="0" name="add_add_pickup_entery" <?php if($resPerm['add_pickup_entry']['create']=="1"){ echo"checked"; }?>> <span class="slider round"></span> </label> </td> <td> - </td> <td>-</td> </tr> <tr><td> <i class='fa fa-user-tie '></i> <span>Manifest</span> </td> <td> <label class="switch"> <input type="checkbox" class="master_child" name="child_manifest"> <span class="slider round"></span> </label> </td> <td> <label class="switch"> <input type="checkbox" class="child_manifest" value="0" name="view_manifest" <?php if($resPerm['manifest']['read']=="1"){ echo"checked"; }?>> <span class="slider round"></span> </label> </td> <td> <label class="switch"> <input type="checkbox" class="child_manifest" value="0" name="add_manifest" <?php if($resPerm['manifest']['create']=="1"){ echo"checked"; }?>> <span class="slider round"></span> </label> </td> <td> <label class="switch"> <input type="checkbox" class="child_manifest" value="0" name="edit_manifest" <?php if($resPerm['manifest']['update']=="1"){ echo"checked"; }?>> <span class="slider round"></span> </label> </td> <td> <label class="switch"> <input type="checkbox" class="child_manifest" value="0" name="delete_manifest" <?php if($resPerm['manifest']['delete']=="1"){ echo"checked"; }?>> <span class="slider round"></span> </label> </td> </tr> <tr><td colspan="8" style="text-align:center;color:green;font-weight:bolder;"><h4 style="color:green;font-weight:bolder;">TRACKING</h4></td></tr> <tr><td> <i class='fa fa-user-tie '></i> <span>Tracking</span> </td> <td> <label class="switch"> <input type="checkbox" class="master_child" name="child_tracking"> <span class="slider round"></span> </label> </td> <td> <label class="switch"> <input type="checkbox" class="child_tracking" value="0" name="view_tracking" <?php if($resPerm['tracking']['read']=="1"){ echo"checked"; }?>> <span class="slider round"></span> </label> </td> <td>-</td> <td>-</td> <td> -</td> </tr> <tr><td colspan="8" style="text-align:center;color:green;font-weight:bolder;"><h4 style="color:green;font-weight:bolder;">REPORTS</h4></td></tr> <tr><td> <i class='fa fa-user-tie '></i> <span>Reports</span> </td> <td> <label class="switch"> <input type="checkbox" class="master_child" name="child_reports"> <span class="slider round"></span> </label> </td> <td> <label class="switch"> <input type="checkbox" class="child_reports" value="0" name="view_reports" <?php if($resPerm['reports']['read']=="1"){ echo"checked"; }?>> <span class="slider round"></span> </label> </td> <td>-</td> <td>-</td> <td> -</td> </tr> <tr><td colspan="8" style="text-align:center;color:green;font-weight:bolder;"><h4 style="color:green;font-weight:bolder;">SETTINGS</h4></td></tr> <tr> <td> <i class="fa fa-users"></i><span>Transports</span> </td> <td> <label class="switch"> <input type="checkbox" class="master_child" name="child_transport"> <span class="slider round"></span> </label> </td> <td> <label class="switch"> <input type="checkbox" class="child_transport" value="0" name="view_transport" <?php if($resPerm['transports']['read']=="1"){ echo"checked"; }?>> <span class="slider round"></span> </label> </td> <td> <label class="switch"> <input type="checkbox" class="child_transport" value="0" name="add_transport" <?php if($resPerm['transports']['create']=="1"){ echo"checked"; }?>> <span class="slider round"></span> </label> </td> <td> <label class="switch"> <input type="checkbox" class="child_transport" value="0" name="edit_transport" <?php if($resPerm['transports']['update']=="1"){ echo"checked"; }?>> <span class="slider round"></span> </label> </td> <td> <label class="switch"> <input type="checkbox" class="child_transport" value="0" name="delete_transport" <?php if($resPerm['transports']['delete']=="1"){ echo"checked"; }?>> <span class="slider round"></span> </label> </td> </tr> <tr> <td> <i class="fa fa-users"></i><span>Contents</span> </td> <td> <label class="switch"> <input type="checkbox" class="master_child" name="child_contents"> <span class="slider round"></span> </label> </td> <td> <label class="switch"> <input type="checkbox" class="child_contents" value="0" name="view_contents" <?php if($resPerm['contents']['read']=="1"){ echo"checked"; }?>> <span class="slider round"></span> </label> </td> <td> <label class="switch"> <input type="checkbox" class="child_contents" value="0" name="add_contents" <?php if($resPerm['contents']['create']=="1"){ echo"checked"; }?>> <span class="slider round"></span> </label> </td> <td> <label class="switch"> <input type="checkbox" class="child_contents" value="0" name="edit_contents" <?php if($resPerm['contents']['update']=="1"){ echo"checked"; }?>> <span class="slider round"></span> </label> </td> <td> <label class="switch"> <input type="checkbox" class="child_contents" value="0" name="delete_contents" <?php if($resPerm['contents']['delete']=="1"){ echo"checked"; }?>> <span class="slider round"></span> </label> </td> </tr> <tr> <td> <i class="fa fa-users"></i><span>Backup</span> </td> <td> <label class="switch"> <input type="checkbox" class="master_child" name="child_backup"> <span class="slider round"></span> </label> </td> <td> <label class="switch"> <input type="checkbox" class="child_backup" value="0" name="view_backup" <?php if($resPerm['backups']['read']=="1"){ echo"checked"; }?>> <span class="slider round"></span> </label> </td> <td>-</td> <td>-</td> <td>-</td> </tr> <tr> <td colspan="8" style="text-align:center;"> <div class="form-group"> <span class="required" for="name">Role Status</span> <select name="status" id="" class="form-control tip"> <option value="1" <?php if($roleStatus==1){echo "selected";}?>>Active</option> <option value="2" <?php if($roleStatus==2){echo "selected";}?>>In-Active</option> </select> </div </td> </tr> </table> <style> table,th,td{ padding:4px 5px; text-align:center; } </style> <div class="form-group col-sm-12"> </div> <br><br> <!--role details Start--> <div class="form-group col-sm-12"></div> <div class="form-group col-sm-12"></div> <div class="form-group col-sm-12"></td> </b> </center> <!--role Details End--> </div> <!-- /.box-body --> <div class="box-footer"> <center> <button type="submit" name="submits" class="btn btn-success">Submit</button></center> </div> </form> </div> <!-- /.box --> </div> <!-- /.box-body --> </div> <!-- /.box --> </div> <!--/.col (right) --> </div> </section> <script type="text/javascript"> function JSalert(){ swal("Congrats!", " Your Package is added succesfully!", "success"); } </script> <script> jQuery(document).ready(function() { // 1 Capitalize string - convert textbox user entered text to uppercase jQuery('#txtuppercase').keyup(function() { $(this).val($(this).val().toUpperCase()); }); }); </script> <script> $(document).ready(function() { $('input[type=checkbox]').on('click',function(){ var current_value = $(this).val(); // console.log(current_value); if(current_value==1) { $(this).val(0); } else { $(this).val(1); } } ); } ); </script> <script type="text/javascript"> $(document).ready(function(){ $('.master_child').on('change',function(){ var values=$(this).attr("name"); if(this.checked){ $('.'+values).each(function(){ this.checked = true; }); }else{ $('.'+values).each(function(){ this.checked = false; }); } }); }); </script> <?php require_once('footer.php'); ?>