<?php  include "header.php";

$permissions = array();


if(isset($_POST['update_role'])){
        try{
            
          
           $permissions['users'] = array("create" => isset($_POST['add_users']) ? 1 : 0, "read" => isset($_POST['view_users']) ? 1 : 0, 
                                    "update" => isset($_POST['edit_users']) ? 1 : 0, "delete" => isset($_POST['delete_users']) ? 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['purchases'] = array("create" => isset($_POST['add_purchases']) ? 1 : 0, "read" => isset($_POST['view_purchases']) ? 1 : 0, 
                                    "update" => isset($_POST['edit_purchases']) ? 1 : 0, "delete" => isset($_POST['delete_purchases']) ? 1 : 0);
            
            $permissions['barcode'] = array("create" => isset($_POST['add_barcode']) ? 1 : 0, "read" => isset($_POST['view_barcode']) ? 1 : 0, 
                                    "update" => isset($_POST['edit_barcode']) ? 1 : 0, "delete" => isset($_POST['delete_barcode']) ? 1 : 0);
            
            
            $permissions['products'] = array("create" => isset($_POST['add_products']) ? 1 : 0, "read" => isset($_POST['view_products']) ? 1 : 0, 
                                    "update" => isset($_POST['edit_products']) ? 1 : 0, "delete" => isset($_POST['delete_products']) ? 1 : 0);
                                    
            $permissions['sales'] = array("create" => isset($_POST['add_sales']) ? 1 : 0, "read" => isset($_POST['view_sales']) ? 1 : 0, 
                                    "update" => isset($_POST['edit_sales']) ? 1 : 0, "delete" => isset($_POST['delete_sales']) ? 1 : 0);
            
            $permissions['sales_payments'] = array("create" => isset($_POST['add_sales_payments']) ? 1 : 0, "read" => isset($_POST['view_sales_payments']) ? 1 : 0, 
                                    "update" => isset($_POST['edit_sales_payments']) ? 1 : 0, "delete" => isset($_POST['delete_sales_payments']) ? 1 : 0);
            
            $permissions['customers'] = array("create" => isset($_POST['add_customers']) ? 1 : 0, "read" => isset($_POST['view_customers']) ? 1 : 0, 
                                    "update" => isset($_POST['edit_customers']) ? 1 : 0, "delete" => isset($_POST['delete_customers']) ? 1 : 0);
                                    
            
            $permissions['customer_scheme'] = array("create" => isset($_POST['add_customer_scheme']) ? 1 : 0, "read" => isset($_POST['view_customer_scheme']) ? 1 : 0, 
                                    "update" => isset($_POST['edit_customer_scheme']) ? 1 : 0, "delete" => isset($_POST['delete_customer_scheme']) ? 1 : 0);
                                    
            
            $permissions['scheme_payments'] = array("create" => isset($_POST['add_scheme_payments']) ? 1 : 0,"read" => isset($_POST['view_scheme_payments']) ? 1 : 0, 
                                    "update" => isset($_POST['edit_scheme_payments']) ? 1 : 0, "delete" => isset($_POST['delete_scheme_payments']) ? 1 : 0);
            
            
            
            $permissions['price'] = array("update_price" => isset($_POST['update_price']) ? 1 : 0, "price_reports" => isset($_POST['view_price_reports']) ? 1 : 0);
                                             
                                             
            $permissions['dashboard'] = array("today_price_list" => isset($_POST['today_price_list']) ? 1 : 0, "price_reports" => isset($_POST['price_reports']) ? 1 : 0);
                                             
            
            $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['stock_transfer'] = array("create" => isset($_POST['add_stock_transfer']) ? 1 : 0, "read" => isset($_POST['view_stock_transfer']) ? 1 : 0, 
                                                   "update" => isset($_POST['edit_stock_transfer']) ? 1 : 0, "delete" => isset($_POST['delete_stock_transfer']) ? 1 : 0);
                                                     
            
            $permissions['reports'] = array("all" => isset($_POST['all_reports']) ? 1 : 0);
            
            
            $permissions['expenses'] = array("create" => isset($_POST['add_expenses']) ? 1 : 0,"read" => isset($_POST['view_expenses']) ? 1 : 0, 
                                             "update" => isset($_POST['edit_expenses']) ? 1 : 0,"delete" => isset($_POST['delete_expenses']) ? 1 : 0);
                                    
            
            $permissions['expenses_category'] = array("create" => isset($_POST['add_expenses_category']) ? 1 : 0,"read" => isset($_POST['view_expenses_category']) ? 1 : 0, 
                                                      "update" => isset($_POST['edit_expenses_category']) ? 1 : 0,"delete" => isset($_POST['delete_expenses_category']) ? 1 : 0);
            
            $permissions['suppliers'] = array("create" => isset($_POST['add_suppliers']) ? 1 : 0,"read" => isset($_POST['view_suppliers']) ? 1 : 0, 
                                              "update" => isset($_POST['edit_suppliers']) ? 1 : 0,"delete" => isset($_POST['delete_suppliers']) ? 1 : 0);
            
            $permissions['repair_voucher'] = array("create" => isset($_POST['add_repair_voucher']) ? 1 : 0,"read" => isset($_POST['view_repair_voucher']) ? 1 : 0, 
                                    "update" => isset($_POST['edit_repair_voucher']) ? 1 : 0,"delete" => isset($_POST['delete_repair_voucher']) ? 1 : 0);
            
            $permissions['advance_voucher'] = array("create" => isset($_POST['add_advance_voucher']) ? 1 : 0,"read" => isset($_POST['view_advance_voucher']) ? 1 : 0, 
                                    "update" => isset($_POST['edit_advance_voucher']) ? 1 : 0,"delete" => isset($_POST['delete_advance_voucher']) ? 1 : 0);
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
            
            
            
    // Customs Starts Here
            $permissions['scheme_name'] = array("create" => isset($_POST['add_scheme_name']) ? 1 : 0, "read" => isset($_POST['view_scheme_name']) ? 1 : 0, 
                                                "update" => isset($_POST['edit_scheme_name']) ? 1 : 0, "delete" => isset($_POST['delete_scheme_name']) ? 1 : 0);  
            
            $permissions['products_name'] = array("create" => isset($_POST['add_products_name']) ? 1 : 0, "read" => isset($_POST['view_products_name']) ? 1 : 0, 
                                                  "update" => isset($_POST['edit_products_name']) ? 1 : 0, "delete" => isset($_POST['delete_products_name']) ? 1 : 0); 
            
            $permissions['category'] = array("create" => isset($_POST['add_category']) ? 1 : 0, "read" => isset($_POST['view_category']) ? 1 : 0, 
                                             "update" => isset($_POST['edit_category']) ? 1 : 0,"delete" => isset($_POST['delete_category']) ? 1 : 0);
                                    
            $permissions['sub_category'] = array("create" => isset($_POST['add_sub_category']) ? 1 : 0, "read" => isset($_POST['view_sub_category']) ? 1 : 0, 
                                                 "update" => isset($_POST['edit_sub_category']) ? 1 : 0,"delete" => isset($_POST['delete_sub_category']) ? 1 : 0);
                                    
            $permissions['gst'] = array("create" => isset($_POST['add_gst']) ? 1 : 0,"read" => isset($_POST['view_gst']) ? 1 : 0, 
                                        "update" => isset($_POST['edit_gst']) ? 1 : 0,"delete" => isset($_POST['delete_gst']) ? 1 : 0);
                                    
            $permissions['wastage'] = array("create" => isset($_POST['add_wastage']) ? 1 : 0,"read" => isset($_POST['view_wastage']) ? 1 : 0, 
                                            "update" => isset($_POST['edit_wastage']) ? 1 : 0,"delete" => isset($_POST['delete_wastage']) ? 1 : 0);
                                    
            $permissions['purity'] = array("create" => isset($_POST['add_purity']) ? 1 : 0,"read" => isset($_POST['view_purity']) ? 1 : 0, 
                                           "update" => isset($_POST['edit_purity']) ? 1 : 0,"delete" => isset($_POST['delete_purity']) ? 1 : 0);
    
    // Customs Endsss Here
    
    
    
    
    
    
    
    
    
    
    
    
    
    
                                    
            

            $role_name = $_POST['role_name'];
            $ids = $_POST['ids'];
            $permissions = json_encode($permissions);                       
            
            
            
    $statement = $pdo->prepare("UPDATE tbl_role SET role_name=?, permission=?, updated_by=? WHERE id=?");
    $result = $statement->execute(array($role_name, $permissions, $session_id, $ids));


        
                    
                    if($result){
                        $message = 'Role Updated Successfully!';
                        unset($_POST);      
                    }else{
                        $warning = "Something went wrong try again...";
                    }  
                }catch(Exception $e){
                    $error=$e;
                }   
    }
    
?>


<div class="content-wrapper" style="background:white;">
        <section class="content-header">
            <a href="role.php" class="btn btn-danger btn-sm pull-left"><i class="fa fa-arrow-left"></i> Back to Role List</a>
        </section>



        <div class="col-lg-12 alerts">
            <div id="custom-alerts" style="display:none;">
                <div class="alert alert-dismissable">
                    <div class="custom-msg"></div>
                </div>
            </div>
            <?php if ($error)  { ?>
            <div class="alert alert-danger alert-dismissable">
                <button aria-hidden="true" data-dismiss="alert" class="close" type="button">×</button>
                <h4><i class="icon fa fa-ban"></i> Error</h4>
                <?= $error; ?>
            </div>
            <?php $error=0;} if ($warning) { ?>
            <div class="alert alert-warning alert-dismissable">
                <button aria-hidden="true" data-dismiss="alert" class="close" type="button">×</button>
                <h4><i class="icon fa fa-warning"></i> warning</h4>
                <?= $warning; ?>
            </div>
            <?php  $warning=0;} if ($message) { ?>
           <br> <div class="alert alert-success alert-dismissable">
                <button aria-hidden="true" data-dismiss="alert" class="close" type="button">×</button>
                <h4>    <i class="icon fa fa-check"></i> Success</h4>
                <?= $message; ?>
            </div>
            <?php $message=0; } ?>
        </div>
        <div class="clearfix"></div>



<?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]['permission'])) {
    $resPerm = json_decode($result[0]['permission'], true);
    $roleName = $result[0]['role_name'];
    $roleStatus = $result[0]['status'];
} else {
    header("location: role.php");
}
?>



<section class="content">
    <div class="row">
        <div class="col-xs-12">
            <div >
                <div class="box-header">
                    <h3 class="box-title"><b>Update Role Details</b></h3>
                </div>
                <div class="box-body">
                    <div class="col-lg-12">
                <form action="" class="validation" enctype="multipart/form-data" method="post" accept-charset="utf-8">
                    <input type='hidden' name="ids" value="<?=$_REQUEST['id']?>" >
                    
                    
                    <div class="row">
                            <div class="col-md-4">
                                <div class="form-group">
                                    <label class="required" for="name">Role Name</label>                                    
                                    <input type="text" name="role_name" value="<?php if(isset($roleName)){echo $roleName;} ?>" placeholder="Enter Role Name" class="form-control tip" id="name"  required="required" />
                                </div>
                            </div>
                    </div>
                    
                    
                    
                    
                    
                    
                    <div class="row">
                        
                        <div class="col-md-12 role_content" style="">   
                            <center> <h4><b>Users & Role Management System</b></h4></center>
                            
                            
                        	<div class="col-md-4">
						        <h4><b>Users</b></h4>
        						 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label">View Users</span>
                						<label>
                                          <input type="checkbox" style="width:35%;"   value="0" name="view_users" <?php if($resPerm['users']['read']=="1"){ echo "checked"; }?>>
                                        </label>
                                 </div>
                                 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label">Add Users</span>
                						<label>
                                          <input type="checkbox"  style="width:35%;"   value="0" name="add_users" <?php if($resPerm['users']['create']=="1"){ echo "checked"; }?>>
                                          
                                        </label>
                                 </div>
                                 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label">Edit Users</span>
                						<label>
                                          <input type="checkbox"  style="width:35%;"   value="0" name="edit_users" <?php if($resPerm['users']['update']=="1"){ echo "checked"; }?>>
                                          
                                        </label>
                                 </div>
                                 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label">Delete Users</span>
                						<label>
                                          <input type="checkbox"  style="width:35%;"  class="child_client " value="0" name="delete_users" <?php if($resPerm['users']['delete']=="1"){ echo "checked"; }?>>
                                          
                                        </label>
                                 </div>
                             </div>
                             
                             
                            <div class="col-md-4">
						        <h4><b>Roles</b></h4>
        						<div class="form-group">
        						    <span for="" class="col-sm-6 control-label">View Role</span>
                						<label>
                                          <input type="checkbox" style="width:35%;"   value="0" name="view_role"  <?php if($resPerm['role']['read']=="1"){ echo"checked"; }?>>
                                        </label>
                                 </div>
                                 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label">Add Role</span>
                						<label>
                                          <input type="checkbox"  style="width:35%;"   value="0" name="add_role" <?php if($resPerm['role']['create']=="1"){ echo"checked"; }?>>
                                          
                                        </label>
                                 </div>
                                 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label">Edit Role</span>
                						<label>
                                          <input type="checkbox"  style="width:35%;"   value="0" name="edit_role" <?php if($resPerm['role']['update']=="1"){ echo"checked"; }?>>
                                          
                                        </label>
                                 </div>
                                 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label">Delete Role</span>
                						<label>
                                          <input type="checkbox"  style="width:35%;"  value="0" name="delete_role" <?php if($resPerm['role']['delete']=="1"){ echo"checked"; }?>>
                                          
                                        </label>
                                 </div>
                             </div>
                          
                          
                           
                        </div>
                        
                        <div class="col-md-12 role_content" style="">   
                            <center> <h4><b>Purchases & Barcode Management System</b></h4></center>
                            
                            <div class="col-md-4">
						        <h4><b>Purchases</b></h4>
        						<div class="form-group">
        						    <span for="" class="col-sm-6 control-label">View Purchases</span>
                						<span class="switch">
                                          <input type="checkbox" style="width:35%;"  class="child_client" value="0" name="view_purchases" <?php if($resPerm['purchases']['read']=="1"){ echo"checked"; }?>>
                                        </span>
                                 </div>
                                 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label">Add Purchases</span>
                						<span class="switch">
                                          <input type="checkbox"  style="width:35%;"  class="child_client" value="0" name="add_purchases" <?php if($resPerm['purchases']['create']=="1"){ echo"checked"; }?>>
                                          
                                        </span>
                                 </div>
                                 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label">Edit Purchases</span>
                						<span class="switch">
                                          <input type="checkbox"  style="width:35%;"  class="child_client" value="0" name="edit_purchases" <?php if($resPerm['purchases']['update']=="1"){ echo"checked"; }?>>
                                          
                                        </span>
                                 </div>
                                 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label">Delete Purchases</span>
                						<span class="switch">
                                          <input type="checkbox"  style="width:35%;"  class="child_client " value="0" name="delete_purchases" <?php if($resPerm['purchases']['delete']=="1"){ echo"checked"; }?>>
                                          
                                        </span>
                                 </div>
                                 
                             </div>
                            <div class="col-md-4">
						        <h4><b>Barcode</b></h4>
        						<div class="form-group">
        						    <span for="" class="col-sm-6 control-label">View Barcode</span>
                						<span class="switch">
                                          <input type="checkbox" style="width:35%;"  class="child_client" value="0" name="view_barcode" <?php if($resPerm['barcode']['read']=="1"){ echo"checked"; }?>>
                                        </span>
                                 </div>
                                 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label">Add Barcode</span>
                						<span class="switch">
                                          <input type="checkbox"  style="width:35%;"  class="child_client" value="0" name="add_barcode" <?php if($resPerm['barcode']['create']=="1"){ echo"checked"; }?>>
                                          
                                        </span>
                                 </div>
                                 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label">Edit Barcode</span>
                						<span class="switch">
                                          <input type="checkbox"  style="width:35%;"  class="child_client" value="0" name="edit_barcode" <?php if($resPerm['barcode']['update']=="1"){ echo"checked"; }?>>
                                          
                                        </span>
                                 </div>
                                 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label">Delete Barcode</span>
                						<span class="switch">
                                          <input type="checkbox"  style="width:35%;"  class="child_client " value="0" name="delete_barcode" <?php if($resPerm['barcode']['delete']=="1"){ echo"checked"; }?>>
                                          
                                        </span>
                                 </div>
                                
                             </div>
                             <div class="col-md-4">
						        <h4><b>Suppliers</b></h4>
        						<div class="form-group">
        						    <span for="" class="col-sm-6 control-label">View Suppliers</span>
                						<span class="switch">
                                          <input type="checkbox" style="width:35%;"  class="child_client" value="0" name="view_suppliers" <?php if($resPerm['suppliers']['read']=="1"){ echo"checked"; }?>>
                                        </span>
                                 </div>
                                 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label">Add Suppliers</span>
                						<span class="switch">
                                          <input type="checkbox"  style="width:35%;"  class="child_client" value="0" name="add_suppliers" <?php if($resPerm['suppliers']['create']=="1"){ echo"checked"; }?>>
                                          
                                        </span>
                                 </div>
                                 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label">Edit Suppliers</span>
                						<span class="switch">
                                          <input type="checkbox"  style="width:35%;"  class="child_client" value="0" name="edit_suppliers" <?php if($resPerm['suppliers']['update']=="1"){ echo"checked"; }?>>
                                          
                                        </span>
                                 </div>
                                 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label">Delete Suppliers</span>
                						<span class="switch">
                                          <input type="checkbox"  style="width:35%;"  class="child_client " value="0" name="delete_suppliers" <?php if($resPerm['suppliers']['delete']=="1"){ echo"checked"; }?>>
                                          
                                        </span>
                                 </div>
                                 
                             </div>
                             
                        </div>  
                        
                        <div class="col-md-12 role_content" style="">   
                        <center> <h4><b>Products & Sales Management System</b></h4></center>
                       
                             <div class="col-md-4">
						        <h4><b>Products</b></h4>
        						<div class="form-group">
        						    <span for="" class="col-sm-6 control-label">View Products</span>
                						<span class="switch">
                                          <input type="checkbox" style="width:35%;"  class="child_client" value="0" name="view_products" <?php if($resPerm['products']['read']=="1"){ echo"checked"; }?>>
                                        </span>
                                 </div>
                                 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label">Add Products</span>
                						<span class="switch">
                                          <input type="checkbox"  style="width:35%;"  class="child_client" value="0" name="add_products" <?php if($resPerm['products']['create']=="1"){ echo"checked"; }?>>
                                          
                                        </span>
                                 </div>
                                 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label">Edit Products</span>
                						<span class="switch">
                                          <input type="checkbox"  style="width:35%;"  class="child_client" value="0" name="edit_products" <?php if($resPerm['products']['update']=="1"){ echo"checked"; }?>>
                                          
                                        </span>
                                 </div>
                                 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label">Delete Products</span>
                						<span class="switch">
                                          <input type="checkbox"  style="width:35%;"  class="child_client " value="0" name="delete_products" <?php if($resPerm['products']['delete']=="1"){ echo"checked"; }?>>
                                          
                                        </span>
                                 </div>
                             </div>
                             
                             <div class="col-md-4">
						        <h4><b>Sales</b></h4>
                                 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label">List Sales</span>
                						<span class="switch">
                                          <input type="checkbox"  style="width:35%;"  class="child_client" value="0" name="view_sales" <?php if($resPerm['sales']['read']=="1"){ echo"checked"; }?>>
                                          
                                        </span>
                                 </div>
                                 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label">Add Sales</span>
                						<span class="switch">
                                          <input type="checkbox"  style="width:35%;"  class="child_client" value="0" name="add_sales" <?php if($resPerm['sales']['create']=="1"){ echo"checked"; }?>>
                                          
                                        </span>
                                 </div>
                                 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label">Update Sales</span>
                						<span class="switch">
                                          <input type="checkbox"  style="width:35%;"  class="child_client " value="0" name="edit_sales" <?php if($resPerm['sales']['update']=="1"){ echo"checked"; }?>>
                                        </span>
                                 </div>
                                 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label">Delete Sales</span>
                						<span class="switch">
                                          <input type="checkbox"  style="width:35%;"  class="child_client " value="0" name="delete_sales" <?php if($resPerm['sales']['delete']=="1"){ echo"checked"; }?>>
                                          
                                        </span>
                                 </div>
                             </div>
                             
                             <div class="col-md-4">
						        <h4><b>Sales Payments</b></h4>
                                 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label">List Sales Payments</span>
                						<span class="switch">
                                          <input type="checkbox"  style="width:35%;"  class="child_client" value="0" name="view_sales_payments" <?php if($resPerm['sales_payments']['read']=="1"){ echo"checked"; }?>>
                                          
                                        </span>
                                 </div>
                                 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label">Add Sales Payments</span>
                						<span class="switch">
                                          <input type="checkbox"  style="width:35%;"  class="child_client" value="0" name="add_sales_payments" <?php if($resPerm['sales_payments']['create']=="1"){ echo"checked"; }?>>
                                          
                                        </span>
                                 </div>
                                 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label">Update Sales Payments</span>
                						<span class="switch">
                                          <input type="checkbox"  style="width:35%;"  class="child_client " value="0" name="edit_sales_payments" <?php if($resPerm['sales_payments']['update']=="1"){ echo"checked"; }?>>
                                        </span>
                                 </div>
                                 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label">Delete Sales Payments</span>
                						<span class="switch">
                                          <input type="checkbox"  style="width:35%;"  class="child_client " value="0" name="delete_sales_payments" <?php if($resPerm['sales_payments']['delete']=="1"){ echo"checked"; }?>>
                                          
                                        </span>
                                 </div>
                             </div>
                             
                            
                        </div>
                        

                        <div class="col-md-12 role_content" style="">   
                        <center> <h4><b>Customers Management System</b></h4></center>
                       
                             <div class="col-md-4">
						        <h4><b>Customers</b></h4>
        						<div class="form-group">
        						    <span for="" class="col-sm-6 control-label">View Customers</span>
                						<span class="switch">
                                          <input type="checkbox" style="width:35%;"  class="child_client" value="0" name="view_customers" <?php if($resPerm['customers']['read']=="1"){ echo"checked"; }?>>
                                        </span>
                                 </div>
                                 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label">Add Customers</span>
                						<span class="switch">
                                          <input type="checkbox"  style="width:35%;"  class="child_client" value="0" name="add_customers" <?php if($resPerm['customers']['create']=="1"){ echo"checked"; }?>>
                                          
                                        </span>
                                 </div>
                                 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label">Edit Customers</span>
                						<span class="switch">
                                          <input type="checkbox"  style="width:35%;"  class="child_client" value="0" name="edit_customers" <?php if($resPerm['customers']['update']=="1"){ echo"checked"; }?>>
                                          
                                        </span>
                                 </div>
                                 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label">Delete Customers</span>
                						<span class="switch">
                                          <input type="checkbox"  style="width:35%;"  class="child_client " value="0" name="delete_customers" <?php if($resPerm['customers']['delete']=="1"){ echo"checked"; }?>>
                                          
                                        </span>
                                 </div>
                             </div>
                             
                             
                             <div class="col-md-4">
						        <h4><b>Customers Scheme</b></h4>
                                 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label">List Customers Scheme</span>
                						<span class="switch">
                                          <input type="checkbox"  style="width:35%;"  class="child_client" value="0" name="view_customer_scheme" <?php if($resPerm['customer_scheme']['read']=="1"){ echo"checked"; }?>>
                                          
                                        </span>
                                 </div>
                                 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label">Add Customers Scheme</span>
                						<span class="switch">
                                          <input type="checkbox"  style="width:35%;"  class="child_client" value="0" name="add_customer_scheme" <?php if($resPerm['customer_scheme']['create']=="1"){ echo"checked"; }?>>
                                          
                                        </span>
                                 </div>
                                 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label">Update Customers Scheme</span>
                						<span class="switch">
                                          <input type="checkbox"  style="width:35%;"  class="child_client " value="0" name="edit_customer_scheme" <?php if($resPerm['customer_scheme']['update']=="1"){ echo"checked"; }?>>
                                        </span>
                                 </div>
                                 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label">Delete Customers Scheme</span>
                						<span class="switch">
                                          <input type="checkbox"  style="width:35%;"  class="child_client " value="0" name="delete_customer_scheme" <?php if($resPerm['customer_scheme']['delete']=="1"){ echo"checked"; }?>>
                                          
                                        </span>
                                 </div>
                             </div>
                             
                             
                             <div class="col-md-4">
						        <h4><b>Scheme Payments</b></h4>
                                 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label">List Scheme Payments</span>
                						<span class="switch">
                                          <input type="checkbox"  style="width:35%;"  class="child_client" value="0" name="view_scheme_payments" <?php if($resPerm['scheme_payments']['read']=="1"){ echo"checked"; }?>>
                                          
                                        </span>
                                 </div>
                                 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label">Add Scheme Payments</span>
                						<span class="switch">
                                          <input type="checkbox"  style="width:35%;"  class="child_client" value="0" name="add_scheme_payments" <?php if($resPerm['scheme_payments']['create']=="1"){ echo"checked"; }?>>
                                          
                                        </span>
                                 </div>
                                 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label">Update Scheme Payments</span>
                						<span class="switch">
                                          <input type="checkbox"  style="width:35%;"  class="child_client " value="0" name="edit_scheme_payments" <?php if($resPerm['scheme_payments']['update']=="1"){ echo"checked"; }?>>
                                        </span>
                                 </div>
                                 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label">Delete Scheme Payments</span>
                						<span class="switch">
                                          <input type="checkbox"  style="width:35%;"  class="child_client " value="0" name="delete_scheme_payments" <?php if($resPerm['scheme_payments']['delete']=="1"){ echo"checked"; }?>>
                                          
                                        </span>
                                 </div>
                             </div>
                             
                            
                        </div>
                        
                        
                        <div class="col-md-12 role_content" style="background: antiquewhite;">  
                        
                            <center> <h4><b>Customs Mangement System</b></h4></center>
                       
                            <div class="col-md-4">
						        <h4><b>Category</b></h4>
        						<div class="form-group">
        						    <span for="" class="col-sm-6 control-label"> View Category</span>
                						<span class="switch">
                                          <input type="checkbox" style="width:35%;"  class="child_client" value="0" name="view_category" <?php if($resPerm['category']['read']=="1"){ echo"checked"; }?>>
                                        </span>
                                 </div>
                                 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label"> Add Category</span>
                						<span class="switch">
                                          <input type="checkbox" style="width:35%;"  class="child_client" value="0" name="add_category" <?php if($resPerm['category']['create']=="1"){ echo"checked"; }?>>
                                        </span>
                                 </div>
                                 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label"> Edit Category</span>
                						<span class="switch">
                                          <input type="checkbox" style="width:35%;"  class="child_client" value="0" name="edit_category" <?php if($resPerm['category']['update']=="1"){ echo"checked"; }?>>
                                        </span>
                                 </div>
                                 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label"> Delete Category</span>
                						<span class="switch">
                                          <input type="checkbox" style="width:35%;"  class="child_client" value="0" name="delete_category" <?php if($resPerm['category']['delete']=="1"){ echo"checked"; }?>>
                                        </span>
                                 </div>
                             </div>
                             
                             
                            <div class="col-md-4">
						        <h4><b>Sub Category</b></h4>
        						<div class="form-group">
        						    <span for="" class="col-sm-6 control-label"> View Sub Category</span>
                						<span class="switch">
                                          <input type="checkbox" style="width:35%;"  class="child_client" value="0" name="view_sub_category" <?php if($resPerm['sub_category']['read']=="1"){ echo"checked"; }?>>
                                        </span>
                                 </div>
                                 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label"> Add Sub Category</span>
                						<span class="switch">
                                          <input type="checkbox" style="width:35%;"  class="child_client" value="0" name="add_sub_category" <?php if($resPerm['sub_category']['create']=="1"){ echo"checked"; }?>>
                                        </span>
                                 </div>
                                 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label"> Edit Sub Category</span>
                						<span class="switch">
                                          <input type="checkbox" style="width:35%;"  class="child_client" value="0" name="edit_sub_category" <?php if($resPerm['sub_category']['update']=="1"){ echo"checked"; }?>>
                                        </span>
                                 </div>
                                 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label"> Delete Sub Category</span>
                						<span class="switch">
                                          <input type="checkbox" style="width:35%;"  class="child_client" value="0" name="delete_sub_category" <?php if($resPerm['sub_category']['delete']=="1"){ echo"checked"; }?>>
                                        </span>
                                 </div>
                             </div>
                             
                             
                            <div class="col-md-4">
                                <h4><b>GST</b></h4>
        						<div class="form-group">
        						    <span for="" class="col-sm-6 control-label">View GST</span>
                						<span class="switch">
                                          <input type="checkbox" style="width:35%;"  class="child_client" value="0" name="view_gst" <?php if($resPerm['gst']['read']=="1"){ echo"checked"; }?>>
                                        </span>
                                 </div>
                                 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label">Add GST</span>
                						<span class="switch">
                                          <input type="checkbox" style="width:35%;"  class="child_client" value="0" name="add_gst" <?php if($resPerm['gst']['create']=="1"){ echo"checked"; }?>>
                                        </span>
                                 </div>
                                 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label">Edit GST</span>
                						<span class="switch">
                                          <input type="checkbox" style="width:35%;"  class="child_client" value="0" name="edit_gst" <?php if($resPerm['gst']['update']=="1"){ echo"checked"; }?>>
                                        </span>
                                 </div>
                                 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label">Delete GST</span>
                						<span class="switch">
                                          <input type="checkbox" style="width:35%;"  class="child_client" value="0" name="delete_gst" <?php if($resPerm['gst']['delete']=="1"){ echo"checked"; }?>>
                                        </span>
                                 </div>
                             </div>
                             
                            
                            <div class="col-md-4">
						        <h4><b>Wastage</b></h4>
        						<div class="form-group">
        						    <span for="" class="col-sm-6 control-label"> View Wastage</span>
                						<span class="switch">
                                          <input type="checkbox" style="width:35%;"  class="child_client" value="0" name="view_wastage" <?php if($resPerm['wastage']['read']=="1"){ echo"checked"; }?>>
                                        </span>
                                </div>
                                <div class="form-group">
        						    <span for="" class="col-sm-6 control-label"> Add Wastage</span>
                						<span class="switch">
                                          <input type="checkbox" style="width:35%;"  class="child_client" value="0" name="add_wastage" <?php if($resPerm['wastage']['create']=="1"){ echo"checked"; }?>>
                                        </span>
                                </div>
                                <div class="form-group">
        						    <span for="" class="col-sm-6 control-label"> Edit Wastage</span>
                						<span class="switch">
                                          <input type="checkbox" style="width:35%;"  class="child_client" value="0" name="edit_wastage" <?php if($resPerm['wastage']['update']=="1"){ echo"checked"; }?>>
                                        </span>
                                </div>
                                <div class="form-group">
        						    <span for="" class="col-sm-6 control-label"> Delete Wastage</span>
                						<span class="switch">
                                          <input type="checkbox" style="width:35%;"  class="child_client" value="0" name="delete_wastage" <?php if($resPerm['wastage']['delete']=="1"){ echo"checked"; }?>>
                                        </span>
                                </div>
                            </div>
                             
                             
                             
                            <div class="col-md-4">
						        <h4><b>Purity</b></h4>
        						<div class="form-group">
        						    <span for="" class="col-sm-6 control-label"> View Purity</span>
                						<span class="switch">
                                          <input type="checkbox" style="width:35%;"  class="child_client" value="0" name="view_purity" <?php if($resPerm['purity']['read']=="1"){ echo"checked"; }?>>
                                        </span>
                                </div>
                                <div class="form-group">
        						    <span for="" class="col-sm-6 control-label"> Add Purity</span>
                						<span class="switch">
                                          <input type="checkbox" style="width:35%;"  class="child_client" value="0" name="add_purity" <?php if($resPerm['purity']['create']=="1"){ echo"checked"; }?>>
                                        </span>
                                </div>
                                <div class="form-group">
        						    <span for="" class="col-sm-6 control-label"> Edit Purity</span>
                						<span class="switch">
                                          <input type="checkbox" style="width:35%;"  class="child_client" value="0" name="edit_purity" <?php if($resPerm['purity']['update']=="1"){ echo"checked"; }?>>
                                        </span>
                                </div>
                                <div class="form-group">
        						    <span for="" class="col-sm-6 control-label"> Delete Purity</span>
                						<span class="switch">
                                          <input type="checkbox" style="width:35%;"  class="child_client" value="0" name="delete_purity" <?php if($resPerm['purity']['delete']=="1"){ echo"checked"; }?>>
                                        </span>
                                </div>
                            </div>
                            
                            <div class="col-md-4">
						        <h4><b>Products Name</b></h4>
        						<div class="form-group">
        						    <span for="" class="col-sm-6 control-label"> View Products Name</span>
                						<span class="switch">
                                          <input type="checkbox" style="width:35%;"  class="child_client" value="0" name="view_products_name" <?php if($resPerm['products_name']['read']=="1"){ echo"checked"; }?>>
                                        </span>
                                </div>
                                <div class="form-group">
        						    <span for="" class="col-sm-6 control-label"> Add Products Name</span>
                						<span class="switch">
                                          <input type="checkbox" style="width:35%;"  class="child_client" value="0" name="add_products_name" <?php if($resPerm['products_name']['create']=="1"){ echo"checked"; }?>>
                                        </span>
                                </div>
                                <div class="form-group">
        						    <span for="" class="col-sm-6 control-label"> Edit Products Name</span>
                						<span class="switch">
                                          <input type="checkbox" style="width:35%;"  class="child_client" value="0" name="edit_products_name" <?php if($resPerm['products_name']['update']=="1"){ echo"checked"; }?>>
                                        </span>
                                </div>
                                <div class="form-group">
        						    <span for="" class="col-sm-6 control-label"> Delete Products Name</span>
                						<span class="switch">
                                          <input type="checkbox" style="width:35%;"  class="child_client" value="0" name="delete_products_name" <?php if($resPerm['products_name']['delete']=="1"){ echo"checked"; }?>>
                                        </span>
                                </div>
                            </div>
                            
                            <div class="col-md-4">
						        <h4><b>Scheme Name</b></h4>
        						<div class="form-group">
        						    <span for="" class="col-sm-6 control-label"> View Scheme Name</span>
                						<span class="switch">
                                          <input type="checkbox" style="width:35%;"  class="child_client" value="0" name="view_scheme_name" <?php if($resPerm['scheme_name']['read']=="1"){ echo"checked"; }?>>
                                        </span>
                                </div>
                                <div class="form-group">
        						    <span for="" class="col-sm-6 control-label"> Add Scheme Name</span>
                						<span class="switch">
                                          <input type="checkbox" style="width:35%;"  class="child_client" value="0" name="add_scheme_name" <?php if($resPerm['scheme_name']['create']=="1"){ echo"checked"; }?>>
                                        </span>
                                </div>
                                <div class="form-group">
        						    <span for="" class="col-sm-6 control-label"> Edit Scheme Name</span>
                						<span class="switch">
                                          <input type="checkbox" style="width:35%;"  class="child_client" value="0" name="edit_scheme_name" <?php if($resPerm['scheme_name']['update']=="1"){ echo"checked"; }?>>
                                        </span>
                                </div>
                                <div class="form-group">
        						    <span for="" class="col-sm-6 control-label"> Delete Scheme Name</span>
                						<span class="switch">
                                          <input type="checkbox" style="width:35%;"  class="child_client" value="0" name="delete_scheme_name" <?php if($resPerm['scheme_name']['delete']=="1"){ echo"checked"; }?>>
                                        </span>
                                </div>
                            </div>
                             
                             
                        </div>
                        
          
                        
                        <div class="col-md-12 role_content" style="">   
                            <center> <h4><b>Price & Dashboard Management System</b></h4></center>
                            
                            <div class="col-md-4">
						        <h4><b>Price</b></h4>
        						<div class="form-group">
        						    <span for="" class="col-sm-6 control-label">Update Price</span>
                						<span class="switch">
                                          <input type="checkbox" style="width:35%;"  class="child_client" value="0" name="update_price" <?php if($resPerm['price']['update_price']=="1"){ echo"checked"; }?>>
                                        </span>
                                 </div>
                                 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label">Price Reports</span>
                						<span class="switch">
                                          <input type="checkbox" style="width:35%;"  class="child_client" value="0" name="view_price_reports" <?php if($resPerm['price']['price_reports']=="1"){ echo"checked"; }?>>
                                        </span>
                                 </div>
                            </div>
                            
                            
                            <div class="col-md-4">
						        <h4><b>Dashboard</b></h4>
                                 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label">Today Price List</span>
                						<span class="switch">
                                          <input type="checkbox" style="width:35%;"  class="child_client" value="0" name="today_price_list" <?php if($resPerm['dashboard']['today_price_list']=="1"){ echo"checked"; }?>>
                                        </span>
                                 </div>
                                 
                                 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label">Price Reports</span>
                						<span class="switch">
                                          <input type="checkbox" style="width:35%;"  class="child_client" value="0" name="price_reports" <?php if($resPerm['dashboard']['price_reports']=="1"){ echo"checked"; }?>>
                                        </span>
                                 </div>
                                 
                            </div>
                             
                            
                            
                        </div>  
                        
                        
                        <div class="col-md-12 role_content" style="">   
                            <center> <h4><b>Branch & Stock Management System</b></h4></center>
                            
                              <div class="col-md-4">
						        <h4><b>Branch</b></h4>
        						<div class="form-group">
        						    <span for="" class="col-sm-6 control-label"> View Branch</span>
                						<span class="switch">
                                          <input type="checkbox" style="width:35%;"  class="child_client" value="0" name="view_branch" <?php if($resPerm['branch']['read']=="1"){ echo"checked"; }?>>
                                        </span>
                                 </div>
                                 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label"> Add Branch</span>
                						<span class="switch">
                                          <input type="checkbox" style="width:35%;"  class="child_client" value="0" name="add_branch" <?php if($resPerm['branch']['create']=="1"){ echo"checked"; }?>>
                                        </span>
                                 </div>
                                 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label"> Edit Branch</span>
                						<span class="switch">
                                          <input type="checkbox" style="width:35%;"  class="child_client" value="0" name="edit_branch" <?php if($resPerm['branch']['update']=="1"){ echo"checked"; }?>>
                                        </span>
                                 </div>
                                 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label"> Delete Branch</span>
                						<span class="switch">
                                          <input type="checkbox" style="width:35%;"  class="child_client" value="0" name="delete_branch" <?php if($resPerm['branch']['delete']=="1"){ echo"checked"; }?>>
                                        </span>
                                 </div>
                             </div>
                             
                             
                             
                             <div class="col-md-4">
						        <h4><b>Stock Transfer</b></h4>
        						<div class="form-group">
        						    <span for="" class="col-sm-6 control-label"> View Stock Transfer</span>
                						<span class="switch">
                                          <input type="checkbox" style="width:35%;"  class="child_client" value="0" name="view_stock_transfer" <?php if($resPerm['stock_transfer']['read']=="1"){ echo"checked"; }?>>
                                        </span>
                                 </div>
                                 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label"> Add Stock Transfer</span>
                						<span class="switch">
                                          <input type="checkbox" style="width:35%;"  class="child_client" value="0" name="add_stock_transfer" <?php if($resPerm['stock_transfer']['create']=="1"){ echo"checked"; }?>>
                                        </span>
                                 </div>
                                 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label"> Edit Stock Transfer</span>
                						<span class="switch">
                                          <input type="checkbox" style="width:35%;"  class="child_client" value="0" name="edit_stock_transfer" <?php if($resPerm['stock_transfer']['update']=="1"){ echo"checked"; }?>>
                                        </span>
                                 </div>
                                 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label"> Delete Stock Transfer</span>
                						<span class="switch">
                                          <input type="checkbox" style="width:35%;"  class="child_client" value="0" name="delete_stock_transfer" <?php if($resPerm['stock_transfer']['delete']=="1"){ echo"checked"; }?>>
                                        </span>
                                 </div>
                             </div>
                            
                        </div>  
                        
                        
                        <div class="col-md-12 role_content" style="">   
                            <center> <h4><b>Reports Management System</b></h4></center>
                            
                              <div class="col-md-4">
						        <h4><b>Reports</b></h4>
        						<div class="form-group">
        						    <span for="" class="col-sm-6 control-label"> All Reports</span>
                						<span class="switch">
                                          <input type="checkbox" style="width:35%;"  class="child_client" value="0" name="all_reports" <?php if($resPerm['reports']['all']=="1"){ echo"checked"; }?>>
                                        </span>
                                 </div>
                             </div>
                             
                             
                            
                        </div> 
                        
                        
                        <div class="col-md-12 role_content" style="">   
                            <center> <h4><b>Expenses Management System</b></h4></center>
                            
                              <div class="col-md-4">
						        <h4><b>Expenses</b></h4>
        						<div class="form-group">
        						    <span for="" class="col-sm-6 control-label"> View Expenses</span>
                						<span class="switch">
                                          <input type="checkbox" style="width:35%;"  class="child_client" value="0" name="view_expenses" <?php if($resPerm['expenses']['read']=="1"){ echo"checked"; }?>>
                                        </span>
                                 </div>
                                 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label"> Add Expenses</span>
                						<span class="switch">
                                          <input type="checkbox" style="width:35%;"  class="child_client" value="0" name="add_expenses" <?php if($resPerm['expenses']['create']=="1"){ echo"checked"; }?>>
                                        </span>
                                 </div>
                                 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label"> Edit Expenses</span>
                						<span class="switch">
                                          <input type="checkbox" style="width:35%;"  class="child_client" value="0" name="edit_expenses" <?php if($resPerm['expenses']['update']=="1"){ echo"checked"; }?>>
                                        </span>
                                 </div>
                                 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label"> Delete Expenses</span>
                						<span class="switch">
                                          <input type="checkbox" style="width:35%;"  class="child_client" value="0" name="delete_expenses" <?php if($resPerm['expenses']['delete']=="1"){ echo"checked"; }?>>
                                        </span>
                                 </div>
                             </div>
                             
                             
                             
                             <div class="col-md-4">
						        <h4><b>Expenses Category</b></h4>
        						<div class="form-group">
        						    <span for="" class="col-sm-6 control-label"> View Expenses Category</span>
                						<span class="switch">
                                          <input type="checkbox" style="width:35%;"  class="child_client" value="0" name="view_expenses_category" <?php if($resPerm['expenses_category']['read']=="1"){ echo"checked"; }?>>
                                        </span>
                                 </div>
                                 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label"> Add Expenses Category</span>
                						<span class="switch">
                                          <input type="checkbox" style="width:35%;"  class="child_client" value="0" name="add_expenses_category" <?php if($resPerm['expenses_category']['create']=="1"){ echo"checked"; }?>>
                                        </span>
                                 </div>
                                 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label"> Edit Expenses Category</span>
                						<span class="switch">
                                          <input type="checkbox" style="width:35%;"  class="child_client" value="0" name="edit_expenses_category" <?php if($resPerm['expenses_category']['update']=="1"){ echo"checked"; }?>>
                                        </span>
                                 </div>
                                 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label"> Delete Expenses Category</span>
                						<span class="switch">
                                          <input type="checkbox" style="width:35%;"  class="child_client" value="0" name="delete_expenses_category" <?php if($resPerm['expenses_category']['delete']=="1"){ echo"checked"; }?>>
                                        </span>
                                 </div>
                             </div>
                            
                        </div>  
                        
                        
                        <div class="col-md-12 role_content" style="">   
                        <center> <h4><b>Voucher Management System</b></h4></center>
                       
                             <div class="col-md-4">
						        <h4><b>Advance Voucher</b></h4>
        						<div class="form-group">
        						    <span for="" class="col-sm-6 control-label">View Advance Voucher</span>
                						<span class="switch">
                                          <input type="checkbox" style="width:35%;"  class="child_client" value="0" name="view_advance_voucher" <?php if($resPerm['advance_voucher']['read']=="1"){ echo"checked"; }?>>
                                        </span>
                                 </div>
                                 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label">Add Advance Voucher</span>
                						<span class="switch">
                                          <input type="checkbox"  style="width:35%;"  class="child_client" value="0" name="add_advance_voucher" <?php if($resPerm['advance_voucher']['create']=="1"){ echo"checked"; }?>>
                                          
                                        </span>
                                 </div>
                                 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label">Edit Advance Voucher</span>
                						<span class="switch">
                                          <input type="checkbox"  style="width:35%;"  class="child_client" value="0" name="edit_advance_voucher" <?php if($resPerm['advance_voucher']['update']=="1"){ echo"checked"; }?>>
                                          
                                        </span>
                                 </div>
                                 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label">Delete Advance Voucher</span>
                						<span class="switch">
                                          <input type="checkbox"  style="width:35%;"  class="child_client " value="0" name="delete_advance_voucher" <?php if($resPerm['advance_voucher']['delete']=="1"){ echo"checked"; }?>>
                                          
                                        </span>
                                 </div>
                             </div>
                             
                             
                             <div class="col-md-4">
						        <h4><b>Repair Voucher</b></h4>
                                 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label">List Repair Voucher</span>
                						<span class="switch">
                                          <input type="checkbox"  style="width:35%;"  class="child_client" value="0" name="view_repair_voucher" <?php if($resPerm['repair_voucher']['read']=="1"){ echo"checked"; }?>>
                                          
                                        </span>
                                 </div>
                                 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label">Add Repair Voucher</span>
                						<span class="switch">
                                          <input type="checkbox"  style="width:35%;"  class="child_client" value="0" name="add_repair_voucher" <?php if($resPerm['repair_voucher']['create']=="1"){ echo"checked"; }?>>
                                          
                                        </span>
                                 </div>
                                 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label">Update Repair Voucher</span>
                						<span class="switch">
                                          <input type="checkbox"  style="width:35%;"  class="child_client " value="0" name="edit_repair_voucher" <?php if($resPerm['repair_voucher']['update']=="1"){ echo"checked"; }?>>
                                        </span>
                                 </div>
                                 <div class="form-group">
        						    <span for="" class="col-sm-6 control-label">Delete Repair Voucher</span>
                						<span class="switch">
                                          <input type="checkbox"  style="width:35%;"  class="child_client " value="0" name="delete_repair_voucher" <?php if($resPerm['repair_voucher']['delete']=="1"){ echo"checked"; }?>>
                                          
                                        </span>
                                 </div>
                             </div>
                             
                            
                        </div>
                        
                    </div>
                    
                    
                    
                    
                    
                    
                    <div class="form-group" style="text-align:center; margin-top: 10px;">
                            <br><input type="submit" name="update_role" value="Update Role"  class="btn btn-success" />
                    </div>
                        
                        
                        
                    
                 </form>       
                       

                    </div>
                        
                    <div class="clearfix"></div>
                </div>
            </div>
        </div>
    </div>
</section>


<?php include "footer.php"; ?>

<style>
    .role_content{
        border: 2px solid #efefef;
        border-style: dashed;
        margin-top: 15px !important;
        background: azure;
        border-radius: 7px;
        box-shadow: rgba(0, 0, 0, 0.02) 0px 1px 3px 0px, rgba(27, 31, 35, 0.15) 0px 0px 0px 1px;
    }
</style>

<script>
    function SelectAll(){
        console.log("Clicked");
        $(".child_client").prop("checked", true);
    }
</script>