/home/mip/public_html_/old-website/employerxxx/report_applicant_version2.php
<?
session_start();
require_once("func_all.php");
session_start();
require_once("func_all.php");
do_report_header2a("Applicant's Qualification Highlights - ".get_applicantname($applicant_id));
$company = getdata_one("*","company",1,1);
$applicant = getdata_one("*","personal","applicant_id",$applicant_id);
if(!strcasecmp(getname($applicant['country_id'],"country","country_id"),'Taiwan'))// if 1st country is equal to Taiwan in case insensitive way
$applicantid_taiwan = $applicant['applicant_id1'];
elseif(!strcasecmp(getname($applicant['country_id2'],"country","country_id"),'Taiwan'))// if 2nd country is equal to Taiwan in case insensitive way
$applicantid_taiwan = $applicant['applicant_id2'];
$education = getdata("select * from education where applicant_id='$applicant_id' order by from_date desc");
$dependents = getdata_one("*","dependents","applicant_id","$applicant_id");
$children = getdata("select bday from children where applicant_id='$applicant_id' order by bday asc");
$num_children = count($children);
$employment = getdata("select * , DATE_FORMAT(from_date,'%b %Y') AS frm_date, IF(to_date,DATE_FORMAT(to_date,'%b %Y'),'PRESENT') as t_date from employment where applicant_id='$applicant_id' and overseas=0 order by from_date desc limit 3");
$num_emp = count($employment);
$employment2 = getdata("select * , DATE_FORMAT(from_date,'%b %Y') AS frm_date, IF(to_date,DATE_FORMAT(to_date,'%b %Y'),'PRESENT') as t_date from employment where applicant_id='$applicant_id' and overseas=1 order by from_date desc limit 3");
$num_emp2 = count($employment2);
$questions = getdata_one("*","questions","applicant_id","$applicant_id");
$prequalify = getdata_one("*","prequalify","applicant_id","$applicant_id");
$educ_elem = getdata("select * from education where applicant_id=" .$applicant_id . " And education='Elementary'");
$educ_high = getdata("select * from education where applicant_id=" .$applicant_id . " And education='Secondary'");
$educ_college = getdata("select * from education where applicant_id=" .$applicant_id . " And education='College/University'");
$educ_voc = getdata("select * from education where applicant_id=" .$applicant_id . " And (education='Vocational' OR education='Training/Seminar')");
$educ_voc_num =count($educ_voc);
$educ_post = getdata("select * from education where applicant_id=" .$applicant_id . " And education='Post Graduate'");
$educ_post_num =count($educ_post);
$educ_lic = getdata("select * from education where applicant_id=" .$applicant_id . " And education='Licentiate'");
$educ_lic_num =count($educ_lic);
?>
<tr><td height="100%" align=center valign="top">
<table align=center cellpadding='2' cellspacing='2' border=0 width=100%>
<script language="JavaScript"><!--
function cent(amount) {
// returns the amount in the .99 format
amount -= 0;
amount = (Math.round(amount*100))/100;
return (amount == Math.floor(amount)) ? amount + '.00' : ( (amount*10 == Math.floor(amount*10)) ? amount + '0' : amount);
}
</script>
<tr><td valign='top' width=100%>
<table border=0 align=center width="100%" cellpadding=3 bordercolor="whiteviolet">
<tr>
<td align="center" valign='bottom' width=100% class="report_thicker">
<table border=0 bordercolor='#333333' width=100% cellpadding=0 cellspacing=0 class="report">
<td align="center" width=30% valign='bottom'>
<img src="../irisonline/img/jakelogoonly.jpg" align="center">
</td>
<td align="left" width=70%>
<font color="green">
<b>
<?=$company['agency_address']?><br>
Tel no.: <?=$company['agency_tel']?> * FAX No.: <?=$company['agency_fax']?><br>
Email: <?=$company['agency_email']?></font></b>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table width="100%" cellpadding=0 cellspacing=0 border=0 bordercolor="maroon">
<tr>
<td colspan=8>
<table border=0 width=100%><tr><td valign="bottom" width=12%><b>REF. NO:</td>
<td class="line" width=30%><?=$applicant['applicant_id']?></td>
<td width=58%> </td>
</tr></table>
</td>
<td colspan=2 rowspan=7 class="report" align='center' width=20% valign='bottom'>
<?if ($applicant[picture]){print resize_pic1(175,175,$pic_dir1.$applicant[picture],"","","",1);}else{echo "PHOTO<br>2 x 2";}?>
</td>
</tr>
<tr>
<td colspan=8 width=100%>
<table border=0 width=100%><tr><td valign="bottom" width=14%><b>Nationality:</td>
<td class="line" width=40%><?=$applicant['nationality']?> </td>
<td width=46%> </td>
</tr></table>
</td>
</tr>
<tr>
<td colspan=8>
<table border=0 width=100%><tr><td valign="bottom" width=28%><b>Positioned Applied for:</td>
<td class="line" width=50%><?=getfield("name","positions", "position_id", $applicant['position_id1'])?> </td>
<td width=22%> </td>
</tr></table>
</td>
</tr>
<tr>
<td colspan=7 class="line_thicker" valign="bottom" width=90%>
<table border=0 width=100%><tr><td valign="bottom" width=90%><font size=3><b>APPLICANT'S QUALIFICATION HIGHLIGHTS</b></font></td>
</tr></table>
<td width=10%> </td>
</td>
</tr>
<tr>
<td colspan=7>
<table border=0 width=100%><tr><td valign="bottom" width=7%><b>NAME:</td>
<td class="line" width=93%><?=$applicant["fname"]?> <?=substr($applicant["mname"],0,1)?>. <?=$applicant["lname"]?> </td>
</tr></table>
</td>
</tr>
<tr>
<td colspan=7>
<table border=0 width=100%><tr><td valign="bottom" WIDTH=6%><b>AGE:</td>
<td class="line" WIDTH=15% valign='bottom'> <?=get_age($applicant['birthdate'])?></td>
<td valign="bottom" WIDTH=30% align='left' style="padding-left:25px;"><b>DATE OF BIRTH:</td>
<td class="line" WIFTH=49%><?=dateformat($applicant['birthdate'])?> </td>
</tr></table>
</td>
</tr>
<tr>
<td colspan=7>
<table border=0 width=100%><tr><td valign="bottom" WIDTH=23%><b>PLACE OF BIRTH:</td>
<td class="line" WIDTH=77%><?=$applicant['birthplace']?> </td>
</tr></table>
</td>
</tr>
<tr>
<td colspan=10>
<table border=0 width=100%><tr><td valign="bottom" WIDTH=13%><b>CIVIL STATUS:</td>
<td class="line" WIDTH=25% valign='bottom'><?=$applicant['civil_status']?> </td>
<td valign="top" align='left' width=25% style="padding-left:30px;"><font size=1>IF MARRIED</font><br>
<b>HUSBAND/WIFE'S NAME:</b></td>
<td class="line" width=28% valign='bottom'><?=$applicant['husband_or_wife']?> </td>
</tr></table>
</td>
</tr>
<tr>
<td colspan=10>
<table border=0 width=100%>
<tr>
<td height=1 width=8%><b>HEIGHT: </td>
<td class="line" align='center' width=11%>
<?if($applicant['height2']=="ft"){
list($feet, $inch) = split("[.]", $applicant["height1"]);
$ft = ($feet)*100/3.28;
$in = ($inch/12)*100/3.28;
echo "<b>" . $converted_cm = round($ft+$in,2);
}else{
echo $applicant["height1"];
}
?>
</td>
<td width=11%>
<b>cm.</b></td>
<td width=8%><b>WEIGHT: </td>
<td class="line" align="center" width=11%>
<?=($applicant['weight2']=="lbs")?round(($applicant['weight1']/2.2),2):$applicant['weight1'];?>
</td>
<td width=11%>
<b>kg.</b></td>
<td colspan=1 width=10%><b>RELIGION:</td>
<td class="line" colspan=3 rowspan=2 valign='top' width=30%> <?=$applicant['religion']?></td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan=10 width=100%>
<table border=0 width=100%>
<tr>
<td width=20%><b>NAME OF FATHER: </td>
<td class="line" width=80%><?=$dependents["f_lname"]?>, <?=$dependents["f_fname"]?> <?=substr($dependents["f_mname"],0,1)?>.</td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan=10 width=100%>
<table border=0 width=100%>
<tr>
<td width=20%><b>NAME OF MOTHER: </td>
<td class="line" width=80%><?=$dependents["m_lname"]?>, <?=$dependents["m_fname"]?> <?=substr($dependents["m_mname"],0,1)?>.</td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan=10 width=100%>
<table border=0 width=100%>
<tr>
<td width=15%><b>PASSPORT NO.: </td>
<td class="line" width=85%><?=getfield("passport","process","applicant_id",$dependents["applicant_id"])?></td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan=10 width=100%>
<table border=0 width=100%>
<tr>
<td width=16%><b>DATE OF ISSUE: </td>
<td class="line" width=30%><?
$date_issued = getfield("pp_date_issued","process","applicant_id",$dependents["applicant_id"]);
print ($date_issued!='0000-00-00')?dateformat1($date_issued):" ";
?></td>
<td width=19% align='center' style="pading-left:5px;"><b>DATE OF EXPIRY: </td>
<td class="line" width=35%><?
$date_expiry = getfield("pp_date_expires","process","applicant_id",$dependents["applicant_id"]);
print ($date_expiry!='0000-00-00')?dateformat1($date_expiry):" ";
?></td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan=10 width=100%>
<table border=0 width=100%>
<tr>
<td width=20%><b>PLACE OF ISSUE :</td>
<td class="line" width=80%><?=getfield("pp_place_issued","process","applicant_id",$dependents["applicant_id"])?></td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan=10 width=100%>
<table border=0 width=100%>
<tr>
<td>
<?if ($applicant[picture_body]){print resize_pic1(351,473,$pic_dir1.$applicant[picture_body],"","","",1);}else{echo "<td width=351 height=473 align='center' valign='middle' class='report'>PHOTO<br>WHOLE BODY";}?></td>
<td width=1% valign="top"> </td>
<td valign="top" align="right">
<br>
<table border=0 width=100% class="report">
<tr>
<td colspan=3 width=100% class="report" height=25><b>EDUCATIONAL ATTAINMENT:</b></td>
</tr>
<tr>
<td align="center" class="report"> </td>
<td align="center" class="report"><b>Degree/Course</b></td>
<td align="center" class="report"><b>Date</b></td>
</tr>
<tr>
<td align="center" class="report" width=5%>1.</td>
<td align="center" class="report"><?=$educ_elem[1]["course"]?> </td>
<td align="center" class="report"> <?=$educ_elem[1]["from_date"]?><?if($educ_elem[1]["from_date"]){echo "-";}?><?=$educ_elem[1]["to_date"]?></td>
</tr>
<tr>
<td align="center" class="report" width=5%>2.</td>
<td align="center" class="report"><?=$educ_high[1]["course"]?> </td>
<td align="center" class="report"> <?=$educ_elem[1]["from_date"]?><?if($educ_elem[1]["from_date"]){echo "-";}?><?=$educ_high[1]["to_date"]?></td>
</tr>
<tr>
<td align="center" class="report" width=5%>3.</td>
<td align="center" class="report"><?=$educ_college[1]["course"]?> </td>
<td align="center" class="report" > <?=$educ_elem[1]["from_date"]?><?if($educ_elem[1]["from_date"]){echo "-";}?><?=$educ_college[1]["to_date"]?></td>
</tr>
<tr>
<td colspan=3 width=100% class="report" height=25><b>TECHNICAL:</b></td>
</tr>
<?for($x=1;$x<=3;$x++){?>
<tr>
<td align="center" class="report" width=5%><?=$x?>.</td>
<td align="center" class="report"> <?=$educ_voc[$x]["course"]?></td>
<td align="center" class="report"> <?=$educ_voc[$x]["from_date"]?><?if($educ_voc[$x]["from_date"]){echo "-";}?><?=$educ_voc[$x]["to_date"]?></td>
</tr>
<?}?>
</table>
<br><br>
<table border=1 width=100% class="report">
<tr>
<td colspan=3 width=100% class="report" height=25><b>WORK EXPERIENCE LOCAL:</b></td>
</tr>
<tr>
<td align="center" class="report"><b>Name of Employer</b></td>
<td align="center" class="report"><b>Country</b></td>
<td align="center" class="report"><b>Year</b></td>
</tr>
<?
for($x=1; $x<=3; $x++){ ?>
<tr>
<td align="center" class="report" height=25><?=$employment[$x]["company"]?> </td>
<td align="center" class="report" height=25><?=getfield("name","country", "country_id", $employment[$x]["country_id"])?> </td>
<td align="center" class="report" height=25>
<?=substr($employment[$x]["from_date"],0,4)?><?
if($employment[$x]["from_date"]){echo "-"; }
print ($employment[$x]["to_date"]!='0000-00-00')?substr($employment[$x]["to_date"],0,4):"PRESENT";
if($employment[$x]["to_date"]!='0000-00-00'){
$total_yrs_exp1 += $employment[$x]["total_years"];
}
?> </td>
</tr>
<? }?>
<tr>
<td colspan=3 width=100% class="report" height=25><b>WORK EXPERIENCE ABROAD:</b></td>
</tr>
<tr>
<td align="center" class="report" width=40%><b>Name of Employer</b></td>
<td align="center" class="report"width=30%><b>Country</b></td>
<td align="center" class="report"width=30%><b>Year</b></td>
</tr>
<?
for($x=1; $x<=3; $x++){ ?>
<tr>
<td align="center" class="report"><?=$employment2[$x]["company"]?> </td>
<td align="center" class="report"><?=getfield("name","country", "country_id", $employment2[$x]["country_id"])?> </td>
<td align="center" class="report">
<?=substr($employment2[$x]["from_date"],0,4)?><?
if($employment2[$x]["from_date"]){echo "-"; }
print ($employment2[$x]["to_date"]!='0000-00-00')?substr($employment2[$x]["to_date"],0,4):"PRESENT";
if($employment2[$x]["to_date"]!='0000-00-00'){
$total_yrs_exp2 += $employment2[$x]["total_years"];
}
?> </td>
</tr>
<? }
$sql2="select applicant_id, from_date, to_date from employment where applicant_id=" . $applicant["applicant_id"] . " AND total_years=0 and from_date <> '0000-00-00'";
$result2 = getdata($sql2);
$result2_num = count($result2) . "<br>";
for($x=1;$x<=$result2_num;$x++){
//echo $result2[$x][from_date];
list($year1,$month1,$day1) = split('[-]', $result2[$x][from_date]);
$unix_time = time();
$unix_from_date = mktime("", "", "", $month1 ,1, $year1);
$compute_years = round(($unix_time - $unix_from_date)/(365*24*60*60),2);
$total_years_exp += $compute_years;
}
$total_total = $total_years_exp + $total_yrs_exp1 + $total_yrs_exp2;?>
</table>
<table border=0 width=100% cclass="report">
<tr>
<td colspan=2 align="right" valign="top" width=65%><b>TOTAL:</b></td>
<td colspan=1 class="line" align="center" valign="top" width=35%><?=format_yymm($total_total)?></td>
</tr>
</table>
<table border=0 width=100% >
<tr>
<td colspan=2 align="center" valign="top" width=45%> </td>
<td colspan=1 class="line" align="center" valign="top" width=55%> </td>
</tr>
<tr>
<td colspan=2 align="center" valign="top" width=45%> </td>
<td colspan=1 align="center" valign="top" width=55%><b>Signature of Applicant</b></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td></tr>
<?
do_report_footer();
?>