/recruitment/reports/print_functions.php
PHP | 183 lines | 147 code | 36 blank | 0 comment | 18 complexity | 819a8a3a1cf7776198d4b74bd9c6beeb MD5 | raw file
Possible License(s): LGPL-2.1
- <?php
- require_once('../helper_functions.php');
- require_once('../../lib/database.php');
- openConnection();
-
- function get_printable_biodata($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 #ff0000;"><td colspan="2">Error while retrieving the profile information: <strong>"Invalid Applicant ID"</strong></td></tr>';
- }else{
- $q = "SELECT titleid, surname, firstname, othernames, gender, maritalstatus, physicalchallenge, birthdate, birthplace, hometown, lga, nationality ";
- $q .= "FROM tblapplicantsdetails 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 #999999;background-color:#dddddd;font-size:18px"><td colspan="2"><strong>1: BIODATA</strong></td></tr>';
-
- $returnVal .= '<tr><td style="width:30%"><strong>Gender:</strong></td><td>' . $row['gender'] . '</td></tr>';
- $returnVal .= '<tr><td><strong>Marital Status:</strong></td><td>' . $row['maritalstatus'] . '</td></tr>';
- $returnVal .= '<tr><td><strong>Date of Birth:</strong></td><td>' . get_my_date_format($row['birthdate'], 'L') . ' <i>(' . get_full_age_from_date($row['birthdate'], 'Full Details') . ')</i></td></tr>';
- $returnVal .= '<tr><td><strong>Place of Birth:</strong></td><td>' . $row['birthplace'] . '</td></tr>';
- $returnVal .= '<tr><td><strong>Home Town:</strong></td><td>' . $row['hometown'] . '</td></tr>';
- $returnVal .= '<tr><td><strong>Local Government Area:</strong></td><td>' . $row['lga'] . '</td></tr>';
- $returnVal .= '<tr><td><strong>State of Origin:</strong></td><td>' . '' . '</td></tr>';
- $returnVal .= '<tr><td><strong>Country of Origin:</strong></td><td>' . $row['nationality'] . '</td></tr>';
- $returnVal .= '<tr><td><strong>Physical Challenge:</strong></td><td>' . $row['physicalchallenge'] . '</td></tr>';
- }else {
- $returnVal .= '<tr><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;
- }
-
-
- function get_printable_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><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 #999999;background-color:#dddddd;font-size:18px"><td colspan="2"><strong>2: CONTACT DETAILS</strong></td></tr>';
- $returnVal .= '<tr><td style="width:30%"><strong>Primary E-Mail:</strong></td><td>' . $row['accountemail'] . '</td></tr>';
- $returnVal .= '<tr><td><strong>Primary GSM Number:</strong></td><td>' . $row['primaryphone'] . '</td></tr>';
- $returnVal .= '<tr><td><strong>Alternative E-Mail:</strong></td><td>' . $row['alternateemail'] . '</td></tr>';
- $returnVal .= '<tr><td><strong>Alternative GSM Number:</strong></td><td>' . $row['phonenumber'] . '</td></tr>';
- $returnVal .= '<tr><td><strong>Current Contact Address:</strong></td><td>' . $row['currentaddress'] . '</td></tr>';
- $returnVal .= '<tr><td><strong>Permanent Home Address:</strong></td><td>' . $row['permanenthomeaddress'] . '</td></tr>';
- }else {
- $returnVal .= '<tr><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_printable_qualifications_details($applicant_row_id){
- $returnVal = '<table border="1px" style="border-collapse: collapse; width:100%; margin-top:10px" cellpadding="5px" cellspacing="10px">';
- $returnVal .= '<tr style="border: solid 1px #999999;background-color:#dddddd;font-size:18px"><td colspan="5"><strong>3: HIGHEST ACADEMIC QUALIFICATION</strong></td></tr>';
-
- if(!is_numeric($applicant_row_id) || ((int)$applicant_row_id < 1) ){
- $returnVal .= '<tr><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, qualification ";
- $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 .= "LEFT JOIN tblqualificationclass ON tblapplicantshighestqual.degreeclassid = tblqualificationclass.qualificationclassid "; //gets class of the degree
- $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);
- if(isset($row['certificate'])){
- $returnVal .= '<tr style="border:solid 1px #999999; font-weight:bold"><td align="center">SN</td><td>Qualification</td><td>Class of Degree</td><td>Awarding Institution</td><td>Year</td></tr>';
-
- $qual = '<td align="center">1.</td><td>' . $row['certificate'] . ' (' . $row['studyfield'] . ') </td><td>' .$row['qualification']. '</td><td>' .$row['institutionobtained'] . '</td><td>' .$row['yearobtained']. '</td>';
- }else{
- $qual = '<tr><td colspan="5">No academic qualification information supplied.</td></tr>';
- }
- $returnVal .= '<tr>' . $qual . '</tr>';
- }else {
- $returnVal .= '<tr><td colspan="5">No academic qualification information supplied.</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 #999999;background-color:#dddddd;font-size:18px"><td colspan="4"><strong>4: PROFESSIONAL QUALIFICATIONS</strong></td></tr>';
-
- if ($foundRecord > 0) {
- $i = 0;
- $returnVal .= '<tr style="border:solid 1px #999999; font-weight:bold"><td align="center">SN</td><td style="width:25%">Qualification</td><td>Awarding Body</td><td>Year Obtained</td></tr>';
- while($row = mysql_fetch_assoc($query)){
- $i++;
- $returnVal .= '<tr><td align="center">' . $i . '.</td><td>' . $row['name'] . '</td><td>' . $row['awardingbody'] . '</td><td>' .$row['yearobtained']. '</td></tr>';
- }//end while
- }else {
- $returnVal .= '<tr><td colspan="4">No professional qualification information supplied.</td></tr>';
- }//end if ($foundRecord == 1)
-
- $returnVal .= '</table></br>';
-
- echo $returnVal;
- }
-
- function get_printable_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><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;background-color:#dddddd;font-size:18px"><td colspan="5"><strong>5: HISTORY OF PREVIOUS WORK EXPERIENCE</strong></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></tr>';
- while($row = mysql_fetch_assoc($query)){
- $i++;
- $returnVal .= '<tr><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></tr>';
- }//end while
- }else {
- $returnVal .= '<tr><td colspan="4">No previous work experience information supplied.</td></tr>';
- }//end if ($foundRecord == 1)
- }
- $returnVal .= '</table></br>';
-
- echo $returnVal;
- }
-
-
- function get_printable_photo($applicant_row_id){
- $finalURL = get_current_photo($applicant_row_id);
- $fURL = '';
- if (user_photo_not_uploaded($applicant_row_id)){
- $fURL = '<div style="position:relative; margin-top:-100px; margin-left:5px">' . $finalURL . '</div>';
- $fURL .= '<div style="float:center; text-align:center; width:100px; margin:5px; margin-left:2px; background-color:#eeeeee; border: 1px solid #339933"><a href="photo_upload.php" title="click to upload your photo">upload photo</a></div>';
-
- $finalURL = $fURL; //'<div style="position:relative; margin-top:-100px; margin-left:5px><a href="photo_upload.php" title="click to upload your photo">upload photo</a></div>';
- }else{
- $fURL = '<div style="position:relative; margin-top:-100px; margin-left:5px">' . $finalURL . '</div>';
- $finalURL = $fURL;
- }
-
- echo $finalURL;
- }
- ?>