PageRenderTime 43ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/recruitment/reports/print_functions.php

https://bitbucket.org/lecturer34/hrmis
PHP | 183 lines | 147 code | 36 blank | 0 comment | 18 complexity | 819a8a3a1cf7776198d4b74bd9c6beeb MD5 | raw file
Possible License(s): LGPL-2.1
  1. <?php
  2. require_once('../helper_functions.php');
  3. require_once('../../lib/database.php');
  4. openConnection();
  5. function get_printable_biodata($applicant_row_id){
  6. $returnVal = '<table border="1px" style="border-collapse: collapse; width:100%; margin-top:10px" cellpadding="5px" cellspacing="10px">';
  7. if(!is_numeric($applicant_row_id) || ((int)$applicant_row_id < 1) ){
  8. $returnVal .= '<tr style="border: solid 1px #ff0000;"><td colspan="2">Error while retrieving the profile information: <strong>"Invalid Applicant ID"</strong></td></tr>';
  9. }else{
  10. $q = "SELECT titleid, surname, firstname, othernames, gender, maritalstatus, physicalchallenge, birthdate, birthplace, hometown, lga, nationality ";
  11. $q .= "FROM tblapplicantsdetails WHERE appaccountrowid = $applicant_row_id";
  12. $query = mysql_query($q);
  13. $foundRecord = mysql_num_rows($query);
  14. if ($foundRecord == 1) {
  15. $row = mysql_fetch_assoc($query);
  16. $returnVal .= '<tr style="border: solid 1px #999999;background-color:#dddddd;font-size:18px"><td colspan="2"><strong>1:&nbsp;&nbsp;BIODATA</strong></td></tr>';
  17. $returnVal .= '<tr><td style="width:30%"><strong>Gender:</strong></td><td>' . $row['gender'] . '</td></tr>';
  18. $returnVal .= '<tr><td><strong>Marital Status:</strong></td><td>' . $row['maritalstatus'] . '</td></tr>';
  19. $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>';
  20. $returnVal .= '<tr><td><strong>Place of Birth:</strong></td><td>' . $row['birthplace'] . '</td></tr>';
  21. $returnVal .= '<tr><td><strong>Home Town:</strong></td><td>' . $row['hometown'] . '</td></tr>';
  22. $returnVal .= '<tr><td><strong>Local Government Area:</strong></td><td>' . $row['lga'] . '</td></tr>';
  23. $returnVal .= '<tr><td><strong>State of Origin:</strong></td><td>' . '' . '</td></tr>';
  24. $returnVal .= '<tr><td><strong>Country of Origin:</strong></td><td>' . $row['nationality'] . '</td></tr>';
  25. $returnVal .= '<tr><td><strong>Physical Challenge:</strong></td><td>' . $row['physicalchallenge'] . '</td></tr>';
  26. }else {
  27. $returnVal .= '<tr><td colspan="2">Error while retrieving the profile information: <strong>"Invalid Applicant ID"</strong></td></tr>';
  28. }//end if ($foundRecord == 1)
  29. }//end if(!is_numeric($applicant_row_id) || ((int)$applicant_row_id < 1)
  30. $returnVal .= '</table><br />';
  31. echo $returnVal;
  32. }
  33. function get_printable_contact_details($applicant_row_id){
  34. $returnVal = '<table border="1px" style="border-collapse: collapse; width:100%; margin-top:10px" cellpadding="5px" cellspacing="10px">';
  35. if(!is_numeric($applicant_row_id) || ((int)$applicant_row_id < 1) ){
  36. $returnVal .= '<tr><td colspan="2">Error while retrieving the contact information: <strong>"Invalid Applicant ID"</strong></td></tr>';
  37. }else{
  38. $q = "SELECT accountemail, currentaddress, permanenthomeaddress, primaryphone, phonenumber, alternateemail ";
  39. $q .= "FROM tblapplicantsaccount LEFT JOIN tblapplicantscontacts ON tblapplicantsaccount.account_rowid = tblapplicantscontacts.appaccountrowid ";
  40. $q .= "LEFT JOIN tblapplicantsotherphones ON tblapplicantsaccount.account_rowid = tblapplicantsotherphones.appaccountrowid ";
  41. $q .= "WHERE tblapplicantsaccount.account_rowid = $applicant_row_id";
  42. $query = mysql_query($q);
  43. $foundRecord = mysql_num_rows($query);
  44. if ($foundRecord == 1) {
  45. $row = mysql_fetch_assoc($query);
  46. $returnVal .= '<tr style="border: solid 1px #999999;background-color:#dddddd;font-size:18px"><td colspan="2"><strong>2:&nbsp;&nbsp;CONTACT DETAILS</strong></td></tr>';
  47. $returnVal .= '<tr><td style="width:30%"><strong>Primary E-Mail:</strong></td><td>' . $row['accountemail'] . '</td></tr>';
  48. $returnVal .= '<tr><td><strong>Primary GSM Number:</strong></td><td>' . $row['primaryphone'] . '</td></tr>';
  49. $returnVal .= '<tr><td><strong>Alternative E-Mail:</strong></td><td>' . $row['alternateemail'] . '</td></tr>';
  50. $returnVal .= '<tr><td><strong>Alternative GSM Number:</strong></td><td>' . $row['phonenumber'] . '</td></tr>';
  51. $returnVal .= '<tr><td><strong>Current Contact Address:</strong></td><td>' . $row['currentaddress'] . '</td></tr>';
  52. $returnVal .= '<tr><td><strong>Permanent Home Address:</strong></td><td>' . $row['permanenthomeaddress'] . '</td></tr>';
  53. }else {
  54. $returnVal .= '<tr><td colspan="2">Error while retrieving the contact information: <strong>"Invalid Applicant ID"</strong></td></tr>';
  55. }//end if ($foundRecord == 1)
  56. }//end if(!is_numeric($applicant_row_id) || ((int)$applicant_row_id < 1)
  57. $returnVal .= '</table><br />';
  58. echo $returnVal;
  59. }
  60. function get_printable_qualifications_details($applicant_row_id){
  61. $returnVal = '<table border="1px" style="border-collapse: collapse; width:100%; margin-top:10px" cellpadding="5px" cellspacing="10px">';
  62. $returnVal .= '<tr style="border: solid 1px #999999;background-color:#dddddd;font-size:18px"><td colspan="5"><strong>3:&nbsp;&nbsp;HIGHEST ACADEMIC QUALIFICATION</strong></td></tr>';
  63. if(!is_numeric($applicant_row_id) || ((int)$applicant_row_id < 1) ){
  64. $returnVal .= '<tr><td colspan="2">Error while retrieving the qualification information: <strong>"Invalid Applicant ID"</strong></td></tr>';
  65. }else{
  66. $q = "SELECT accountemail, yearobtained, institutionobtained, fieldofstudyid, qualificationtypeid, degreeclassid, certificate, studyfield, qualification ";
  67. $q .= "FROM tblapplicantsaccount LEFT JOIN tblapplicantshighestqual ON tblapplicantsaccount.account_rowid = tblapplicantshighestqual.appaccountrowid ";
  68. $q .= "LEFT JOIN tblqualifications_lookup ON tblapplicantshighestqual.qualificationtypeid = tblqualifications_lookup.id "; // gets PhD, MSc, BSc, etc
  69. $q .= "LEFT JOIN tblstudyfield_lookup ON tblapplicantshighestqual.fieldofstudyid = tblstudyfield_lookup.id "; //gets description of field of study
  70. $q .= "LEFT JOIN tblqualificationclass ON tblapplicantshighestqual.degreeclassid = tblqualificationclass.qualificationclassid "; //gets class of the degree
  71. $q .= "WHERE tblapplicantsaccount.account_rowid = $applicant_row_id";
  72. $query = mysql_query($q);
  73. $foundRecord = mysql_num_rows($query);
  74. if ($foundRecord == 1) {
  75. $row = mysql_fetch_assoc($query);
  76. if(isset($row['certificate'])){
  77. $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>';
  78. $qual = '<td align="center">1.</td><td>' . $row['certificate'] . ' (' . $row['studyfield'] . ') </td><td>' .$row['qualification']. '</td><td>' .$row['institutionobtained'] . '</td><td>' .$row['yearobtained']. '</td>';
  79. }else{
  80. $qual = '<tr><td colspan="5">No academic qualification information supplied.</td></tr>';
  81. }
  82. $returnVal .= '<tr>' . $qual . '</tr>';
  83. }else {
  84. $returnVal .= '<tr><td colspan="5">No academic qualification information supplied.</td></tr>';
  85. }//end if ($foundRecord == 1)
  86. }//end if(!is_numeric($applicant_row_id) || ((int)$applicant_row_id < 1)
  87. $returnVal .= '</table></br>';
  88. $q = "SELECT tblapplicants_profqualifications.rowid, qualificationid, yearobtained, awardingbody, tblprofessionalquals_lookup.name ";
  89. $q .= "FROM tblapplicants_profqualifications LEFT JOIN tblprofessionalquals_lookup ON ";
  90. $q .= "tblapplicants_profqualifications.qualificationid = tblprofessionalquals_lookup.id ";
  91. $q .= "WHERE tblapplicants_profqualifications.appaccountrowid = $applicant_row_id ORDER BY name";
  92. $query = mysql_query($q);
  93. $foundRecord = mysql_num_rows($query);
  94. $returnVal .= '<table border="1px" style="border-collapse: collapse; width:100%; margin-top:10px" cellpadding="5px" cellspacing="10px">';
  95. $returnVal .= '<tr style="border: solid 1px #999999;background-color:#dddddd;font-size:18px"><td colspan="4"><strong>4:&nbsp;&nbsp;PROFESSIONAL QUALIFICATIONS</strong></td></tr>';
  96. if ($foundRecord > 0) {
  97. $i = 0;
  98. $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>';
  99. while($row = mysql_fetch_assoc($query)){
  100. $i++;
  101. $returnVal .= '<tr><td align="center">' . $i . '.</td><td>' . $row['name'] . '</td><td>' . $row['awardingbody'] . '</td><td>' .$row['yearobtained']. '</td></tr>';
  102. }//end while
  103. }else {
  104. $returnVal .= '<tr><td colspan="4">No professional qualification information supplied.</td></tr>';
  105. }//end if ($foundRecord == 1)
  106. $returnVal .= '</table></br>';
  107. echo $returnVal;
  108. }
  109. function get_printable_work_experience_details($applicant_row_id){
  110. $returnVal = '<table border="1px" style="border-collapse: collapse; width:100%; margin-top:10px" cellpadding="5px" cellspacing="10px">';
  111. if(!is_numeric($applicant_row_id) || ((int)$applicant_row_id < 1) ){
  112. $returnVal .= '<tr><td colspan="2">Error while retrieving the work experience information: <strong>"Invalid Applicant ID"</strong></td></tr>';
  113. }else{
  114. $q = "SELECT workingexpid, employer, positionheld, responsibilities, datefrom, dateto ";
  115. $q .= "FROM tblapplicantsworkexperience WHERE appaccountrowid = $applicant_row_id ORDER BY datefrom DESC";
  116. $query = mysql_query($q);
  117. $foundRecord = mysql_num_rows($query);
  118. $returnVal .= '<table border="1px" style="border-collapse: collapse; width:100%; margin-top:10px" cellpadding="5px" cellspacing="10px">';
  119. $returnVal .= '<tr style="border: solid 1px;background-color:#dddddd;font-size:18px"><td colspan="5"><strong>5:&nbsp;&nbsp;HISTORY OF PREVIOUS WORK EXPERIENCE</strong></td></tr>';
  120. if ($foundRecord > 0) {
  121. $i = 0;
  122. $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>';
  123. while($row = mysql_fetch_assoc($query)){
  124. $i++;
  125. $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>';
  126. }//end while
  127. }else {
  128. $returnVal .= '<tr><td colspan="4">No previous work experience information supplied.</td></tr>';
  129. }//end if ($foundRecord == 1)
  130. }
  131. $returnVal .= '</table></br>';
  132. echo $returnVal;
  133. }
  134. function get_printable_photo($applicant_row_id){
  135. $finalURL = get_current_photo($applicant_row_id);
  136. $fURL = '';
  137. if (user_photo_not_uploaded($applicant_row_id)){
  138. $fURL = '<div style="position:relative; margin-top:-100px; margin-left:5px">' . $finalURL . '</div>';
  139. $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>';
  140. $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>';
  141. }else{
  142. $fURL = '<div style="position:relative; margin-top:-100px; margin-left:5px">' . $finalURL . '</div>';
  143. $finalURL = $fURL;
  144. }
  145. echo $finalURL;
  146. }
  147. ?>