<?php require_once('../auth/auth.php'); ?>
<?php 
   $getid=$_GET['getid'];
   $type=$_GET['type'];
   $chper = '';
   if ($type=='company') {

      $perm= mysqli_fetch_array (mysqli_query($conn,"SELECT co_permission FROM company WHERE coid ='$getid' LIMIT 1"))['co_permission'];

   } elseif($type=='business') {

      $burow= mysqli_fetch_array (mysqli_query($conn,"SELECT business_permission,co_permission FROM business INNER JOIN company ON (business.coid=company.coid) WHERE bid ='$getid' LIMIT 1"));
      $perm  = $burow['business_permission'];
      $chper = $burow['co_permission'];

   } elseif($type=='branch') {

      $brrow= mysqli_fetch_array (mysqli_query($conn,"SELECT branch_permission,business_permission FROM branch INNER JOIN business ON (branch.bid=business.bid) WHERE brid ='$getid' LIMIT 1"));
      $perm  = $brrow['branch_permission'];
      $chper = $brrow['business_permission'];

   } elseif($type=='user_g') {

      $prow= mysqli_fetch_array (mysqli_query($conn,"SELECT user_g.coid,group_permission,co_permission FROM user_g INNER JOIN company ON (user_g.coid=company.coid) WHERE ugid ='$getid' LIMIT 1"));
      $gcoid = $prow['coid'];
      $perm  = $prow['group_permission'];
      $chper = $prow['co_permission'];

   }
   
   
   function checked($ap){
    if (strpos($GLOBALS['perm'], $ap) !== false) {
     return $checked='checked';
     } else {return $checked='';}
   }

   function chper($abc){
    if ((strpos($GLOBALS['chper'], $abc) !== false) || $GLOBALS['type']=='company') {
     return 1;} else { return 0;}
   }

   ?>
<section class="content">
   <div class="container-fluid">
      <div class="row">
         <div class="col-md-12">
            <div class="card card-primary card-outline direct-chat direct-chat-primary shadow-none" style="border-left:1px solid #969c9d;border-right:1px solid #969c9d;border-bottom:1px solid #969c9d;">
               <div class="card-header" style="padding: 5px 8px;">
                  <h3 class="card-title text-capitalize"><?php echo $type ;?> <?php echo language(323); ?></h3>
                  <div class="card-tools"> <button type="button" class="btn btn-tool" data-card-widget="remove"> <i class="fas fa-times"></i>  </button> </div>
               </div>
               <form id="com_per_form" action="#" method="post" autocomplete="off">
                  <input type="hidden" name="getid" value="<?php echo $getid ?>">
                  <input type="hidden" name="type" value="<?php echo $type;?>">
                  <input type="hidden" name="cperc[]" value="">
                  <div class="card-body">
                     <div class="col-md-12">
                        <div class="row mt-2">
                        <?php if ($type=='user_g') {?>
                           <div class="col-md-6">
                              <div class="form-group">
                                 <label> <?php echo language(231); ?></label>
                                 <select multiple="multiple" name="business_id[]" id="bbid" class="form-control select2" required="true">
                                <?php 
                                    $prr= mysqli_query($conn,"SELECT bid,bid_name FROM business WHERE coid='$gcoid'") or die(mysqli_error($conn));
                                      while($prw= mysqli_fetch_assoc($prr)){
                                      echo '<option value='.$prw["bid"].'>'.$prw["bid_name"].'</option>';
                                    }?>
                                 </select>
                              </div>
                           </div>
                           <div class="col-md-6">
                              <div class="form-group">
                                 <label> <?php echo language(232); ?></label>
                                 <select multiple="multiple" id="viewid" name="branch_id[]" class="form-control select2" required="true">
                                 </select>
                              </div>
                           </div>
                           <div class="col-md-12"><hr style="margin-top: 7px;margin-bottom: 7px;"></div>
                        <?php } ?>
                           <div class="col-md-3">
                              <div class="card card card-outline direct-chat direct-chat shadow-none" style="border-left:1px solid #969c9d;border-right:1px solid #969c9d;border-bottom:1px solid #969c9d;">
                                 <div class="card-header" style="background: #0d461a;padding: 4px 8px;color: whitesmoke;">
                                    <h3 style="float:left" class="card-title text-center"> <?php echo language(1); ?> </h3>
                                    <div class="card-tools" >
                                       <button type="button"  class="btn btn-tool" data-card-widget="remove"> <i class="fas fa-times" style="color: whitesmoke;"></i></button>
                                    </div>
                                 </div>
                                 <table class="table-sm table-hover table-bordered table-dark">
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i><?php echo language(222); ?> </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" class="custom-control-input"  id="Alldash"/>
                                             <label class="custom-control-label" for="Alldash"></label>
                                          </div>
                                       </td>
                                    </tr>
                                    <tr> 

                                 <?php if (chper('dash')==1) { ?>
                                    <tr>
                                       <td ><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(1);?></td>
                                       <td style="width: 5%">
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="dash" class="custom-control-input dash"  name="cperc[]" value="dash" <?php echo checked('dash');?>>
                                             <label class="custom-control-label" for="dash"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 
                                 
                                   <?php if (chper('dash2_layout_show')==1) { ?>
                                    <tr>
                                       <td ><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo 'New Layout Dashboard';?></td>
                                       <td style="width: 5%">
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="dash2_layout_show" class="custom-control-input dash"  name="cperc[]" value="dash2_layout_show" <?php echo checked('dash2_layout_show');?>>
                                             <label class="custom-control-label" for="dash2_layout_show"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 
                                 
                                 
                                 
                                 <?php if (chper('dash_y_show')==1) { ?>
                                    <tr>
                                       <td ><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(1);?>Yearly</td>
                                       <td style="width: 5%">
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="dash_y_show" class="custom-control-input dash"  name="cperc[]" value="dash_y_show" <?php echo checked('dash_y_show');?>>
                                             <label class="custom-control-label" for="dash_y_show"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 
                                 
                                 <?php if (chper('daybook')==1) { ?>
                                    <tr>
                                    <td ><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(27);?> </td>
                                    <td style="width: 5%">
                                       <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                          <input type="checkbox" id="daybook" class="custom-control-input dash"  name="cperc[]" value="daybook" <?php echo checked('daybook');?>>
                                          <label class="custom-control-label" for="daybook"></label>
                                       </div>
                                    </td>
                                    </tr>  
                                 <?php } ?>
                                 <?php if (chper('d_history')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i><?php echo language(28);?></td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="d_history" class="custom-control-input dash" name="cperc[]" value="d_history" <?php echo checked('d_history');?>>
                                             <label class="custom-control-label" for="d_history"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('recyle_bin')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(29);?></td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="recyle_bin" class="custom-control-input dash" name="cperc[]" value="recyle_bin" <?php echo checked('recyle_bin');?>>
                                             <label class="custom-control-label" for="recyle_bin"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('bluk_sms')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i>  <?php echo language(30);?></td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="bluk_sms" class="custom-control-input dash" name="cperc[]" value="bluk_sms" <?php echo checked('bluk_sms');?>>
                                             <label class="custom-control-label" for="bluk_sms"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('visitor')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(169); ?> </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="visitor" class="custom-control-input dash" name="cperc[]" value="visitor" <?php echo checked('visitor');?>>
                                             <label class="custom-control-label" for="visitor"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 </table>
                              </div>
                           </div>
                           <script type="text/javascript">
                              if ($('.dash:checked').length === $('.dash').length) {
                                 $('#Alldash').prop('checked', true);   
                              }
                              $('#Alldash').click(function(){
                                 $('.dash').prop('checked', true);
                                 if(!$(this).prop("checked")) {
                                    $('.dash').prop('checked', false);
                                 }
                              });
                              $('.dash').change(function() {
                                 if(!$(this).prop("checked")) {
                                    $('#Alldash').prop('checked', false);
                                 } else {
                                    if ($('.dash:checked').length === $('.dash').length) {
                                       $('#Alldash').prop('checked', true);
                                    }
                                 }
                              });
                           </script>
                           <!-- Dashboard menu complete -->
                           <div class="col-md-3">
                              <div class="card card card-outline direct-chat direct-chat shadow-none" style="border-left:1px solid #969c9d;border-right:1px solid #969c9d;border-bottom:1px solid #969c9d;">
                                 <div class="card-header" style="background: #0d461a;padding: 4px 8px;color: whitesmoke;">
                                    <h3 style="float:left" class="card-title"> <?php echo language(2); ?> </h3>
                                    <div class="card-tools" >
                                       <button type="button"  class="btn btn-tool" data-card-widget="remove"> <i class="fas fa-times" style="color: whitesmoke;"></i></button>
                                    </div>
                                 </div>
                                 <table class="table-sm table-hover table-bordered table-dark">
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(222); ?></td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" class="custom-control-input" id="Allac"/>
                                             <label class="custom-control-label" for="Allac"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php if (chper('ac_menu')==1) { ?>
                                    <tr>
                                       <td ><i class="ion-ios-navigate-outline text-success mr-1"> </i>  <?php echo language(2);?> </td>
                                       <td style="width: 5%">
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="ac_menu" class="custom-control-input ac"  name="cperc[]" value="ac_menu" <?php echo checked('ac_menu');?>>
                                             <label class="custom-control-label" for="ac_menu"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('ac_view')==1) { ?>
                                    <tr>
                                       <td ><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(32);?> </td>
                                       <td style="width: 5%">
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="ac_view" class="custom-control-input ac"  name="cperc[]" value="ac_view" <?php echo checked('ac_view');?>>
                                             <label class="custom-control-label" for="ac_view"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('ac_add')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(280); ?> </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="ac_add" class="custom-control-input ac"  name="cperc[]" value="ac_add" <?php echo checked('ac_add');?>>
                                             <label class="custom-control-label" for="ac_add"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('ac_deactive')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(33);?> </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="ac_deactive" class="custom-control-input ac"  name="cperc[]" value="ac_deactive" <?php echo checked('ac_deactive');?>>
                                             <label class="custom-control-label" for="ac_deactive"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 </table>
                              </div>
                           </div>
                           <script type="text/javascript">
                              if ($('.ac:checked').length === $('.ac').length) {
                                 $('#Allac').prop('checked', true);   
                              }
                              
                              $('#Allac').click(function(){
                                 $('.ac').prop('checked', true);
                                 if(!$(this).prop("checked")) {
                                    $('.ac').prop('checked', false);
                                 }
                              });
                              $('.ac').change(function() {
                                 if(!$(this).prop("checked")) {
                                    $('#Allac').prop('checked', false);
                                 } else {
                                    if ($('.ac:checked').length === $('.ac').length) {
                                       $('#Allac').prop('checked', true);
                                    }
                                 }
                              });
                           </script>
                           <!-- Accounts menu complete -->
                           <div class="col-md-3 mb-2">
                              <div class="card card card-outline direct-chat direct-chat shadow-none" style="border-left:1px solid #969c9d;border-right:1px solid #969c9d;border-bottom:1px solid #969c9d;">
                                 <div class="card-header" style="background: #0d461a;padding: 4px 8px;color: whitesmoke;">
                                    <h3 style="float:left" class="card-title"> <?php echo language(3); ?> </h3>
                                    <div class="card-tools" >
                                       <button type="button"  class="btn btn-tool" data-card-widget="remove"> <i class="fas fa-times" style="color: whitesmoke;"></i></button>
                                    </div>
                                 </div>
                                 <table class="table-sm table-hover table-bordered table-dark">
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(222); ?></td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" class="custom-control-input"   id="cusAll"/>
                                             <label class="custom-control-label" for="cusAll"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php if (chper('cus_menu')==1) { ?>
                                    <tr>
                                       <td ><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(3);?>  </td>
                                       <td style="width: 5%">
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="cus_menu" class="custom-control-input cuss" name="cperc[]" value="cus_menu" <?php echo checked('cus_menu');?>>
                                             <label class="custom-control-label" for="cus_menu"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('view_customer')==1) { ?>
                                    <tr>
                                       <td ><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(34); ?></td>
                                       <td style="width: 5%">
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="view_customer" class="custom-control-input cuss" name="cperc[]" value="view_customer" <?php echo checked('view_customer');?>>
                                             <label class="custom-control-label" for="view_customer"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('cus_reciv_list')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(35); ?> </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="cus_reciv_list" class="custom-control-input cuss" name="cperc[]" value="cus_reciv_list" <?php echo checked('cus_reciv_list');?>>
                                             <label class="custom-control-label" for="cus_reciv_list"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('cus_route')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(191);?> </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="cus_route" class="custom-control-input cuss" name="cperc[]" value="cus_route" <?php echo checked('cus_route');?>>
                                             <label class="custom-control-label" for="cus_route"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('cus_setting')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(36); ?>  </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="cus_setting" class="custom-control-input cuss"  name="cperc[]" value="cus_setting" <?php echo checked('cus_setting');?>>
                                             <label class="custom-control-label" for="cus_setting"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('cus_import')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(37); ?> </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="cus_import" class="custom-control-input cuss"  name="cperc[]" value="cus_import" <?php echo checked('cus_import');?>>
                                             <label class="custom-control-label" for="cus_import"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('cus_add')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(108);?> </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="cus_add" class="custom-control-input cuss"  name="cperc[]" value="cus_add" <?php echo checked('cus_add');?>>
                                             <label class="custom-control-label" for="cus_add"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 </table>
                              </div>
                           </div>
                           <script type="text/javascript">
                              if ($('.cuss:checked').length === $('.cuss').length) {
                                 $('#cusAll').prop('checked', true);   
                              }
                              $('#cusAll').click(function(){
                                 $('.cuss').prop('checked', true);
                                 if(!$(this).prop("checked")) {
                                    $('.cuss').prop('checked', false);
                                 }
                              });
                              $('.cuss').change(function() {
                                 if(!$(this).prop("checked")) {
                                    $('#cusAll').prop('checked', false);
                                 } else {
                                    if ($('.cuss:checked').length === $('.cuss').length) {
                                       $('#cusAll').prop('checked', true);
                                    }
                                 }
                              });
                           </script>
                           <!-- Accounts menu complete -->
                           <div class="col-md-3 mb-2">
                              <div class="card card card-outline direct-chat direct-chat shadow-none" style="border-left:1px solid #969c9d;border-right:1px solid #969c9d;border-bottom:1px solid #969c9d;">
                                 <div class="card-header" style="background: #0d461a;padding: 4px 8px;color: whitesmoke;">
                                    <h3 style="float:left" class="card-title"> <?php echo language(4);?> </h3>
                                    <div class="card-tools" >
                                       <button type="button"  class="btn btn-tool" data-card-widget="remove"> <i class="fas fa-times" style="color: whitesmoke;"></i></button>
                                    </div>
                                 </div>
                                 <table class="table-sm table-hover table-bordered table-dark">
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(222); ?></td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" class="custom-control-input"  id="suppAll"/>
                                             <label class="custom-control-label" for="suppAll"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php if (chper('sup_menu')==1) { ?>
                                    <tr>
                                       <td ><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(4);?> </td>
                                       <td style="width: 5%">
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="sup_menu" class="custom-control-input supp" name="cperc[]" value="sup_menu" <?php echo checked('sup_menu');?>>
                                             <label class="custom-control-label" for="sup_menu"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('view_supplier')==1) { ?>
                                    <tr>
                                       <td ><i class="ion-ios-navigate-outline text-success mr-1"> </i><?php echo language(39);?></td>
                                       <td style="width: 5%">
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="view_supplier" class="custom-control-input supp" name="cperc[]" value="view_supplier" <?php echo checked('view_supplier');?>>
                                             <label class="custom-control-label" for="view_supplier"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('payable_list')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(38);?>  </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="payable_list" class="custom-control-input supp" name="cperc[]" value="payable_list" <?php echo checked('payable_list');?>>
                                             <label class="custom-control-label" for="payable_list"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('sup_setting')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(40);?> </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="sup_setting" class="custom-control-input supp" name="cperc[]" value="sup_setting" <?php echo checked('sup_setting');?>>
                                             <label class="custom-control-label" for="sup_setting"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('sup_import')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(41);?> </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="sup_import" class="custom-control-input supp"  name="cperc[]" value="sup_import" <?php echo checked('sup_import');?>>
                                             <label class="custom-control-label" for="sup_import"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('sup_add')==1) { ?>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(133);?> </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="sup_add" class="custom-control-input supp" name="cperc[]" value="sup_add" <?php echo checked('sup_add');?>>
                                             <label class="custom-control-label" for="sup_add"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 </table>
                              </div>
                           </div>
                           <script type="text/javascript">
                              if ($('.supp:checked').length === $('.supp').length) {
                                 $('#suppAll').prop('checked', true);   
                              }
                              $('#suppAll').click(function(){
                                 $('.supp').prop('checked', true);
                                 if(!$(this).prop("checked")) {
                                    $('.supp').prop('checked', false);
                                 }
                              });
                              $('.supp').change(function() {
                                 if(!$(this).prop("checked")) {
                                    $('#suppAll').prop('checked', false);
                                 } else {
                                    if ($('.supp:checked').length === $('.supp').length) {
                                       $('#suppAll').prop('checked', true);
                                    }
                                 }
                              });
                           </script>
                           <div class="col-md-3">
                              <div class="card card card-outline direct-chat direct-chat shadow-none" style="border-left:1px solid #969c9d;border-right:1px solid #969c9d;border-bottom:1px solid #969c9d;">
                                 <div class="card-header" style="background: #0d461a;padding: 4px 8px;color: whitesmoke;">
                                    <h3 style="float:left" class="card-title"><?php echo language(5);?></h3>
                                    <div class="card-tools" >
                                       <button type="button"  class="btn btn-tool" data-card-widget="remove"> <i class="fas fa-times" style="color: whitesmoke;"></i></button>
                                    </div>
                                 </div>
                                 <table class="table-sm table-hover table-bordered table-dark">
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(222); ?></td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" class="custom-control-input"  id="hrAll"/>
                                             <label class="custom-control-label" for="hrAll"></label>
                                          </div>
                                       </td>
                                    </tr>
                                     <?php if (chper('hr_menu')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(5);?>  </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="hr_menu" class="custom-control-input hr"  name="cperc[]" value="hr_menu" <?php echo checked('hr_menu');?>>
                                             <label class="custom-control-label" for="hr_menu "></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('em_list')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(170); ?>    </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="em_list" class="custom-control-input hr"  name="cperc[]" value="em_list" <?php echo checked('em_list');?>>
                                             <label class="custom-control-label" for="em_list"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('us_list')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(171); ?>   </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="us_list" class="custom-control-input hr"  name="cperc[]" value="us_list" <?php echo checked('us_list');?>>
                                             <label class="custom-control-label" for="us_list"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('ug_list')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(172); ?>  </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="ug_list" class="custom-control-input hr"  name="cperc[]" value="ug_list" <?php echo checked('ug_list');?>>
                                             <label class="custom-control-label" for="ug_list"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('u_desig')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(173); ?>  </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="u_desig" class="custom-control-input hr"  name="cperc[]" value="u_desig" <?php echo checked('u_desig');?>>
                                             <label class="custom-control-label" for="u_desig"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('u_target')==1) { ?>
                                    <tr>
                                       <td><i  class="ion-ios-navigate-outline text-success mr-1"> </i><?php echo language(174); ?>  </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="u_target" class="custom-control-input hr"  name="cperc[]" value="u_target" <?php echo checked('u_target');?>>
                                             <label class="custom-control-label" for="u_target"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('u_tr_ach')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i><?php echo language(175); ?> t </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="u_tr_ach" class="custom-control-input hr" name="cperc[]" value="u_tr_ach" <?php echo checked('u_tr_ach');?>>
                                             <label class="custom-control-label" for="u_tr_ach"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('ds_list')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i><?php echo language(176);?></td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="ds_list" class="custom-control-input hr" name="cperc[]" value="ds_list" <?php echo checked('ds_list');?>>
                                             <label class="custom-control-label" for="ds_list"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('payroll_list')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(177);?> </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="payroll_list" class="custom-control-input hr" name="cperc[]" value="payroll_list" <?php echo checked('payroll_list');?>>
                                             <label class="custom-control-label" for="payroll_list"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('sp_list')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i>  <?php echo language(178);?>  </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="sp_list" class="custom-control-input hr" name="cperc[]" value="sp_list" <?php echo checked('sp_list');?>>
                                             <label class="custom-control-label" for="sp_list"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('u_atten')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(179);?>  </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="u_atten" class="custom-control-input hr" name="cperc[]" value="u_atten" <?php echo checked('u_atten');?>>
                                             <label class="custom-control-label" for="u_atten"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 </table>
                              </div>
                           </div>
                           <script type="text/javascript">
                              if ($('.hr:checked').length === $('.hr').length) {
                                 $('#hrAll').prop('checked', true);   
                              }
                              $('#hrAll').click(function(){
                                 $('.hr').prop('checked', true);
                                 if(!$(this).prop("checked")) {
                                    $('.hr').prop('checked', false);
                                 }
                              });
                              $('.hr').change(function() {
                                 if(!$(this).prop("checked")) {
                                    $('#hrAll').prop('checked', false);
                                 } else {
                                    if ($('.hr:checked').length === $('.hr').length) {
                                       $('#hrAll').prop('checked', true);
                                    }
                                 }
                              });
                           </script>
                           <div class="col-md-3 mb-2">
                              <div class="card card card-outline direct-chat direct-chat shadow-none" style="border-left:1px solid #969c9d;border-right:1px solid #969c9d;border-bottom:1px solid #969c9d;">
                                 <div class="card-header" style="background: #0d461a;padding: 4px 8px;color: whitesmoke;">
                                    <h3 style="float:left" class="card-title"> <?php echo language(6);?> </h3>
                                    <div class="card-tools" >
                                       <button type="button"  class="btn btn-tool" data-card-widget="remove"> <i class="fas fa-times" style="color: whitesmoke;"></i></button>
                                    </div>
                                 </div>
                                 <table class="table-sm table-hover table-bordered table-dark">
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(222); ?>  </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" class="custom-control-input" id="vouAll"/>
                                             <label class="custom-control-label" for="vouAll"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php if (chper('vou_menu')==1) { ?>
                                    <tr>
                                       <td ><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(6);?> </td>
                                       <td style="width: 5%">
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="vou_menu" class="custom-control-input vou" name="cperc[]" value="vou_menu" <?php echo checked('vou_menu');?>>
                                             <label class="custom-control-label" for="vou_menu"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('g_received')==1) { ?>                                    
                                 <tr>
                                       <td ><i class="ion-ios-navigate-outline text-success mr-1"> </i>  <?php echo language(42);?> </td>
                                       <td style="width: 5%">
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="g_received" class="custom-control-input vou" name="cperc[]" value="g_received" <?php echo checked('g_received');?>>
                                             <label class="custom-control-label" for="g_received"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('i_received')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success"> </i>  <?php echo language(43);?> </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="i_received" class="custom-control-input vou" name="cperc[]" value="i_received" <?php echo checked('i_received');?>>
                                             <label class="custom-control-label" for="i_received"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('s_payment')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(44);?></td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="s_payment" class="custom-control-input vou" name="cperc[]" value="s_payment" <?php echo checked('s_payment');?>>
                                             <label class="custom-control-label" for="s_payment"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('m_payment')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i>  <?php echo language(45);?></td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="m_payment" class="custom-control-input vou" name="cperc[]" value="m_payment" <?php echo checked('m_payment');?>>
                                             <label class="custom-control-label" for="m_payment"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('Journal')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(46);?> </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="Journal" class="custom-control-input vou" name="cperc[]" value="Journal" <?php echo checked('Journal');?>>
                                             <label class="custom-control-label" for="Journal"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('contra')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(47);?>  </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="contra" class="custom-control-input vou" name="cperc[]" value="contra" <?php echo checked('contra');?>>
                                             <label class="custom-control-label" for="contra"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('g_opening')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(48);?> </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="g_opening" class="custom-control-input vou" name="cperc[]" value="g_opening" <?php echo checked('g_opening');?>>
                                             <label class="custom-control-label" for="g_opening"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('i_opening')==1) { ?>
                                    <tr>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(49);?> </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="i_opening" class="custom-control-input vou" name="cperc[]" value="i_opening" <?php echo checked('i_opening');?>>
                                             <label class="custom-control-label" for="i_opening"></label>
                                          </div>
                                       </td>
                                    </tr>
                                    <tr>
                                 <?php } ?>
                                 <?php if (chper('bc_transfer')==1) { ?>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i>  <?php echo language(50);?> </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="bc_transfer" class="custom-control-input vou" name="cperc[]" value="bc_transfer" <?php echo checked('bc_transfer');?>>
                                             <label class="custom-control-label" for="bc_transfer"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('v_history')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(51);?> </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="v_history" class="custom-control-input vou" name="cperc[]" value="v_history" <?php echo checked('v_history');?>>
                                             <label class="custom-control-label" for="v_history"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('vou_edit')==1) { ?>                                    
                                    <tr>
                                       <td ><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(25);?> </td>
                                       <td style="width: 5%">
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="vou_edit" class="custom-control-input vou" name="cperc[]" value="vou_edit" <?php echo checked('vou_edit');?>>
                                             <label class="custom-control-label" for="vou_edit"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('vou_delete')==1) { ?>                                    
                                    <tr>
                                       <td ><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(324); ?>  </td>
                                       <td style="width: 5%">
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="vou_delete" class="custom-control-input vou" name="cperc[]" value="vou_delete" <?php echo checked('vou_delete');?>>
                                             <label class="custom-control-label" for="vou_delete"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>                                    
                                    
                                 </table>
                              </div>
                           </div>
                           <script type="text/javascript">
                              if ($('.vou:checked').length === $('.vou').length) {
                                 $('#vouAll').prop('checked', true);   
                              }
                              $('#vouAll').click(function(){
                                 $('.vou').prop('checked', true);
                                 if(!$(this).prop("checked")) {
                                    $('.vou').prop('checked', false);
                                 }
                              });
                              $('.vou').change(function() {
                                 if(!$(this).prop("checked")) {
                                    $('#vouAll').prop('checked', false);
                                 } else {
                                    if ($('.vou:checked').length === $('.vou').length) {
                                       $('#vouAll').prop('checked', true);
                                    }
                                 }
                              });
                           </script>
                           <div class="col-md-3">
                              <div class="card card card-outline direct-chat direct-chat shadow-none" style="border-left:1px solid #969c9d;border-right:1px solid #969c9d;border-bottom:1px solid #969c9d;">
                                 <div class="card-header" style="background: #0d461a;padding: 4px 8px;color: whitesmoke;">
                                    <h3 style="float:left" class="card-title"> <?php echo language(7);?> </h3>
                                    <div class="card-tools" >
                                       <button type="button"  class="btn btn-tool" data-card-widget="remove"> <i class="fas fa-times" style="color: whitesmoke;"></i></button>
                                    </div>
                                 </div>
                                 <table class="table-sm table-hover table-bordered table-dark">
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(222); ?>  </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" class="custom-control-input" id="purAll"/>
                                             <label class="custom-control-label" for="purAll"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php if (chper('pur_menu')==1) { ?>
                                    <tr>
                                       <td ><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(7);?>  </td>
                                       <td style="width: 5%">
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="pur_menu" class="custom-control-input pur" name="cperc[]" value="pur_menu" <?php echo checked('pur_menu');?>>
                                             <label class="custom-control-label" for="pur_menu"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('g_purchase')==1) { ?>
                                    <tr>
                                       <td ><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(325); ?>  </td>
                                       <td style="width: 5%">
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="g_purchase" class="custom-control-input pur" name="cperc[]" value="g_purchase" <?php echo checked('g_purchase');?>>
                                             <label class="custom-control-label" for="g_purchase"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                <?php if (chper('g_project')==1) { ?>
                                    <tr>
                                       <td ><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(326); ?>  </td>
                                       <td style="width: 5%">
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="g_project" class="custom-control-input pur" name="cperc[]" value="g_project" <?php echo checked('g_project');?>>
                                             <label class="custom-control-label" for="g_project"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('epur_add')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(57);?> </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="epur_add" class="custom-control-input pur" name="cperc[]" value="epur_add" <?php echo checked('epur_add');?>>
                                             <label class="custom-control-label" for="epur_add"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('epur_ret')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(58);?>  </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="epur_ret" class="custom-control-input pur" name="cperc[]" value="epur_ret" <?php echo checked('epur_ret');?>>
                                             <label class="custom-control-label" for="epur_ret"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('epur_draft')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(61);?> </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="epur_draft" class="custom-control-input pur" name="cperc[]" value="epur_draft" <?php echo checked('epur_draft');?>>
                                             <label class="custom-control-label" for="epur_draft"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('epur_reg_list')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(185);?> </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="epur_reg_list" class="custom-control-input pur" name="cperc[]" value="epur_reg_list" <?php echo checked('epur_reg_list');?>>
                                             <label class="custom-control-label" for="epur_reg_list"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('epur_ireg_list')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(313);?> </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="epur_ireg_list" class="custom-control-input pur" name="cperc[]" value="epur_ireg_list" <?php echo checked('epur_ireg_list');?>>
                                             <label class="custom-control-label" for="epur_ireg_list"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('epur_sett')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(60);?> </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="epur_sett" class="custom-control-input pur" name="cperc[]" value="epur_sett" <?php echo checked('epur_sett');?>>
                                             <label class="custom-control-label" for="epur_sett"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 
                                 <?php if (chper('pinv_edit')==1) { ?>                                    
                                    <tr>
                                       <td ><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(25);?> </td>
                                       <td style="width: 5%">
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="pinv_edit" class="custom-control-input pur" name="cperc[]" value="pinv_edit" <?php echo checked('pinv_edit');?>>
                                             <label class="custom-control-label" for="pinv_edit"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('pinv_delete')==1) { ?>                                    
                                    <tr>
                                       <td ><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(324); ?> </td>
                                       <td style="width: 5%">
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="pinv_delete" class="custom-control-input pur" name="cperc[]" value="pinv_delete" <?php echo checked('pinv_delete');?>>
                                             <label class="custom-control-label" for="pinv_delete"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>  
                                 </table>
                              </div>
                           </div>
                           <script type="text/javascript">
                              if ($('.pur:checked').length === $('.pur').length) {
                                 $('#purAll').prop('checked', true);   
                              }
                              $('#purAll').click(function(){
                                 $('.pur').prop('checked', true);
                                 if(!$(this).prop("checked")) {
                                    $('.pur').prop('checked', false);
                                 }
                              });
                              $('.pur').change(function() {
                                 if(!$(this).prop("checked")) {
                                    $('#purAll').prop('checked', false);
                                 } else {
                                    if ($('.pur:checked').length === $('.pur').length) {
                                       $('#purAll').prop('checked', true);
                                    }
                                 }
                              });
                           </script>
                           <div class="col-md-3">
                              <div class="card card card-outline direct-chat direct-chat shadow-none" style="border-left:1px solid #969c9d;border-right:1px solid #969c9d;border-bottom:1px solid #969c9d;">
                                 <div class="card-header" style="background: #0d461a;padding: 4px 8px;color: whitesmoke;">
                                    <h3 style="float:left" class="card-title"> <?php echo language(8);?> </h3>
                                    <div class="card-tools" >
                                       <button type="button"  class="btn btn-tool" data-card-widget="remove"> <i class="fas fa-times" style="color: whitesmoke;"></i></button>
                                    </div>
                                 </div>
                                 <table class="table-sm table-hover table-bordered table-dark">
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(222); ?>  </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" class="custom-control-input" id="saleAll"/>
                                             <label class="custom-control-label" for="saleAll"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php if (chper('sale_menu')==1) { ?>
                                    <tr>
                                       <td ><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(8);?> </td>
                                       <td style="width: 5%">
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="sale_menu" class="custom-control-input sale" name="cperc[]" value="sale_menu" <?php echo checked('sale_menu');?>>
                                             <label class="custom-control-label" for="sale_menu"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('g_sale')==1) { ?>
                                    <tr>
                                       <td ><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(327);?> </td>
                                       <td style="width: 5%">
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="g_sale" class="custom-control-input sale" name="cperc[]" value="g_sale" <?php echo checked('g_sale');?>>
                                             <label class="custom-control-label" for="g_sale"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('ecash_sale')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(62);?>   </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="ecash_sale" class="custom-control-input sale" name="cperc[]" value="ecash_sale" <?php echo checked('ecash_sale');?>>
                                             <label class="custom-control-label" for="ecash_sale"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('eretail_sale')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(63);?></td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="eretail_sale" class="custom-control-input sale" name="cperc[]" value="eretail_sale" <?php echo checked('eretail_sale');?>>
                                             <label class="custom-control-label" for="eretail_sale"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('esale_retrun')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"></i> <?php echo language(64);?> </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="esale_retrun" class="custom-control-input sale" name="cperc[]" value="esale_retrun" <?php echo checked('esale_retrun');?>>
                                             <label class="custom-control-label" for="esale_retrun"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                     
                                 <?php if (chper('esale_list')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(186);?>  </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="esale_list" class="custom-control-input sale" name="cperc[]" value="esale_list" <?php echo checked('esale_list');?>>
                                             <label class="custom-control-label" for="esale_list"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('esale_draft')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(66);?> </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="esale_draft" class="custom-control-input sale" name="cperc[]" value="esale_draft" <?php echo checked('esale_draft');?>>
                                             <label class="custom-control-label" for="esale_draft"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('esale_sett')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(67);?> </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="esale_sett" class="custom-control-input sale" name="cperc[]" value="esale_sett" <?php echo checked('esale_sett');?>>
                                             <label class="custom-control-label" for="esale_sett"></label>
                                          </div>
                                       </td>
                                    </tr> 
                                 <?php } ?>
                                 
                                <?php if (chper('sinv_edit')==1) { ?>                                    
                                    <tr>
                                       <td ><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(25);?> </td>
                                       <td style="width: 5%">
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="sinv_edit" class="custom-control-input sale" name="cperc[]" value="sinv_edit" <?php echo checked('sinv_edit');?>>
                                             <label class="custom-control-label" for="sinv_edit"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('sinv_delete')==1) { ?>                                    
                                    <tr>
                                       <td ><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(324);?> </td>
                                       <td style="width: 5%">
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="sinv_delete" class="custom-control-input sale" name="cperc[]" value="sinv_delete" <?php echo checked('sinv_delete');?>>
                                             <label class="custom-control-label" for="sinv_delete"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>  
                                 </table>
                              </div>
                           </div>
                           <script type="text/javascript">
                              if ($('.sale:checked').length === $('.sale').length) {
                                 $('#saleAll').prop('checked', true);   
                              }
                              $('#saleAll').click(function(){
                                 $('.sale').prop('checked', true);
                                 if(!$(this).prop("checked")) {
                                    $('.sale').prop('checked', false);
                                 }
                              });
                              $('.sale').change(function() {
                                 if(!$(this).prop("checked")) {
                                    $('#saleAll').prop('checked', false);
                                 } else {
                                    if ($('.sale:checked').length === $('.sale').length) {
                                       $('#saleAll').prop('checked', true);
                                    }
                                 }
                              });
                           </script>
                           <div class="col-md-3">
                              <div class="card card card-outline direct-chat direct-chat shadow-none" style="border-left:1px solid #969c9d;border-right:1px solid #969c9d;border-bottom:1px solid #969c9d;">
                                 <div class="card-header" style="background: #0d461a;padding: 4px 8px;color: whitesmoke;">
                                    <h3 style="float:left" class="card-title"> <?php echo language(9);?> </h3>
                                    <div class="card-tools" >
                                       <button type="button"  class="btn btn-tool" data-card-widget="remove"> <i class="fas fa-times" style="color: whitesmoke;"></i></button>
                                    </div>
                                 </div>
                                 <table class="table-sm table-hover table-bordered table-dark">
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(222);?> </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" class="custom-control-input"  id="stockAll"/>
                                             <label class="custom-control-label" for="stockAll"></label>
                                          </div>
                                       </td>
                                    </tr>
          
                                 
                                <?php if (chper('item_menu')==1) { ?>
                                    <tr>
                                       <td ><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(9);?> </td>
                                       <td style="width: 5%">
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="itemssaaa" class="custom-control-input stock" name="cperc[]" value="item_menu" <?php echo checked('item_menu');?>>
                                             <label class="custom-control-label" for="itemssaaa"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 
                                 
                                 <?php if (chper('item_stock')==1) { ?>
                                    <tr>
                                       <td ><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(53);?> </td>
                                       <td style="width: 5%">
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="item_stock" class="custom-control-input stock" name="cperc[]" value="item_stock" <?php echo checked('item_stock');?>>
                                             <label class="custom-control-label" for="item_stock"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>

                                 <?php if (chper('item_add')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i>  <?php echo language(55); ?>  </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="item_add" class="custom-control-input stock" name="cperc[]" value="item_add" <?php echo checked('item_add');?>>
                                             <label class="custom-control-label" for="item_add"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 
                                 
                                 <?php if (chper('item_imei_stock')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(394);?>  </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="item_imei_stock" class="custom-control-input stock" name="cperc[]" value="item_imei_stock" <?php echo checked('item_imei_stock');?>>
                                             <label class="custom-control-label" for="item_imei_stock"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 
                                 
                                 <?php if (chper('item_adj')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(199);?>  </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="item_adj" class="custom-control-input stock" name="cperc[]" value="item_adj" <?php echo checked('item_adj');?>>
                                             <label class="custom-control-label" for="item_adj"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('item_price_adj')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(296);?>  </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="item_price_adj" class="custom-control-input stock" name="cperc[]" value="item_price_adj" <?php echo checked('item_price_adj');?>>
                                             <label class="custom-control-label" for="item_price_adj"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('item_trns')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(180); ?>  </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="item_trns" class="custom-control-input stock" name="cperc[]" value="item_trns" <?php echo checked('item_trns');?>>
                                             <label class="custom-control-label" for="item_trns"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('item_p_setup')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(54); ?>  </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="item_p_setup" class="custom-control-input stock" name="cperc[]" value="item_p_setup" <?php echo checked('item_p_setup');?>>
                                             <label class="custom-control-label" for="item_p_setup"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('item_uom')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(56); ?>   </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="item_uom" class="custom-control-input stock" name="cperc[]" value="item_uom" <?php echo checked('item_uom');?>>
                                             <label class="custom-control-label" for="item_uom"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 
                            
                                 <?php if (chper('item_setting')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(235); ?>  </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="item_setting" class="custom-control-input stock" name="cperc[]" value="item_setting" <?php echo checked('item_setting');?>>
                                             <label class="custom-control-label" for="item_setting"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('item_import')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(96)?> </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="item_import" class="custom-control-input stock" name="cperc[]" value="item_import" <?php echo checked('item_import');?>>
                                             <label class="custom-control-label" for="item_import"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 
                                 <?php if (chper('item_cost_show')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(81);?> </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="item_cost_show" class="custom-control-input stock" name="cperc[]" value="item_cost_show" <?php echo checked('item_cost_show');?>>
                                             <label class="custom-control-label" for="item_cost_show"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 
                                <?php if (chper('item_avg_show')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(82);?> </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="item_avg_show" class="custom-control-input stock" name="cperc[]" value="item_avg_show" <?php echo checked('item_avg_show');?>>
                                             <label class="custom-control-label" for="item_avg_show"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 
                                 <?php if (chper('item_minsale_show')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i><?php echo language(83);?> </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="item_minsale_show" class="custom-control-input stock" name="cperc[]" value="item_minsale_show" <?php echo checked('item_avg_show');?>>
                                             <label class="custom-control-label" for="item_minsale_show"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 
                                 
                                 <?php if (chper('item_scan_status')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(328);?> </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="item_scan_status" class="custom-control-input stock" name="cperc[]" value="item_scan_status" <?php echo checked('item_scan_status');?>>
                                             <label class="custom-control-label" for="item_scan_status"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 
                                 
                                 </table>
                              </div>
                           </div>
                           <script type="text/javascript">
                              if ($('.stock:checked').length === $('.stock').length) {
                                 $('#stockAll').prop('checked', true);   
                              }
                              $('#stockAll').click(function(){
                                 $('.stock').prop('checked', true);
                                 if(!$(this).prop("checked")) {
                                    $('.stock').prop('checked', false);
                                 }
                              });
                              $('.stock').change(function() {
                                 if(!$(this).prop("checked")) {
                                    $('#stockAll').prop('checked', false);
                                 } else {
                                    if ($('.stock:checked').length === $('.stock').length) {
                                       $('#stockAll').prop('checked', true);
                                    }
                                 }
                              });
                           </script>
                           <div class="col-md-3 mb-2">
                              <div class="card card card-outline direct-chat direct-chat shadow-none" style="border-left:1px solid #969c9d;border-right:1px solid #969c9d;border-bottom:1px solid #969c9d;">
                                 <div class="card-header" style="background: #0d461a;padding: 4px 8px;color: whitesmoke;">
                                    <h3 style="float:left" class="card-title"> <?php echo language(10);?> </h3>
                                    <div class="card-tools" >
                                       <button type="button"  class="btn btn-tool" data-card-widget="remove"> <i class="fas fa-times" style="color: whitesmoke;"></i></button>
                                    </div>
                                 </div>
                                 <table class="table-sm table-hover table-bordered table-dark">
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(222);?> </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" class="custom-control-input"   id="reportAll"/>
                                             <label class="custom-control-label" for="reportAll"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php if (chper('rep_menu')==1) { ?>
                                    <tr>
                                       <td ><i class="ion-ios-navigate-outline text-success mr-1"> </i><?php echo language(10);?> </td>
                                       <td style="width: 5%">
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="rep_menu" class="custom-control-input report" name="cperc[]" value="rep_menu" <?php echo checked('rep_menu');?>>
                                             <label class="custom-control-label" for="rep_menu"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('rep_profit')==1) { ?>
                                    <tr>
                                       <td ><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(181);?>  </td>
                                       <td style="width: 5%">
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="rep_profit" class="custom-control-input report" name="cperc[]" value="rep_profit" <?php echo checked('rep_profit');?>>
                                             <label class="custom-control-label" for="rep_profit"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('rep_trail')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(182);?>   </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="rep_trail" class="custom-control-input report" name="cperc[]" value="rep_trail" <?php echo checked('rep_trail');?>>
                                             <label class="custom-control-label" for="rep_trail"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('rep_group')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(183);?> </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="rep_group" class="custom-control-input report" name="cperc[]" value="rep_group" <?php echo checked('rep_group');?>>
                                             <label class="custom-control-label" for="rep_group"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('rep_b_shit')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(184);?>  </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="rep_b_shit" class="custom-control-input report" name="cperc[]" value="rep_b_shit" <?php echo checked('rep_b_shit');?>>
                                             <label class="custom-control-label" for="rep_b_shit"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('rep_d_book')==1) { ?>
                                     <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i>  <?php echo language(27);?>  </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="rep_d_book" class="custom-control-input report" name="cperc[]" value="rep_d_book" <?php echo checked('rep_d_book');?>>
                                             <label class="custom-control-label" for="rep_d_book"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('rep_c_flow')==1) { ?>
                                     <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(188);?>  </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="rep_c_flow" class="custom-control-input report" name="cperc[]" value="rep_c_flow" <?php echo checked('rep_c_flow');?>>
                                             <label class="custom-control-label" for="rep_c_flow"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('erep_purchase')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(185);?></td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="erep_purchase" class="custom-control-input report" name="cperc[]" value="erep_purchase" <?php echo checked('erep_purchase');?>>
                                             <label class="custom-control-label" for="erep_purchase"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('erep_item_pur')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(313);?></td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="erep_item_pur" class="custom-control-input report" name="cperc[]" value="erep_item_pur" <?php echo checked('erep_item_pur');?>>
                                             <label class="custom-control-label" for="erep_item_pur"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('erep_sales')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(186);?> </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="erep_sales" class="custom-control-input report" name="cperc[]" value="erep_sales" <?php echo checked('erep_sales');?>>
                                             <label class="custom-control-label" for="erep_sales"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('erep_item_sales')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(316);?> </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="erep_item_sales" class="custom-control-input report" name="cperc[]" value="erep_item_sales" <?php echo checked('erep_item_sales');?>>
                                             <label class="custom-control-label" for="erep_item_sales"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('bw_profit')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(314);?> </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="bw_profit" class="custom-control-input report" name="cperc[]" value="bw_profit" <?php echo checked('bw_profit');?>>
                                             <label class="custom-control-label" for="bw_profit"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                  <?php if (chper('cus_item_wise_profit')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(335);?> </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="cus_item_wise_profit" class="custom-control-input report" name="cperc[]" value="cus_item_wise_profit" <?php echo checked('cus_item_wise_profit');?>>
                                             <label class="custom-control-label" for="cus_item_wise_profit"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('rep_i_summary')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(187);?> </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="rep_i_summary" class="custom-control-input report" name="cperc[]" value="rep_i_summary" <?php echo checked('rep_i_summary');?>>
                                             <label class="custom-control-label" for="rep_i_summary"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                  <?php if (chper('rep_i_tar_aciv')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(424);?> </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="rep_i_tar_aciv" class="custom-control-input report" name="cperc[]" value="rep_i_tar_aciv" <?php echo checked('rep_i_tar_aciv');?>>
                                             <label class="custom-control-label" for="rep_i_tar_aciv"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('rep_i_tranfer')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i>  <?php echo language(180);?> </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="rep_i_tranfer" class="custom-control-input report" name="cperc[]" value="rep_i_tranfer" <?php echo checked('rep_i_tranfer');?>>
                                             <label class="custom-control-label" for="rep_i_tranfer"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('rep_payroll')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(177);?> </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="rep_payroll" class="custom-control-input report" name="cperc[]" value="rep_payroll" <?php echo checked('rep_payroll');?>>
                                             <label class="custom-control-label" for="rep_payroll"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('rep_atten')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(179);?> </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="rep_atten" class="custom-control-input report" name="cperc[]" value="rep_atten" <?php echo checked('rep_atten');?>>
                                             <label class="custom-control-label" for="rep_atten"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('rep_cus')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i>  <?php echo language(35); ?>  </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="rep_cus" class="custom-control-input report" name="cperc[]" value="rep_cus" <?php echo checked('rep_cus');?>>
                                             <label class="custom-control-label" for="rep_cus"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 
                                           <?php if (chper('rep_ins')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i>  <?php echo language(359); ?>  </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="rep_ins" class="custom-control-input report" name="cperc[]" value="rep_ins" <?php echo checked('rep_ins');?>>
                                             <label class="custom-control-label" for="rep_ins"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 
                                 
                                 
                                 
                                 
                                 <?php if (chper('rep_supp')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(38);?> </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="rep_supp" class="custom-control-input report" name="cperc[]" value="rep_supp" <?php echo checked('rep_supp');?>>
                                             <label class="custom-control-label" for="rep_supp"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 
                                   <?php if (chper('rep_cus_tar_aciv')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(425);?> </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="rep_cus_tar_aciv" class="custom-control-input report" name="cperc[]" value="rep_cus_tar_aciv" <?php echo checked('rep_cus_tar_aciv');?>>
                                             <label class="custom-control-label" for="rep_cus_tar_aciv"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 </table>
                              </div>
                           </div>
                           <script type="text/javascript">
                              if ($('.report:checked').length === $('.report').length) {
                                 $('#reportAll').prop('checked', true);   
                              }
                              $('#reportAll').click(function(){
                                 $('.report').prop('checked', true);
                                 if(!$(this).prop("checked")) {
                                    $('.report').prop('checked', false);
                                 }
                              });
                              $('.report').change(function() {
                                 if(!$(this).prop("checked")) {
                                    $('#reportAll').prop('checked', false);
                                 } else {
                                    if ($('.report:checked').length === $('.report').length) {
                                       $('#reportAll').prop('checked', true);
                                    }
                                 }
                              });
                           </script>
                           <div class="col-md-3">
                              <div class="card card card-outline direct-chat direct-chat shadow-none" style="border-left:1px solid #969c9d;border-right:1px solid #969c9d;border-bottom:1px solid #969c9d;">
                                 <div class="card-header" style="background: #0d461a;padding: 4px 8px;color: whitesmoke;">
                                    <h3 style="float:left" class="card-title"><?php echo language(11);?> </h3>
                                    <div class="card-tools" >
                                       <button type="button"  class="btn btn-tool" data-card-widget="remove"> <i class="fas fa-times" style="color: whitesmoke;"></i></button>
                                    </div>
                                 </div>
                                 <table class="table-sm table-hover table-bordered table-dark">
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i><?php echo language(222);?> </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" class="custom-control-input" id="settall"/>
                                             <label class="custom-control-label" for="settall"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php if (chper('sett_menu')==1) { ?>
                                    <tr>
                                       <td ><i class="ion-ios-navigate-outline text-success mr-1"> </i><?php echo language(11);?>  </td>
                                       <td style="width: 5%">
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="sett_menu" class="custom-control-input sett"  name="cperc[]" value="sett_menu" <?php echo checked('sett_menu');?>>
                                             <label class="custom-control-label" for="sett_menu"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('co_update')==1) { ?>
                                    <tr>
                                       <td ><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(193); ?>  </td>
                                       <td style="width: 5%">
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="co_update" class="custom-control-input sett"  name="cperc[]" value="co_update" <?php echo checked('co_update');?>>
                                             <label class="custom-control-label" for="co_update"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('co_wharehouse')==1) { ?>
                                    <tr>
                                       <td ><i class="ion-ios-navigate-outline text-success mr-1"> </i>  <?php echo language(195); ?> </td>
                                       <td style="width: 5%">
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="co_wharehouse" class="custom-control-input sett" name="cperc[]" value="co_wharehouse" <?php echo checked('co_wharehouse');?>>
                                             <label class="custom-control-label" for="co_wharehouse"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                              
                                 <?php if (chper('co_tax')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(196);?>  </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="co_tax" class="custom-control-input sett" name="cperc[]" value="co_tax" <?php echo checked('co_tax');?>>
                                             <label class="custom-control-label" for="co_tax"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                  
                                 <?php if (chper('co_others')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(198);?>  </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="co_others" class="custom-control-input sett"  name="cperc[]" value="co_others" <?php echo checked('co_others');?>>
                                             <label class="custom-control-label" for="co_others"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('co_l_history')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(197);?> </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="co_l_history" class="custom-control-input sett"  name="cperc[]" value="co_l_history" <?php echo checked('co_l_history');?>>
                                             <label class="custom-control-label" for="co_l_history"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 </table>
                              </div>
                           </div>
                           <script type="text/javascript">
                              if ($('.sett:checked').length === $('.sett').length) {
                                 $('#settall').prop('checked', true);   
                              }
                              $('#settall').click(function(){
                                 $('.sett').prop('checked', true);
                                 if(!$(this).prop("checked")) {
                                    $('.sett').prop('checked', false);
                                 }
                              });
                              $('.sett').change(function() {
                                 if(!$(this).prop("checked")) {
                                    $('#settall').prop('checked', false);
                                 } else {
                                    if ($('.sett:checked').length === $('.sett').length) {
                                       $('#settall').prop('checked', true);
                                    }
                                 }
                              });
                           </script>
                           <div class="col-md-3">
                              <div class="card card card-outline direct-chat direct-chat shadow-none" style="border-left:1px solid #969c9d;border-right:1px solid #969c9d;border-bottom:1px solid #969c9d;">
                                 <div class="card-header" style="background: #0d461a;padding: 4px 8px;color: whitesmoke;">
                                    <h3 style="float:left" class="card-title"> <?php echo language(12);?>  </h3>
                                    <div class="card-tools" >
                                       <button type="button"  class="btn btn-tool" data-card-widget="remove"> <i class="fas fa-times" style="color: whitesmoke;"></i></button>
                                    </div>
                                 </div>
                                 <table class="table-sm table-hover table-bordered table-dark">
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(222);?>  </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" class="custom-control-input"  name="cperc[]" id="docall"/>
                                             <label class="custom-control-label" for="docall"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php if (chper('doc_menu')==1) { ?>
                                    <tr>
                                       <td ><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(12);?> </td>
                                       <td style="width: 5%">
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="doc_menu" class="custom-control-input doc" name="cperc[]" value="doc_menu" <?php echo checked('doc_menu');?>>
                                             <label class="custom-control-label" for="doc_menu"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('user_book')==1) { ?> 
                                    <tr>
                                       <td ><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(329);?> </td>
                                       <td style="width: 5%">
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="user_book" class="custom-control-input doc" name="cperc[]" value="user_book" <?php echo checked('user_book');?>>
                                             <label class="custom-control-label" for="user_book"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('l_update')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(330);?> </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="l_update" class="custom-control-input doc" name="cperc[]" value="l_update" <?php echo checked('l_update');?>>
                                             <label class="custom-control-label" for="l_update"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 </table>
                              </div>
                           </div>
                           <script type="text/javascript">
                              if ($('.doc:checked').length === $('.doc').length) {
                                 $('#docall').prop('checked', true);   
                              }
                              $('#docall').click(function(){
                                 $('.doc').prop('checked', true);
                                 if(!$(this).prop("checked")) {
                                    $('.doc').prop('checked', false);
                                 }
                              });
                              $('.doc').change(function() {
                                 if(!$(this).prop("checked")) {
                                    $('#docall').prop('checked', false);
                                 } else {
                                    if ($('.doc:checked').length === $('.doc').length) {
                                       $('#docall').prop('checked', true);
                                    }
                                 }
                              });
                           </script>
                           <div class="col-md-3">
                              <div class="card card card-outline direct-chat direct-chat shadow-none" style="border-left:1px solid #969c9d;border-right:1px solid #969c9d;border-bottom:1px solid #969c9d;">
                                 <div class="card-header" style="background: #0d461a;padding: 4px 8px;color: whitesmoke;">
                                    <h3 style="float:left" class="card-title"> <?php echo language(13);?>  </h3>
                                    <div class="card-tools" >
                                       <button type="button"  class="btn btn-tool" data-card-widget="remove"> <i class="fas fa-times" style="color: whitesmoke;"></i></button>
                                    </div>
                                 </div>
                                 <table class="table-sm table-hover table-bordered table-dark">
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(222);?>   </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" class="custom-control-input"   id="supportall"/>
                                             <label class="custom-control-label" for="supportall"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php if (chper('help_menu')==1) { ?>
                                    <tr>
                                       <td ><i class="ion-ios-navigate-outline text-success mr-1"> </i><?php echo language(13);?>  </td>
                                       <td style="width: 5%">
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="help_menu" class="custom-control-input support"  name="cperc[]" value="help_menu" <?php echo checked('help_menu');?>>
                                             <label class="custom-control-label" for="help_menu"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('help_center')==1) { ?>
                                    <tr>
                                       <td ><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(200); ?> </td>
                                       <td style="width: 5%">
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="help_center" class="custom-control-input support"  name="cperc[]" value="help_center" <?php echo checked('help_center');?>>
                                             <label class="custom-control-label" for="help_center"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('w_complaint')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i>  <?php echo language(201); ?>     </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="w_complaint" class="custom-control-input support"  name="cperc[]" value="w_complaint" <?php echo checked('w_complaint');?>>
                                             <label class="custom-control-label" for="w_complaint"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('c_history')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i>  <?php echo language(202); ?>  </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="c_history" class="custom-control-input support" name="cperc[]" value="c_history" <?php echo checked('c_history');?>>
                                             <label class="custom-control-label" for="c_history"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 </table>
                              </div>
                           </div>
                           <script type="text/javascript">
                              if ($('.support:checked').length === $('.support').length) {
                                 $('#supportall').prop('checked', true);   
                              }
                              $('#supportall').click(function(){
                                 $('.support').prop('checked', true);
                                 if(!$(this).prop("checked")) {
                                    $('.support').prop('checked', false);
                                 }
                              });
                              $('.support').change(function() {
                                 if(!$(this).prop("checked")) {
                                    $('#supportall').prop('checked', false);
                                 } else {
                                    if ($('.support:checked').length === $('.support').length) {
                                       $('#supportall').prop('checked', true);
                                    }
                                 }
                              });
                           </script>
                           <div class="col-md-3">
                              <div class="card card card-outline direct-chat direct-chat shadow-none" style="border-left:1px solid #969c9d;border-right:1px solid #969c9d;border-bottom:1px solid #969c9d;">
                                 <div class="card-header" style="background: #0d461a;padding: 4px 8px;color: whitesmoke;">
                                    <h3 style="float:left" class="card-title"> <?php echo language(14);?> </h3>
                                    <div class="card-tools" >
                                       <button type="button"  class="btn btn-tool" data-card-widget="remove"> <i class="fas fa-times" style="color: whitesmoke;"></i></button>
                                    </div>
                                 </div>
                                 <table class="table-sm table-hover table-bordered table-dark">
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(222);?> </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" class="custom-control-input" id="PackageAll"/>
                                             <label class="custom-control-label" for="PackageAll"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php if (chper('pack_menu')==1) { ?>
                                    <tr>
                                       <td ><i class="ion-ios-navigate-outline text-success mr-1"> </i><?php echo language(14);?></td>
                                       <td style="width: 5%">
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="pack_menu" class="custom-control-input Package"  name="cperc[]" value="pack_menu" <?php echo checked('pack_menu');?>>
                                             <label class="custom-control-label" for="pack_menu"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('new_package')==1) { ?>
                                    <tr>
                                       <td ><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(204); ?></td>
                                       <td style="width: 5%">
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="new_package" class="custom-control-input Package"  name="cperc[]" value="new_package" <?php echo checked('new_package');?>>
                                             <label class="custom-control-label" for="new_package"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('balance_add')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(205); ?>    </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="balance_add" class="custom-control-input Package" name="cperc[]" value="balance_add" <?php echo checked('balance_add');?>>
                                             <label class="custom-control-label" for="balance_add"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 <?php if (chper('balance_summary')==1) { ?>
                                    <tr>
                                       <td><i class="ion-ios-navigate-outline text-success mr-1"> </i> <?php echo language(206); ?>  </td>
                                       <td>
                                          <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                             <input type="checkbox" id="balance_summary" class="custom-control-input Package" name="cperc[]" value="balance_summary" <?php echo checked('balance_summary');?>>
                                             <label class="custom-control-label" for="balance_summary"></label>
                                          </div>
                                       </td>
                                    </tr>
                                 <?php } ?>
                                 </table>
                              </div>
                           </div>
                           <script type="text/javascript">
                              if ($('.Package:checked').length === $('.Package').length) {
                                 $('#PackageAll').prop('checked', true);   
                              }
                              $('#PackageAll').click(function(){
                                 $('.Package').prop('checked', true);
                                 if(!$(this).prop("checked")) {
                                    $('.Package').prop('checked', false);
                                 }
                              });
                              $('.Package').change(function() {
                                 if(!$(this).prop("checked")) {
                                    $('#PackageAll').prop('checked', false);
                                 } else {
                                    if ($('.Package:checked').length === $('.Package').length) {
                                       $('#PackageAll').prop('checked', true);
                                    }
                                 }
                              });
                           </script>
                        </div>
                     </div>
                  </div>
               </form>
            </div>
         </div>
      </div>
   </div>
</section>
<script>
   $('select').select2();
   $(document).ready(function() {
     $('#bbid').change(function(e) { 
      var bbid = $(this).val();
       $.post("../company_setup/branch.php",{bbid:bbid},function(data){
         $('#viewid').html(data);
       });
   });
   });  
</script>

<script>
   $(document).ready(function() {
     $('#com_per_form input[type=checkbox],#viewid').change(function(e) { 
      e.preventDefault(); 
       $.post("../company_setup/permissoin_db.php",$('#com_per_form').serialize(),function(data){
          toastr.success(data, yourdata);
       });
   });
   });  
</script>