<?php
session_start();
if(!isset ($_SESSION['user_id'])){
	header("Location:../login.php?msg=Log in first");
    exit();
}else{
	
	include('../Server/connection.php');
	include('includes/session.php');
	echo "<div class='div-request div-hide'>editOrd</div>";
    	
?>

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <!-- Meta, title, CSS, favicons, etc. -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

	
	 <?php
  include 'title.php';
         ?>
	
	
	<link type = "image/png" rel="icon" href="images/brvision.png" />

    <!-- Bootstrap must-->
    <link href="../vendors/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
	
    <!-- Font Awesome must-->
    <link href="../vendors/font-awesome/css/font-awesome.min.css" rel="stylesheet">
	
	<!-- custom css -->
    <link rel="stylesheet" href="custom/css/custom.css">
	
    <!-- NProgress must-->
    <link href="../vendors/nprogress/nprogress.css" rel="stylesheet">
	
    <!-- Custom Theme Style must-->
    <link href="../build/css/custom.min.css" rel="stylesheet">
	
	
	
	<!-- must-->
	<script src="assests/jquery/jquery.min.js"></script>
	
	<script type="text/javascript" src="https://ajax.aspnetcdn.com/ajax/jquery.validate/1.13.1/jquery.validate.min.js"></script>
    <script type="text/javascript" src="https://ajax.aspnetcdn.com/ajax/jquery.validate/1.13.1/additional-methods.min.js"></script>
	
  <!-- jquery ui -->  
  <link rel="stylesheet" href="assests/jquery-ui/jquery-ui.min.css">
  <script src="assests/jquery-ui/jquery-ui.min.js"></script>
	
  <!-- Must Bootstrap -->
    <script src="../vendors/bootstrap/dist/js/bootstrap.min.js"></script>
	
	<style>
  .error {
    color: #F00;
}  

</style>
	
	<script type="text/javascript">
$(document).ready(function(){
    $('#relId').on('change',function(){
        var regID = $(this).val();
        if(regID){
            $.ajax({
                type:'POST',
                url:'rajaxData.php',
                data:'relId='+regID,
                success:function(html){
                    $('#denId').html(html);
                }
            }); 
        }else{
            $('#denId').html('<option value="">Select Religion First</option>');
        }
    });

});
</script>

<script type="text/javascript">
$(document).ready(function(){
    $('#deptId').on('change',function(){
        var regID = $(this).val();
        if(regID){
            $.ajax({
                type:'POST',
                url:'ajaxData.php',
                data:'deptId='+regID,
                success:function(html){
                    $('#desId').html(html);
                }
            }); 
        }else{
            $('#desId').html('<option value="">Select Department First</option>');
        }
    });

});
</script>
	
  </head>

  <body class="nav-md">
  
    <div class="container body">
	
      <div class="main_container">
        <div class="col-md-3 left_col">
          <div class="left_col scroll-view">
		  
             <?php  
		include 'includes/role.php';
               ?>

            <div class="clearfix"></div>
            
			
			<?php
            include 'includes/profile.php';
			print '</br></br>';
			include 'includes/menu.php';
			?>


           

        <!-- page content -->
        <div class="right_col" role="main">
          <div class="">
		  
			
			
            <div class="clearfix"></div>

            <div class="row">
              <div class="col-md-12 col-sm-12 col-xs-12">
                <div class="x_panel">
                  <div class="x_title">
				  
                    <a href="manage_staff.php">  <h2><span class="glyphicon glyphicon-step-backward"></span> Back</h2></a>
					
					<?php
				$staff_id = $_GET['i'];
				$sql81 = "SELECT * FROM staff WHERE staff_id = {$staff_id}";
				$result81 = $conn->query($sql81);
				while($data81 = mysqli_fetch_array($result81))
							{
							$firstname = $data81['firstname'];
							$middlename = $data81['middlename'];
							$lastname = $data81['lastname'];
							$staff_tin = $data81['staff_tin'];
							$gender_id = $data81['gender_id'];
							$email = $data81['email'];
							$PhoneNumber = $data81['phone_number'];
							$birthDate = $data81['birth_date'];
							$employDate = $data81['emply_date'];
							$birth_date = date('d-m-Y', strtotime($birthDate));
                            $employment_date = date('d-m-Y', strtotime($employDate));
							$n = substr($PhoneNumber,3);
                            $n1 = '0';
                            $phone_number = $n1.$n;
							$marital_id = $data81['marital_id'];
							$dept_id = $data81['dept_id'];
							$sect_id = $data81['sect_id'];
							$des_id = $data81['des_id'];
							$eduLevel_id = $data81['eduLevel_id'];
							$emply_type_id = $data81['emply_type_id'];
							$cont_dur_id = $data81['cont_dur_id'];
							$staffcate_id = $data81['staffcate_id'];
							$rel_status = $data81['rel_status'];
							$religion_id = $data81['religion_id'];
							$denom_id = $data81['denom_id'];
							$region_id = $data81['region_id'];
							$district_id = $data81['district_id'];
							$ward_id = $data81['ward_id'];
							$BasicSalary = $data81['BasicSalary'];
							$HeStatusId = $data81['HesBenId'];
							$bankName = $data81['bankName'];
							$BankAccountNo = $data81['BankAccountNo'];
							$nssf_no = $data81['nssf_no'];
							$nhif_no = $data81['nhif_no'];
				            }	
                           
						   if(!empty($cont_dur_id)){

                         $sql81z = "SELECT * FROM staff_contracts WHERE cont_dur_id = {$cont_dur_id} and staff_id='$staff_id' order by contract_id desc limit 1";
				$result81z = $conn->query($sql81z);
				while($data81z = mysqli_fetch_array($result81z))
							{
							$contStart = $data81z['contract_start'];
							}
                             }else{
                            $contStart = '';
							 }								 
				      ?>
					
					
					
                    <ul class="nav navbar-right panel_toolbox">
                      <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
                      </li>
                      
                     
                    </ul>
                    <div class="clearfix"></div>
                  </div>
				  
				
				<div class="x_content" style="overflow: auto;">
				
				<?php if (isset($_SESSION['success_message']) && !empty($_SESSION['success_message'])) { ?>
                        <div class="success-message" style="margin-bottom: 20px;font-size: 20px;color: green;"><?php echo $_SESSION['success_message']; ?></div>
                        <?php
                        unset($_SESSION['success_message']);
                    }
                    ?>	
				 
				  <div class="success-messages"></div> <!--/success-messages-->

               <form class="form-horizontal" method="POST" action="php_action/editStaff.php" enctype="multipart/form-data">
			   
			    <input type="hidden" name="staff_id" value="<?php echo $staff_id; ?>">
				
				  <div class="controls">
			  <div class="row">
			  

			  <div class="col-sm-4">
			  <div class="form-group">
                 <label for="form_name"> Staff First Name </label>
                 <input  type="text" class="form-control" id="fname" name="fname"  value="<?php echo $firstname; ?>" placeholder="Staff First Name" autocomplete="off" />
                    <br/>
                         <label for="fname" class="error" generated="true"></label>  
                    </div>
			  </div>
			  
			  <div class="col-sm-4">
			  <div class="form-group">
			  
			  <label for="form_name"> Staff Middle Name </label>
                 <input  type="text" class="form-control" id="mname" name="mname"  value="<?php echo $middlename; ?>" placeholder="Staff Middle Name" autocomplete="off" />
                 <br/>
                         <label for="mname" class="error" generated="true"></label>  
                      
                    </div>
			  </div>
			  
			  <div class="col-sm-4">
			  <div class="form-group">
			  
			  <label for="form_name"> Staff Last Name </label>
                 <input  type="text" class="form-control" id="lname" name="lname"  value="<?php echo $lastname; ?>" placeholder="Staff Last Name" autocomplete="off"/>
                 <br/>
                         <label for="lname" class="error" generated="true"></label>
                      
                    </div>
			  </div>
			 
			  
			  	</div>	  
                </div>
				
				
				<div class="controls">
			  <div class="row">
			  
			  <div class="col-sm-4">
			  <div class="form-group">
                 <label for="form_name"> Staff TIN </label>
                 <input  type="text" class="form-control" id="tin" name="tin"  value="<?php echo $staff_tin; ?>" placeholder="Staff TIN" autocomplete="off" />
                    <br/>
                         <label for="tin" class="error" generated="true"></label>  
                    </div>
			  </div>
			  
			  <div class="col-sm-3">
			  <div class="form-group">
                 <label for="form_name"> Staff Nssf No </label>
                 <input  type="text" class="form-control" id="nssf_no" name="nssf_no" value="<?php echo $nssf_no; ?>"  placeholder="Staff Nssf No" autocomplete="off" />
                    <br/>
                         <label for="nssf_no" class="error" generated="true"></label>  
                    </div>
			  </div>
			  

			  <div class="col-sm-2">
			  <div class="form-group">
                 <label for="form_name"> Staff Gender</label>
				  <select class="form-control" name="gender_id" id="gender_id" autocomplete="off" />
				
			  						<?php
			  							$productSql = "SELECT * from gender where gender_id='$gender_id'";
			  							$productData = $conn->query($productSql);

			  							while($row = $productData->fetch_array()){									 		
			  								echo "<option value='".$row['gender_id']."'>".$row['gender_name']."</option>";
										 	} // /while 
											
									   $productSql1 = "SELECT * from gender where gender_id!='$gender_id'";
			  							$productData1 = $conn->query($productSql1);

			  							while($row1 = $productData1->fetch_array()){									 		
			  								echo "<option value='".$row1['gender_id']."'>".$row1['gender_name']."</option>";
										 	} // /while

			  						?>
		  						</select>
                      <br/>
                         <label for="gender_id" class="error" generated="true"></label>  
                    </div>
			  </div>
			  
			  
			   <div class="col-sm-3">
			  <div class="form-group">
                 <label for="form_name"> Staff Email Address </label>
                 <input  type="email" class="form-control" id="email" name="email" value="<?php echo $email; ?>" placeholder="Staff Email Address" autocomplete="off" />
                    <br/>
                         <label for="email" class="error" generated="true"></label>  
                    </div>
			  </div>
			  
			  
			
			  	</div>	  
                </div>
				
						<div class="controls">
			  <div class="row">
			  
			  <div class="col-sm-3">
			  <div class="form-group">
                 <label for="form_name"> Staff Phone Number </label>
                 <input  type="tel" class="form-control" id="phone" name="phone" value="<?php echo $phone_number; ?>" placeholder="Staff Phone Number" autocomplete="off" />
                    <br/>
                         <label for="phone" class="error" generated="true"></label>  
                    </div>
			  </div>
			  
			   <div class="col-sm-3">
			  <div class="form-group">
                 <label for="form_name"> Staff Nhif Number </label>
                 <input  type="tel" class="form-control" id="nhif_no" name="nhif_no" value="<?php echo $nhif_no; ?>" placeholder="Staff Nhif Number" autocomplete="off" />
                    <br/>
                         <label for="nhif_no" class="error" generated="true"></label>  
                    </div>
			  </div>
			  
			  <div class="col-sm-3">
			  <div class="form-group">
                 <label for="form_name"> Staff Birth Date </label>
                 <input  type="text" class="form-control" id="bdate" name="bdate"  value="<?php echo $birth_date; ?>" placeholder="Staff Birth Date" autocomplete="off" />
                    <br/>
                         <label for="bdate" class="error" generated="true"></label>  
                    </div>
			  </div>
			  
			  <div class="col-sm-3">
			  <div class="form-group">
                 <label for="form_name"> Staff Employment Date </label>
                 <input  type="text" class="form-control" id="empdate" name="empdate"  value="<?php echo $employment_date; ?>" placeholder="Staff Employment Date" autocomplete="off" />
                    <br/>
                         <label for="empdate" class="error" generated="true"></label>  
                    </div>
			  </div>
			  

			
			  	</div>	  
                </div>
				
			<div class="controls">
			  <div class="row">
			  
			   <div class="col-sm-3">
			  <div class="form-group">
                 <label for="form_name"> Staff Marital Status</label>
				  <select class="form-control" name="marital_id" id="marital_id" autocomplete="off" />
				     
			  						<?php
			  							$productSql1 = "SELECT * from marital_status where marital_id='$marital_id'";
			  							$productData1 = $conn->query($productSql1);

			  							while($row1 = $productData1->fetch_array()){									 		
			  								echo "<option value='".$row1['marital_id']."'>".$row1['marital_name']."</option>";
										 	} // /while 
											
										$productSql1x = "SELECT * from marital_status where marital_id!='$marital_id'";
			  							$productData1x = $conn->query($productSql1x);

			  							while($row1x = $productData1x->fetch_array()){									 		
			  								echo "<option value='".$row1x['marital_id']."'>".$row1x['marital_name']."</option>";
										 	} // /while 

			  						?>
		  						</select>
                      <br/>
                         <label for="marital_id" class="error" generated="true"></label>  
                    </div>
			  </div>
			  
			  <div class="col-sm-3">
			  <div class="form-group">
                 <label for="form_name"> Does Staff Has Religion?</label>
				 </br>
		 <?php	
                 $sql421 = "SELECT * FROM staff where staff_id='$staff_id'";	
        $result421 = $conn->query($sql421); 
		while ($row421 = mysqli_fetch_array($result421))
		{
			
			$relStatus22 = $row421['rel_status'];
	
		?>			
				 
				 <label class="radio-inline">
          <input type="radio" name="rel_status" value="Have Religion" id="rel_status" <?php if($relStatus22=='Have Religion'){ echo "checked";}?> /> Yes
         </label>&nbsp&nbsp&nbsp&nbsp
         <label class="radio-inline">
          <input type="radio" name="rel_status" value="Atheists" id="rel_status" <?php if($relStatus22=='Atheists'){ echo "checked";}?> /> No
         </label>&nbsp&nbsp&nbsp&nbsp
				 
		<?php
		                }
						?>		
				    
              </div>
			  </div>
			  
			  <?php
			if($rel_status=='Have Religion'){  
			  ?>
			  
			  <div id="textboxes1">	
			  <div class="col-sm-3">
			  <div class="form-group">
                 <label for="form_name"> Staff Religion </label>
				 <select class="form-control" name="relId" id="relId">
			  						<?php
			  							$productSql2 = "SELECT religions.religion_id,religions.religion_name FROM religions where religion_id='$religion_id'";
			  							$productData2 = $conn->query($productSql2);
			  							while($row2 = $productData2->fetch_array()){									 		
			  								echo "<option value='".$row2['religion_id']."'>".$row2['religion_name']."</option>";
										 	} // /while 
                                         
									    $productSql3 = "SELECT religions.religion_id,religions.religion_name FROM religions where religion_id!='$religion_id'";
			  							$productData3 = $conn->query($productSql3);
			  							while($row3 = $productData3->fetch_array()){									 		
			  								echo "<option value='".$row3['religion_id']."'>".$row3['religion_name']."</option>";
										 	} // /while 
			  						?>
		  						</select>
				 
                    <br/>
                         <label for="relId" class="error" generated="true"></label>  
                    </div>
			  </div>
			  
			  <div class="col-sm-3">
			  <div class="form-group">
                 <label for="form_name"> Staff Denomination </label>
                 <select class="form-control" name="denId" id="denId">
				 <?php
				 $productSql32 = "SELECT * FROM denomination where denom_id='$denom_id' and religion_id='$religion_id'";
			  							$productData32 = $conn->query($productSql32);
			  							while($row32 = $productData32->fetch_array()){									 		
			  								echo "<option value='".$row32['denom_id']."'>".$row32['denom_name']."</option>";
										 	} // /while 
											
				$productSql33 = "SELECT * FROM denomination where denom_id!='$denom_id' and religion_id='$religion_id'";
			  							$productData33 = $conn->query($productSql33);
			  							while($row33 = $productData33->fetch_array()){									 		
			  								echo "<option value='".$row33['denom_id']."'>".$row33['denom_name']."</option>";
										 	} // /while 
											?>
			  					
		  						</select>  
                    <br/>
                         <label for="denId" class="error" generated="true"></label>  
                    </div>
			  </div>
			  
             </div>
			 
			 <?php
               }else{
			 ?>
			 
			
             <div id="textboxes1" style="display: none">			 
			  <div class="col-sm-3">
			  <div class="form-group">
                 <label for="form_name"> Staff Religion </label>
                 
				 <select class="form-control" name="relId" id="relId">
			  						<option value="">~~SELECT~~</option>
			  						<?php
			  							$productSql2 = "SELECT religions.religion_id,religions.religion_name FROM religions ORDER BY religion_name";
			  							$productData2 = $conn->query($productSql2);
			  							while($row2 = $productData2->fetch_array()){									 		
			  								echo "<option value='".$row2['religion_id']."'>".$row2['religion_name']."</option>";
										 	} // /while 

			  						?>
		  						</select>
				 
                    <br/>
                         <label for="relId" class="error" generated="true"></label>  
                    </div>
			  </div>
			  
			  <div class="col-sm-3">
			  <div class="form-group">
                 <label for="form_name"> Staff Denomination </label>
                 <select class="form-control" name="denId" id="denId">
			  						<option value="">~~SELECT~~</option>
		  						</select>  
                    <br/>
                         <label for="denId" class="error" generated="true"></label>  
                    </div>
			  </div>
			  
             </div>
			 
			 <?php
               }
			 ?>
			
			  	</div>	  
                </div>
				
			
			 <div class="controls">
			  <div class="row">
			  
			   <div class="col-sm-3">
			  <div class="form-group">
                 <label for="form_name"> Staff Category </label>
				 </br>
				 <?php
				
							$sql42133 = "SELECT staff.staffcate_id FROM staff where staff.staffcate_id='$staffcate_id' and staff.staff_id='$staff_id'";	
        $result42133 = $conn->query($sql42133); 
		while ($row42133 = mysqli_fetch_array($result42133))
		{
			$staffcate_id42133 = $row42133['staffcate_id'];
			//$mode_name41 = $row421['staffcate_name'];
	 
		?>
		
		                 <label class="radio-inline">
          <input type="radio" id="staffcate_id" name="staffcate_id" value="1" <?php if($staffcate_id42133==1){ echo "checked";}?> /> Normal Staff
         </label>
		 </br>
		 
		 <label class="radio-inline">
          <input type="radio" id="staffcate_id" name="staffcate_id" value="2" <?php if($staffcate_id42133==2){ echo "checked";}?> /> Section Head
         </label>
		 </br>
		  <label class="radio-inline">
          <input type="radio" id="staffcate_id" name="staffcate_id" value="3" <?php if($staffcate_id42133==3){ echo "checked";}?> /> Department Manager
         </label>
		 </br>
		 
		 <label class="radio-inline">
          <input type="radio" id="staffcate_id" name="staffcate_id" value="4" <?php if($staffcate_id42133==4){ echo "checked";}?> /> Director
         </label>
		
		
					
						</br>
						
						
						<?php
		                }
						?>
				  
              </div>
			  </div>
			  
			   <!-- Normal Staff-->
			  <?php
			  if($staffcate_id==1){
			  ?>
			  
			  <div id="textboxes2">	
			  
			  <div class="col-sm-3">
			  <div class="form-group">
                 <label for="form_name"> Department </label>
				 
				 <select class="form-control" name="dept_id" id="dept_id">
			  						<?php
			  							$productSql3 = "SELECT departments.dept_id,departments.depart_name FROM departments where dept_id='$dept_id'";
			  							$productData3 = $conn->query($productSql3);
			  							while($row3 = $productData3->fetch_array()){									 		
			  								echo "<option value='".$row3['dept_id']."'>".$row3['depart_name']."</option>";
										 	} // /while 
											
										$productSql3a = "SELECT departments.dept_id,departments.depart_name FROM departments where dept_id!='$dept_id'";
			  							$productData3a = $conn->query($productSql3a);
			  							while($row3a = $productData3a->fetch_array()){									 		
			  								echo "<option value='".$row3a['dept_id']."'>".$row3a['depart_name']."</option>";
										 	} // /while 

			  						?>
		  						</select>
				 <br/>
                         <label for="dept_id" class="error" generated="true"></label>  
				
				    
              </div>
			  </div>
			  
			  
			  
			  <div class="col-sm-3">
			  <div class="form-group">
                 <label for="form_name"> Section </label>
                 
				  <select class="form-control" name="sect_id" id="sect_id">
				  <?php
				  $productSql3b = "SELECT * FROM sections where sect_id='$sect_id'";
			  							$productData3b = $conn->query($productSql3b);
			  							while($row3b = $productData3b->fetch_array()){									 		
			  								echo "<option value='".$row3b['sect_id']."'>".$row3b['sect_name']."</option>";
										 	} // /while 
											
										$productSql3c = "SELECT * FROM sections where sect_id!='$sect_id'";
			  							$productData3c = $conn->query($productSql3c);
			  							while($row3c = $productData3c->fetch_array()){									 		
			  								echo "<option value='".$row3c['sect_id']."'>".$row3c['sect_name']."</option>";
										 	} // /while 
				  ?>
				  
			  						<option value="">~~SELECT~~</option>
		  						</select>  
				 
                    <br/>
                         <label for="sect_id" class="error" generated="true"></label>  
                    </div>
			  </div>
			  
			  <div class="col-sm-3">
			  <div class="form-group">
                 <label for="form_name"> Designation </label>
                 <select class="form-control" name="des_id" id="des_id">
				 
				 <?php
				  $productSql3d = "SELECT * FROM designation where des_id='$des_id'";
			  							$productData3d = $conn->query($productSql3d);
			  							while($row3d = $productData3d->fetch_array()){									 		
			  								echo "<option value='".$row3d['des_id']."'>".$row3d['des_name']."</option>";
										 	} // /while 
											
										$productSql3e = "SELECT * FROM designation where des_id!='$des_id'";
			  							$productData3e = $conn->query($productSql3e);
			  							while($row3e = $productData3e->fetch_array()){									 		
			  								echo "<option value='".$row3e['des_id']."'>".$row3e['des_name']."</option>";
										 	} // /while 
				  ?>
				 
				 
			  						<option value="">~~SELECT~~</option>
		  						</select>  
                    <br/>
                         <label for="des_id" class="error" generated="true"></label>  
                    </div>
			  </div>
			  
             </div>
			 
			 <?php
              }else if($staffcate_id==2){
			 ?>
			 
			 <div id="textboxes2" style="display: none">	
			  
			  <div class="col-sm-3">
			  <div class="form-group">
                 <label for="form_name"> Department </label>
				 
				 <select class="form-control" name="dept_id" id="dept_id">
			  						<option value="">~~SELECT~~</option>
			  						<?php
			  							$productSql3 = "SELECT departments.dept_id,departments.depart_name FROM departments ORDER BY depart_name";
			  							$productData3 = $conn->query($productSql3);
			  							while($row3 = $productData3->fetch_array()){									 		
			  								echo "<option value='".$row3['dept_id']."'>".$row3['depart_name']."</option>";
										 	} // /while 

			  						?>
		  						</select>
				 <br/>
                         <label for="dept_id" class="error" generated="true"></label>  
				
				    
              </div>
			  </div>
			  
			  
			  
			  <div class="col-sm-3">
			  <div class="form-group">
                 <label for="form_name"> Section </label>
                 
				  <select class="form-control" name="sect_id" id="sect_id">
			  						<option value="">~~SELECT~~</option>
		  						</select>  
				 
                    <br/>
                         <label for="sect_id" class="error" generated="true"></label>  
                    </div>
			  </div>
			  
			  <div class="col-sm-3">
			  <div class="form-group">
                 <label for="form_name"> Designation </label>
                 <select class="form-control" name="des_id" id="des_id">
			  						<option value="">~~SELECT~~</option>
		  						</select>  
                    <br/>
                         <label for="des_id" class="error" generated="true"></label>  
                    </div>
			  </div>
			  
             </div>
			 
			 
			 <?php
               }else if($staffcate_id==3){
			 ?>
			 
			 <div id="textboxes2" style="display: none">	
			  
			  <div class="col-sm-3">
			  <div class="form-group">
                 <label for="form_name"> Department </label>
				 
				 <select class="form-control" name="dept_id" id="dept_id">
			  						<option value="">~~SELECT~~</option>
			  						<?php
			  							$productSql3 = "SELECT departments.dept_id,departments.depart_name FROM departments ORDER BY depart_name";
			  							$productData3 = $conn->query($productSql3);
			  							while($row3 = $productData3->fetch_array()){									 		
			  								echo "<option value='".$row3['dept_id']."'>".$row3['depart_name']."</option>";
										 	} // /while 

			  						?>
		  						</select>
				 <br/>
                         <label for="dept_id" class="error" generated="true"></label>  
				
				    
              </div>
			  </div>
			  
			  
			  
			  <div class="col-sm-3">
			  <div class="form-group">
                 <label for="form_name"> Section </label>
                 
				  <select class="form-control" name="sect_id" id="sect_id">
			  						<option value="">~~SELECT~~</option>
		  						</select>  
				 
                    <br/>
                         <label for="sect_id" class="error" generated="true"></label>  
                    </div>
			  </div>
			  
			  <div class="col-sm-3">
			  <div class="form-group">
                 <label for="form_name"> Designation </label>
                 <select class="form-control" name="des_id" id="des_id">
			  						<option value="">~~SELECT~~</option>
		  						</select>  
                    <br/>
                         <label for="des_id" class="error" generated="true"></label>  
                    </div>
			  </div>
			  
             </div>
			 
			 <?php
              }else{
			 ?>
			 
			 
			 <div id="textboxes2" style="display: none">	
			  
			  <div class="col-sm-3">
			  <div class="form-group">
                 <label for="form_name"> Department </label>
				 
				 <select class="form-control" name="dept_id" id="dept_id">
			  						<option value="">~~SELECT~~</option>
			  						<?php
			  							$productSql3 = "SELECT departments.dept_id,departments.depart_name FROM departments ORDER BY depart_name";
			  							$productData3 = $conn->query($productSql3);
			  							while($row3 = $productData3->fetch_array()){									 		
			  								echo "<option value='".$row3['dept_id']."'>".$row3['depart_name']."</option>";
										 	} // /while 

			  						?>
		  						</select>
				 <br/>
                         <label for="dept_id" class="error" generated="true"></label>  
				
				    
              </div>
			  </div>
			  
			  
			  
			  <div class="col-sm-3">
			  <div class="form-group">
                 <label for="form_name"> Section </label>
                 
				  <select class="form-control" name="sect_id" id="sect_id">
			  						<option value="">~~SELECT~~</option>
		  						</select>  
				 
                    <br/>
                         <label for="sect_id" class="error" generated="true"></label>  
                    </div>
			  </div>
			  
			  <div class="col-sm-3">
			  <div class="form-group">
                 <label for="form_name"> Designation </label>
                 <select class="form-control" name="des_id" id="des_id">
			  						<option value="">~~SELECT~~</option>
		  						</select>  
                    <br/>
                         <label for="des_id" class="error" generated="true"></label>  
                    </div>
			  </div>
			  
             </div>
			 
			 
			 <?php
               }
			 ?>
			 <!-- Normal Staff-->
			 
			 
			 <!-- Department Head-->
			  <?php
			  if($staffcate_id==1){
			  ?>
			  
			 
			 <div id="textboxes3" style="display: none">
			 
			 <div class="col-sm-3">
			  <div class="form-group">
                 <label for="form_name"> Department </label>
				 
				 <select class="form-control" name="deptId" id="deptId">
			  						<option value="">~~SELECT~~</option>
			  						<?php
			  							$productSql3 = "SELECT departments.dept_id,departments.depart_name FROM departments ORDER BY depart_name";
			  							$productData3 = $conn->query($productSql3);
			  							while($row3 = $productData3->fetch_array()){									 		
			  								echo "<option value='".$row3['dept_id']."'>".$row3['depart_name']."</option>";
										 	} // /while 

			  						?>
		  						</select>
				 <br/>
                         <label for="deptId" class="error" generated="true"></label>  
				
				    
              </div>
			  </div>
			  
			   <div class="col-sm-3">
			  <div class="form-group">
                 <label for="form_name"> Designation </label>
                 
				  <select class="form-control" name="desId" id="desId">
				  
			  						<option value="">~~SELECT~~</option>
		  						</select>  
				 
                    <br/>
                         <label for="desId" class="error" generated="true"></label>  
                    </div>
			  </div>
			 
			 </div>
			 
			 <?php
			  }else if($staffcate_id==2){
			 ?>
			 
			  <div id="textboxes3" style="display: none">
			 
			 <div class="col-sm-3">
			  <div class="form-group">
                 <label for="form_name"> Department </label>
				 
				 <select class="form-control" name="deptId" id="deptId">
			  						<option value="">~~SELECT~~</option>
			  						<?php
			  							$productSql3 = "SELECT departments.dept_id,departments.depart_name FROM departments ORDER BY depart_name";
			  							$productData3 = $conn->query($productSql3);
			  							while($row3 = $productData3->fetch_array()){									 		
			  								echo "<option value='".$row3['dept_id']."'>".$row3['depart_name']."</option>";
										 	} // /while 

			  						?>
		  						</select>
				 <br/>
                         <label for="deptId" class="error" generated="true"></label>  
				
				    
              </div>
			  </div>
			  
			   <div class="col-sm-3">
			  <div class="form-group">
                 <label for="form_name"> Designation </label>
                 
				  <select class="form-control" name="desId" id="desId">
			  						<option value="">~~SELECT~~</option>
		  						</select>  
				 
                    <br/>
                         <label for="desId" class="error" generated="true"></label>  
                    </div>
			  </div>
			 
			 </div>
			 
			 <?php
               }else if($staffcate_id==3){
			 ?>
			 
			 
			  <div id="textboxes3">
			 
			 <div class="col-sm-3">
			  <div class="form-group">
                 <label for="form_name"> Department </label>
				 
				 <select class="form-control" name="deptId" id="deptId">
			  						<?php
			  							$productSql3 = "SELECT departments.dept_id,departments.depart_name FROM departments where dept_id='$dept_id'";
			  							$productData3 = $conn->query($productSql3);
			  							while($row3 = $productData3->fetch_array()){									 		
			  								echo "<option value='".$row3['dept_id']."'>".$row3['depart_name']."</option>";
										 	} // /while 
											
										$productSql3a = "SELECT departments.dept_id,departments.depart_name FROM departments where dept_id!='$dept_id'";
			  							$productData3a = $conn->query($productSql3a);
			  							while($row3a = $productData3a->fetch_array()){									 		
			  								echo "<option value='".$row3a['dept_id']."'>".$row3a['depart_name']."</option>";
										 	} // /while 

			  						?>
		  						</select>
				 <br/>
                         <label for="deptId" class="error" generated="true"></label>  
				
				    
              </div>
			  </div>
			  
			   <div class="col-sm-3">
			  <div class="form-group">
                 <label for="form_name"> Designation </label>
                 
				  <select class="form-control" name="desId" id="desId">
				  
				  				 <?php
				  $productSql3d = "SELECT * FROM designation where des_id='$des_id'";
			  							$productData3d = $conn->query($productSql3d);
			  							while($row3d = $productData3d->fetch_array()){									 		
			  								echo "<option value='".$row3d['des_id']."'>".$row3d['des_name']."</option>";
										 	} // /while 
											
										$productSql3e = "SELECT * FROM designation where des_id!='$des_id'";
			  							$productData3e = $conn->query($productSql3e);
			  							while($row3e = $productData3e->fetch_array()){									 		
			  								echo "<option value='".$row3e['des_id']."'>".$row3e['des_name']."</option>";
										 	} // /while 
				  ?>
				  
				  
			  						<option value="">~~SELECT~~</option>
		  						</select>  
				 
                    <br/>
                         <label for="desId" class="error" generated="true"></label>  
                    </div>
			  </div>
			 
			 </div>
		 
		 
		     <?php
               }else{
			 ?>
			 
			  <div id="textboxes3" style="display: none">
			 
			 <div class="col-sm-3">
			  <div class="form-group">
                 <label for="form_name"> Department </label>
				 
				 <select class="form-control" name="deptId" id="deptId">
			  						<option value="">~~SELECT~~</option>
			  						<?php
			  							$productSql3 = "SELECT departments.dept_id,departments.depart_name FROM departments ORDER BY depart_name";
			  							$productData3 = $conn->query($productSql3);
			  							while($row3 = $productData3->fetch_array()){									 		
			  								echo "<option value='".$row3['dept_id']."'>".$row3['depart_name']."</option>";
										 	} // /while 

			  						?>
		  						</select>
				 <br/>
                         <label for="deptId" class="error" generated="true"></label>  
				
				    
              </div>
			  </div>
			  
			   <div class="col-sm-3">
			  <div class="form-group">
                 <label for="form_name"> Designation </label>
                 
				  <select class="form-control" name="desId" id="desId">
			  						<option value="">~~SELECT~~</option>
		  						</select>  
				 
                    <br/>
                         <label for="desId" class="error" generated="true"></label>  
                    </div>
			  </div>
			 
			 </div>
			 
			 
			 <?php
                }
			 ?>
			 
			 <!-- Department Head-->
			 
			  <!-- Director-->
			 <?php
			 if($staffcate_id==1){
			 ?>
			  <div id="textboxes4" style="display: none">
			  
			   <div class="col-sm-3">
			  <div class="form-group">
                 <label for="form_name"> Designation </label>
				 
				 <select class="form-control" name="designId" id="designId">
			  						<option value="">~~SELECT~~</option>
			  						<?php
			  							$productSql4 = "SELECT designation.des_id,designation.des_name FROM designation where staffcate_id=4 ORDER BY des_name";
			  							$productData4 = $conn->query($productSql4);
			  							while($row4 = $productData4->fetch_array()){									 		
			  								echo "<option value='".$row4['des_id']."'>".$row4['des_name']."</option>";
										 	} // /while 

			  						?>
		  						</select>
				 <br/>
                         <label for="designId" class="error" generated="true"></label>  
				
				    
              </div>
			  </div>
			  
			  </div>
			  
			  <?php
                }else if($staffcate_id==2){
			  ?>
			  
			  <div id="textboxes4" style="display: none">
			  
			   <div class="col-sm-3">
			  <div class="form-group">
                 <label for="form_name"> Designation </label>
				 
				 <select class="form-control" name="designId" id="designId">
			  						<option value="">~~SELECT~~</option>
			  						<?php
			  							$productSql4 = "SELECT designation.des_id,designation.des_name FROM designation where staffcate_id=4 ORDER BY des_name";
			  							$productData4 = $conn->query($productSql4);
			  							while($row4 = $productData4->fetch_array()){									 		
			  								echo "<option value='".$row4['des_id']."'>".$row4['des_name']."</option>";
										 	} // /while 

			  						?>
		  						</select>
				 <br/>
                         <label for="designId" class="error" generated="true"></label>  
				
				    
              </div>
			  </div>
			  
			  </div>
			  
			  <?php
                 }else if($staffcate_id==3){
			  ?>
			  
			  <div id="textboxes4" style="display: none">
			  
			   <div class="col-sm-3">
			  <div class="form-group">
                 <label for="form_name"> Designation </label>
				 
				 <select class="form-control" name="designId" id="designId">
			  						<option value="">~~SELECT~~</option>
			  						<?php
			  							$productSql4 = "SELECT designation.des_id,designation.des_name FROM designation where staffcate_id=4 ORDER BY des_name";
			  							$productData4 = $conn->query($productSql4);
			  							while($row4 = $productData4->fetch_array()){									 		
			  								echo "<option value='".$row4['des_id']."'>".$row4['des_name']."</option>";
										 	} // /while 

			  						?>
		  						</select>
				 <br/>
                         <label for="designId" class="error" generated="true"></label>  
				
				    
              </div>
			  </div>
			  
			  </div>
			  
			  <?php
                }else{
			  ?>
			  
			  <div id="textboxes4">
			  
			   <div class="col-sm-3">
			  <div class="form-group">
                 <label for="form_name"> Designation </label>
				 
				 <select class="form-control" name="designId" id="designId">
			  						<?php
			  							$productSql4 = "SELECT designation.des_id,designation.des_name FROM designation where staffcate_id=4 and des_id='$des_id'";
			  							$productData4 = $conn->query($productSql4);
			  							while($row4 = $productData4->fetch_array()){									 		
			  								echo "<option value='".$row4['des_id']."'>".$row4['des_name']."</option>";
										 	} // /while 
                                        
										$productSql4s = "SELECT designation.des_id,designation.des_name FROM designation where staffcate_id=4 and des_id!='$des_id'";
			  							$productData4s = $conn->query($productSql4s);
			  							while($row4s = $productData4s->fetch_array()){									 		
			  								echo "<option value='".$row4s['des_id']."'>".$row4s['des_name']."</option>";
										 	} // /while 
			  						?>
		  						</select>
				 <br/>
                         <label for="designId" class="error" generated="true"></label>  
				
				    
              </div>
			  </div>
			  
			  </div>
			  
			  <?php
                }
			  ?>
			  
			  <?php
			 if($staffcate_id==1){
			 ?>
			  
			   <div id="textboxes5" style="display: none">
			   
			    <div class="col-sm-3">
			  <div class="form-group">
                 <label for="form_name"> Department </label>
				 
				 <select class="form-control" name="depart_id" id="depart_id">
			  						<option value="">~~SELECT~~</option>
			  						<?php
			  							$productSql8 = "SELECT departments.dept_id,departments.depart_name FROM departments ORDER BY depart_name";
			  							$productData8 = $conn->query($productSql8);
			  							while($row8 = $productData8->fetch_array()){									 		
			  								echo "<option value='".$row8['dept_id']."'>".$row8['depart_name']."</option>";
										 	} // /while 

			  						?>
		  						</select>
				 <br/>
                         <label for="depart_id" class="error" generated="true"></label>  
				
				    
              </div>
			  </div>
			  
			  
			  
			  <div class="col-sm-3">
			  <div class="form-group">
                 <label for="form_name"> Section </label>
                 
				  <select class="form-control" name="section_id" id="section_id">
			  						<option value="">~~SELECT~~</option>
		  						</select>  
				 
                    <br/>
                         <label for="section_id" class="error" generated="true"></label>  
                    </div>
			  </div>
			  
			  <div class="col-sm-3">
			  <div class="form-group">
                 <label for="form_name"> Designation </label>
                 <select class="form-control" name="desi_id" id="desi_id">
			  						<option value="">~~SELECT~~</option>
		  						</select>  
                    <br/>
                         <label for="desi_id" class="error" generated="true"></label>  
                    </div>
			  </div>
			   
			   </div>
			   
			   <?php
                 }else if($staffcate_id==2){
			   ?>
			   
			    <div id="textboxes5">
			   
			    <div class="col-sm-3">
			  <div class="form-group">
                 <label for="form_name"> Department </label>
				 
				 <select class="form-control" name="depart_id" id="depart_id">
			  						<option value="">~~SELECT~~</option>
			  						<?php
			  							$productSql8 = "SELECT departments.dept_id,departments.depart_name FROM departments where departments.dept_id='$dept_id'";
			  							$productData8 = $conn->query($productSql8);
			  							while($row8 = $productData8->fetch_array()){									 		
			  								echo "<option value='".$row8['dept_id']."'>".$row8['depart_name']."</option>";
										 	} // /while 
											
											
										$productSql8y = "SELECT departments.dept_id,departments.depart_name FROM departments where departments.dept_id!='$dept_id'";
			  							$productData8y = $conn->query($productSql8y);
			  							while($row8y = $productData8y->fetch_array()){									 		
			  								echo "<option value='".$row8y['dept_id']."'>".$row8y['depart_name']."</option>";
										 	} // /w

			  						?>
		  						</select>
				 <br/>
                         <label for="depart_id" class="error" generated="true"></label>  
				
				    
              </div>
			  </div>
			  
			  
			  
			  <div class="col-sm-3">
			  <div class="form-group">
                 <label for="form_name"> Section </label>
                 
				  <select class="form-control" name="section_id" id="section_id">
			  						<?php
			  							$productSql8x = "SELECT * FROM sections where sections.sect_id='$sect_id'";
			  							$productData8x = $conn->query($productSql8x);
			  							while($row8x = $productData8x->fetch_array()){									 		
			  								echo "<option value='".$row8x['sect_id']."'>".$row8x['sect_name']."</option>";
										 	} // /while 
											
											
									$productSql8xx = "SELECT * FROM sections where sections.sect_id!='$sect_id'";
			  							$productData8xx = $conn->query($productSql8xx);
			  							while($row8xx = $productData8xx->fetch_array()){									 		
			  								echo "<option value='".$row8xx['sect_id']."'>".$row8xx['sect_name']."</option>";
										 	} // /while 
									?>
		  						</select>  
				 
                    <br/>
                         <label for="section_id" class="error" generated="true"></label>  
                    </div>
			  </div>
			  
			  <div class="col-sm-3">
			  <div class="form-group">
                 <label for="form_name"> Designation </label>
                 <select class="form-control" name="desi_id" id="desi_id">
			  						<?php
			  							$productSql8xxx = "SELECT * FROM designation where designation.des_id='$des_id'";
			  							$productData8xxx = $conn->query($productSql8xxx);
			  							while($row8xxx = $productData8xxx->fetch_array()){									 		
			  								echo "<option value='".$row8xxx['des_id']."'>".$row8xxx['des_name']."</option>";
										 	} // /while 
											
											
										$productSql8xxx1 = "SELECT * FROM designation where designation.des_id!='$des_id'";
			  							$productData8xxx1 = $conn->query($productSql8xxx1);
			  							while($row8xxx1 = $productData8xxx1->fetch_array()){									 		
			  								echo "<option value='".$row8xxx1['des_id']."'>".$row8xxx1['des_name']."</option>";
										 	} // /while 
									?>
		  						</select>  
                    <br/>
                         <label for="desi_id" class="error" generated="true"></label>  
                    </div>
			  </div>
			   
			   </div>
			   
			   <?php
                }else if($staffcate_id==3){
			   ?>
			   
			    <div id="textboxes5" style="display: none">
			   
			    <div class="col-sm-3">
			  <div class="form-group">
                 <label for="form_name"> Department </label>
				 
				 <select class="form-control" name="depart_id" id="depart_id">
			  						<option value="">~~SELECT~~</option>
			  						<?php
			  							$productSql8 = "SELECT departments.dept_id,departments.depart_name FROM departments ORDER BY depart_name";
			  							$productData8 = $conn->query($productSql8);
			  							while($row8 = $productData8->fetch_array()){									 		
			  								echo "<option value='".$row8['dept_id']."'>".$row8['depart_name']."</option>";
										 	} // /while 

			  						?>
		  						</select>
				 <br/>
                         <label for="depart_id" class="error" generated="true"></label>  
				
				    
              </div>
			  </div>
			  
			  
			  
			  <div class="col-sm-3">
			  <div class="form-group">
                 <label for="form_name"> Section </label>
                 
				  <select class="form-control" name="section_id" id="section_id">
			  						<option value="">~~SELECT~~</option>
		  						</select>  
				 
                    <br/>
                         <label for="section_id" class="error" generated="true"></label>  
                    </div>
			  </div>
			  
			  <div class="col-sm-3">
			  <div class="form-group">
                 <label for="form_name"> Designation </label>
                 <select class="form-control" name="desi_id" id="desi_id">
			  						<option value="">~~SELECT~~</option>
		  						</select>  
                    <br/>
                         <label for="desi_id" class="error" generated="true"></label>  
                    </div>
			  </div>
			   
			   </div>
			   
			   
			   <?php
                  }else{
			   ?>
			   
			   <div id="textboxes5" style="display: none">
			   
			    <div class="col-sm-3">
			  <div class="form-group">
                 <label for="form_name"> Department </label>
				 
				 <select class="form-control" name="depart_id" id="depart_id">
			  						<option value="">~~SELECT~~</option>
			  						<?php
			  							$productSql8 = "SELECT departments.dept_id,departments.depart_name FROM departments ORDER BY depart_name";
			  							$productData8 = $conn->query($productSql8);
			  							while($row8 = $productData8->fetch_array()){									 		
			  								echo "<option value='".$row8['dept_id']."'>".$row8['depart_name']."</option>";
										 	} // /while 

			  						?>
		  						</select>
				 <br/>
                         <label for="depart_id" class="error" generated="true"></label>  
				
				    
              </div>
			  </div>
			  
			  
			  
			  <div class="col-sm-3">
			  <div class="form-group">
                 <label for="form_name"> Section </label>
                 
				  <select class="form-control" name="section_id" id="section_id">
			  						<option value="">~~SELECT~~</option>
		  						</select>  
				 
                    <br/>
                         <label for="section_id" class="error" generated="true"></label>  
                    </div>
			  </div>
			  
			  <div class="col-sm-3">
			  <div class="form-group">
                 <label for="form_name"> Designation </label>
                 <select class="form-control" name="desi_id" id="desi_id">
			  						<option value="">~~SELECT~~</option>
		  						</select>  
                    <br/>
                         <label for="desi_id" class="error" generated="true"></label>  
                    </div>
			  </div>
			   
			   </div>
			   
			   <?php
				  }
			   ?>
			   
			
			  	</div>	  
                </div> 
				
				
			<div class="controls">
			  <div class="row">
			  

			  <div class="col-sm-3">
			  <div class="form-group">
			  
               <label for="form_name"> Employment Type </label>
				 
			</br>	
						
			<?php			
		$sql4216 = "SELECT * FROM staff,emp_type where staff.emply_type_id='$emply_type_id' and staff.staff_id='$staff_id' and staff.emply_type_id=emp_type.emptype_id";	
        $result4216 = $conn->query($sql4216); 
		while ($row4216 = mysqli_fetch_array($result4216))
		{
			$empcate_id4216 = $row4216['emply_type_id'];
			//$clientcate_name4216 = $row4216['clientcate_name'];
	
		?>
						
						
						 <label class="radio-inline">
          <input type="radio" id="emptype_id" name="emptype_id" value="1" <?php if($empcate_id4216==1){ echo "checked";}?> /> Permanent
         </label>
		 
		 
		 <label class="radio-inline">
          <input type="radio" id="emptype_id" name="emptype_id" value="2" <?php if($empcate_id4216==2){ echo "checked";}?> /> Contract
         </label>
						
						
						
						<?php
		                }
						?>				
						
						
						 
              </div>
			  </div>
			  
			  <div class="col-sm-3">
			  <div class="form-group">
			  
			  <label for="form_name"> Highest Education Level </label>
                   
                      <select class="form-control" name="edu_level_id" id="edu_level_id">
			  						<?php
			  							$productSql63g = "SELECT * FROM edu_level where eduLevel_id='$eduLevel_id'";
			  							$productData63g = $conn->query($productSql63g);
			  							while($row63g = $productData63g->fetch_array()){									 		
			  								echo "<option value='".$row63g['eduLevel_id']."'>".$row63g['eduName']."</option>";
										 	} // /while 
                                        
										$productSql63gg = "SELECT * FROM edu_level where eduLevel_id!='$eduLevel_id'";
			  							$productData63gg = $conn->query($productSql63gg);
			  							while($row63gg = $productData63gg->fetch_array()){									 		
			  								echo "<option value='".$row63gg['eduLevel_id']."'>".$row63gg['eduName']."</option>";
										 	} // /while 
			  						?>
		  						</select>
				 <br/>
                         <label for="edu_level_id" class="error" generated="true"></label>
                    </div>
			  </div>
			  
			  <?php
			  if($emply_type_id==2){
			   ?>
			  
			 <div id="textboxes6">
			 
			 <div class="col-sm-3">
			  <div class="form-group">
			  
			  <label for="form_name"> Contract Start Date </label>
			  
			  <input type="text" class="form-control" id="contStart" placeholder="Contract Start Date" name="contStart" value="<?php echo $contStart; ?>" autocomplete="off">    
                   
                
				 <br/>
                         <label for="contStart" class="error" generated="true"></label>
                    </div>
			  </div>
			 
			 
			  <div class="col-sm-3">
			  <div class="form-group">
			  
			  <label for="form_name"> Contract Duration (Months) </label>
                   
                      <select class="form-control" name="cont_dur_id" id="cont_dur_id">
			  						<?php
			  							$productSql6 = "SELECT cont_duration.cont_dur_id,cont_duration.cont_dur_name FROM cont_duration where cont_dur_id='$cont_dur_id'";
			  							$productData6 = $conn->query($productSql6);
			  							while($row6 = $productData6->fetch_array()){									 		
			  								echo "<option value='".$row6['cont_dur_id']."'>".$row6['cont_dur_name']."</option>";
										 	} // /while 
											
											
										$productSql69 = "SELECT cont_duration.cont_dur_id,cont_duration.cont_dur_name FROM cont_duration where cont_dur_id!='$cont_dur_id'";
			  							$productData69 = $conn->query($productSql69);
			  							while($row69 = $productData69->fetch_array()){									 		
			  								echo "<option value='".$row69['cont_dur_id']."'>".$row69['cont_dur_name']."</option>";
										 	} // /while 

			  						?>
		  						</select>
				 <br/>
                         <label for="cont_dur_id" class="error" generated="true"></label>
                    </div>
			  </div>
			  </div>
			  
			  <?php
                }
			  ?>
			  
			
			
			  	</div>	  
                </div>
				
				
				<div class="controls">
			  <div class="row">
			  
			  <div class="col-sm-4">
			  <div class="form-group">
                 <label for="form_name"> Region Of Birth: </label>
				 
				 <select class="form-control" name="region_id" id="region_id">
			  						<?php
			  							$productSql44 = "SELECT regions.region_id,regions.region_name FROM regions where region_id='$region_id'";
			  							$productData44 = $conn->query($productSql44);
			  							while($row44 = $productData44->fetch_array()){									 		
			  								echo "<option value='".$row44['region_id']."'>".$row44['region_name']."</option>";
										 	} 
                                        $productSql44u = "SELECT regions.region_id,regions.region_name FROM regions where region_id!='$region_id'";
			  							$productData44u = $conn->query($productSql44u);
			  							while($row44u = $productData44u->fetch_array()){									 		
			  								echo "<option value='".$row44u['region_id']."'>".$row44u['region_name']."</option>";
										 	} 
			  						?>
		  						</select>
				 <br/>
                         <label for="region_id" class="error" generated="true"></label>  
                 
			
                </div>
			   </div>
			   
			    <div class="col-sm-4">
			  <div class="form-group">
                 <label for="form_name"> District Of Birth: </label>
				 
				 <select class="form-control" name="district_id" id="district_id">
				                     <?php
			  						 $productSql44uu = "SELECT * FROM districts where district_id='$district_id'";
			  							$productData44uu = $conn->query($productSql44uu);
			  							while($row44uu = $productData44uu->fetch_array()){									 		
			  								echo "<option value='".$row44uu['district_id']."'>".$row44uu['district_name']."</option>";
										 	} 
											
									$productSql44uu1 = "SELECT * FROM districts where district_id!='$district_id'";
			  							$productData44uu1 = $conn->query($productSql44uu1);
			  							while($row44uu1 = $productData44uu1->fetch_array()){									 		
			  								echo "<option value='".$row44uu1['district_id']."'>".$row44uu1['district_name']."</option>";
										 	} 
											?>
		  						</select>  
				 
                    <br/>
                         <label for="district_id" class="error" generated="true"></label>  
                 
			
                </div>
			   </div>
			   
			    <div class="col-sm-4">
			  <div class="form-group">
                 <label for="form_name"> Ward Of Birth: </label>
				 
				 <select class="form-control" name="ward_id" id="ward_id">
				                    <?php
			  						$productSql44uu12 = "SELECT * FROM wards where ward_id='$ward_id'";
			  							$productData44uu12 = $conn->query($productSql44uu12);
			  							while($row44uu12 = $productData44uu12->fetch_array()){									 		
			  								echo "<option value='".$row44uu12['ward_id']."'>".$row44uu12['ward_name']."</option>";
										 	}
                                     
                                      $productSql44uu123 = "SELECT * FROM wards where ward_id!='$ward_id'";
			  							$productData44uu123 = $conn->query($productSql44uu123);
			  							while($row44uu123 = $productData44uu123->fetch_array()){									 		
			  								echo "<option value='".$row44uu123['ward_id']."'>".$row44uu123['ward_name']."</option>";
										 	} 									 
											?>
		  						</select>  
				 
                    <br/>
                         <label for="ward_id" class="error" generated="true"></label>  
                 
			
                </div>
			   </div>
			
				
			  </div>	  
              </div>
			  
			  
			   <div class="controls">
			  <div class="row">
			  
			  <div class="col-sm-12">
			  <div class="form-group">
                 <label for="form_name"> Career Acomplishment: </label>
               
                </div>
			   </div>
			  </div>	  
              </div>
			  
			 
			  
			  <table class="table" id="productTable">
			  	<thead>
			  		<tr>			  			
			  			<th style="width:5%;">S/N</th>
						<th style="width:30%;">Institution Name</th>
						<th style="width:30%;">Period</th>
			  			<th style="width:30%;">Award</th>		  			
			  			<th style="width:5%;"></th>
			  		</tr>
			  	</thead>
			  	<tbody>
			  		<?php
			  		//$arrayNumber = 0;
					//$no 	= 1;
			  		//for($x = 1; $x < 4; $x++) { 
					
					$invItemSql = "SELECT * FROM edu_background WHERE staff_id = {$staff_id}";
					$invItemResult = $conn->query($invItemSql);
						// $orderItemData = $orderItemResult->fetch_all();						
						
						// print_r($orderItemData);
			  		$arrayNumber = 0;
			  		// for($x = 1; $x <= count($orderItemData); $x++) {
			  		$x = 1;
			  		while($invItemData = $invItemResult->fetch_array()) { 
					$eduDesc = $invItemData['eduDesc'];
					$inst_name	 = $invItemData['inst_name'];
					$edu_period	 = $invItemData['edu_period'];
					          ?>
					
			  			<tr id="row<?php echo $x; ?>" class="<?php echo $arrayNumber; ?>">	
						
						   <td style="padding-left:20px;">
			  					<div class="form-group">
								<?php
								print $x;
								?>
			  					</div>
			  				</td>
							
							<td style="padding-left:20px;">
			  					<div class="form-group">
								<input type="text" name="inst_name[]" class="form-control" id="inst_name<?php echo $x; ?>" value="<?php echo $invItemData['inst_name']; ?>"  placeholder="Institution Name" autocomplete="off"/>
			  					</div>
			  				</td>	
							
							
							<td style="padding-left:20px;">
			  					<div class="form-group">
								<input type="text" name="edu_period[]" class="form-control" id="edu_period<?php echo $x; ?>" value="<?php echo $invItemData['edu_period']; ?>"  placeholder="Education Period" autocomplete="off"/>
			  					</div>
			  				</td>
							
							
							 <td style="padding-left:20px;">
			  					<div class="form-group">
								<textarea rows="3" cols="50" name="edu_desc[]" id="edu_desc<?php echo $x; ?>"  class="form-control" style="margin-left:0%;" autocomplete="off" /> <?php echo htmlspecialchars($eduDesc); ?> </textarea>
								
			  					</div>
			  				</td>
							
			  				<td>

			  					<button class="btn btn-default removeProductRowBtn" type="button" id="removeProductRowBtn" onclick="removeProductRow(<?php echo $x; ?>)"><i class="glyphicon glyphicon-trash"></i></button>
			  				</td>
			  			</tr>
		  			<?php
		  			//$arrayNumber++;
					//$no++;
			  		//} // /for
					$arrayNumber++;
		  			$x++;
			  		} // /for
			  		?>
			  	</tbody>			  	
			  </table>
			  
			  
			  
			    <div class="col-md-6">
			  
			       <div class="form-group">
				    <div class="col-sm-6">
				      <button type="button" class="btn btn-default" onclick="addRow()" id="addRowBtn" data-loading-text="Loading..."> <i class="glyphicon glyphicon-plus-sign"></i> Add Row </button>
				    </div>
				  </div> <!--/form-group-->	
				  
				 </br>
			
			  </div> <!--/col-md-6-->
			  
			
			  
			  </br></br></br></br></br>
			  
			  <div class="controls">
			  <div class="row">
			  
			  <div class="col-sm-12">
			  <div class="form-group">
                 <label for="form_name"> Does Staff Has Parents/Guardians: </label>
				 
				  </br>
		 <?php	
                 $sql421f1 = "SELECT * FROM staff where staff_id='$staff_id'";	
        $result421f1 = $conn->query($sql421f1); 
		while ($row421f1 = mysqli_fetch_array($result421f1))
		{
			
			$pStatus22f1 = $row421f1['parent_status'];
	
		?>			
				 
				 <label class="radio-inline">
          <input type="radio" name="parent_status" value="Yes" id="parent_status" <?php if($pStatus22f1=='Yes'){ echo "checked";}?> /> Yes
         </label>&nbsp&nbsp&nbsp&nbsp
         <label class="radio-inline">
          <input type="radio" name="parent_status" value="No" id="parent_status" <?php if($pStatus22f1=='No'){ echo "checked";}?> /> No
         </label>&nbsp&nbsp&nbsp&nbsp
				 
		<?php
		                }
						?>	
                 
			
                </div>
			   </div>
			
				
			  </div>	  
              </div>
			  
			  <?php
			  if($pStatus22f1=='Yes'){
			  ?>
			 
			  <div id="textboxes10">
			   <table class="table" id="productTable">
			  	<thead>
			  		<tr>			  			
						<!--<th style="width:10%;">No</th>-->
                        <th style="width:20%;">Relationship</th>						
			  			<th style="width:15%;">First Name</th>
						<th style="width:15%;">Middle Name</th>
						<th style="width:15%;">Last Name</th>
						<th style="width:15%;">Phone No</th>
						<th style="width:20%;">Email</th>
						
			  		</tr>
			  	</thead>
			  	<tbody>
			  		<?php
			  		//$arrayNumber1 = 0;
					//$no1 	= 1;
			  		//for($x1 = 1; $x1 < 4; $x1++) { ?>
					
					
						<?php
			  		//$arrayNumber = 0;
					//$no 	= 1;
			  		//for($x = 1; $x < 4; $x++) { 
					
					$invItemSql1 = "SELECT * FROM parents_guardians WHERE staff_id = {$staff_id}";
					$invItemResult1 = $conn->query($invItemSql1);
						// $orderItemData = $orderItemResult->fetch_all();						
						
						// print_r($orderItemData);
			  		$arrayNumber = 0;
			  		// for($x = 1; $x <= count($orderItemData); $x++) {
			  		$x = 1;
			  		while($invItemData1 = $invItemResult1->fetch_array()) { 
					$prel_id = $invItemData1['prel_id'];
					$pfname	 = $invItemData1['pfname'];
					$pmname	 = $invItemData1['pmname'];
					$plname	 = $invItemData1['plname'];
					$pphone	 = $invItemData1['pphone'];
					$pemail	 = $invItemData1['pemail'];
					$n = substr($pphone,3);
                    $n1 = '0';
					$phoneNo = $n1.$n;
					          ?>
					
					
					
					
					
			  			<tr id="row<?php echo $x; ?>" class="<?php echo $arrayNumber; ?>">	
						
						
						   <!--<td style="padding-left:20px;">
			  					<div class="form-group">
								<?php
								//print $x;
								?>
			  					</div>
			  				</td>-->
							
							 <td style="margin-left:20px;">
			  					<div class="form-group">

			  					<select class="form-control" name="prel_id[]" id="prel_id<?php echo $x; ?>">
			  						<?php
			  							$productSql3v1 = "SELECT * FROM parent_relationships where prel_id='$prel_id'";
			  							$productData3v1 = $conn->query($productSql3v1);

			  							while($row3v1 = $productData3v1->fetch_array()) {									 		
			  								echo "<option value='".$row3v1['prel_id']."'>".$row3v1['prel_name']."</option>";
										 	} // /while 
                                       
									   $productSql3v12 = "SELECT * FROM parent_relationships where prel_id!='$prel_id'";
			  							$productData3v12 = $conn->query($productSql3v12);

			  							while($row3v12 = $productData3v12->fetch_array()) {									 		
			  								echo "<option value='".$row3v12['prel_id']."'>".$row3v12['prel_name']."</option>";
										 	} // /while 
			  						?>
		  						</select>
			  					</div>
			  				</td>

                            <td style="padding-left:20px;">
			  					<div class="form-group">
								<input type="text" name="pf_name[]" class="form-control" id="pf_name<?php echo $x; ?>"  value="<?php echo $pfname; ?>"  placeholder="First Name" autocomplete="off"/>
			  					</div>
			  				</td>	
							
							
							<td style="padding-left:20px;">
			  					<div class="form-group">
								<input type="text" name="pm_name[]" class="form-control" id="pm_name<?php echo $x; ?>" value="<?php echo $pmname; ?>"  placeholder="Middle Name" autocomplete="off"/>
			  					</div>
			  				</td>
							
							<td style="padding-left:20px;">
			  					<div class="form-group">
								<input type="text" name="pl_name[]" class="form-control" id="pl_name<?php echo $x; ?>" value="<?php echo $plname; ?>"   placeholder="Last Name" autocomplete="off"/>
			  					</div>
			  				</td>
							
							<td style="padding-left:20px;">
			  					<div class="form-group">
								<input type="text" name="p_phone[]" class="form-control" id="p_phone<?php echo $x; ?>" value="<?php echo $phoneNo; ?>"  placeholder="Phone Number" autocomplete="off"/>
			  					</div>
			  				</td>
							
							
							<td style="padding-left:20px;">
			  					<div class="form-group">
								<input type="email" name="p_email[]" class="form-control" id="p_email<?php echo $x; ?>" value="<?php echo $pemail; ?>"  placeholder="Email Address" autocomplete="off"/>
			  					</div>
			  				</td>
							
			  			
			  			</tr>
		  			<?php
		  			$arrayNumber++;
					$no++;
			  		} // /for
			  		?>
			  	</tbody>			  	
			  </table>
			  </div>
			  
			  <?php
					}
			  ?>
			  
			  
			  </br></br></br>
			  
			  <div class="controls">
			  <div class="row">
			  
			  <div class="col-sm-12">
			  <div class="form-group">
                 <label for="form_name"> Does Staff Has Next Of KIN: </label>
				 
				 </br>
		 <?php	
                 $sql421f11 = "SELECT * FROM staff where staff_id='$staff_id'";	
        $result421f11 = $conn->query($sql421f11); 
		while ($row421f11 = mysqli_fetch_array($result421f11))
		{
			
			$pStatus22f11 = $row421f11['kin_status'];
	
		?>			
				 
				 <label class="radio-inline">
          <input type="radio" name="kin_status" value="Yes" id="kin_status" <?php if($pStatus22f11=='Yes'){ echo "checked";}?> /> Yes
         </label>&nbsp&nbsp&nbsp&nbsp
         <label class="radio-inline">
          <input type="radio" name="kin_status" value="No" id="kin_status" <?php if($pStatus22f11=='No'){ echo "checked";}?> /> No
         </label>&nbsp&nbsp&nbsp&nbsp
				 
		<?php
		                }
						?>	
                 
                 
			
                </div>
			   </div>
			
				
			  </div>	  
              </div>
			  
			  <?php
			  if($pStatus22f11=='Yes'){
			  ?>
			  
			  <div id="textboxes11">
			  
			  <table class="table" id="productTable2">
			  	<thead>
			  		<tr>			  			
						
                        <th style="width:20%;">Relationship</th>						
			  			<th style="width:15%;">First Name</th>
						<th style="width:15%;">Middle Name</th>
						<th style="width:15%;">Last Name</th>
						<th style="width:15%;">Phone No</th>
						<th style="width:20%;">Email</th>
						
						
			  		</tr>
			  	</thead>
			  	<tbody>
			  		<?php
			  		$arrayNumber2 = 0;
					$no2 	= 1;
			  		//for($x2 = 1; $x2 < 4; $x2++) { 
					
					$invItemSql1 = "SELECT * FROM next_kin WHERE staff_id = {$staff_id}";
					$invItemResult1 = $conn->query($invItemSql1);
						// $orderItemData = $orderItemResult->fetch_all();						
						
						// print_r($orderItemData);
			  		$arrayNumber = 0;
			  		// for($x = 1; $x <= count($orderItemData); $x++) {
			  		$x = 1;
			  		while($invItemData1 = $invItemResult1->fetch_array()) { 
					$prel_id1 = $invItemData1['prel_id'];
					$kfname	 = $invItemData1['kfname'];
					$kmname	 = $invItemData1['kmname'];
					$klname	 = $invItemData1['klname'];
					$kphone	 = $invItemData1['kphone'];
					$kemail	 = $invItemData1['kemail'];
					$n4 = substr($kphone,3);
                    $n13 = '0';
					$kphoneNo = $n13.$n4;
					?>
			  			<tr id="row<?php echo $x2; ?>" class="<?php echo $arrayNumber2; ?>">	
						
						
						   
							
							 <td style="margin-left:20px;">
			  					<div class="form-group">

			  					<select class="form-control" name="krel_id[]" id="krel_id<?php echo $x2; ?>">
								<?php
			  						$productSql3v1b = "SELECT * FROM parent_relationships where prel_id='$prel_id1'";
			  							$productData3v1b = $conn->query($productSql3v1b);

			  							while($row3v1b = $productData3v1b->fetch_array()) {									 		
			  								echo "<option value='".$row3v1b['prel_id']."'>".$row3v1b['prel_name']."</option>";
										 	} // /while 
                                       
									   $productSql3v12b = "SELECT * FROM parent_relationships where prel_id!='$prel_id1'";
			  							$productData3v12b = $conn->query($productSql3v12b);

			  							while($row3v12b = $productData3v12b->fetch_array()) {									 		
			  								echo "<option value='".$row3v12b['prel_id']."'>".$row3v12b['prel_name']."</option>";
										 	} // /while 
											?>
		  						</select>
			  					</div>
			  				</td>

                            <td style="padding-left:20px;">
			  					<div class="form-group">
								<input type="text" name="kf_name[]" class="form-control" id="kf_name<?php echo $x2; ?>" value="<?php echo $kfname; ?>"  placeholder="First Name" autocomplete="off"/>
			  					</div>
			  				</td>	
							
							
							<td style="padding-left:20px;">
			  					<div class="form-group">
								<input type="text" name="km_name[]" class="form-control" id="km_name<?php echo $x2; ?>" value="<?php echo $kmname; ?>"  placeholder="Middle Name" autocomplete="off"/>
			  					</div>
			  				</td>
							
							<td style="padding-left:20px;">
			  					<div class="form-group">
								<input type="text" name="kl_name[]" class="form-control" id="kl_name<?php echo $x2; ?>" value="<?php echo $klname; ?>"  placeholder="Last Name" autocomplete="off"/>
			  					</div>
			  				</td>
							
							<td style="padding-left:20px;">
			  					<div class="form-group">
								<input type="text" name="k_phone[]" class="form-control" id="k_phone<?php echo $x2; ?>" value="<?php echo $kphoneNo; ?>"  placeholder="Phone Number" autocomplete="off"/>
			  					</div>
			  				</td>
							
							
							<td style="padding-left:20px;">
			  					<div class="form-group">
								<input type="email" name="k_email[]" class="form-control" id="k_email<?php echo $x2; ?>" value="<?php echo $kemail; ?>"  placeholder="Email Address" autocomplete="off"/>
			  					</div>
			  				</td>
							
			  				
			  			</tr>
		  			<?php
		  			$arrayNumber2++;
					$no2++;
			  		} // /for
			  		?>
			  	</tbody>			  	
			  </table>
			  
			  </div>
			  
			  <?php
					}
			  ?>
			  
			    <div class="controls">
			  <div class="row">
			  
			  <div class="col-sm-12">
			  <div class="form-group">
                 <label for="form_name"> Does Staff Has Dependants?: </label>
				 
				 </br>
				 
				  <?php	
                 $sql421f = "SELECT * FROM staff where staff_id='$staff_id'";	
        $result421f = $conn->query($sql421f); 
		while ($row421f = mysqli_fetch_array($result421f))
		{
			
			$depStatus22f = $row421f['dep_status'];
	
		?>			
				 
				 <label class="radio-inline">
          <input type="radio" name="dep_status" value="Yes" id="dep_status" <?php if($depStatus22f=='Yes'){ echo "checked";}?> /> Yes
         </label>&nbsp&nbsp&nbsp&nbsp
         <label class="radio-inline">
          <input type="radio" name="dep_status" value="No" id="dep_status" <?php if($depStatus22f=='No'){ echo "checked";}?> /> No
         </label>&nbsp&nbsp&nbsp&nbsp
				 
		<?php
		                }
						?>	
                 
			
                </div>
			   </div>
			
				
			  </div>	  
              </div>
			  
			  <?php
			if($depStatus22f=='Yes')  {
			  ?>
			  
			  <div id="textboxes8">
			  
			  <table class="table" id="productTable3">
			  	<thead>
			  		<tr>			  			
						
                        <th style="width:20%;">Relationship</th>						
			  			<th style="width:15%;">First Name</th>
						<th style="width:15%;">Middle Name</th>
						<th style="width:15%;">Last Name</th>
						<th style="width:15%;">Gender/Sex</th>
						<th style="width:20%;">Birth Date</th>
						
						
			  		</tr>
			  	</thead>
			  	<tbody>
			  		<?php
			  		$arrayNumber3 = 0;
					$no3 	= 1;
			  		//for($x3 = 1; $x3 < 6; $x3++) { 
					
							$invItemSql12 = "SELECT * FROM dependants WHERE staff_id = {$staff_id}";
					$invItemResult12 = $conn->query($invItemSql12);
						// $orderItemData = $orderItemResult->fetch_all();						
						
						// print_r($orderItemData);
			  		$arrayNumber3 = 0;
			  		// for($x = 1; $x <= count($orderItemData); $x++) {
			  		$x3 = 1;
			  		while($invItemData12 = $invItemResult12->fetch_array()) { 
					$dprel_id1i = $invItemData12['dependant_rel_id'];
					$dpfname= $invItemData12['dependant_fname'];
					$dpmname= $invItemData12['dependant_mname'];
					$dplname= $invItemData12['dependant_lname'];
					$dpphone= $invItemData12['kphone'];
					$dpemail= $invItemData12['kemail'];
					$dpgender= $invItemData12['gender_id'];
					$dependant_birthDate= $invItemData12['dependant_birthDate'];
					$n41 = substr($dpphone,3);
                    $n131 = '0';
					$kphoneNo = $n131.$n41;
					
					?>
			  			<tr id="row<?php echo $x3; ?>" class="<?php echo $arrayNumber3; ?>">	
						
						
							
							 <td style="margin-left:20px;">
			  					<div class="form-group">

			  					<select class="form-control" name="drel_id[]" id="drel_id<?php echo $x3; ?>">
			  						<?php
			  							$productSql3v111 = "SELECT * FROM dependants_rel where dependant_rel_id='$dprel_id1i'";
			  							$productData3v111 = $conn->query($productSql3v111);

			  							while($row3v111 = $productData3v111->fetch_array()) {									 		
			  								echo "<option value='".$row3v111['dependant_rel_id']."'>".$row3v111['dependant_rel_name']."</option>";
										 	} // /while 
											
									$productSql3v111y = "SELECT * FROM dependants_rel where dependant_rel_id!='$dprel_id1i'";
			  							$productData3v111y = $conn->query($productSql3v111y);

			  							while($row3v111y = $productData3v111y->fetch_array()) {									 		
			  								echo "<option value='".$row3v111y['dependant_rel_id']."'>".$row3v111y['dependant_rel_name']."</option>";
										 	} // /while 

			  						?>
		  						</select>
			  					</div>
			  				</td>

                            <td style="padding-left:20px;">
			  					<div class="form-group">
								<input type="text" name="df_name[]" class="form-control" id="df_name<?php echo $x3; ?>" value="<?php echo $dpfname; ?>"  placeholder="First Name" autocomplete="off"/>
			  					</div>
			  				</td>	
							
							
							<td style="padding-left:20px;">
			  					<div class="form-group">
								<input type="text" name="dm_name[]" class="form-control" id="dm_name<?php echo $x3; ?>" value="<?php echo $dpmname; ?>"  placeholder="Middle Name" autocomplete="off"/>
			  					</div>
			  				</td>
							
							<td style="padding-left:20px;">
			  					<div class="form-group">
								<input type="text" name="dl_name[]" class="form-control" id="dl_name<?php echo $x3; ?>" value="<?php echo $dplname; ?>"  placeholder="Last Name" autocomplete="off"/>
			  					</div>
			  				</td>
							
							<td style="margin-left:20px;">
			  					<div class="form-group">

			  					<select class="form-control" name="gender_id1[]" id="gender_id1<?php echo $x3; ?>">
			  						<?php
			  							$productSql3v111g = "SELECT * FROM gender where gender_id='$dpgender'";
			  							$productData3v111g = $conn->query($productSql3v111g);

			  							while($row3v111g = $productData3v111g->fetch_array()) {									 		
			  								echo "<option value='".$row3v111g['gender_id']."'>".$row3v111g['gender_name']."</option>";
										 	} // /while 
											
										$productSql3v111gm = "SELECT * FROM gender where gender_id!='$dpgender'";
			  							$productData3v111gm = $conn->query($productSql3v111gm);

			  							while($row3v111gm = $productData3v111gm->fetch_array()) {									 		
			  								echo "<option value='".$row3v111gm['gender_id']."'>".$row3v111gm['gender_name']."</option>";
										 	} // /while 

			  						?>
		  						</select>
			  					</div>
			  				</td>
							
							<td style="padding-left:20px;">
			  					<div class="form-group">
								<input type="date" name="db_date[]" class="form-control" id="db_date<?php echo $x3; ?>"  value="<?php echo $dependant_birthDate; ?>" placeholder="Birth Date" autocomplete="off"/>
			  					</div>
			  				</td>
							
			  				
			  			</tr>
		  			<?php
		  			$arrayNumber3++;
					$no3++;
			  		} // /for
			  		?>
			  	</tbody>			  	
			  </table>
			  
			  </div>
		  
		  <?php
					}
		  ?>
			  
			  
			 
			   </br></br></br>
			  
			  <div class="controls">
			  <div class="row">
			  
			  <div class="col-sm-3">
			  <div class="form-group">
                 <label for="form_name"> HESLB Beneficiary: </label>
                 <select class="form-control" name="heslb_status" id="heslb_status" autocomplete="off" />
				
			  						<?php
			  							$productSqlvb = "SELECT * from heslb_ben where HesBenId='$HeStatusId'";
			  							$productDatavb = $conn->query($productSqlvb);

			  							while($rowvb = $productDatavb->fetch_array()){									 		
			  								echo "<option value='".$rowvb['HesBenId']."'>".$rowvb['HesbenName']."</option>";
										 	} // /while 
											
									   $productSql1vb = "SELECT * from heslb_ben where HesBenId!='$HeStatusId'";
			  							$productData1vb = $conn->query($productSql1vb);

			  							while($row1vb = $productData1vb->fetch_array()){									 		
			  								echo "<option value='".$row1vb['HesBenId']."'>".$row1vb['HesbenName']."</option>";
										 	} // /while

			  						?>
		  						</select>
                    <br/>
                         <label for="heslb_status" class="error" generated="true"></label>  
                    </div>
			  </div>
			  
			  <div class="col-sm-3">
			  <div class="form-group">
                 <label for="form_name"> Staff Basic Salary in Tsh. </label>
                 <input  type="number" class="form-control" id="basicSalary" name="basicSalary" min="1" value="<?php echo $BasicSalary; ?>" placeholder="Staff Basic Salary in Tsh" autocomplete="off" />
                    <br/>
                         <label for="basicSalary" class="error" generated="true"></label>  
                    </div>
			  </div>
			  
			  <div class="col-sm-3">
			  <div class="form-group">
                 <label for="form_name"> Staff Bank Name </label>
                 <input  type="text" class="form-control" id="bankName" name="bankName"  value="<?php echo $bankName; ?>" placeholder="Staff Bank Name" autocomplete="off" />
                    <br/>
                         <label for="bankName" class="error" generated="true"></label>  
                    </div>
			  </div>
			  
			  <div class="col-sm-3">
			  <div class="form-group">
                 <label for="form_name"> Staff Bank Account No </label>
                 <input  type="text" class="form-control" id="bankAccountNo" name="bankAccountNo"  value="<?php echo $BankAccountNo; ?>" placeholder="Staff Bank Account No" autocomplete="off" />
                    <br/>
                         <label for="bankAccountNo" class="error" generated="true"></label>  
                    </div>
			  </div>
			  

			
			  	</div>	  
                </div>
			 
			
			  <div class="form-group submitButtonFooter">
			    <div class="col-sm-12">
			      <button type="submit" id="createOrderBtn" data-loading-text="Loading..." class="btn btn-success"><i class="glyphicon glyphicon-ok-sign"></i> Save Changes</button>
                  </br></br>
			      <!--<button type="reset" class="btn btn-default" onclick="resetOrderForm()"><i class="glyphicon glyphicon-erase"></i> Reset</button>-->
			    </div>
			  </div>
			  
			  
			</form>                  
				
            </div>
			
			
			
              </div>
            </div>
          </div>
        </div>
        <!-- /page content -->
		
		
		<?php
		include 'includes/footer.php';
		?>
		
        
      </div>
      </div>


	
	<script>
	// order date picker
		$("#bdate").datepicker();
		
		// delivery date picker
		$("#empdate").datepicker();
		
		$("#contStart").datepicker();
	
	</script>
	
	<script>
//$(function(){
	
$(document).ready(function(){
    $('input[name="rel_status"]').on('click', function(){
        if ($(this).val() == 'Have Religion'){
			 $('#textboxes1').show();
        }else {
			$('#textboxes1').hide();
		}
	
		
    });
});

$(document).ready(function(){
    $('input[name="upl_status"]').on('click', function(){
        if ($(this).val() == 'Yes'){
			 $('#textboxes7').show();
        }else {
			$('#textboxes7').hide();
		}
	
		
    });
});

$(document).ready(function(){
    $('input[name="dep_status"]').on('click', function(){
        if ($(this).val() == 'Yes'){
			 $('#textboxes8').show();
        }else {
			$('#textboxes8').hide();
		}
	
		
    });
});

$(document).ready(function(){
    $('input[name="parent_status"]').on('click', function(){
        if ($(this).val() == 'Yes'){
			 $('#textboxes10').show();
        }else {
			$('#textboxes10').hide();
		}
	
		
    });
});

$(document).ready(function(){
    $('input[name="kin_status"]').on('click', function(){
        if ($(this).val() == 'Yes'){
			 $('#textboxes11').show();
        }else {
			$('#textboxes11').hide();
		}
	
		
    });
});

$(document).ready(function(){
    $('input[name="emptype_id"]').on('click', function(){
        if ($(this).val() == 1){
			 $('#textboxes6').hide();
        }else if($(this).val() == 2){
			$('#textboxes6').show();
		}
	
		
    });
});

$(document).ready(function(){
    $('input[name="staffcate_id"]').on('click', function(){
        if ($(this).val() == 1){
			 $('#textboxes2').show();
			 $('#textboxes3').hide();
			 $('#textboxes4').hide();
			 $('#textboxes5').hide();
        }else if($(this).val() == 2){
			$('#textboxes5').show();
			$('#textboxes2').hide();
			$('#textboxes3').hide();
			$('#textboxes4').hide();
		}else if($(this).val() == 3){
			$('#textboxes3').show();
			$('#textboxes2').hide();
			$('#textboxes4').hide();
			$('#textboxes5').hide();
		}else{
			$('#textboxes4').show();
			$('#textboxes2').hide();
			$('#textboxes3').hide();
			$('#textboxes5').hide();
		}
	
		
    });
});

$(document).ready(function(){
    $('#dept_id').on('change', function(){
        var deptID = $(this).val();
        if(deptID){
            $.ajax({
                type:'POST',
                url:'ajax_Data.php',
                data:'dept_id='+deptID,
                success:function(html){
                    $('#sect_id').html(html);
                    $('#des_id').html('<option value="">Select Section first</option>'); 
                }
            }); 
        }else{
            $('#sect_id').html('<option value="">Select Department first</option>');
            $('#des_id').html('<option value="">Select Section first</option>'); 
        }
    });
    
    $('#sect_id').on('change', function(){
        var sectID = $(this).val();
        if(sectID){
            $.ajax({
                type:'POST',
                url:'ajax_Data.php',
                data:'sect_id='+sectID,
                success:function(html){
                    $('#des_id').html(html);
                }
            }); 
        }else{
            $('#des_id').html('<option value="">Select Section first</option>'); 
        }
    });
});


$(document).ready(function(){
    $('#region_id').on('change', function(){
        var regionID = $(this).val();
        if(regionID){
            $.ajax({
                type:'POST',
                url:'ajax_Data16.php',
                data:'region_id='+regionID,
                success:function(html){
                    $('#district_id').html(html);
                    $('#ward_id').html('<option value="">Select District first</option>'); 
                }
            }); 
        }else{
            $('#district_id').html('<option value="">Select Region first</option>');
            $('#ward_id').html('<option value="">Select District first</option>'); 
        }
    });
    
    $('#district_id').on('change', function(){
        var districtID = $(this).val();
        if(districtID){
            $.ajax({
                type:'POST',
                url:'ajax_Data16.php',
                data:'district_id='+districtID,
                success:function(html){
                    $('#ward_id').html(html);
                }
            }); 
        }else{
            $('#ward_id').html('<option value="">Select District first</option>'); 
        }
    });
});


$(document).ready(function(){
    $('#depart_id').on('change', function(){
        var departID = $(this).val();
        if(departID){
            $.ajax({
                type:'POST',
                url:'ajax_Data1.php',
                data:'depart_id='+departID,
                success:function(html){
                    $('#section_id').html(html);
                    $('#desi_id').html('<option value="">Select Section first</option>'); 
                }
            }); 
        }else{
            $('#section_id').html('<option value="">Select Department first</option>');
            $('#desi_id').html('<option value="">Select Section first</option>'); 
        }
    });
    
    $('#section_id').on('change', function(){
        var sectiID = $(this).val();
        if(sectiID){
            $.ajax({
                type:'POST',
                url:'ajax_Data1.php',
                data:'section_id='+sectiID,
                success:function(html){
                    $('#desi_id').html(html);
                }
            }); 
        }else{
            $('#desi_id').html('<option value="">Select Section first</option>'); 
        }
    });
});

 $("#id_frm").validate({
        rules: {
			
			"fname": {
                required: true
            },
			
			"mname": {
                required: true
            },
			
			"lname": {
                required: true
            },
			
			"gender_id": {
                required: true
            },
			
			"email": {
                required: true
            },
			
			"phone": {
                required: true
            },
			
			
			"bdate": {
                required: true
            },
			
			
			"empdate": {
                required: true
            },
			
			"marital_id": {
                required: true
            },
			
			"relId": {
                required: true
            },
			
			"denId": {
                required: true
            },
			
			"cont_dur_id": {
                required: true
            },
			
			
            "contStart": {
                required: true,
                //minlength: 10,
                // minlength: 10 // same rule twice
            },
			
			"edu_level_id": {
                required: true
            },
			
			"region_id": {
                required: true
            },
			
			"district_id": {
                required: true
            },
			
			"ward_id": {
                required: true
            },
			
			"heslb_status": {
                required: true
            },
			
			"basicSalary": {
                required: true
            },
			
			"bankName": {
                required: true
            },
			
			"bankAccountNo": {
                required: true
            },
			
			"company_address": {
                required: true
            }
			
            
        },
        messages: {
			
			"fname": {
                required: "Please Enter Staff First Name."
            },
			
			"mname": {
                required: "Please Enter Staff Middle Name"
            },
			
			"lname": {
                required: "Please Enter Staff Last Name"
            },
			
			"gender_id": {
                required: "Please Select Gender"
            },
			
            "email": {
                required: "Please Enter Staff Email Address"
            },
			
			"phone": {
                required: "Please Enter Staff Phone Number"
            },
			
			"bdate": {
                required: "Please Enter Staff Birth Date"
            },
			
			"empdate": {
                required: "Please Enter Staff Employment Date"
            },
			
			"marital_id": {
                required: "Please Select Marital Status."
            },
			
			
			"relId": {
                required: "Please Select Religion"
            },
			
			"denId": {
                required: "Please Select Denomination."
            },
			
			
			"cont_dur_id": {
                required: "Please Select Contract Duration"
            },
			
			"contStart": {
                required: "Please Enter Contract Start Date"
            },
			
			"edu_level_id": {
                required: "Please Select Education Level"
            },
			
			"region_id": {
                required: "Please Select Region"
            },
			
			"district_id": {
                required: "Please Select District"
            },
			
			"ward_id": {
                required: "Please Select Ward"
            },
			
			"heslb_status": {
                required: "Please Select Heslb Status"
            },
			
			"basicSalary": {
                required: "Please Select Staff Basic Salary"
            },
			
			"bankName": {
                required: "Please Select Staff Bank Name"
            },
			
			"bankAccountNo": {
                required: "Please Select Staff Bank Account No"
            },
			
			"company_address": {
                required: "Please Enter Company Address"
            }
			
			
        },
        // for demo
        //submitHandler: function(form) {
            //alert('valid form');
            //return false;
        //}
 });


</script>
	
	

   <!-- Must -->
    <script src="custom/js/editStaff.js"></script>
	
    <!-- Must Custom Theme Scripts -->
    <script src="../build/js/custom.min.js"></script>
	
	<!-- file input -->
	<script src="assests/plugins/fileinput/js/plugins/canvas-to-blob.min.js'); ?>" type="text/javascript"></script>	
	<script src="assests/plugins/fileinput/js/plugins/sortable.min.js" type="text/javascript"></script>	
	<script src="assests/plugins/fileinput/js/plugins/purify.min.js" type="text/javascript"></script>
	<script src="assests/plugins/fileinput/js/fileinput.min.js"></script>	


	<!-- DataTables -->
	<script src="assests/plugins/datatables/jquery.dataTables.min.js"></script>

  </body>
</html>



<?php
}
?>