<?php include("../secure.php"); ?>
<!DOCTYPE html>
<html lang="en" data-layout="vertical" data-topbar="light" data-sidebar="dark" data-sidebar-size="lg" data-sidebar-image="none">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0">
        <meta name="description" content="Smarthr - Bootstrap Admin Template">
		<meta name="keywords" content="admin, estimates, bootstrap, business, corporate, creative, management, minimal, modern, accounts, invoice, html5, responsive, CRM, Projects">
        <meta name="author" content="Dreamguys - Bootstrap Admin Template">
        <meta name="robots" content="noindex, nofollow">
        <title>Dept - HR Marsa System </title>
                <style>
@font-face {
    font-family: 'DroidSansArabic';
    src: url('../../font/DroidSansArabic.ttf');
}
body * {
    font-family: "DroidSansArabic", sans-serif ;
}
    </style>
		<?php 
	$lang=$_GET['lang'];  
    $link_lang='lang='.$lang;
    $company_id=$_GET['company_id']; 
    $main_system_id='2222';
	?> 
	
	 <?php include("../languege_filee_hr.php");?>
	 
	 <?php include("../hr_permission.php");?>
	
		<!-- Favicon -->
        <link rel="shortcut icon" type="image/x-icon" href="../../assets/img/favicon.png">
        
        <link rel="stylesheet" href="../../assets/plugins/alertify/alertify.min.css">
        
		<?php
	if($lang=='ar'){
	?>


         <link rel="stylesheet" href="../../assets/css/bootstrap.rtl.min.css">
   
		<!-- Fontawesome CSS -->
        <link rel="stylesheet" href="../../assets/plugins/fontawesome/css/fontawesome.min.css">
    	<link rel="stylesheet" href="../../assets/plugins/fontawesome/css/all.min.css">

		<!-- Lineawesome CSS -->
        <link rel="stylesheet" href="../../assets/css/line-awesome.min.css">
		<link rel="stylesheet" href="../../assets/css/material.css">
		
		<!-- Fontawesome CSS -->
        <link rel="stylesheet" href="../../assets/css/font-awesome.min.css">
		
		<!-- Datatable CSS -->
		<link rel="stylesheet" href="../../assets/css/dataTables.bootstrap4.min.css">
		
		 <!-- Select2 CSS -->
         <link rel="stylesheet" href="../../assets/css/select2.min.css">
         
         <!-- Datetimepicker CSS -->
         <link rel="stylesheet" href="../../assets/css/bootstrap-datetimepicker.min.css">
		
		
		<!-- Main CSS -->
        <link rel="stylesheet" href="../../assets/css/style.css">
             
             
             
             
        <?php }else{ ?>
            <link rel="stylesheet" href="../../assets_en/css/bootstrap.min.css">
   
		<!-- Fontawesome CSS -->
        <link rel="stylesheet" href="../../assets_en/plugins/fontawesome/css/fontawesome.min.css">
    	<link rel="stylesheet" href="../../assets_en/plugins/fontawesome/css/all.min.css">

		<!-- Lineawesome CSS -->
        <link rel="stylesheet" href="../../assets_en/css/line-awesome.min.css">
		<link rel="stylesheet" href="../../assets_en/css/material.css">
		
		<!-- Fontawesome CSS -->
        <link rel="stylesheet" href="../../assets_en/css/font-awesome.min.css">
		
		<!-- Datatable CSS -->
		<link rel="stylesheet" href="../../assets_en/css/dataTables.bootstrap4.min.css">
		
		<!-- Main CSS -->
        <link rel="stylesheet" href="../../assets_en/css/style.css">
        

            <?php } ?>
		
		 
    </head>
    <body>
		<!-- Main Wrapper -->
        <div class="main-wrapper">
		
			<!-- Toper -->
            <?php include("../toper.php"); ?>
			<!-- /Toper -->
			
			<!-- header -->
            <?php include("../header.php");?>
			
			<!-- /header -->
			
			
				<!-- permission View -->
	<?php //if(($urow['user_type']=='Top_Manager' or $urow['user_type']=='System_Manager')or($hr_add_dept==1)){ ?>			
					<!-- /permission View -->
		
		
			
			<!-- Page Wrapper -->
            <div class="page-wrapper">
			
				<!-- Page Content -->
                <div class="content container-fluid">
				
					<!-- Page Header -->
					<div class="page-header">
					    
						<div class="row align-items-center">
							<div class="col">
								<h3 class="page-title"><?php echo $shifts; ?></h3>
								<ul class="breadcrumb">
									<li class="breadcrumb-item"><a href="../main/index.php?<?php echo $link_lang; ?>&company_id=<?php echo $company_id; ?>"><?php echo $Dashboard; ?></a></li>
									<li class="breadcrumb-item active"><?php echo $shifts; ?></li>
								</ul>
							</div>
							<!--div class="col-auto float-end ms-auto">
							 <?php //include("hr_add_holidays_modal.php");?>
							 
							 <?php if(($urow['user_type']=='Top_Manager' or $urow['user_type']=='System_Manager')or($add_hr_shiftlist==1)){ ?>
								<a href="#" class="btn add-btn" data-bs-toggle="modal" data-bs-target="#add_department"><i class="fa fa-plus"></i><?php  echo $Add_a_public_holiday; ?></a>
							<?php }else{ ?>
							<a href="#" class="btn add-btn up_add" ><i class="fa fa-plus"></i><?php echo $add_dept; ?><?php  echo $hr_add_dept; ?></a>
							<?php }  ?>
							</div-->
							
							<div class="col-auto float-end ms-auto">
							     <?php include("add_shift_modal.php");?>
							      <?php if(($urow['user_type']=='Top_Manager' or $urow['user_type']=='System_Manager')or($add_hr_shiftlist==1)){ ?>
								<a href="#" class="btn add-btn m-r-5" data-bs-toggle="modal" data-bs-target="#add_shift"><?php echo $Add_Shifts; ?></a>
									<?php }else{ ?>
										<a href="#" class="btn add-btn m-r-5 up_add" ><?php echo $Add_Shifts; ?></a>
										<?php }  ?>
								<!--a href="#" class="btn add-btn m-r-5" data-bs-toggle="modal" data-bs-target="#add_schedule"> Assign Shifts</a-->
							</div>	
							
							
						</div>
					</div>
					<!-- /Page Header -->
					
					
				<div class="card">
						<div class="card-body">
							<!-- <h4 class="card-title">Solid justified</h4> -->
							<ul class="nav nav-tabs nav-tabs-solid nav-justified">
							    <li class="nav-item"><a class="nav-link a active" href="hr_shiftlist.php?<?php echo $link_lang; ?>&company_id=<?php echo $company_id; ?>" id="active_employ"><?php echo $shifts; ?> <span class="spinner-border spinner-border-sm me-2" role="status" id="loaderr" style="display: none;"></span></a></li>
							
								<?php if(($urow['user_type']=='Top_Manager' or $urow['user_type']=='System_Manager')or($hr_shiftlist_connect==1)){ ?>
								<li class="nav-item"><a class="nav-link a" href="hr_shiftlist_connect.php?<?php echo $link_lang; ?>&company_id=<?php echo $company_id; ?>" id="inactive_employ"><?php echo $shifts_connect_employ; ?> </a></li>
								<?php }else{ ?>
								<li class="nav-item"><a class="nav-link a up_add" href="#" id="inactive_employ"><?php echo $shifts_connect_employ; ?> </a></li>
							   <?php  } ?>
							</ul>
						</div>
					</div>
					
					
					
		<?php 
			if(($urow['user_type']=='Top_Manager' or $urow['user_type']=='System_Manager')or($view_hr_shiftlist==1)){
		     //echo'Yes Permation';
			}else{
          // echo 'No Permation'; 
             //header("Refresh:0; url=../main/error_permation.php?$link_lang&company_id=$company_id"); 
			}
			?>
			
			<?php
         if(($urow['user_type']=='Top_Manager' or $urow['user_type']=='System_Manager')or($view_hr_shiftlist==1)){
         }else{
       ?>
             <script>window.location="https://www.marsalogistics.com/new/hr_marsa_system/ar/main/error_permation.php?<?php echo $link_lang; ?>&company_id=<?php echo $company_id;?>"</script>;
          </script>
        <?php } ?> 
			
			
			
					
					<div class="row">
					    
		<div class="alert1" id="messages" style="font-family:'Tajawal',sans-serif;">
		    
         	   <?php if(isset($_SESSION['message'])): ?>
            <div class="alert3 alert3-success">
            <?php echo $_SESSION['message']; ?>
            <script>
    setTimeout(function() {
        let alert = document.querySelector(".alert3");
            alert.remove();
    }, 3000);
    </script>
           </div>
            <?php endif; ?>
           <?php unset($_SESSION['message']); ?></div>
			
			
			<?php
			   $modal_table_name='hr_shift_tbl';
              
                $id_name='shift_id';
                  $proccess_details_delete='حذف الشفت رقم '.$modal_id;
                   $proccess_details_en_delete='Delete Shift Number'.$modal_id;
                  $proccess_details_delete_enable='تنشيط الشفت رقم '.$modal_id;
                   $proccess_details_en_delete_enable='Enable Shift Number'.$modal_id;
                  $proccess_details_delete_disable='الغاء تنشيط الشفت رقم '.$modal_id;
                $proccess_details_en_delete_disable='Disable Shift Number'.$modal_id;
               
                $proccess_details_enable=' تنشيط الشفت رقم '.$modal_id;
                 $proccess_details_en_enable='Enable Shift Number'.$modal_id;        
			
			?>		    
			<input type="hidden" name="modal_table_name" id="modal_table_name" readonly value="<?php echo $modal_table_name; ?>"> 
            <input type="hidden" name="id_name" id="id_name" readonly value="<?php echo $id_name; ?>"> 
           <input type="hidden" name="proccess_details_delete" id="proccess_details_delete" readonly value="<?php echo $proccess_details_delete; ?>"> 
           <input type="hidden" name="proccess_details_en_delete" id="proccess_details_en_delete" readonly value="<?php echo $proccess_details_en_delete; ?>">
           
           
              <input type="hidden" name="$proccess_details_delete_disable" id="proccess_details_delete_disable" readonly value="<?php echo $proccess_details_delete_disable; ?>"> 
           <input type="hidden" name="proccess_details_en_delete_disable" id="proccess_details_en_delete_disable" readonly value="<?php echo $proccess_details_en_delete_disable; ?>">
           
           
           <input type="hidden" name="proccess_details_enable" id="proccess_details_enable" readonly value="<?php echo $proccess_details_enable; ?>"> 
           <input type="hidden" name="proccess_details_en_enable" id="proccess_details_en_enable" readonly value="<?php echo $proccess_details_en_enable; ?>">
           
					    
						<div class="col-md-12">
							<div>
							    <div class="table-responsive">
							    <table class="table  datanew table-striped mb-0">
								<!--table class="table table-striped custom-table mb-0 datatable" -->
                                <thead>
										<tr>
											<th>
												<label class="checkboxs">
													<input type="checkbox">
													<span class="checkmarks"></span>
												</label>
											</th>
											<th><?php echo $id; ?></th>
											<th><?php echo $The_name_of_the_shift; ?></th>
											<th><?php echo $the_companyr; ?></th>
											<th><?php echo $Number_of_Employees; ?></th>
											<th><?php echo $Working_days; ?></th>
											<th><?php echo $Min_Start_Time; ?></th>
										    <th><?php echo $Start_Time; ?></th>
										    <th><?php echo $Max_Start_Time; ?></th>
										    <th><?php echo $MinEndTime; ?></th>
										    <th><?php echo $End_Time; ?></th>
										    <th><?php echo $Max_End_Time; ?></th>
										    <th><?php echo $working_hours; ?></th>
										    <th><?php echo $Break_Time; ?></th>
										    <th><?php echo $Flexible_Working; ?></th>
										    <th><?php echo $Only_presence_and_absence; ?></th>
										      
									     	<th><?php echo $t_request_date_time; ?></th>
											<th><?php echo $status; ?></th>
											<th>Action</th>
										</tr>
									</thead>
									<tbody>
                                    <?php
                    include("dbConfig.php");
                   
                    if($urow['user_type']=='System_Manager'){
                    $sql_cu="SELECT * FROM hr_shift_tbl where  deleted='0' ORDER BY `hr_shift_tbl`.`shift_name_ar` ASC ";
                    }else{ 
                    if($company_id=='all_company'){
                    $sql_cu="SELECT * FROM hr_shift_tbl where (company_id IN ('$ids')or user_id_top_manager ='$user_id_top_manager') AND company_id!='' AND deleted='0' ORDER BY `hr_shift_tbl`.`shift_name_ar` ASC ";

                    }else{
                 $sql_cu="SELECT * FROM hr_shift_tbl where company_id='$company_id' AND company_id!='' AND deleted='0' ORDER BY `hr_shift_tbl`.`shift_name_ar` ASC ";
                    }
                    
                    }
 
                        $result_cu = $conn->query($sql_cu);
                        if ($result_cu->num_rows > 0) {
                          while($row_cu = $result_cu->fetch_assoc()) {
                          $modal_id=$row_cu['shift_id'];
                       

                          ?> 
							    
                                        <tr class="D<?php echo $row_cu['shift_id']; ?>">
											<td>
												<label class="checkboxs">
													<input type="checkbox">
													<span class="checkmarks"></span>
												</label>
											</td>
											<td>
											  <?php echo $row_cu['shift_id']; ?><br><b style="color:red;"><?php //echo $user_id_top_manager; ?></b>
											 <input type="hidden" name="modal_id" class="modal_id" id="modal_id<?php echo $modal_id; ?>" readonly value="<?php echo $modal_id; ?>"> 	  
											</td>
											
											<td>
											<?php if($lang=='ar'){$shift_name=$row_cu['shift_name_ar'];}else{$shift_name=$row_cu['shift_name_en'];} 
											echo $shift_name; ?>
											</td>
											
											<td>
											  <?php if($row_cu['company_id']=='all_company'){ ?>  
											  <?php echo 'كل الشركات'; ?>
											  <?php }else{?> 
											    <?php
                                             $sql_c="SELECT * FROM main_company_tbl where company_id='".$row_cu['company_id']."' ";
                                             $result_c = $conn->query($sql_c);
                                             if ($result_c->num_rows > 0) {
                                             while($row_c = $result_c->fetch_assoc()) {
                                            
                                                if($lang=='ar'){$city_name2=$row_c['company_name_ar'];}else{$city_name2=$row_c['company_name_en'];} 
                                            echo $city_name2;     
                                           // echo $row_c['company_name_ar'];
                                             }}
                                               ?> 
                                               <?php } ?>
											    </td>
											    
											    
											    <td>
											          <?php
											           $no_emp=0;
                                             $sql_sh="SELECT * FROM hr_waseet_employ_shift_tbl where shift_id='".$row_cu['shift_id']."' AND waseet_stat='0'  ";
                                             $result_sh = $conn->query($sql_sh);
                                             if ($result_sh->num_rows > 0) {
                                             while($row_sh = $result_sh->fetch_assoc()) {
                                                  $no_emp++;
                                                  $employ_id_shift=$row_sh['employ_id'];
                                                  //echo $employ_id_shift;
                                             }}
                                               ?>
                                               <a class="btn btn-outline-info btn-sm" style="margin-left: 1rem!important;" href="javascript:void(0);" data-bs-toggle="tooltip" data-bs-placement="top" title="" data-bs-original-title="<?php echo $employ_id_shift; ?>" aria-label="print">
											      <?php echo  $no_emp; ?>
											      </a> 
											        </td>
											    
											    <td>
                      <div class="user-add-shedule-list">
                    <h2>
                      <a href="#" data-bs-toggle="modal" data-bs-target="#edit_schedule" style="border:2px dashed #1eb53a">
                      <!--span class="username-info m-b-10">6:30 am - 9:30 pm ( 14 hrs 15 mins)</span-->
                        <span class="userrole-info">
                        <?php if($row_cu['sat']=='1'){echo'السبت';} ?>
                         -<?php if($row_cu['sun']=='1'){echo'الأحد';} ?>
                         -<?php if($row_cu['mon']=='1'){echo'الإثنين';} ?>
                         -<?php if($row_cu['tue']=='1'){echo'الثلاثاء';} ?>
                         -<?php if($row_cu['we']=='1'){echo'الأربعاء';} ?>
                         -<?php if($row_cu['thu']=='1'){echo'الخميس';} ?>
                         -<?php if($row_cu['fr']=='1'){echo'الجمعه';} ?>
                        </span>
                        </a>
                         </h2>
                         </div>
                         </td>
										
										
											  
											  	<td>
										   <?php echo $row_cu['min_start_time']; ?>
											  </td>
											  
											  <td>
										   <?php echo $row_cu['start_time']; ?>
											  </td>
											   <td>
										   <?php echo $row_cu['max_start_time']; ?>
											  </td>
											  
											  	  	<td>
										   <?php echo $row_cu['min_end_time']; ?>
											  </td>
											  
											  <td>
										   <?php echo $row_cu['end_time']; ?>
											  </td>
											   <td>
										   <?php echo $row_cu['max_end_time']; ?>
											  </td>
											  
											    <td>
										   
										   <small style="font-size:12px"><?php echo $working_hours; ?><?php echo $row_cu['number_hours']; ?></small><br>
										     <small style="font-size:12px"><?php echo $allowed_minutes; ?>/<?php echo $row_cu['allowed_minutes']; ?></small><br>
										      <small style="font-size:12px"><?php echo $The_number_of_hours_calculated; ?>/<?php echo $row_cu['number_hours_calculated']; ?></small>
											  </td>
											  
											    <td>
										   <?php echo $row_cu['break_time']; ?>
											  </td>
											  
											   
											    <td>
										   <?php if($row_cu['flexible_working']=='0'){echo'غير فعال';
										   }elseif($row_cu['flexible_working']=='1'){echo'فعال';} else{} ?>
											  </td>
											  
											     <td>
										   <?php if($row_cu['hodoor_ghyab']=='0'){echo'غير فعال';
										   }elseif($row_cu['hodoor_ghyab']=='1'){echo'فعال';} else{} ?>
											  </td>
										
											  
											
									
									
										<td><small dir="ltr"><?php echo $row_cu['createdDate_time']; ?></small></td>
											
												<td>
											    <?php if($urow['user_type']=='Top_Manager'){ ?>	  
										  <input type="hidden" id="id_check" value="1">
										  <?php }else{ ?>
										   <input type="hidden" id="id_check" value="<?php echo $desabled_enabled_dept; ?>">
										  <?php } ?>
												<?php
												//echo $enable_disable_city;
												if(($urow['user_type']=='Top_Manager' or $urow['user_type']=='System_Manager')or($proccess_hr_shiftlist==1)){ ?> 
												<div class="status-toggle d-flex justify-content-between align-items-center">
												    <?php if($row_cu['stop']==0){ ?>
													<input type="checkbox" id="user<?php echo $modal_id; ?>" class="check"  checked="checked" value='1'>
												<?php }else{ ?>
												<input type="checkbox" id="user<?php echo $modal_id; ?>" class="check" value='1'>
												<?php } ?>
													<label for="user<?php echo $modal_id; ?>" data-id="<?php echo $modal_id; ?>" class="checktoggle">checkbox</label> 
												</div>
												<?php }else{ ?>
													<div class="status-toggle d-flex justify-content-between align-items-center">
												    <?php if($row_cu['stop']==0){ ?>
													<input type="checkbox" disabled id="usern<?php echo $modal_id; ?>" class="check up_add"  checked="checked" value='1'>
												<?php }else{ ?>
												<input type="checkbox" disabled id="usern<?php echo $modal_id; ?>" class="check up_add" value='1'>
												<?php } ?>
													<label for="usern<?php echo $modal_id; ?>" data-id="<?php echo $modal_id; ?>" class="checktoggle">checkbox</label> 
												</div>
												<?php } ?>
												
											</td>
											
										
											
											<td class="text-end">
											    
											 <?php include("../modals/hr_delete_modal.php");?>   
											 <?php include("hr_edit_holidays_modal.php");?>
											    	
										<div class="dropdown dropdown-action">
										<a href="#" class="action-icon dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false"><i class="material-icons">more_vert</i></a>
										<div class="dropdown-menu dropdown-menu-right" style="">
											<?php if(($urow['user_type']=='Top_Manager' or $urow['user_type']=='System_Manager')or($proccess_hr_shiftlist==1)){ ?>  
										<a class="dropdown-item" href="#" data-bs-toggle="modal" data-bs-target="#edit_holday<?php echo $modal_id; ?>"><i class="fa fa-pencil m-r-5"></i> <?php echo $edit; ?></a>
										<?php }else{ ?>
										<a class="dropdown-item up_add" href="javascript:void(0);" ><i class="fa fa-pencil m-r-5"></i> <?php echo $edit; ?></a>
									    <?php } ?>
									    
									    <?php if(($urow['user_type']=='Top_Manager' or $urow['user_type']=='System_Manager')or($proccess_hr_shiftlist==1)){ ?>  
										<a class="dropdown-item" href="#" data-bs-toggle="modal" data-bs-target="#delete_modal<?php echo $modal_id; ?>"><i class="fa fa-trash-o m-r-5"></i> <?php echo $delete; ?></a>
											<?php }else{ ?>
										<a class="dropdown-item up_add" href="javascript:void(0);" ><i class="fa fa-pencil m-r-5"></i> <?php echo $delete; ?></a>
									    <?php } ?>
													</div>
												</div>	
											</td>
											
											
											<?php   }} ?>
										</tr>
								

									</tbody>
								</table>
							</div>
						</div>
					</div>
                </div>
                	</div>
				<!-- /Page Content -->
				
			
				
				
				
				
				<!-- Edit Department Modal -->
				<div id="edit_department" class="modal custom-modal fade" role="dialog">
					<div class="modal-dialog modal-dialog-centered" role="document">
						<div class="modal-content">
							<div class="modal-header">
								<h5 class="modal-title">Edit Department</h5>
								<button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
									<span aria-hidden="true">&times;</span>
								</button>
							</div>
							<div class="modal-body">
								<form>
									<div class="form-group">
										<label>Department Name <span class="text-danger">*</span></label>
										<input class="form-control" value="IT Management" type="text">
									</div>
									<div class="submit-section">
										<button class="btn btn-primary submit-btn">Save</button>
									</div>
								</form>
							</div>
						</div>
					</div>
				</div>
				<!-- /Edit Department Modal -->

				<!-- Delete Department Modal -->
				<!--div class="modal custom-modal fade" id="delete_department" role="dialog">
					<div class="modal-dialog modal-dialog-centered">
						<div class="modal-content">
							<div class="modal-body">
								<div class="form-header">
									<h3>Delete Department</h3>
									<p>Are you sure want to delete?</p>
								</div>
								<div class="modal-btn delete-action">
									<div class="row">
										<div class="col-6">
											<a href="javascript:void(0);" class="btn btn-primary continue-btn">Delete</a>
										</div>
										<div class="col-6">
											<a href="javascript:void(0);" data-bs-dismiss="modal" class="btn btn-primary cancel-btn">Cancel</a>
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div-->
				<!-- /Delete Department Modal -->
				
				
				
				
            </div>
			<!-- /Page Wrapper -->

        </div>
		<!-- /Main Wrapper -->
		
	 
		<!-- sitting -->
		<?php include("../setting.php"); ?>
	    <!-- /sitting -->

	<!-- Footer -->
		<?php include("../footer.php"); ?>
		<!-- /Footer -->

	 <!-- jQuery -->
        <script src="../../assets/js/jquery-3.6.0.min.js"></script>

        <!-- Feather Icon JS -->
        <script src="../../assets/js/feather.min.js"></script>

        <!-- Slimscroll JS -->
        <script src="../../assets/js/jquery.slimscroll.min.js"></script>
        
          <!-- Select2 JS -->
    <script src="../../assets/js/select2.min.js"></script>
    
    <!-- Datetimepicker JS -->
    <script src="../../assets/js/moment.min.js"></script>
    <script src="../../assets/js/bootstrap-datetimepicker.min.js"></script>

        <!-- Datatable JS -->
        <script src="../../assets/js/jquery.dataTables.min.js"></script>
        <script src="../../assets/js/dataTables.bootstrap4.min.js"></script>
        
        <!-- Bootstrap Core JS -->
        <script src="../../assets/js/bootstrap.bundle.min.js"></script>

        <!-- Custom JS -->
        <script src="../../assets/js/script.js"></script>
      

		 <!-- Theme Settings JS -->
		<script src="../../assets/js/layout.js"></script>
		<script src="../../assets/js/theme-settings.js"></script>
		<script src="../../assets/js/greedynav.js"></script>
		
		 <script src="../../assets/js/app_tow.js"></script>

		<!-- Custom JS -->
		<!--script src="../../assets/js/app.js"></script-->
		
		<script src="../script_lang.js"></script> 
		
		  <!-- Alertify JS -->
		<script src="../../assets/plugins/alertify/alertify.min.js"></script>
		<!--script src="../../assets/plugins/alertify/custom-alertify.min.js"></script-->
        <!-- /Alertify JS -->
		
		
		
	    <script>
  $(document).ready(function(e) {
   $(".up_add").click(function(){
   alertify.error(message_per);
      });
      });
       </script>	
    
    
    <script>
  $(document).ready(function(e) {
   $(".up_addh").click(function(){
   alertify.error(message_per);
      });
      });
       </script>
       
       
       
       	<script>
       	 var modal_table_name=$('#modal_table_name').val();
       	 var id_name=$('#id_name').val();
       	 var proccess_details_delete_disable=$('#proccess_details_delete_disable').val();
       	 var proccess_details_en_delete_disable=$('#proccess_details_en_delete_disable').val();
       	 
       	 var proccess_details_enable=$('#proccess_details_enable').val();
       	 var proccess_details_en_enable=$('#proccess_details_en_enable').val();
       	  
    $(".checktoggle").click(function(e){
        var id = $(this).attr('data-id');
        //alert(id);
        
           var id_check=$('#id_check').val(); 
        if(id_check==''){
      alertify.error(message_per);
        }else{
        
        if($('#user'+id).is(':checked') ){
      if(confirm(message_disabled)){
         //alert("Checkbox Is checked");
    $('#user'+id).prop('checked', true);
    
   //======================
      var add_user_id=$('#add_user_id').val();
      var company_id=$('#company_id').val();
      var g = $(this).attr('data-id');
      var date_did = $("#date_did"+g).val();
   //alert(g);
          $.post('../modals/hr_disabeld_code.php', {'g':g,'add_user_id':add_user_id,'company_id':company_id,'modal_table_name':modal_table_name,'id_name':id_name,'proccess_details_delete_disable':proccess_details_delete_disable,'proccess_details_en_delete_disable':proccess_details_en_delete_disable}, function(r) {
              //alert(r);
        if (r == 1) {
     //  alert("تمت العمليه بنجاح");
      alertify.error(message_success);
         // window.location.reload();
         $(".D"+i).css("background-color", "#ccc");
         $(".D"+i).fadeOut("slow");
       

               }
             });
             
      }else{
        return false;
      }
   
   //======================
}
else{
   // alert("Checkbox Is not checked");
    $('#user'+id).prop('checked', false);
     if(confirm(message_enabled)){
    
      //======================
      var add_user_id=$('#add_user_id').val();  
      var company_id=$('#company_id').val();
      var g = $(this).attr('data-id');
      var date_did = $("#date_did"+g).val();
  // alert(g);
          $.post('../modals/hr_enable_code.php', {'g':g,'add_user_id':add_user_id,'company_id':company_id,'modal_table_name':modal_table_name,'id_name':id_name,'proccess_details_enable':proccess_details_enable,'proccess_details_en_enable':proccess_details_en_enable}, function(r) {
             // alert(r);
        if (r == 1) {
     //  alert("تمت العمليه بنجاح");
   alertify.success(message_success);
         $(".D"+i).css("background-color", "#ccc");
         $(".D"+i).fadeOut("slow");
          window.location.reload();

               }
             });
             
      }else{
        return false;
      }
   
 }  //====================== 
    
}
    });
</script>
       
       
		
		
   <style>
.alert {
  text-align: center;
  padding: 10px;
  background: rgb(168, 240, 177);
  color: green;
  margin-bottom: 10px;
  display: none;
}
.alert3 {
  text-align: center;
  padding: 10px;
  background: rgb(168, 240, 177);
  color: green;
  margin-bottom: 10px;
  
}
.alert4 {
  text-align: center;
  padding: 10px;
  margin-bottom: 10px;
  border-color: #ebad30;
  font-size:18px;
}

</style>	
		
    </body>
</html>




