<!DOCTYPE html>
<html>
<head>
<style>
/*
table, th, td {
  border: 1px solid black;
  border-collapse: collapse;
}
*/
.deptext{
color:#fff;	
}

.container7{
            width: 100%;
            margin-right: auto;
            margin-left: auto;
			background-color: #F6F6F6;
			page-break-after: always;
        }

.stftext{
font-size:8px;
/*font-family: "Open Sans", sans-serif;*/
font-family: "Poppins", sans-serif;
}

.emptext{
font-size:8px;
font-family: "Open Sans", sans-serif;
}

.fhdtext{
font-size:11px;
 font-weight: 300;
/*font-family: "Open Sans", sans-serif;*/
font-family: "Roboto", sans-serif;
/*font-family: "Trebuchet MS", sans-serif;
 font-family: "Times New Roman", Times, serif;*/
}

.ghdtext{
font-size:9px;
 font-weight: 30;
/*font-family: "Open Sans", sans-serif;*/
font-family: "Roboto", sans-serif;
/*font-family: "Trebuchet MS", sans-serif;
 font-family: "Times New Roman", Times, serif;*/
}

table{
            background-color: #fff;
            width: 100%;
            border-collapse: collapse;
			/*border: 1px solid black;*/
        }

        table thead tr{
            border: 1px solid #111;
            background-color: #f2f2f2;
        }
		/*
        table td {
            vertical-align: middle !important;
            text-align: center;
        }
		*/
        table th, table td {
            padding-top: 08px;
            padding-bottom: 08px;
        }

.table-bordered{
            box-shadow: 0px 0px 5px 0.5px gray;
        }
        .table-bordered td, .table-bordered th {
            border: 1px solid #dee2e6;
        }
</style>
</head>
<body>

   <?php
  $sql81 = "SELECT staff.firstname,staff.middlename,staff.lastname,staff.dep_status,staff.rel_status,staff.parent_status,staff.kin_status,staff.staffId,status.name,gender.gender_name,staff.email,staff.phone_number,staff.birth_date,staff.emply_date,marital_status.marital_name,departments.depart_name,sections.sect_name,designation.des_name,designation.des_short_name,staff.BasicSalary,staff.NetPay,staff.taxableAmount,staff.EmployeeNhifContri,staff.EmployeeNssfContri,edu_level.eduName,heslb_ben.HesbenName,denomination.denom_name,religions.religion_name,regions.region_name,denomination.denom_name,wards.ward_name,districts.district_name,emp_type.emp_name,staff.cont_dur_id,staff.bankName,staff.BankAccountNo FROM staff,marital_status,gender,designation,departments,sections,status,edu_level,heslb_ben,religions,denomination,districts,regions,wards,emp_type WHERE staff.staff_id = {$staff_id} and staff.gender_id=gender.gender_id and staff.marital_id=marital_status.marital_id and staff.dept_id=departments.dept_id and staff.des_id=designation.des_id and staff.sect_id=sections.sect_id and staff.status_id=status.status_id and edu_level.eduLevel_id=staff.eduLevel_id and staff.HesBenId=heslb_ben.HesBenId and religions.religion_id=staff.religion_id and denomination.denom_id=staff.denom_id and districts.district_id=staff.district_id and regions.region_id=staff.region_id and wards.ward_id=staff.ward_id and emp_type.emptype_id=staff.emply_type_id";
				$result81 = $conn->query($sql81);
				while($data81 = mysqli_fetch_array($result81))
							{
							$fName = $data81['firstname'];
							$mName = $data81['middlename'];
							$lName = $data81['lastname'];
							$staffId = $data81['staffId'];
							$gender = $data81['gender_name'];
							$phoneNumber = $data81['phone_number'];
							$emailAddress = $data81['email'];
							$desName = $data81['des_name'];
							$deptName = $data81['depart_name'];
							$sectName = $data81['sect_name'];
							$birth_date = $data81['birth_date'];
							$emply_date = $data81['emply_date'];
							$emply_name = $data81['emp_name'];
							$cont_duration = $data81['cont_dur_id'];
							$maritalStatus = $data81['marital_name'];
							$status = $data81['name'];
							$eduName = $data81['eduName'];
							$status = $data81['name'];
							$denomName = $data81['denom_name'];
							$districtName = $data81['district_name'];
							$wardName = $data81['ward_name'];
							$regionName = $data81['region_name'];
							$religName = $data81['religion_name'];
							$EmployeeNhifContri = number_format($data81['EmployeeNhifContri'],2);
							$EmployeeNssfContri = number_format($data81['EmployeeNssfContri'],2);
							$taxableAmount = number_format($data81['taxableAmount'],2);
							$netPay = number_format($data81['NetPay'],2);
							$BasicSalary = number_format($data81['BasicSalary'],2);
							$BSalary = $data81['BasicSalary'];
							$bankName = $data81['bankName'];
							$BankAccountNo = $data81['BankAccountNo'];
							$dep_status = $data81['dep_status'];
							$rel_status = $data81['rel_status'];
							$kin_status = $data81['kin_status'];
							$parent_status = $data81['parent_status'];
							$nssf_no = $data81['nssf_no'];
							$nhif_no = $data81['nhif_no'];
				            }
							
							if($heslbStatus=='No'){
							$HeslbAmount = 0; 	
							}else{
							$HeslbAmount = 0.15*$BSalary; 	
							}
							
				$birthDate = date('d-m-Y', strtotime($birth_date));
                $employmentDate = date('d-m-Y', strtotime($emply_date));			
							
				 $phone = substr($phoneNumber, 3);
	             $phone_number = '0'.$phone;
				 
				 $current_date = date("Y-m-d");
	                         $d1 = strtotime("$birth_date");
                             $d2 = strtotime("$current_date");
                             $min_date = min($d1, $d2);
                             $max_date = max($d1, $d2);
                                    $i = 0;
				while (($min_date = strtotime("+1 YEAR", $min_date)) <= $max_date) {
                                   $i++;
                                      }
									  $Year = $i;
									  $age=$Year;
									  
							if($age>0) {
									$age=$Year; 
										 
									 }else{
										 
						$d11 = strtotime("$birth_date");
                             $d22 = strtotime("$current_date");
                             $min_date = min($d11, $d22);
                             $max_date = max($d11, $d22);
                                    $i = 0;
				while (($min_date = strtotime("+1 MONTH", $min_date)) <= $max_date) {
                                   $i++;
                                      }					  
										  
								$Month = $i;		  
								$age1 = $Month.' '.'Months';
                                  
                                  if($age1>0){
									 $age =  $age1;
								      }else{
									$d111 = strtotime("$birth_date");
                             $d222 = strtotime("$current_date");
                             $min_date = min($d111, $d222);
                             $max_date = max($d111, $d222);
                                    $i = 0;
				while (($min_date = strtotime("+1 DAY", $min_date)) <= $max_date) {
                                   $i++;
                                      }	

                                $day = $i;		  
								$age1 = $day.' '.'Days';									  
								$age =  $age1;	  
									  }								  
										 
									 }
									 
				$d1g = strtotime("$emply_date");
                             $d2g = strtotime("$current_date");
                             $min_dateg = min($d1g, $d2g);
                             $max_dateg = max($d1g, $d2g);
                                    $ig = 0;
				while (($min_dateg = strtotime("+1 YEAR", $min_dateg)) <= $max_dateg) {
                                   $ig++;
                                      }
									  $Yearg = $ig;
									  $ageg=$Yearg;
									  
							if($ageg>0) {
									$agem=$Yearg; 
										 
									 }else{
										 
						$d11g = strtotime("$emply_date");
                             $d22g = strtotime("$current_date");
                             $min_dateg = min($d11g, $d22g);
                             $max_dateg = max($d11g, $d22g);
                                    $ig = 0;
				while (($min_dateg = strtotime("+1 MONTH", $min_dateg)) <= $max_dateg) {
                                   $ig++;
                                      }					  
										  
								$Monthg = $ig;		  
								$age1g = $Monthg.' '.'Months';
                                  
                                  if($age1g>0){
									 $agem =  $age1g;
								      }else{
									$d111g = strtotime("$emply_date");
                             $d222g = strtotime("$current_date");
                             $min_dateg = min($d111g, $d222g);
                             $max_dateg = max($d111g, $d222g);
                                    $ig = 0;
				while (($min_dateg = strtotime("+1 DAY", $min_dateg)) <= $max_dateg) {
                                   $ig++;
                                      }	

                                $dayg = $ig;		  
								$age1g = $dayg.' '.'Days';									  
								$agem =  $age1g;	  
									  }								  
										 
									 }					 
									 
									 
				 ?>

<div class="container7">

<table>
  <tr>
    <td rowspan="4" style="width:20%">
	<center>
	<?php
			  //global $conn;
			  /*
			  $sql362a = "SELECT company_details.logo FROM company_details";
              $result362a = $conn->query($sql362a);
			 $num362a = mysqli_num_rows($result362a);
			          if($num362a>0){
              while ($row362a = mysqli_fetch_array($result362a)){
						$image_urla = substr($row362a['logo'], 3);
						echo "<img src = ".$image_urla." width='40' height='50px'>";
			                }
                            }
							*/
			  ?>	
	</center>
	</td>
    <td style="width:80%"><div class="fhdtext"> LUPTAN ENGINEERING CO LTD </div></td>
	
  </tr>
  <tr>
    <td style="width:80%"><div class="ghdtext"> P.O BOX 24520, MIKOCHENI "B" | +255 763 499 997 | info@luptan.co.tz </div></td>
	
  </tr>
  <tr>
    <td style="width:80%"><div class="ghdtext"> EMPLOYEE PROFILE SHEET </div></td>
	
  </tr>
  <tr>
    <td style="width:80%"><div class="ghdtext">Note: This information will be shared within organizations participating agency immersive development programs</div></td>
	
	
	
  </tr>
  
 
  
  
   <tr>
   
    <td colspan="4"> <div class="emptext"> <hr> <br> Employee Details  </div> </td>
	
  </tr>
  
  
  
  <tr>
    <td colspan="4"> 
	
	<!--<div class="body-section">-->
	
    <table style="width:100%" class="table-bordered">
	
	 <thead>
	
	<tr>  
	<td style="width:20%"> <div class="stftext">First Name </div> </td>
	<td style="width:30%"> <div class="stftext"><?php echo $fName; ?> </div></td>
	<td style="width:20%"> <div class="stftext">Middle Name </div> </td>
	<td style="width:30%"> <div class="stftext"><?php echo $mName; ?> </div></td>
	</tr>
	
	<tr>  
	<td style="width:20%"> <div class="stftext">Last Name </div> </td>
	<td style="width:30%"> <div class="stftext"><?php echo $lName; ?> </div></td>
	<td style="width:20%"> <div class="stftext"> Staff Id </div> </td>
	<td style="width:30%"> <div class="stftext"><?php echo $staffId; ?> </div></td>
	</tr>
	
	<tr>  
	<td style="width:20%"> <div class="stftext"> Email </div> </td>
	<td style="width:30%"> <div class="stftext"><?php echo $emailAddress; ?> </div></td>
	<td style="width:20%"> <div class="stftext"> Phone Number </div> </td>
	<td style="width:30%"> <div class="stftext"><?php echo $phone_number; ?> </div></td>
	</tr>
	
	<tr>  
	<td style="width:20%"> <div class="stftext"> Gender </div> </td>
	<td style="width:30%"> <div class="stftext"><?php echo $gender; ?> </div></td>
	<td style="width:20%"> <div class="stftext"> Marital Status </div> </td>
	<td style="width:30%"> <div class="stftext"><?php echo $maritalStatus; ?> </div></td>
	</tr>
	
	<tr>  
	<td style="width:20%"> <div class="stftext"> Birth Date </div> </td>
	<td style="width:30%"> <div class="stftext"><?php echo $birthDate; ?> </div></td>
	<td style="width:20%"> <div class="stftext"> Employment Date </div> </td>
	<td style="width:30%"> <div class="stftext"><?php echo $employmentDate; ?> </div></td>
	</tr>
	
	<tr>  
	<td style="width:20%"> <div class="stftext"> Age </div> </td>
	<td style="width:30%"> <div class="stftext"><?php echo $age; ?> </div></td>
	<td style="width:20%"> <div class="stftext"> Employment Period </div> </td>
	<td style="width:30%"> <div class="stftext"><?php echo $agem; ?> </div></td>
	</tr>
	
	<?php
	if($rel_status=='Have Religion'){
	?>
	
	<tr>  
	<td style="width:20%"> <div class="stftext"> Religion </div> </td>
	<td style="width:30%"> <div class="stftext"><?php echo $religName; ?> </div></td>
	<td style="width:20%"> <div class="stftext"> Denomination </div> </td>
	<td style="width:30%"> <div class="stftext"><?php echo $denomName; ?> </div></td>
	</tr>
	
	<?php
	}else{
	?>
	
	<tr>  
	<td colspan="4" style="width:100%"> <div class="stftext"> Atheist </div> </td>
	
	</tr>
	
	<?php
	}
	?>
	
	<tr>  
	<td style="width:20%"> <div class="stftext"> Region Of Birth </div> </td>
	<td style="width:30%"> <div class="stftext"><?php echo $regionName ; ?> </div></td>
	<td style="width:20%"> <div class="stftext"> District Of Birth </div> </td>
	<td style="width:30%"> <div class="stftext"><?php echo $districtName; ?> </div></td>
	</tr>
	
	<tr>  
	<td style="width:20%"> <div class="stftext"> Ward Of Birth </div> </td>
	<td style="width:30%"> <div class="stftext"><?php echo $wardName; ?> </div></td>
	<td style="width:20%"> <div class="stftext"> Basic Salary in Tsh: </div> </td>
	<td style="width:30%"> <div class="stftext"><?php echo $BasicSalary; ?> </div></td>
	</tr>
	
	<tr>  
	<td style="width:20%"> <div class="stftext"> Department </div> </td>
	<td style="width:30%"> <div class="stftext"><?php echo $deptName; ?> </div></td>
	<td style="width:20%"> <div class="stftext"> Section: </div> </td>
	<td style="width:30%"> <div class="stftext"><?php echo $sectName; ?> </div></td>
	</tr>
	
	<tr>  
	<td style="width:20%"> <div class="stftext"> Designation </div> </td>
	<td style="width:30%"> <div class="stftext"><?php echo $desName; ?> </div></td>
	<td style="width:20%"> <div class="stftext"> Education Level: </div> </td>
	<td style="width:30%"> <div class="stftext"><?php echo $eduName; ?> </div></td>
	</tr>
	
	<?php
	if($emply_name=='Contract'){
	?>
	
	<tr>  
	<td style="width:20%"> <div class="stftext"> Employment Type </div> </td>
	<td style="width:30%"> <div class="stftext"><?php echo $emply_name; ?> </div> </td>
	<td style="width:20%"> <div class="stftext"> Contract Duration (Months) </div> </td>
	<td style="width:30%"> <div class="stftext"><?php echo $cont_duration; ?> </div> </td>
	</tr>
	
	<?php
	}else{
	?>
	
	<tr>  
	<td colspan="2" style="width:50%"> <div class="stftext"> Employment Type </div> </td>
	<td colspan="2" style="width:50%"> <div class="stftext"><?php echo $emply_name; ?> </div> </td>
	</tr>

    <?php
	}
	?>
	
	<tr>  
	<td style="width:20%"> <div class="stftext"> Staff Nssf No </div> </td>
	<td style="width:30%"> <div class="stftext"><?php echo $nssf_no; ?> </div> </td>
	<td style="width:20%"> <div class="stftext"> Staff Nhif No </div> </td>
	<td style="width:30%"> <div class="stftext"><?php echo $nhif_no; ?> </div> </td>
	</tr>
	
	<tr> 
    <!--<td style="width:25%"> <div class="stftext"> Staff Nssf No </div> </td>
	<td style="width:15%"> <div class="stftext"><?php echo $nssfNo; ?> </div> </td>-->
	<td style="width:20%"> <div class="stftext"> Nssf Contribution in Tsh </div> </td>
	<td style="width:30%"> <div class="stftext"><?php echo $EmployeeNssfContri; ?> </div> </td>
	<td style="width:20%"> <div class="stftext"> Nhif Contribution in Tsh</div> </td>
	<td style="width:30%"> <div class="stftext"><?php echo $EmployeeNhifContri; ?> </div> </td>
	</tr>
	
	<tr>  
	<td style="width:20%"> <div class="stftext"> Taxable Amount in Tsh </div> </td>
	<td style="width:30%"> <div class="stftext"><?php echo $taxableAmount; ?> </div> </td>
	<td style="width:20%"> <div class="stftext"> Net Pay in Tsh</div> </td>
	<td style="width:30%"> <div class="stftext"><?php echo $netPay; ?> </div> </td>
	</tr>
	
	<tr>  
	<td style="width:20%"> <div class="stftext"> Bank Name </div> </td>
	<td style="width:30%"> <div class="stftext"><?php echo $bankName; ?> </div></td>
	<td style="width:20%"> <div class="stftext"> Bank Account No</div> </td>
	<td style="width:30%"> <div class="stftext"><?php echo $BankAccountNo; ?> </div></td>
	</tr>
	
	
	 </thead>
	
	</table>
	
	<!--</div>-->
	
	</td>
	
  </tr>
  
 
  
   <tr>
    <td colspan="4"> 
	
	<table style="width:100%">
	
	<tr bgcolor="#363333">  
	<td> <div class="deptext">DEPENDANTS </div> </td>
	</tr>
	
	
	
	</table>
	
	
	
	</td>
	 
  </tr>
  
  <?php
  if($dep_status=='Yes'){
  ?>
  
 <tr style="width:100%">
    <td colspan="4"> 
	
    <table style="width:100%" border="1">
	  <thead>
	<tr>  
	<th style="width:5%"> <div class="stftext"> S/No:</div> </th>
	<th style="width:50%"> <div class="stftext"> Name Of Dependants</div> </th>
	<th style="width:20%"> <div class="stftext">Date Of Birth </div></th>
	<th style="width:5%"> <div class="stftext">Gender </div> </th>
	<th style="width:20%"> <div class="stftext">Relationship </div></th>
	</tr>
	 </thead>
	 
	  <tbody>
				
				<?php
  $procRequestSql219 = "SELECT * from dependants,dependants_rel,gender WHERE dependants.staff_id='$staff_id' and dependants.dependant_rel_id=dependants_rel.dependant_rel_id and gender.gender_id=dependants.gender_id order by dependants.dependant_fname asc";
  $procRequestResult219 = $conn->query($procRequestSql219);
                    $x = 1;
					$no = 1;
    while($procRequestData219 = $procRequestResult219->fetch_array()){ 
          $depFname = $procRequestData219['dependant_fname'];
		  $depLname = $procRequestData219['dependant_lname'];
		  $depRelName = $procRequestData219['dependant_rel_name'];
		  $gender_name = $procRequestData219['gender_name'];
		  $dependant_rel_name = $procRequestData219['dependant_rel_name'];
		  $dependant_birthDate = $procRequestData219['dependant_birthDate'];
		  $dependantBirthDate = date('d-m-Y', strtotime($dependant_birthDate));
    ?>
				
                    <tr>
					    <td class="stftext"><?php print $no;  ?></td>
                        <td class="stftext"><?php print $depFname.' '.$depLname;  ?></td>
						<td class="stftext"><?php print $dependantBirthDate;  ?></td>
						<td class="stftext"><?php print $gender_name;  ?></td>
						<td class="stftext"><?php print $dependant_rel_name;  ?></td>
                    </tr>
                    
					
				<?php
				$no++;
}
?>	
					
	
					
                </tbody> 
	 
	</table>
	
	</td>
	
  </tr>
  
  <?php
  }else{
  ?>
  
  <tr>
    <td colspan="4"> 
	
   <div class="stftext">NONE</div>
	
	</td>
	
  </tr>

  <?php
  }
  ?>
  
  
   <tr>
    <td colspan="4"> 
	
	<table style="width:100%">
	
	<tr bgcolor="#363333">  
	<td> <div class="deptext"> CAREER ACCOMPLISHMENTS </div> </td>
	</tr>
	
	
	
	</table>
	
	
	
	</td>
	 
  </tr>
  
    <tr>
    <td colspan="4"> <div class="emptext"> Your career accomplishment (s) </div> </td>
	
  </tr>
  
  
  
  <tr>
    <td colspan="4"> 
	
    <table style="width:100%" border="1">
	
	 <thead>
	<tr>  
	<th style="width:5%"> <div class="stftext"> S/No:</div> </th>
	<th style="width:10%"> <div class="stftext"> DURATION </div> </td>
	<th style="width:40%"> <div class="stftext"> NAME OF UNIVERSITY/SCHOOL </div></td>
	<th style="width:45%"> <div class="stftext"> AWARDS </div> </td>
	</tr>
	 </thead>
	 
	 <tbody>
				
				<?php
  $procRequestSql219s = "SELECT * from edu_background WHERE edu_background.staff_id='$staff_id'";
  $procRequestResult219s = $conn->query($procRequestSql219s);
                    $xs = 1;
					$nos = 1;
    while($procRequestData219s = $procRequestResult219s->fetch_array()){ 
          $eduDesc = $procRequestData219s['eduDesc'];
		  $inst_name = $procRequestData219s['inst_name'];
		  $edu_period = $procRequestData219s['edu_period'];
    ?>
				
                    <tr>
					    <td class="stftext"><?php print $nos;  ?></td>
                        <td class="stftext"><?php print $edu_period;  ?></td>
						<td class="stftext"><?php print $inst_name;  ?></td>
						<td class="stftext"><?php print $eduDesc;  ?></td>
                    </tr>
                    
					
				<?php
				$nos++;
}
?>	
					
	
					
                </tbody> 
	 
	</table>
	
	</td>
	
  </tr>
  
  
  
  
  
   <tr>
    <td colspan="4"> 
	
	<table style="width:100%">
	
	<tr bgcolor="#363333">  
	<td> <div class="deptext"> PARENTS/GUARDIANS </div> </td>
	</tr>
	
	
	
	</table>
	
	
	
	</td>
	 
  </tr>
  
  <?php
  if($parent_status=='Yes'){
  ?>
  
 <tr>
    <td colspan="4"> 
	
    <table style="width:100%" border="1">
	  <thead>
	<tr>  
	<th style="width:5%"> <div class="stftext"> S/No:</div> </th>
	<th style="width:50%"> <div class="stftext"> NAME OF PARENT/GUARDIAN</div> </th>
	<th style="width:20%"> <div class="stftext"> PHONE NUMBER </div></th>
	<th style="width:5%"> <div class="stftext"> EMAIL </div> </th>
	<th style="width:20%"> <div class="stftext"> RELATIONSHIP </div></th>
	</tr>
	 </thead>
	 
	  <tbody>
				
				<?php
  $procRequestSql219n = "SELECT * from parents_guardians,parent_relationships WHERE parents_guardians.staff_id='$staff_id' and parents_guardians.prel_id=parent_relationships.prel_id";
  $procRequestResult219n = $conn->query($procRequestSql219n);
                    $xn = 1;
					$non = 1;
    while($procRequestData219n = $procRequestResult219n->fetch_array()){ 
          $pFname = $procRequestData219n['pfname'];
		  $pLname = $procRequestData219n['plname'];
		  $pphone = $procRequestData219n['pphone'];
		  $pemail = $procRequestData219n['pemail'];
		  $prel_name = $procRequestData219n['prel_name'];
		  
		  $p_phone = substr($pphone, 3);
	             $pphone_number = '0'.$p_phone;
    ?>
				
                    <tr>
					    <td class="stftext"><?php print $non;  ?></td>
                        <td class="stftext"><?php print $pFname.' '.$pLname;  ?></td>
						<td class="stftext"><?php print $pphone_number;  ?></td>
						<td class="stftext"><?php print $pemail;  ?></td>
						<td class="stftext"><?php print $prel_name;  ?></td>
                    </tr>
                    
					
				<?php
				$non++;
}
?>	
					
	
					
                </tbody> 
	 
	</table>
	
	</td>
	
  </tr>
  
  <?php
  }else{
  ?>
  
  <tr>
    <td colspan="4"> 
	
   <div class="stftext">NONE</div>
	
	</td>
	
  </tr>

  <?php
  }
  ?>
  
 
  
  <tr>
    <td colspan="4"> 
	
	<table style="width:100%">
	
	<tr bgcolor="#363333">  
	<td> <div class="deptext"> NEXT OF KIN </div> </td>
	</tr>
	
	
	
	</table>
	
	
	
	</td>
	 
  </tr>
  
  
  
  
    <?php
  if($kin_status=='Yes'){
  ?>
  
 <tr>
    <td colspan="4"> 
	
    <table style="width:100%" border="1">
	  <thead>
	<tr>  
	<th style="width:5%"> <div class="stftext"> S/No:</div> </th>
	<th style="width:50%"> <div class="stftext"> NAME </div> </th>
	<th style="width:20%"> <div class="stftext"> PHONE NUMBER </div></th>
	<th style="width:5%"> <div class="stftext"> EMAIL </div> </th>
	<th style="width:20%"> <div class="stftext"> RELATIONSHIP </div></th>
	</tr>
	 </thead>
	 
	  <tbody>
				
				<?php
  $procRequestSql219n2 = "SELECT * from next_kin,parent_relationships WHERE next_kin.staff_id='$staff_id' and next_kin.prel_id=parent_relationships.prel_id";
  $procRequestResult219n2 = $conn->query($procRequestSql219n2);
                    $xn2 = 1;
					$non2 = 1;
    while($procRequestData219n2 = $procRequestResult219n2->fetch_array()){ 
          $kFname = $procRequestData219n2['kfname'];
		  $kLname = $procRequestData219n2['klname'];
		  $kphone = $procRequestData219n2['kphone'];
		  $kemail = $procRequestData219n2['kemail'];
		  $kprel_name = $procRequestData219n2['prel_name'];
		  
		  $k_phone = substr($kphone, 3);
	             $kphone_number = '0'.$k_phone;
    ?>
				
                    <tr>
					    <td class="stftext"><?php print $non2;  ?></td>
                        <td class="stftext"><?php print $kFname.' '.$kLname;  ?></td>
						<td class="stftext"><?php print $kphone_number;  ?></td>
						<td class="stftext"><?php print $kemail;  ?></td>
						<td class="stftext"><?php print $kprel_name;  ?></td>
                    </tr>
                    
					
				<?php
				$non2++;
}
?>	
					
	
					
                </tbody> 
	 
	</table>
	
	</td>
	
  </tr>
  
  <?php
  }else{
  ?>
  
  <tr>
    <td colspan="4"> 
	
   <div class="stftext">NONE</div>
	
	</td>
	
  </tr>

  <?php
  }
  ?>
  
</table>

</div>


<div style="page-break-inside: avoid;">
</div>


</body>
</html>