<?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>
												<?php
                        
                              // top manager companies
                              $top_manager_companies=array();
                                $sql_comvv="SELECT * FROM waseet_company_user_tbl where system_id='2222' AND deleted='0' AND user_id='".$user_id_top_manager."' GROUP BY company_id ";
                                     $result_comvv = $conn->query($sql_comvv);
                                        if ($result_comvv->num_rows > 0) {
                                            while($row_comvv = $result_comvv->fetch_assoc()) {
                                             
                                                   $company_id_allv=$row_comvv['company_id']; 
                                                         array_push($top_manager_companies,$company_id_allv);
                
                                               }} 
                 
			                                        $ids_top_manager_companies = join("','",$top_manager_companies);
                                            
                              // 
                              //print_r($top_manager_companies);
                        ?>
                       
                        <?php 
                         $hfta_array=array();
                         $sql_hfat="SELECT * FROM hr_forms_attachments_tbl where system_id='2222'AND company_id IN ('$ids_top_manager_companies') AND deleted='0' AND stop='0'";
                         $result_hfat = $conn->query($sql_hfat);
                           if ($result_hfat->num_rows > 0) {
                            while($row_hfat = $result_hfat->fetch_assoc()) { 
                              array_push($hfta_array,$row_hfat["att_type_id"]);
                            }}
                            $ids_hfat = join("','",$hfta_array);
                        ?>
                        <?php 
                         $sql_w="SELECT * FROM waseet_company_user_tbl where user_id='".$urow['user_id']."' ";
                    $result_w = $conn->query($sql_w);
                     if ($result_w->num_rows > 0) {
                    while($row_w = $result_w->fetch_assoc()) {
                    
                    $sql_emp="SELECT * FROM hr_employ_tbl where employ_id='".$row_w['user_id']."' ";
                    $result_emp = $conn->query($sql_emp);
                     if ($result_emp->num_rows > 0) {
                    while($row_emp = $result_emp->fetch_assoc()) {
                        
                        
                    $em_dept = $row_emp['dept_id'];
                   // echo $em_dept;
                          }}
                          
                    }}
                    ?>
                        <?php //print_r($hfta_array);?>
													  <?php
                                           if(($urow['user_type']=='Top_Manager' or $urow['user_type']=='System_Manager')or($View_all_form_attachments==1)){            
							   $sql_attype="SELECT * FROM hr_attachments_type_tbl where company_id IN ('$ids_top_manager_companies') AND att_type_id in ('$ids_hfat') and deleted='0' and stop='0' ";
                                           }else{
                                            $sql_attype="SELECT * FROM hr_attachments_type_tbl where dept_id='$em_dept' and deleted='0' and stop='0' ";
                                           }
                          $result_attype = $conn->query($sql_attype);
                           if ($result_attype->num_rows > 0) {
                            while($row_attype = $result_attype->fetch_assoc()) { 

                              $sql_co="SELECT * FROM main_company_tbl where company_id = '".$row_attype["company_id"]."' and deleted='0' and stop='0' ";
                          $result_co = $conn->query($sql_co);
                           if ($result_co->num_rows > 0) {
                            while($row_co = $result_co->fetch_assoc()) { 
                              if($lang=='ar'){$att_c_name=$row_co['company_name_ar'];}else{$att_c_name=$row_co['company_name_en'];}
                            }}
                            if($lang=='ar'){$att_type_name=$row_attype['att_type_name_ar'];}else{$att_type_name=$row_attype['att_type_name_en'];}
                             ?>	
							<li class="li-link">
                             <a  class="att_type" id="<?php echo $row_attype["att_type_id"];?>"><?php echo $att_type_name."/"; ?><br><small style="font-size:12px;"><?php echo $att_c_name; ?></small></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"></h4>
														<div class="row row-sm" >
											
															
															
												<!-- ===22table====================================================================== -->	
														<div class="col-sm-12">
														<table class="table datanew table-striped mb-0 dataTable no-footer">
														 <thead>
										                 <tr>
										             <th>m1</th>
										             <th><?php echo $attachments; ?></th>
										              <th><?php echo $Serial_Number; ?></th>
										               <th><?php echo $employee_name; ?></th>
										                 <th><?php echo $status; ?></th>
										                <th><?php echo $Audit; ?></th>
										             </tr>
									                     </thead>
									                     
									                     
									                 <tbody id="row-sm">
							<?php
                             $noo=0;
                              //if($company_id=='all_company'){
                              
                              
                   
                              
                              
                              if(($urow['user_type']=='Top_Manager' or $urow['user_type']=='System_Manager')or($View_all_form_attachments==1)){
                              
                              $sql_fil="SELECT * FROM hr_forms_attachments_tbl where system_id='2222'AND company_id IN ('$ids_top_manager_companies') AND deleted='0' AND stop='0' ORDER BY `hr_forms_attachments_tbl`.`attach_id` DESC";
                              }else{
                           $sql_fil="SELECT * FROM hr_forms_attachments_tbl where dept_id ='$em_dept'  AND deleted='0' AND stop='0' ORDER BY `hr_forms_attachments_tbl`.`attach_id` DESC";
                              }
                             // }else{
                               // $sql_fil="SELECT * FROM hr_forms_attachments_tbl where system_id='2222'AND company_id='$company_id' 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;
                                         $noo++;
                                               ?>
										                 <tr>
										             <td><?php echo $noo; ?></td>
										             <td>

																		<ul class="team-members">
								                                           	<li>
								                                           	    <div class="card-file-thumb">
																
																		
																
																		<a href="../hr_files/<?php echo $row_fil['attach_link']; ?>" target="_new" data-bs-toggle="tooltip" title="" data-bs-original-title="<?php echo $row_fil['att_name']; ?>" aria-label="John Doe">
																<?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'){ ?>
																<img  class="fa" src="../hr_files/<?php echo $row_fil['attach_link']; ?>" alt="">
																		    
															
																			<?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><small style="font-size:12px;"><?php echo $row_fil['att_name']; ?>	</small>
								                             	        	</div>
																		</li>

									                               	</ul>	
										                 
										             </td>
										             <td><small class="text-success"><?php echo $row_fil['s_n']; ?></small></td>
										              <td>
										          <?php 
										           $sql_us="SELECT employ_id ,employ_name_ar,employ_name_en FROM hr_employ_tbl where employ_id='".$row_fil['add_user_id']."' ";
                                                   $result_us = $conn->query($sql_us);
                                                   if ($result_us->num_rows > 0) {
                                                   while($row_us = $result_us->fetch_assoc()) { 
                                                       ?>
                                                    <small style="font-size:12px;"><?php echo $row_us['employ_name_ar']; ?></small>
                                                       
                                                  <?php  }}
										          ?>        
										              </td>
										            
										               <td>
										                    <?php 
                                                        $s = 0;
                                                         $sql_co="SELECT * FROM hr_audit_options_tbl where att_type_id='".$row_fil["att_type_id"]."'";
                                                         $result_co = $conn->query($sql_co);
                                                          if ($result_co->num_rows > 0) {
                                                           while($row_co = $result_co->fetch_assoc()) {
                                                            $s++;
                                                           }}
                                                          // echo $s."</br>";
                                                        ?>
                                                        <?php 
                                                        $cc = 0;
                                                        $ff = 0;
                                                         $sql_cc="SELECT * FROM check_confirmation_tb where attach_id='".$row_fil["attach_id"]."'";
                                                         $result_cc = $conn->query($sql_cc);
                                                          if ($result_cc->num_rows > 0) {
                                                           while($row_cc = $result_cc->fetch_assoc()) {
                                                                $ff++; 
                                                               if($row_cc["stat"]=='1'){
                                                                 $cc++;   
                                                               }else{
                                                                  
                                                               }
                                                           
                                                           }}
                                                          // echo $cc."</br>";
                                                        ?>
                                                        <?php if($cc > 0 && $s > 0){?>
                                                            <span style="font-size:12px;" class="badge bg-inverse-warning">نسبة التطابق : <?php echo ($cc*100)/$s;?>%</span>
                                                            <?php }elseif($ff > 0 && $s > 0){ ?>
                                                                <span style="font-size:12px;" class="badge bg-inverse-warning">نسبة التطابق : <?php echo ($cc*100)/$s;?>%</s
                                                           <?php  }else{ ?>
                                                            <span style="font-size:12px;" class="badge bg-inverse-warning">قيد الانتظار</span>
                                                          <?php  } ?>
										               </td>        
										             
										              <td>
				<?php if(($urow['user_type']=='Top_Manager' or $urow['user_type']=='System_Manager')or($checking_forms==1)){ ?>
						<a href="hr_formslistt_audit.php?att_type_id=<?php echo $row_fil['att_type_id']; ?>&attach_id=<?php echo $row_fil['attach_id']; ?>&<?php echo $link_lang; ?>&company_id=<?php echo $company_id; ?>"target="_new" class="btn btn-warning btn-sm" id="btn_send"><?php echo $Audit; ?><i class="fa fa-calendar-check-o" aria-hidden="true"></i></button>
						<?php } ?>		  		              </td>
										              
										                
										                   

										             </tr>
										             <?php }} ?>
									                     </tbody>
									                     
														</table>
														</div>
												<!-- ===22table====================================================================== -->	
													</div>		
															


														</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> </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>');
 
});
 $(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();
var user_id = '<?php echo $urow["user_id"];?>';
var user_type = '<?php echo $urow["user_type"];?>';
//alert(user_type);
$.ajax({
    type: "POST",
    url: "../system_init/hr_dept_for_company_atts.php",
    data: {
      company_id_sel:company_id_sel,lang:lang,user_id:user_id,user_type:user_type				
    },
    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() { 
  });*/
    </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>
  $(".att_type").click(function(){
    
    var id = $(this).attr('id');
    var lang = $("#lang").val();
    var company_id = '<?php echo $company_id;?>';
    //alert(company_id);
    $.ajax({
    type: "POST",
    url: "hr_show_att_by_type.php",
    data: {
      id:id,lang:lang,company_id:company_id			
    },
    success: function(data) {
       $("#row-sm").html(data);
    },
    error:function(data){
        
       alert(data); //===Show Error Message====
    }
    }); 

  });
</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>




