/recruitment/reports/profile_details.php
PHP | 288 lines | 231 code | 57 blank | 0 comment | 57 complexity | 82bd70e9148848011f0f3dd574ddcc17 MD5 | raw file
Possible License(s): LGPL-2.1
- <?php
- require_once('../helper_functions.php');
- require_once('../../lib/database.php');
- openConnection();
-
- function get_fullname($applicant_row_id) {
- $sql_full = "SELECT concat(salutation,' ', surname,', ', firstname,' ', othernames) as fullname FROM tblapplicantsdetails INNER JOIN tblsalutations_lookup ON (tblapplicantsdetails.titleid = tblsalutations_lookup.salutationid) WHERE appaccountrowid = $applicant_row_id";
- $query_full = mysql_query($sql_full);
- $row = mysql_fetch_assoc($query_full);
- $returnVal = $row['fullname'];
- echo $returnVal;
- }
-
- function get_biodata_details($applicant_row_id){
-
- $returnVal = '<table border="1px" style="border-collapse: collapse; width:100%; margin-top:10px" cellpadding="5px" cellspacing="10px">';
-
- if(!is_numeric($applicant_row_id) || ((int)$applicant_row_id < 1) ){
- $returnVal .= '<tr style="border: solid 1px;"><td colspan="2">Error while retrieving the profile information: <strong>"Invalid Applicant ID"</strong></td></tr>';
- }else{
- $q = "SELECT titleid, appaccountrowid, surname, firstname, othernames, concat(salutation,' ', surname,', ', firstname,' ', othernames) as fullname, gender, maritalstatus, physicalchallenge, birthdate, birthplace, hometown, lga, nationality ";
- $q .= "FROM tblapplicantsdetails INNER JOIN tblsalutations_lookup ON (tblapplicantsdetails.titleid = tblsalutations_lookup.salutationid) WHERE appaccountrowid = $applicant_row_id";
-
- $query = mysql_query($q);
- $foundRecord = mysql_num_rows($query);
-
- if ($foundRecord == 1) {
- $row = mysql_fetch_assoc($query);
-
- $returnVal .= '<tr style="border: solid 1px;text-align:center"><td colspan="2"><strong>B I O D A T A</strong><div class="div_square_link"></div></td></tr>';
- $returnVal .= '<tr style="border: solid 1px;"><td><strong>Full Names:</strong></td><td>' . $row['fullname'] . '</td></tr>';
- $returnVal .= '<tr style="border: solid 1px;"><td><strong>Gender:</strong></td><td>' . $row['gender'] . '</td></tr>';
- $returnVal .= '<tr style="border: solid 1px;"><td><strong>Marital Status:</strong></td><td>' . $row['maritalstatus'] . '</td></tr>';
- $returnVal .= '<tr style="border: solid 1px;"><td><strong>Date of Birth:</strong></td><td>' . get_my_date_format($row['birthdate'], 'L') . '<br /><i>(' . get_full_age_from_date($row['birthdate'], 'Full Details') . ')</i></td></tr>';
- $returnVal .= '<tr style="border: solid 1px;"><td><strong>Place of Birth:</strong></td><td>' . $row['birthplace'] . '</td></tr>';
- $returnVal .= '<tr style="border: solid 1px;"><td><strong>Home Town:</strong></td><td>' . $row['hometown'] . '</td></tr>';
- $returnVal .= '<tr style="border: solid 1px;"><td><strong>L. G. A.:</strong></td><td>' . $row['lga'] . '</td></tr>';
- $returnVal .= '<tr style="border: solid 1px;"><td><strong>State:</strong></td><td>' . '' . '</td></tr>';
- $returnVal .= '<tr style="border: solid 1px;"><td><strong>Country:</strong></td><td>' . $row['nationality'] . '</td></tr>';
- $returnVal .= '<tr style="border: solid 1px;"><td><strong>Physical Challenge:</strong></td><td>' . $row['physicalchallenge'] . '</td></tr>';
-
- $_SESSION['bio_Gender'] = $row['gender'];
- $_SESSION['bio_Marital'] = $row['maritalstatus'];
- $_SESSION['bio_DOB'] = get_date_ddmmyyyy($row['birthdate']);
- $_SESSION['bio_Disability'] = $row['physicalchallenge'];
- $_SESSION['bio_BirthPlace'] = $row['birthplace'];
- $_SESSION['bio_HomeTown'] = $row['hometown'];
-
- }else {
- $returnVal .= '<tr style="border: solid 1px;"><td colspan="2">Error while retrieving the profile information: <strong>"Invalid Applicant ID"</strong></td></tr>';
- }//end if ($foundRecord == 1)
- }//end if(!is_numeric($applicant_row_id) || ((int)$applicant_row_id < 1)
-
- $returnVal .= '</table></br>';
- echo $returnVal;
- }
-
- $_SESSION['full_names'] = $row['fullname'];
-
- function get_contact_details($applicant_row_id){
- $returnVal = '<table border="1px" style="border-collapse: collapse; width:100%; margin-top:10px" cellpadding="5px" cellspacing="10px">';
-
- if(!is_numeric($applicant_row_id) || ((int)$applicant_row_id < 1) ){
- $returnVal .= '<tr style="border: solid 1px;"><td colspan="2">Error while retrieving the contact information: <strong>"Invalid Applicant ID"</strong></td></tr>';
- }else{
- $q = "SELECT accountemail, currentaddress, permanenthomeaddress, primaryphone, phonenumber, alternateemail ";
- $q .= "FROM tblapplicantsaccount LEFT JOIN tblapplicantscontacts ON tblapplicantsaccount.account_rowid = tblapplicantscontacts.appaccountrowid ";
- $q .= "LEFT JOIN tblapplicantsotherphones ON tblapplicantsaccount.account_rowid = tblapplicantsotherphones.appaccountrowid ";
- $q .= "WHERE tblapplicantsaccount.account_rowid = $applicant_row_id";
-
- $query = mysql_query($q);
- $foundRecord = mysql_num_rows($query);
-
- if ($foundRecord == 1) {
- $row = mysql_fetch_assoc($query);
- $returnVal .= '<tr style="border: solid 1px;text-align:center"><td colspan="2"><strong>CONTACT DETAILS</strong><div class="div_square_link"></div></td></tr>';
- $returnVal .= '<tr style="border: solid 1px;"><td><strong>Primary E-Mail:</strong></td><td>' . $row['accountemail'] . '</td></tr>';
- $returnVal .= '<tr style="border: solid 1px;"><td><strong>Primary GSM Number:</strong></td><td>' . $row['primaryphone'] . '</td></tr>';
- $returnVal .= '<tr style="border: solid 1px;"><td><strong>Alternative E-Mail:</strong></td><td>' . $row['alternateemail'] . '</td></tr>';
- $returnVal .= '<tr style="border: solid 1px;"><td><strong>Alternative GSM Number:</strong></td><td>' . $row['phonenumber'] . '</td></tr>';
- $returnVal .= '<tr style="border: solid 1px;"><td><strong>Current Contact Address:</strong></td><td>' . $row['currentaddress'] . '</td></tr>';
- $returnVal .= '<tr style="border: solid 1px;"><td><strong>Permanent Home Address:</strong></td><td>' . $row['permanenthomeaddress'] . '</td></tr>';
-
- $_SESSION['contact_AltEmail'] = $row['alternateemail'];
- $_SESSION['contact_AltPhone'] = $row['phonenumber'];
- $_SESSION['contact_PresentAddress'] = $row['currentaddress'];
- $_SESSION['contact_PermaHome'] = $row['permanenthomeaddress'];
- }else {
- $returnVal .= '<tr style="border: solid 1px;"><td colspan="2">Error while retrieving the contact information: <strong>"Invalid Applicant ID"</strong></td></tr>';
- }//end if ($foundRecord == 1)
- }//end if(!is_numeric($applicant_row_id) || ((int)$applicant_row_id < 1)
-
- $returnVal .= '</table></br>';
- echo $returnVal;
- }
-
-
- function get_qualifications_details($applicant_row_id){
- $returnVal = '<table border="1px" style="border-collapse: collapse; width:100%; margin-top:10px" cellpadding="5px" cellspacing="10px">';
-
- if(!is_numeric($applicant_row_id) || ((int)$applicant_row_id < 1) ){
- $returnVal .= '<tr style="border: solid 1px;"><td colspan="2">Error while retrieving the qualification information: <strong>"Invalid Applicant ID"</strong></td></tr>';
- }else{
- $q = "SELECT accountemail, yearobtained, institutionobtained, fieldofstudyid, qualificationtypeid, degreeclassid, certificate, studyfield ";
- $q .= "FROM tblapplicantsaccount LEFT JOIN tblapplicantshighestqual ON tblapplicantsaccount.account_rowid = tblapplicantshighestqual.appaccountrowid ";
- $q .= "LEFT JOIN tblqualifications_lookup ON tblapplicantshighestqual.qualificationtypeid = tblqualifications_lookup.id "; // gets PhD, MSc, BSc, etc
- $q .= "LEFT JOIN tblstudyfield_lookup ON tblapplicantshighestqual.fieldofstudyid = tblstudyfield_lookup.id "; //gets description of field of study
- $q .= "WHERE tblapplicantsaccount.account_rowid = $applicant_row_id";
-
- $query = mysql_query($q);
- $foundRecord = mysql_num_rows($query);
-
- if ($foundRecord == 1) {
- $row = mysql_fetch_assoc($query);
- $returnVal .= '<tr style="border: solid 1px;text-align:center"><td colspan="2"><strong>HIGHEST ACADEMIC QUALIFICATION</strong><div class="div_square_link"></div></td></tr>';
- if(isset($row['certificate'])){
- $qual = $row['certificate'] . ' ' . $row['studyfield'] . ' <i>(' . $row['institutionobtained'] . ', ' . $row['yearobtained'] . ')</i>';
- }else{
- $qual = 'No academic qualification information found.';
- }
- $returnVal .= '<tr style="border: solid 1px;"><td colspan="2">' . $qual . '</td></tr>';
- }else {
- $returnVal .= '<tr style="border: solid 1px;"><td colspan="2">No academic qualification information found.</td></tr>';
- }//end if ($foundRecord == 1)
- }//end if(!is_numeric($applicant_row_id) || ((int)$applicant_row_id < 1)
-
- $returnVal .= '</table></br>';
-
- $q = "SELECT tblapplicants_profqualifications.rowid, qualificationid, yearobtained, awardingbody, tblprofessionalquals_lookup.name ";
- $q .= "FROM tblapplicants_profqualifications LEFT JOIN tblprofessionalquals_lookup ON ";
- $q .= "tblapplicants_profqualifications.qualificationid = tblprofessionalquals_lookup.id ";
- $q .= "WHERE tblapplicants_profqualifications.appaccountrowid = $applicant_row_id ORDER BY name";
-
- $query = mysql_query($q);
- $foundRecord = mysql_num_rows($query);
-
- $returnVal .= '<table border="1px" style="border-collapse: collapse; width:100%; margin-top:10px" cellpadding="5px" cellspacing="10px">';
- $returnVal .= '<tr style="border: solid 1px;text-align:center"><td colspan="4"><strong>PROFESSIONAL QUALIFICATIONS</strong><div class="div_square_link"></div></td></tr>';
-
- if ($foundRecord > 0) {
- $i = 0;
- $returnVal .= '<tr style="border:solid 1px; font-weight:bold"><td align="center">SN</td><td>Qualification</td><td colspan="2" align="center">Awarding Body & Year Obtained</td></tr>';
- while($row = mysql_fetch_assoc($query)){
- $i++;
- $bodyYear = '<i>' . $row['awardingbody'] . ', ' . $row['yearobtained'] . '</i>';
- $ePointer = $row['rowid'] + 1024;
- $returnVal .= '<tr style="border: solid 1px;"><td align="center">' . $i . '.</td><td>' . $row['name'] . '</td><td>' . $bodyYear . '</td><td><div class="div_square_link"></div></td></tr>';
- }//end while
- } else {
- $returnVal .= '<tr style="border: solid 1px;"><td colspan="4">No professional qualification information found.</td></tr>';
- }//end if ($foundRecord == 1)
-
- $returnVal .= '</table></br>';
-
- echo $returnVal;
- }
-
- function get_work_experience_details($applicant_row_id){
- $returnVal = '<table border="1px" style="border-collapse: collapse; width:100%; margin-top:10px" cellpadding="5px" cellspacing="10px">';
-
- if(!is_numeric($applicant_row_id) || ((int)$applicant_row_id < 1) ){
- $returnVal .= '<tr style="border: solid 1px;"><td colspan="2">Error while retrieving the work experience information: <strong>"Invalid Applicant ID"</strong></td></tr>';
- }else{
- $q = "SELECT workingexpid, employer, positionheld, responsibilities, datefrom, dateto ";
- $q .= "FROM tblapplicantsworkexperience WHERE appaccountrowid = $applicant_row_id ORDER BY datefrom DESC";
-
- $query = mysql_query($q);
- $foundRecord = mysql_num_rows($query);
-
- $returnVal .= '<table border="1px" style="border-collapse: collapse; width:100%; margin-top:10px" cellpadding="5px" cellspacing="10px">';
- $returnVal .= '<tr style="border: solid 1px;text-align:center"><td colspan="6"><strong>PREVIOUS WORK EXPERIENCE HISTORY</strong><div class="div_square_link"></div></td></tr>';
-
- if ($foundRecord > 0) {
- $i = 0;
- $returnVal .= '<tr style="border:solid 1px; font-weight:bold"><td align="center">SN</td><td>Employer</td><td>From</td><td>To</td><td>Position</td><td></td></tr>';
- while($row = mysql_fetch_assoc($query)){
- $i++;
- $ePointer = $row['workingexpid'] + 1024;
- $returnVal .= '<tr style="border: solid 1px;"><td align="center">' . $i . '.</td><td>' . $row['employer'] . '</td><td>' . get_my_date_format($row['datefrom'],'M') . '</td><td>' . get_my_date_format($row['dateto'],'M') . '</td><td>' . $row['positionheld'] . '</td><td><div class="div_square_link"><a href="work_experience_edit.php?edit_pointer=' . $ePointer. '" title="click to edit this work experience">[edit]</a></div></td></tr>';
- }//end while
- }else {
- $returnVal .= '<tr style="border: solid 1px;"><td colspan="4">No previous work experience information found.</td></tr>';
- }//end if ($foundRecord == 1)
- }
- $returnVal .= '</table></br>';
-
- echo $returnVal;
- }
-
-
- function load_gender(){
- $cmb = '<option value = "-1">-- Please Select --</option>';
-
- if(isset($_SESSION['bio_Gender']) && $_SESSION['bio_Gender'] == 'M'){
- $cmb .= '<option value = "M" selected="selected">Male</option>';
- }else{
- $cmb .= '<option value = "M">Male</option>';
- }
-
- if(isset($_SESSION['bio_Gender']) && $_SESSION['bio_Gender'] == 'F'){
- $cmb .= '<option value = "F" selected="selected">Female</option>';
- }else{
- $cmb .= '<option value = "F">Female</option>';
- }
-
- echo $cmb;
- }
-
-
- function load_marital_status(){
- $cmb = '<option value = "-1">-- Please Select --</option>';
-
- if(isset($_SESSION['bio_Marital']) && $_SESSION['bio_Marital'] == 'Divorced'){
- $cmb .= '<option value = "Divorced" selected="selected">Divorced</option>';
- }else{
- $cmb .= '<option value = "Divorced">Divorced</option>';
- }
-
- if(isset($_SESSION['bio_Marital']) && $_SESSION['bio_Marital'] == 'Engaged'){
- $cmb .= '<option value = "Engaged" selected="selected">Engaged</option>';
- }else{
- $cmb .= '<option value = "Engaged">Engaged</option>';
- }
-
- if(isset($_SESSION['bio_Marital']) && $_SESSION['bio_Marital'] == 'Married'){
- $cmb .= '<option value = "Married" selected="selected">Married</option>';
- }else{
- $cmb .= '<option value = "Married">Married</option>';
- }
-
- if(isset($_SESSION['bio_Marital']) && $_SESSION['bio_Marital'] == 'Single'){
- $cmb .= '<option value = "Single" selected="selected">Single</option>';
- }else{
- $cmb .= '<option value = "Single">Single</option>';
- }
-
- if(isset($_SESSION['bio_Marital']) && $_SESSION['bio_Marital'] == 'Widowed'){
- $cmb .= '<option value = "Widowed" selected="selected">Widowed</option>';
- }else{
- $cmb .= '<option value = "Widowed">Widowed</option>';
- }
-
- echo $cmb;
- }
-
-
- function load_physical_challenge(){
- $cmb = '<option value = "-1">-- Please Select --</option>';
-
- if(isset($_SESSION['bio_Disability']) && $_SESSION['bio_Disability'] == 'None'){
- $cmb .= '<option value = "None" selected="selected">None</option>';
- }else{
- $cmb .= '<option value = "None">None</option>';
- }
-
- if(isset($_SESSION['bio_Disability']) && $_SESSION['bio_Disability'] == 'Partially Sighted'){
- $cmb .= '<option value = "Partially Sighted" selected="selected">Partially Sighted</option>';
- }else{
- $cmb .= '<option value = "Partially Sighted">Partially Sighted</option>';
- }
-
- if(isset($_SESSION['bio_Disability']) && $_SESSION['bio_Disability'] == 'Impaired Hearing'){
- $cmb .= '<option value = "Impaired Hearing" selected="selected">Impaired Hearing</option>';
- }else{
- $cmb .= '<option value = "Impaired Hearing">Impaired Hearing</option>';
- }
-
- if(isset($_SESSION['bio_Disability']) && $_SESSION['bio_Disability'] == 'Impaired Speech'){
- $cmb .= '<option value = "Impaired Speech" selected="selected">Impaired Speech</option>';
- }else{
- $cmb .= '<option value = "Impaired Speech">Impaired Speech</option>';
- }
-
- if(isset($_SESSION['bio_Disability']) && $_SESSION['bio_Disability'] == 'Mobility Difficulties'){
- $cmb .= '<option value = "Mobility Difficulties" selected="selected">Mobility Difficulties</option>';
- }else{
- $cmb .= '<option value = "Mobility Difficulties">Mobility Difficulties</option>';
- }
-
- if(isset($_SESSION['bio_Disability']) && $_SESSION['bio_Disability'] == 'Others'){
- $cmb .= '<option value = "Others" selected="selected">Others</option>';
- }else{
- $cmb .= '<option value = "Others">Others</option>';
- }
-
- echo $cmb;
- }
- ?>