<?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>Countries - 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">
		
		<!-- Main CSS -->
        <link rel="stylesheet" href="../../assets/css/style.css">
           <!-- Datetimepicker CSS -->
		<link rel="stylesheet" href="../../assets/css/bootstrap-datetimepicker.min.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">
           <!-- Datetimepicker CSS -->
		<link rel="stylesheet" href="../../assets/css/bootstrap-datetimepicker.min.css">
        
        
           <!-- Datetimepicker JS -->
		<script src="../../assets/js/moment.min.js"></script>
		<script src="../../assets/js/bootstrap-datetimepicker.min.js"></script>

            <?php } ?>
		
		 
    </head>
    <body>
		<!-- Main Wrapper -->
        <div class="main-wrapper">
		
			<!-- Toper -->
            <?php include("../toper.php"); ?>
			<!-- /Toper -->
			
			<!-- header -->
            <?php include("../header.php");?>
			
			<!-- /header -->
			
		
			
			<!-- 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 $Forms ; ?></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 $Forms ; ?></li>
								</ul>
							</div>
							<div class="col-auto float-end ms-auto">
							<?php
                        include("dbConfig.php");
                        $sql_htt="SELECT * FROM hr_tasks_tbl";
                        if ($result_tt=mysqli_query($conn,$sql_htt))
  {
                        $rowcount=mysqli_num_rows($result_tt);
                        mysqli_free_result($result_tt);
  }

  ?>
  
							 <?php //include("../employ_dept/hr_add_hr_task_modal.php");?>
							 
						<!--a href="#" class="btn add-btn" data-bs-toggle="modal" data-bs-target="#add_tasks"><i class="fa fa-plus"></i> <?php echo $add_task; ?></a-->
							</div>
						</div>
					</div>
					<!-- /Page Header -->
					
					<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']; ?>
           </div>
            <?php endif; ?>
           <?php unset($_SESSION['message']); ?></div>
					    
			 
			 
			 <?php 
			  $date_from = $_GET["date_from"]; 
			  $date_to = $_GET["date_to"]; 
			  $date_from_convert=date("Y-m-d", strtotime($date_from)); 
			  $date_to_convert=date("Y-m-d", strtotime($date_to));
			  //echo $date_from_convert.'<br>'; echo $date_to_convert.'<br>'; 
			  // $check_isset=$_GET["check_isset"]; 
			   if(isset($_POST["btn_ard"])){
				$check_isset='1'; 
				//echo $check_isset;
			     }
			     
			    $user_type=$urow['user_type'];
				//echo $user_type;
				?>	 
			 

			
						<!-- /Profile Info Tab -->
						
						<!-- Projects Tab -->
						
						<!-- /Projects Tab -->
					
						<div clas="tab-pane fade" id="bank_statutory2334">

					<div class="row">
						<div class="col-sm-12">
							<div class="file-wrap">
								<div class="file-sidebar">
									<div class="file-header justify-content-center">
										<span><?php echo $attachments_types; ?></span>
										<a href="javascript:void(0);" class="file-side-close"><i class="fa fa-times"></i></a>
									</div>
									<form class="file-search">
										<div class="input-group">
											<div class="input-group-prepend">
												<i class="fa fa-search"></i>
											</div>
											<input type="text" id="searchh" class="form-control rounded-pill" placeholder="Search">
										</div>
									</form>
									<div class="file-pro-list">
										<div class="file-scroll">
											<ul class="file-menu" id="myTable4">
												<li class="li-link active">
												<a  class="att_type" id="all_att"><?php echo $all_attachments; ?></a>
												</li>
												<li class="li-link">
												<a  class="att_type" id="basic_att"><?php echo $basic_attachments; ?></a>
												</li>
												<li class="li-link">
													<a class="att_type" id="other_file"><?php echo $other_file; ?></a>
												</li>
													  <?php
							   $sql_empp="SELECT * FROM hr_employ_tbl where employ_id='876658' ";
                          $result_empp = $conn->query($sql_empp);
                           if ($result_empp->num_rows > 0) {
                            while($row_empp = $result_empp->fetch_assoc()) { 
                            if($lang=='ar'){$employ_name=$row_empp['employ_name_ar'];}else{$employ_name=$row_empp['employ_name_en'];}
							  // echo $row_empp['employ_id'];
                            }}
							   //
							   $sql_att="SELECT * FROM hr_employ_attachments_tbl where system_id='2222'AND company_id IN ('$ids') AND deleted='0' AND stop='0' ORDER BY `hr_forms_attachments_tbl`.`attach_id` DESC";
							   $result_att = $conn->query($sql_att);
								if ($result_att->num_rows > 0) {
								 while($row_att = $result_att->fetch_assoc()) {
								  echo $row_att["attach_type"]."</br>";
							   //
                          $sql_ta="SELECT * FROM hr_attachments_type_tbl where att_type_id='".$row_att["attach_type"]."' and (dept_id='".$row_empp['dept_id']."' or dept_id='all_dept') AND  stop='0' AND deleted='0' ";
                          $result_ta = $conn->query($sql_ta);
                           if ($result_ta->num_rows > 0) {
                            while($row_ta = $result_ta->fetch_assoc()) {
								
                               if($lang=='ar'){$att_type_name=$row_ta['att_type_name_ar'];}else{$att_type_name=$row_ta['att_type_name_en'];}
                             ?>	
							<li class="li-link">
                             <a  class="att_type" id="<?php echo $row_ta['att_type_id'];?>"><?php echo $att_type_name; ?></a>
                            
							</li>
							<?php }} }}  ?>
												
											
							</ul>
											<!--div class="show-more">
												<a href="#">Show More</a>
											</div-->
										</div>
									</div>
								</div>
								<div class="file-cont-wrap">
									<div class="file-cont-inner">
										<div class="file-cont-header">
											<div class="file-options">
												<a href="javascript:void(0)" id="file_sidebar_toggle" class="file-sidebar-toggle">
													<i class="fa fa-bars"></i>
												</a>
											</div>
											<span><?php echo $Form_Attachments; ?></span> 
											<div class="file-options">
									 <!--span class="btn-file"><input type="file" class="upload"><?php echo $add_attachments; ?><i class="fa fa-upload"></i></span-->
									
									  <?php include("hr_add_form_att_modala.php");?>
									
										<a href="#" class="btn btn-success" clas="btn add-btn" data-bs-toggle="modal" data-bs-target="#add_med_att<?php echo $employ_id; ?>"><i class="fa fa-upload"></i><?php echo $add_attachments; ?></a>
											</div>
										</div>
										
										<div class="file-content">
											<form class="file-search">
												<div class="input-group">
													<div class="input-group-prepend">
														<i class="fa fa-search"></i>
													</div>
													<input type="text" id="searchh2" class="form-control rounded-pill" placeholder="Search">
												</div>
											</form>
											
											<div class="file-body">
												<div class="file-scroll">
													<div class="file-content-inner">
													    

														<h4 id="File_Title"><?php echo $All_attachments; ?></h4>
														<div class="row row-sm">
														
						                	<?php
                                             $sql_fil="SELECT * FROM hr_forms_attachments_tbl where system_id='2222'AND company_id IN ('$ids') AND deleted='0' AND stop='0' ORDER BY `hr_forms_attachments_tbl`.`attach_id` DESC";
                                             $result_fil = $conn->query($sql_fil);
                                             if ($result_fil->num_rows > 0) {
                                             while($row_fil = $result_fil->fetch_assoc()) { 
                                            // if($lang=='ar'){$dept_name=$result_fil["dept_name"];}else{$dept_name=$result_fil["dept_name_en"];}
                                             $modal_id=$row_fil['attach_id'];
                                             $modal_table_name='hr_forms_attachments_tbl';
                                             $id_name='attach_id';
                                             $proccess_details_delete='حذف  المرفق رقم '.$modal_id;
                                         $proccess_details_en_delete='Delete Attachment'.$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; ?>">
           
														   <?php include("../modals/hr_edit_att_modal.php");?>
														   	 <?php include("../modals/hr_delete_modal.php");?>   
														   	 
															<div class="col-6 col-sm-4 col-md-3 col-lg-4 col-xl-3">
															      <ul id="myTable42">
														   	     <li>
																<div class="card card-file">
																	<div class="dropdown-file">
																		<a href="" style="background-color:lightgray;" class="dropdown-link" data-bs-toggle="dropdown" aria-expanded="false"><i class="fa fa-ellipsis-v"></i></a>
																		<div class="dropdown-menu dropdown-menu-right" style="">
																		  
																			<a href="#" data-bs-toggle="modal" data-bs-target="#add_med_att<?php echo $row_fil['attach_id']; ?>" class="dropdown-item"><i class="fa fa-pencil m-r-5"></i> <?php echo $edit; ?>
																		<?php //echo $row_fil['attach_id']; ?>	
																			</a>
																			<!--a href="#" class="dropdown-item">Share</a-->
																			 <?php if($row_fil['att_name']=='employ_photo'){ ?>
																			<a  href="../modals/download.php?file=../../../Shipping_Clearance_System/jquery/pages/system_maintenance/user_img/<?php echo urlencode($row_fil['attach_link']); ?>" class="dropdown-item"><i class="fa fa-download" aria-hidden="true"></i><?php echo $download; ?></a>
																			 	<?php }else{ ?>
																			<a  href="../modals/download.php?file=../hr_files/<?php echo urlencode($row_fil['attach_link']); ?>" class="dropdown-item"><i class="fa fa-download" aria-hidden="true"></i><?php echo $download; ?></a>
																		 <?php } ?>
																			<a href="#" class="dropdown-item"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>
																		</div>
																	</div>
																	<div class="card-file-thumb">
																	 <a href="../hr_files/<?php echo $row_fil['attach_link']; ?>" target="_new">
																	    
																	  <?php  if($row_fil['file_type']=='application/pdf'){ ?>  
																		<i class="fa fa-file-pdf-o"></i>
																
																		<?php }elseif($row_fil['file_type']=='image/png' or $row_fil['file_type']=='image/jpeg'){ ?>
																			<!--i class="fa fa-file-image-o"></i-->
																		    
																		    <?php if($row_fil['att_name']=='employ_photo'){ ?>
																		    <a href="../../../Shipping_Clearance_System/jquery/pages/system_maintenance/user_img/<?php echo $row_fil['attach_link']; ?>" target="_new"><img  class="fa" src="../../../Shipping_Clearance_System/jquery/pages/system_maintenance/user_img/<?php echo $row_fil['attach_link']; ?>" alt=""></a>
																			<?php }else{ ?>
																			 <a href="../hr_files/<?php echo $row_fil['attach_link']; ?>"target="_new"><img  class="fa" src="../hr_files/<?php echo $row_fil['attach_link']; ?>" alt=""></a>
                                                                            <?php } ?>
																		
																		 
																			<?php }elseif($row_fil['file_type']=='application/vnd.ms-excel'){ ?>
																		<i class="fa fa-file-excel-o"></i>

																				<?php }elseif($row_fil['file_type']=='application/vnd.openxmlformats-officedocument.wordprocessingml.document'){ ?>
																		<i class="fa fa-file-word-o"></i>
																		
																			<?php }elseif($row_fil['file_type']=='text/plain'){ ?>
																		<i class="fa fa-file-text-o"></i>
																		
																				<?php }else{ ?>
																		<i class="fa fa-file-text-o"></i>
																			<?php } ?>
																			</a>
																		
																	</div> 
																	<div class="card-body">
																		<h6><a href="#">
																		  <?php if($row_fil['att_name']=='employ_photo'){
																		 $name_att='الصورة الشخصية ';
																		  }elseif($row_fil['att_name']=='iqama_copy'){
																		   	 $name_att='صورة الإقامه';   
																		  }elseif($row_fil['att_name']=='pass_copy'){
																		     $name_att='صورة الجواز';    
																		  }
																		  
																		  else{$name_att=$row_fil['att_name'];}
																		  
																		  echo $name_att;
																		  ?>
																		
																		</a>
																		</h6>
																		<span><?php echo $row_fil['attach_size']; ?></span> 
																		 <br><small class="text-success">#<?php echo $row_fil['s_n']; ?></small>
																	</div>
																	<div class="card-footer">
																		<span class="d-none d-sm-inline"dir="ltr"><?php echo $row_fil['createdDate_time']; ?> </span>
																	</div>
																</div>
																	</li>	</ul>
															</div>
															
															
															<?php }} ?>


														</div>
													</div>
												</div>
											</div>
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
					
                </div>	
						
						
				
                </div>
				<!-- /Page Content -->
	
			

		
				
				
				
				
            </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>

        <!-- 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>
		
		  <!-- Datetimepicker JS -->
		<script src="../../assets/js/moment.min.js"></script>
		<script src="../../assets/js/bootstrap-datetimepicker.min.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>
    setTimeout(function() {
        let alert = document.querySelector(".alert3");
            alert.remove();
    }, 3000);
    </script>	
    
    
    <script>
  $(document).ready(function(e) {
   $(".up_add").click(function(){
   alertify.error(message_per);
      });
      });
       </script>
       <script>
  $(document).ready(function(e) {
   $(".update_btn").click(function(){
  var id = $(this).attr("id");
  alert(id);
      });
      });
       </script>
       
       
       <script>
  $(document).ready(function(e) {
   var i=0;
	$('#add').click(function(){
    i++;
	 var button_add = $(this).attr('data-id');   
	
      var date_did = $("#date_did"+i).val();

  
  $('#dynamic_fieldfff').append('<tr id="row" style="border-bottom:1px solid;"> <td colspan="0"> <div class="row" style="font-size:12px;"> <div class="col-md-3"style="font-siz:12px;"> <div class="form-group"> <label><?php echo $the_companyr; ?></label> <select style="font-size:12px;" clas="select" name="company_id_sel'+i+'" id="company_id_sel'+i+'" data-id="'+i+'" class="form-select company_id_selll" required=""> <option value=""> <?php echo $select.$space.$the_companyr; ?></option> <?php if($urow['user_type']=="System_Manager"){ $sql_com="SELECT * FROM waseet_company_user_tbl GROUP BY company_id "; }else{ if($company_id=='all_company'){ $sql_com="SELECT * FROM waseet_company_user_tbl where deleted='0'AND company_id IN ('$ids')GROUP BY company_id "; }else{ $sql_com="SELECT * FROM waseet_company_user_tbl where deleted='0'AND company_id='$company_id' GROUP BY company_id "; } } $result_com = $conn->query($sql_com); if ($result_com->num_rows > 0) { while($row_com = $result_com->fetch_assoc()) { $sql_com1="SELECT * FROM main_company_tbl where deleted='0'AND company_id='".$row_com['company_id']."' "; $result_com1 = $conn->query($sql_com1); if ($result_com1->num_rows > 0) { while($row_com1 = $result_com1->fetch_assoc()) { if($lang=='ar'){$name_ar2=$row_com1['company_name_ar'];}else{$name_ar2=$row_com1['company_name_en'];} ?> <option value="<?php echo $row_com1['company_id']; ?>"><?php echo $name_ar2; ?> </option> <?php }} }} ?> </select> </div> </div> <div class="col-md-3"> <div class="form-group"> <label><?php echo $id; ?></label> <select style="font-size:12px;" name="dept_id'+i+'" id="dept_id'+i+'" data-id="'+i+'" class="form-select dept_idd" required=""> <option value=""> <?php echo $select_the_company_for_the_departments_appear; ?></option> </select> </div> </div> <div class="col-md-3"> <div class="form-group"> <label><?php echo $attachments_types; ?></label> <input type="hidden" name="hidden[]" value="'+i+'"> <select style="font-size:12px;" styl="font-size:9px;width:100%;" name="att_type_id'+i+'" id="att_type_id'+i+'" data-id="'+i+'" class="form-select att_type_idd" required=""> <option value=""> <?php echo $select.$space.$attachments_types; ?></option> </select> </div> </div><div class="col-md-3"> <div class="form-group"> <label><?php echo $Serial_Number; ?></label> <input type="text"readonly value="" name="serial_number'+i+'" id="serial_number'+i+'" data-id='+i+' class="form-control form-control-sm" style="font-size:12px;" value="" > </div> </div> </div> </td> </tr> <tr id="row"style="border-bottom:1px solid;"> <td> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label> <?php echo $file_name; ?> </label> <input type="text" name="att_name'+i+'" id="att_name'+i+'" class="form-control form-control-sm" placeholder="Enter File Name" required=""> </div> </div> <div class="col-md-6"> <div class="form-group"> <label> <?php echo $file; ?> </label> <input id="imageFile'+i+'" name="imageFile'+i+'" type="file"class="form-control form-control-sm" required="" /> </div> </div> </div></td> <td> </td> <td> </td> </tr>');
  $.ajax({
    type: "POST",
    url: "hr_get_serial_number.php",
    data: {
      date_did:date_did				
    },
    success: function(data) {
      
      var datanum = parseInt(data);
      
      var dat ;
      dat = datanum + i + 1;
       $("#serial_number"+i).val('000' + dat);
       
    },
    error:function(data){
        
       alert(data); //===Show Error Message====
    }
    }); 
});
 $(document).on('click', '#btn_remove'+ss, function(){
    var button_id = $(this).attr("data-id"); 
    //alert(button_id);
		$('#row'+button_id+'').remove();
	});
  
});
  </script>
       
       
       
       							  <script>
$(document).on('change', '.company_id_selll', function() {
    //$(".company_id_selll").change(function(){
      var id  = $(this).attr('data-id');
var company_id_sel = $("#company_id_sel"+id).val(); 
var lang = $("#lang").val();
//alert(id);
//alert(company_id_sel);
$.ajax({
    type: "POST",
    url: "../system_init/hr_dept_for_company_att.php",
    data: {
      company_id_sel:company_id_sel,lang:lang				
    },
    success: function(data) {
       $("#dept_id"+id).html(data);
       $("#att_type_id"+id).html('<option value=""> <?php echo $select.$space.$attachments_types; ?></option>');
    },
    error:function(data){
        
       alert(data); //===Show Error Message====
    }
    }); 

    
    
  });
    </script>
      <script>
$(document).on('change', '.dept_idd', function() {
    //$(".dept_idd").change(function(){
      var id  = $(this).attr('data-id');
      var company_id_sel = $("#company_id_sel"+id).val(); 
var dept_id = $("#dept_id"+id).val(); 
var lang = $("#lang").val();
//alert(id);
//alert(dept_id);
$.ajax({
    type: "POST",
    url: "hr_dept_att_type.php",
    data: {
      company_id_sel:company_id_sel,dept_id:dept_id,lang:lang				
    },
    success: function(data) {
       $("#att_type_id"+id).html(data);
    },
    error:function(data){
        
       alert(data); //===Show Error Message====
    }
    }); 

    
    
  });
    </script> 
        <script>
$(document).on('change', '.att_type_idd', function() {
//alert("");
      var id  = parseInt($(this).attr('data-id'));
var att_type_id = $("#att_type_id"+id).val(); 
var lang = $("#lang").val();
alert(att_type_id);
//alert(att_type_id);
 

    
    
  });
    </script> 
         <script>
var $rows4 = $('#myTable4 li');
$('#searchh').keyup(function() {
   // alert();
    var val = $.trim($(this).val()).replace(/ +/g, ' ').toLowerCase();
    
    $rows4.show().filter(function() {
        var text = $(this).text().replace(/\s+/g, ' ').toLowerCase();
        return !~text.indexOf(val);
    }).hide();
});
</script> 

    <script>
var $rows42 = $('#myTable42 li');
$('#searchh2').keyup(function() {
  //  alert();
    var val = $.trim($(this).val()).replace(/ +/g, ' ').toLowerCase();
    
    $rows42.show().filter(function() {
        var text = $(this).text().replace(/\s+/g, ' ').toLowerCase();
        return !~text.indexOf(val);
    }).hide();
});
</script> 



       
       
       
       	<script>
    $(".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}, 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(i);
          $.post('hr_enabledDept_Code.php', {'g':g,'add_user_id':add_user_id,'company_id':company_id}, 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>
       
<!--script>
  
  //refresh
  
  var old_count = 0;
  var company_id = '<?php echo $company_id;?>';
  var user_id = '<?php echo $urow["user_id"];?>';
  var user_type = '<?php echo $user_type;?>';

  var employ_id_sel = '<?php echo $employ_id_sel?>';
  var date_from = '<?php echo $date_from1?>';
  var date_to = '<?php echo $date_to1?>';
  var lang = '<?php echo $_GET['lang']?>';
  //alert(company_id);
  //alert(user_id);
  //alert(user_type);
  //alert(employ_id_sel);
  //alert(date_from);
  //alert(date_to);
  //alert(lang);
  setInterval(function(){    
      $.ajax({
          type : "POST",
          url : "num_tasks.php",
          data: {
            company_id:company_id,
            user_id:user_id,
            user_type:user_type,
            			
          },
          success : function(data){
            
              if (data > old_count) {
                 //alert("yes");
                  //$("#Refresh_tasks").load("Show_Refresh_Tasks.php");
                 $.ajax({
          type : "POST",
          url : "Show_Refresh_Tasks.php",
          data: {
            company_id:company_id,
            user_id:user_id,
            user_type:user_type,
            employ_id_sel:employ_id_sel,
            date_from:date_from,
            date_to:date_to,
            lang:lang				
          },
          success : function(data){
            //alert(data);
            $("#Refresh_tasks").html(data);
          }
      });
               
                  old_count = data;
                  
              }else{
                
              }
             
          }
      });
  },500);
  //
   </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>




