	<!-- Add Department Modal -->
    <div id="add_salf_request" class="modal custom-modal fade" role="dialog">
					<div class="modal-dialog modal-dialog-centered" role="document">
						<div class="modal-content">
							<div class="modal-header">
                <?php 
                 if($lang=='ar'){$salf_request="طلب سلفه";}else{$salf_request="Advance Request";}
                ?>
								<h5 class="modal-title"><?php echo $salf_request; ?></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 clas="cmxform" id="signupForm" method="post" action="Salf_Request_modal_code.php" enctype="multipart/form-data" > 
					   
					   <div class="form-group">
			<input type="hidden" name="add_user_id" id="add_user_id" readonly value="<?php echo $urow['user_id']; ?>">
           	<input type="hidden" name="user_id_top_manager" id="user_id_top_manager" readonly value="<?php echo $user_id_top_manager; ?>">
           	 <input type="hidden" name="company_id" id="company_id" readonly value="<?php echo $company_id; ?>">
           	  <input type="hidden" name="system_id" id="system_id" readonly value="<?php echo $main_system_id; ?>"> 

           <input type="hidden" name="link_lang" id="link_lang" readonly value="<?php echo $link_lang; ?>">  
        <input type="hidden" name="lang" id="lang" readonly value="<?php echo $lang; ?>"> 
		   	<input type="hidden" name="messag_add" id="messag_add" readonly value="<?php echo $messag_add; ?>"> 
		   	<?php 
        function GetSeriaotherrr() {	
          $strings = '123456789';	
          $stringLength = strlen($strings);
          $newStrings = '';
          for ($i = 0; $i < 6; $i++) {
              $newStrings .= $strings[rand(0, $stringLength - 1)];
          }
          return $newStrings;
       }
        ?>
        	<input type="hidden" name="salf_id" id="salf_id" readonly value="<?php echo GetSeriaotherrr(); ?>">
		   	 </div>
			    
				
                <!--div class="form-group"style="font-size:14px; font-weight:;">
                 <label style="float:;">
            
                </label>
          
                       </div-->
                       
                  <div class="form-group">
				<lable><?php echo $the_companyr; ?></lable>
				<select clas="select" name="company_id_sel" id="company_id_sel" class="form-select"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 stop='0'AND company_id IN ('$ids')GROUP BY company_id ";
                     }else{
                      $sql_com="SELECT * FROM waseet_company_user_tbl where deleted='0'AND stop='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()) {
                          //  echo $row_com1['company_name_ar'];
                            if($lang=='ar'){$name_ar2=$row_com1['company_name_ar'];}else{$name_ar2=$row_com1['company_name_en'];}        
                            //  echo $name_ar2;
                          ?>
                   <option value="<?php echo $row_com1['company_id']; ?>"><?php echo $name_ar2; ?> </option>
					<?php  }} }}  ?>	
					</select>
					</div>
          <?php  
					if($lang=='ar'){$amount="المبلغ";}else{$amount="amount";}
                   if($lang=='ar'){$details="سبب طلب السلفه";}else{$details="The reason for requesting the advance";}
          ?>
				<div class="form-group"style="font-size:14px; font-weight:;">
                <label style="float:;">
                <?php echo $amount; ?>
                </label>                                          
                 
                <input type="number" step="0.01" name="amount" id="amount" class="form-control"style="font-size:14px; font-weight:bold;" >
               
                </div>
                <div class="form-group"style="font-size:14px; font-weight:;">
                <label style="float:;">
                <?php echo $details; ?>
                </label>                                          
                 
                <input type="text" name="details" id="details" class="form-control"style="font-size:14px; font-weight:bold;">
               
                </div>
                
                
                <?php
                //include("../Function/hr_all_function_code.php");
                echo fileadd(); 
                ?>
                
                
                
                		
						<div class="modal-footer ">
					    <input type="submit" name="sav_btn" id="sav_btn" style="display:non;" class="btn btn-primary me-2" value="<?php echo $save; ?>">
						<button type="button" class="btn btn-secondary" data-bs-dismiss="modal"><?php echo $cancel; ?></button>
					</div>		
								
								
								</form>
							</div>
						</div>
					</div>
				</div>
				<!-- /Add Department Modal -->
                <script src="../../assets/js/jquery-3.6.0.min.js"></script>
                
                
      		<!--script>
      		$("#add_ff").click(function(){
      		    alert();
                	});
                	
      		</script--> 
      		
    <script>
  $(document).ready(function(e) {
   var i=0;
	$('#add_ff').click(function(){
    i++;
	 //var button_add = $(this).attr('data-id');   
      //var date_did = $("#date_did"+i).val();

   // $('#dynamic_fiel_ff').append('<tr id="row'+i+'"style="border-bottom:1px solid;"> <td colspan="3"> <div class="col-lg-12">	<label clas="col-lg-3 col-form-label"><?php echo $attachments_types; ?>mmm</label> <input type="hidden" name="hidden[]" value="'+i+'"> <select styl="font-size:9px;width:100%;" name="att_type_id'+i+'" id="att_type_id'+i+'" class="form-select" required="">	<option value=""> <?php echo $select.$space.$attachments_types; ?></option>   <option value="basic_files"> <?php echo $basic_attachments;?> </option>    <option value="employ_other_files">  <?php echo $other_file;?> </option> <?php $sql_empp2="SELECT * FROM hr_employ_tbl where employ_id='$employ_id' "; $result_empp2 = $conn->query($sql_empp2); if ($result_empp2->num_rows > 0) {  while($row_empp2 = $result_empp2->fetch_assoc()) {  $sql_ta2="SELECT * FROM hr_attachments_type_tbl where   stop='0' AND deleted='0' ";   $result_ta2 = $conn->query($sql_ta2); if ($result_ta2->num_rows > 0) { while($row_ta2 = $result_ta2->fetch_assoc()) { if($lang=='ar'){$att_type_name=$row_ta2['att_type_name_ar'];}else{$att_type_name=$row_ta2['att_type_name_en'];} ?>	 <option value="<?php echo $row_ta2["att_type_id"];?>"> <?php echo $row_ta2['att_type_name_ar'];?></option><?php }} }} ?></select></div> </td>  </tr>  <tr id="row"style="border-bottom:1px solid;"><td><div class="col-lg-12">  <label> <?php echo $file_name; ?></label> <input type="text" name="att_name'+i+'" id="att_name'+i+'" class="form-control" placeholder="Enter File Name" required="">   </div></td> <td></td><td> <div class="col-lg-12"> <label> <?php echo $file; ?> </label><input id="imageFile'+i+'" name="imageFile'+i+'" type="file" class="form-control" required="" /> </div> </td></tr>');
   $('#dynamic_fiel_ff').append('<tr style="border-bottom:1px solid;" id="row_ff'+i+'"><td><div class="col-lg-12" style="max-width: 100%;"><label>File Name</label><input type="hidden" name="hidden[]" value="'+i+'"><input type="text" style="color:; height:35px;"  placeholder="Enter File Name" name="att_name'+i+'" id="att_name'+i+'" class="form-control" required=""></div></div></td><td><div class="col-lg-12" style="max-width: 100%;"><label>File</label><input id="imageFile'+i+'" name="imageFile'+i+'"style="color:; height:35px;"  type="file" class="form-control" required=""/></div></div></td><td><div class="col-lg-12" style="max-width: 100%;"><button type="button" name="remove" id="btn_remove'+'" data-id="'+i+'" class="btn btn-danger btn_remove">X</button></div></td></tr>');

  });
  
 $(document).on('click', '#btn_remove', function(){
    var button_id = $(this).attr("data-id"); 
		$('#row_ff'+button_id+'').remove();
	});
  
});
  </script>  
  
  
  
      <!--script>
  function Add_file(){    
  $(document).ready(function(e) {
   var i=0;
	$('#add_ff').click(function(){
    i++;
	 //var button_add = $(this).attr('data-id');   
      //var date_did = $("#date_did"+i).val();

   // $('#dynamic_fiel_ff').append('<tr id="row'+i+'"style="border-bottom:1px solid;"> <td colspan="3"> <div class="col-lg-12">	<label clas="col-lg-3 col-form-label"><?php echo $attachments_types; ?>mmm</label> <input type="hidden" name="hidden[]" value="'+i+'"> <select styl="font-size:9px;width:100%;" name="att_type_id'+i+'" id="att_type_id'+i+'" class="form-select" required="">	<option value=""> <?php echo $select.$space.$attachments_types; ?></option>   <option value="basic_files"> <?php echo $basic_attachments;?> </option>    <option value="employ_other_files">  <?php echo $other_file;?> </option> <?php $sql_empp2="SELECT * FROM hr_employ_tbl where employ_id='$employ_id' "; $result_empp2 = $conn->query($sql_empp2); if ($result_empp2->num_rows > 0) {  while($row_empp2 = $result_empp2->fetch_assoc()) {  $sql_ta2="SELECT * FROM hr_attachments_type_tbl where   stop='0' AND deleted='0' ";   $result_ta2 = $conn->query($sql_ta2); if ($result_ta2->num_rows > 0) { while($row_ta2 = $result_ta2->fetch_assoc()) { if($lang=='ar'){$att_type_name=$row_ta2['att_type_name_ar'];}else{$att_type_name=$row_ta2['att_type_name_en'];} ?>	 <option value="<?php echo $row_ta2["att_type_id"];?>"> <?php echo $row_ta2['att_type_name_ar'];?></option><?php }} }} ?></select></div> </td>  </tr>  <tr id="row"style="border-bottom:1px solid;"><td><div class="col-lg-12">  <label> <?php echo $file_name; ?></label> <input type="text" name="att_name'+i+'" id="att_name'+i+'" class="form-control" placeholder="Enter File Name" required="">   </div></td> <td></td><td> <div class="col-lg-12"> <label> <?php echo $file; ?> </label><input id="imageFile'+i+'" name="imageFile'+i+'" type="file" class="form-control" required="" /> </div> </td></tr>');
   $('#dynamic_fiel_ff').append('<tr style="border-bottom:1px solid;" id="row_ff'+i+'"><td><div class="col-lg-12" style="max-width: 100%;"><label>File Name</label><input type="hidden" name="hidden[]" value="'+i+'"><input type="text" style="color:; height:35px;"  placeholder="Enter File Name" name="att_name'+i+'" id="att_name'+i+'" class="form-control" required=""></div></div></td><td><div class="col-lg-12" style="max-width: 100%;"><label>File</label><input id="imageFile'+i+'" name="imageFile'+i+'"style="color:; height:35px;"  type="file" class="form-control" required=""/></div></div></td><td><div class="col-lg-12" style="max-width: 100%;"><button type="button" name="remove" id="btn_remove'+'" data-id="'+i+'" class="btn btn-danger btn_remove">X</button></div></td></tr>');

  });
  
 $(document).on('click', '#btn_remove', function(){
    var button_id = $(this).attr("data-id"); 
		$('#row_ff'+button_id+'').remove();
	});
  
});

}
  </script--> 
      		
      		
				<script>
    /*$("#company_id_sel").change(function(){
       
var company_id_sel = $("#company_id_sel").val(); 
var lang = $("#lang").val();
//عرض الموظفين
$.ajax({
    type: "POST",
    url: "hr_employ_for_company_v.php",
    data: {
      company_id_sel:company_id_sel,lang:lang				
    },
    success: function(data) {
       $("#employ_id").html(data);
    },
    error:function(data){
        
       alert(data); //===Show Error Message====
    }
    }); 
// عرض الحسابات
$.ajax({
    type: "POST",
    url: "hr_account_for_company_v.php",
    data: {
      company_id_sel:company_id_sel,lang:lang				
    },
    success: function(data) {
       $("#account_number").html(data);
    },
    error:function(data){
        
       alert(data); //===Show Error Message====
    }
    });
  });*/
    </script>
				
				
				
				