<?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 $Add_attendance_and_leave_Excel; ?></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 $Add_attendance_and_leave_Excel; ?></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($hr_add_dept==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("connect_shift_modal.php");?>
								<!--a href="#" class="btn add-btn m-r-5" data-bs-toggle="modal" data-bs-target="#add_custom_policy"><?php echo $Add_attendance_and_leave_Excel; ?></a-->
								<!--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 -->
					
			
					
					
					
		<?php 
			if(($urow['user_type']=='Top_Manager' or $urow['user_type']=='System_Manager')or($hr_add_att_excel==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($hr_add_att_excel==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_waseet_employ_shift_tbl';
              
                $id_name='waseet_id';
                  $proccess_details_delete='حذف شفت الموظف رقم  '.$modal_id;
                   $proccess_details_en_delete='Delete Shift Employee Number'.$modal_id;
                  $proccess_details_delete_disable='الغاء تنشيط فت الموظف رقم '.$modal_id;
                $proccess_details_en_delete_disable='Disable Shift Employee Number'.$modal_id;
               
                $proccess_details_enable=' تنشيط شفت الموظف رقم '.$modal_id;
                 $proccess_details_en_enable='Enable Shift Employee 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="card">
			<div class="card-body"> 

          <div class="card-header">
			<h3 class="card-title mb-0"><?php echo $the_attendance_file; ?> (نفس النموذج في جهاز البصمه تحميل ورفع بصيغة csv فقط)</h3>
			</div>
			
          <div class="row"> 
          
          <table class="table" style="border:1px solid gray;">
									<thead>
									<tr class="bg-secondary text-white">
									<th><?php echo $The_employee_number_fingerprint_device; ?></th>
											<th><?php echo $employee_name; ?></th>
											<th>القسم<?php //echo $employee_name; ?></th>
											<th><?php echo $the_date; ?></th>
											<th>اليوم<?php //echo $the_date; ?></th>
											<th><?php echo $Start_Time; ?></th>
											<th> <?php echo $End_Time; ?> </th>
											<th>الوقت الإجمالي</th>
										</tr>
									</thead>
									<tbody>
								<tr class="D">
						<td>7	
							</td>
							
							<td>
						    اسم الموظف	
							</td>
							
								<td>
						 MarsaIntils
							</td>
							
							<td>
							  سنه -شهر - يوم  	
							</td>	
							
								<td>
						        اليوم 	
							</td>
							

							<td>
							   9:3 
							</td>
						
							<td>
						      17:00
							</td>
							
							<td>
						   الوقت الإجمالي
							</td>
							
							</tr>
								</tbody>
								</table>
          
	
								
		
				 </div>
           
           </div>
           </div>
           
           
           
            <div class="card">
			<div class="card-body"> 
           <form clas="form-horizontal well" action="hr_add_att_excel_Code.php" method="post" name="upload_excel" enctype="multipart/form-data">
        
        <input type="hidden" name="add_user_id" id="add_user_id" readonly value="<?php echo $urow['user_id']; ?>">
        <input type="hidden" name="link_lang" id="link_lang" value="<?php echo $link_lang; ?>">
        <input type="hidden" name="company_id" id="company_id" value="<?php echo $company_id; ?>">
        
         <input type="hidden" name="user_id_top_manager" id="user_id_top_manager" readonly value="<?php echo $user_id_top_manager; ?>"> 
        

          <div class="card-header">
			<h3 class="card-title mb-0"><?php echo $Upload_the_attendance_file; ?></h3>
			</div>
			
          <div class="row"> 
          	<div class="col-lg-6" clas="col-sm-6" >
          <div class="form-group">
			<label class="col-lg-3 col-form-label"><?php echo $form; ?></label>
			<div class="col-lg-7">
			<!--input type="file" class="form-control"-->
		
			<!--a class="file-upload-browse btn btn-info" clas="btn btn-primary" href="form_excel_chefz/Attendance_form_2023_nnn.xlsx"><?php echo $Download_the_attendance_file; ?></a-->
		
		<a class="file-upload-browse btn btn-info" clas="btn btn-primary" href="#"><?php echo $Download_the_attendance_file; ?></a>

			<!--span class="form-text text-muted">Recommended image size is 200px x 40px</span-->
			</div>
			</div>
				</div>
				
			<div class="col-lg-6" clas="col-sm-6">
          <div class="form-group">
			<label class="col-lg-3 col-form-label"><?php echo $Attendance_file; ?></label>
			<div class="col-lg-7">
			<input type="file" name="file" id="file" class="form-control" required>
			<!--span class="form-text text-muted">Recommended image size is 200px x 40px</span-->
			</div>
			</div>
				</div> 
				 
				  
				  
				
				
		<div class="col-lg-6" clas="col-sm-6">
          <div class="form-group">
			<label class="col-lg-3 col-form-label"></label>
			<div class="col-lg-7">
	<input type="submit" name="sav_btn" id="sav_btn" style="display:non;" class="btn btn-primary me-2" value="UPLOAD">
			</div>
			</div>
				</div>
				</form>
								
										    
				<!--div class="form-group">
				<lable>الشفتات</lable>
				<select clas="select" name="shift_id" id="shift_id" class="form-select" required="">
				
					</select>
					</div>  
					</div-->
					
				 </div>
           
           </div>
           </div>
           
           
            <?php  $info_type=$_GET['info_type'];  
                //echo $info_type;
                if($info_type=='takeed' or($info_type=='')){$classb='nav-link b active';}else{$classb='nav-link b ';}
                if($info_type=='pr'){$classc='nav-link b active';}else{$classc='nav-link b ';}
                if($info_type=='gh'){$classd='nav-link b active';}else{$classd='nav-link b ';}
                
                ?>
           		
			
           

                </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>
        
          <!-- 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>
      
<!-- Multiselect JS -->
		<script src="../../assets/js/multiselect.min.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>
$('.all_ch_att').click(function(event) { 
   var id = [];
            if(this.checked) { 
                $('.ch_att').each(function(i) { 
                  if(i<30){
                    this.checked = true;
                    id[i] = $(this).val(); 
                  }    
                });
            }else{
                $('.ch_att').each(function() {
                    this.checked = false; 
                });        
            }
        });
        </script>
        
        
        
                  <script>
//إرسال مسائله لعدد من الموظفين

$("#btn_mosala").click(function(){
      if(confirm("هل انت متاكد انك تريد إرسال المسائله ؟")){
        var id = [];
         var employ_id = [];
          var hodor_ensraf_date = [];
          var mosala_type = [];
            var add_user_id=$('#add_user_id').val();
       alert(add_user_id);
          //var att_abs_date = $("#att_abs_date").val();

         // var att_or_abs_or_late = $('#att_or_abs_or_late').find(":selected").val();
        $(":checkbox:checked").each(function(i){
          id[i] = $(this).val();
             
               
          employ_id1=$('#employ_id'+id[i]).val();
          employ_id.push(employ_id1);
         
          hodor_ensraf_date1=$('#hodor_ensraf_date'+id[i]).val();
          hodor_ensraf_date.push(hodor_ensraf_date1);
          
          mosala_type1=$('#mosala_type'+id[i]).val();
          mosala_type.push(mosala_type1);

        

        });

        if(id.length == 0){
          alert("اختر على الاقل احد الموظفين لإرسال المسائله !");

        }else{

      $.post('hr_mosala_Codeee.php', {'id':id,'employ_id':employ_id,'hodor_ensraf_date':hodor_ensraf_date,'mosala_type':mosala_type,'add_user_id':add_user_id}, function(r) {
              // alert("تمت عملية التسجيل بنجاح");
              alertify.error(message_success);
               if(r==1){
                for( var i=0; i<id.length; i++){
         $(".D"+id[i]+'').css("background-color", "#ccc");
         $(".D"+id[i]+'').fadeOut("slow");

         }
               }
               window.location.reload();
              }); 
              
        }

      }else{
        return false;

      }

    });

     </script>
     
     
     <script>
//تعديل الحضور والإنصراف

$("#btn_takeed").click(function(){
      if(confirm("هل انت متاكد انك تريد إرسال التعديل ؟")){
        var id = [];
         var employ_id = [];
          var hodor_ensraf_date = [];
          var mosala_type = [];
             var hodor_time = [];
              var ensraf_time = [];
      var j = 0;
      
          //var att_abs_date = $("#att_abs_date").val();

         // var att_or_abs_or_late = $('#att_or_abs_or_late').find(":selected").val();
        $(":checkbox:checked").each(function(i){
          id[i] = $(this).val();
            // alert(id);
              
          employ_id1=$('#employ_id'+id[i]).val();
          employ_id.push(employ_id1);
         
          hodor_ensraf_date1=$('#hodor_ensraf_date'+id[i]).val();
          hodor_ensraf_date.push(hodor_ensraf_date1);
          
          mosala_type1=$('#mosala_type'+id[i]).val();
          mosala_type.push(mosala_type1);
         
           
          hodor_time1=$('#hodor_time'+id[i]).val();
          hodor_time.push(hodor_time1);
          
           
            ensraf_time1=$('#ensraf_time'+id[i]).val();
          ensraf_time.push(ensraf_time1);
          
           //alert(hodor_time1);
           //alert(ensraf_time1);
           if((hodor_time1==ensraf_time1) || (hodor_time1>ensraf_time1)){
               j++;
           }else{}

        });
        if(id.length == 0){
          alert("اختر  الاقل احد الموظفين لتأكيد التعديل !");

        }else{
if(j>0){
   alert("لا يمكن ان يكون وقت الحضور اكبر او يساوي وقت الانصراف"); 
}else{
    
      $.post('hr_takeed_edit_att_Code.php', {'id':id,'employ_id':employ_id,'hodor_ensraf_date':hodor_ensraf_date,'mosala_type':mosala_type,'hodor_time':hodor_time,'ensraf_time':ensraf_time}, function(r) {
          //     alert("تمت عملية التسجيل بنجاح");
              alertify.success(message_success);
               if(r==1){
                for( var i=0; i<id.length; i++){
         $(".D"+id[i]+'').css("background-color", "#ccc");
         $(".D"+id[i]+'').fadeOut("slow");

         }
               }
               window.location.reload();
              }); 
              
        }}

      }else{
        return false;

      }

    });

     </script>
        
        
        
        
      
       
       	<!--script>
        $('.b').click(function() {
		   $('.nav-link').removeClass('active');
		   $(this).addClass('active');
		});
      </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>




