PageRenderTime 57ms CodeModel.GetById 30ms RepoModel.GetById 1ms app.codeStats 0ms

/recruitment/reports/profile_details.php

https://bitbucket.org/lecturer34/hrmis
PHP | 288 lines | 231 code | 57 blank | 0 comment | 57 complexity | 82bd70e9148848011f0f3dd574ddcc17 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_fullname($applicant_row_id) {
  6. $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";
  7. $query_full = mysql_query($sql_full);
  8. $row = mysql_fetch_assoc($query_full);
  9. $returnVal = $row['fullname'];
  10. echo $returnVal;
  11. }
  12. function get_biodata_details($applicant_row_id){
  13. $returnVal = '<table border="1px" style="border-collapse: collapse; width:100%; margin-top:10px" cellpadding="5px" cellspacing="10px">';
  14. if(!is_numeric($applicant_row_id) || ((int)$applicant_row_id < 1) ){
  15. $returnVal .= '<tr style="border: solid 1px;"><td colspan="2">Error while retrieving the profile information: <strong>"Invalid Applicant ID"</strong></td></tr>';
  16. }else{
  17. $q = "SELECT titleid, appaccountrowid, surname, firstname, othernames, concat(salutation,' ', surname,', ', firstname,' ', othernames) as fullname, gender, maritalstatus, physicalchallenge, birthdate, birthplace, hometown, lga, nationality ";
  18. $q .= "FROM tblapplicantsdetails INNER JOIN tblsalutations_lookup ON (tblapplicantsdetails.titleid = tblsalutations_lookup.salutationid) WHERE appaccountrowid = $applicant_row_id";
  19. $query = mysql_query($q);
  20. $foundRecord = mysql_num_rows($query);
  21. if ($foundRecord == 1) {
  22. $row = mysql_fetch_assoc($query);
  23. $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>';
  24. $returnVal .= '<tr style="border: solid 1px;"><td><strong>Full Names:</strong></td><td>' . $row['fullname'] . '</td></tr>';
  25. $returnVal .= '<tr style="border: solid 1px;"><td><strong>Gender:</strong></td><td>' . $row['gender'] . '</td></tr>';
  26. $returnVal .= '<tr style="border: solid 1px;"><td><strong>Marital Status:</strong></td><td>' . $row['maritalstatus'] . '</td></tr>';
  27. $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>';
  28. $returnVal .= '<tr style="border: solid 1px;"><td><strong>Place of Birth:</strong></td><td>' . $row['birthplace'] . '</td></tr>';
  29. $returnVal .= '<tr style="border: solid 1px;"><td><strong>Home Town:</strong></td><td>' . $row['hometown'] . '</td></tr>';
  30. $returnVal .= '<tr style="border: solid 1px;"><td><strong>L. G. A.:</strong></td><td>' . $row['lga'] . '</td></tr>';
  31. $returnVal .= '<tr style="border: solid 1px;"><td><strong>State:</strong></td><td>' . '' . '</td></tr>';
  32. $returnVal .= '<tr style="border: solid 1px;"><td><strong>Country:</strong></td><td>' . $row['nationality'] . '</td></tr>';
  33. $returnVal .= '<tr style="border: solid 1px;"><td><strong>Physical Challenge:</strong></td><td>' . $row['physicalchallenge'] . '</td></tr>';
  34. $_SESSION['bio_Gender'] = $row['gender'];
  35. $_SESSION['bio_Marital'] = $row['maritalstatus'];
  36. $_SESSION['bio_DOB'] = get_date_ddmmyyyy($row['birthdate']);
  37. $_SESSION['bio_Disability'] = $row['physicalchallenge'];
  38. $_SESSION['bio_BirthPlace'] = $row['birthplace'];
  39. $_SESSION['bio_HomeTown'] = $row['hometown'];
  40. }else {
  41. $returnVal .= '<tr style="border: solid 1px;"><td colspan="2">Error while retrieving the profile information: <strong>"Invalid Applicant ID"</strong></td></tr>';
  42. }//end if ($foundRecord == 1)
  43. }//end if(!is_numeric($applicant_row_id) || ((int)$applicant_row_id < 1)
  44. $returnVal .= '</table></br>';
  45. echo $returnVal;
  46. }
  47. $_SESSION['full_names'] = $row['fullname'];
  48. function get_contact_details($applicant_row_id){
  49. $returnVal = '<table border="1px" style="border-collapse: collapse; width:100%; margin-top:10px" cellpadding="5px" cellspacing="10px">';
  50. if(!is_numeric($applicant_row_id) || ((int)$applicant_row_id < 1) ){
  51. $returnVal .= '<tr style="border: solid 1px;"><td colspan="2">Error while retrieving the contact information: <strong>"Invalid Applicant ID"</strong></td></tr>';
  52. }else{
  53. $q = "SELECT accountemail, currentaddress, permanenthomeaddress, primaryphone, phonenumber, alternateemail ";
  54. $q .= "FROM tblapplicantsaccount LEFT JOIN tblapplicantscontacts ON tblapplicantsaccount.account_rowid = tblapplicantscontacts.appaccountrowid ";
  55. $q .= "LEFT JOIN tblapplicantsotherphones ON tblapplicantsaccount.account_rowid = tblapplicantsotherphones.appaccountrowid ";
  56. $q .= "WHERE tblapplicantsaccount.account_rowid = $applicant_row_id";
  57. $query = mysql_query($q);
  58. $foundRecord = mysql_num_rows($query);
  59. if ($foundRecord == 1) {
  60. $row = mysql_fetch_assoc($query);
  61. $returnVal .= '<tr style="border: solid 1px;text-align:center"><td colspan="2"><strong>CONTACT&nbsp;&nbsp;&nbsp;DETAILS</strong><div class="div_square_link"></div></td></tr>';
  62. $returnVal .= '<tr style="border: solid 1px;"><td><strong>Primary E-Mail:</strong></td><td>' . $row['accountemail'] . '</td></tr>';
  63. $returnVal .= '<tr style="border: solid 1px;"><td><strong>Primary GSM Number:</strong></td><td>' . $row['primaryphone'] . '</td></tr>';
  64. $returnVal .= '<tr style="border: solid 1px;"><td><strong>Alternative E-Mail:</strong></td><td>' . $row['alternateemail'] . '</td></tr>';
  65. $returnVal .= '<tr style="border: solid 1px;"><td><strong>Alternative GSM Number:</strong></td><td>' . $row['phonenumber'] . '</td></tr>';
  66. $returnVal .= '<tr style="border: solid 1px;"><td><strong>Current Contact Address:</strong></td><td>' . $row['currentaddress'] . '</td></tr>';
  67. $returnVal .= '<tr style="border: solid 1px;"><td><strong>Permanent Home Address:</strong></td><td>' . $row['permanenthomeaddress'] . '</td></tr>';
  68. $_SESSION['contact_AltEmail'] = $row['alternateemail'];
  69. $_SESSION['contact_AltPhone'] = $row['phonenumber'];
  70. $_SESSION['contact_PresentAddress'] = $row['currentaddress'];
  71. $_SESSION['contact_PermaHome'] = $row['permanenthomeaddress'];
  72. }else {
  73. $returnVal .= '<tr style="border: solid 1px;"><td colspan="2">Error while retrieving the contact information: <strong>"Invalid Applicant ID"</strong></td></tr>';
  74. }//end if ($foundRecord == 1)
  75. }//end if(!is_numeric($applicant_row_id) || ((int)$applicant_row_id < 1)
  76. $returnVal .= '</table></br>';
  77. echo $returnVal;
  78. }
  79. function get_qualifications_details($applicant_row_id){
  80. $returnVal = '<table border="1px" style="border-collapse: collapse; width:100%; margin-top:10px" cellpadding="5px" cellspacing="10px">';
  81. if(!is_numeric($applicant_row_id) || ((int)$applicant_row_id < 1) ){
  82. $returnVal .= '<tr style="border: solid 1px;"><td colspan="2">Error while retrieving the qualification information: <strong>"Invalid Applicant ID"</strong></td></tr>';
  83. }else{
  84. $q = "SELECT accountemail, yearobtained, institutionobtained, fieldofstudyid, qualificationtypeid, degreeclassid, certificate, studyfield ";
  85. $q .= "FROM tblapplicantsaccount LEFT JOIN tblapplicantshighestqual ON tblapplicantsaccount.account_rowid = tblapplicantshighestqual.appaccountrowid ";
  86. $q .= "LEFT JOIN tblqualifications_lookup ON tblapplicantshighestqual.qualificationtypeid = tblqualifications_lookup.id "; // gets PhD, MSc, BSc, etc
  87. $q .= "LEFT JOIN tblstudyfield_lookup ON tblapplicantshighestqual.fieldofstudyid = tblstudyfield_lookup.id "; //gets description of field of study
  88. $q .= "WHERE tblapplicantsaccount.account_rowid = $applicant_row_id";
  89. $query = mysql_query($q);
  90. $foundRecord = mysql_num_rows($query);
  91. if ($foundRecord == 1) {
  92. $row = mysql_fetch_assoc($query);
  93. $returnVal .= '<tr style="border: solid 1px;text-align:center"><td colspan="2"><strong>HIGHEST&nbsp;&nbsp;ACADEMIC&nbsp;&nbsp;QUALIFICATION</strong><div class="div_square_link"></div></td></tr>';
  94. if(isset($row['certificate'])){
  95. $qual = $row['certificate'] . ' ' . $row['studyfield'] . ' <i>(' . $row['institutionobtained'] . ', ' . $row['yearobtained'] . ')</i>';
  96. }else{
  97. $qual = 'No academic qualification information found.';
  98. }
  99. $returnVal .= '<tr style="border: solid 1px;"><td colspan="2">' . $qual . '</td></tr>';
  100. }else {
  101. $returnVal .= '<tr style="border: solid 1px;"><td colspan="2">No academic qualification information found.</td></tr>';
  102. }//end if ($foundRecord == 1)
  103. }//end if(!is_numeric($applicant_row_id) || ((int)$applicant_row_id < 1)
  104. $returnVal .= '</table></br>';
  105. $q = "SELECT tblapplicants_profqualifications.rowid, qualificationid, yearobtained, awardingbody, tblprofessionalquals_lookup.name ";
  106. $q .= "FROM tblapplicants_profqualifications LEFT JOIN tblprofessionalquals_lookup ON ";
  107. $q .= "tblapplicants_profqualifications.qualificationid = tblprofessionalquals_lookup.id ";
  108. $q .= "WHERE tblapplicants_profqualifications.appaccountrowid = $applicant_row_id ORDER BY name";
  109. $query = mysql_query($q);
  110. $foundRecord = mysql_num_rows($query);
  111. $returnVal .= '<table border="1px" style="border-collapse: collapse; width:100%; margin-top:10px" cellpadding="5px" cellspacing="10px">';
  112. $returnVal .= '<tr style="border: solid 1px;text-align:center"><td colspan="4"><strong>PROFESSIONAL&nbsp;&nbsp;QUALIFICATIONS</strong><div class="div_square_link"></div></td></tr>';
  113. if ($foundRecord > 0) {
  114. $i = 0;
  115. $returnVal .= '<tr style="border:solid 1px; font-weight:bold"><td align="center">SN</td><td>Qualification</td><td colspan="2" align="center">Awarding Body &amp; Year Obtained</td></tr>';
  116. while($row = mysql_fetch_assoc($query)){
  117. $i++;
  118. $bodyYear = '<i>' . $row['awardingbody'] . ', ' . $row['yearobtained'] . '</i>';
  119. $ePointer = $row['rowid'] + 1024;
  120. $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>';
  121. }//end while
  122. } else {
  123. $returnVal .= '<tr style="border: solid 1px;"><td colspan="4">No professional qualification information found.</td></tr>';
  124. }//end if ($foundRecord == 1)
  125. $returnVal .= '</table></br>';
  126. echo $returnVal;
  127. }
  128. function get_work_experience_details($applicant_row_id){
  129. $returnVal = '<table border="1px" style="border-collapse: collapse; width:100%; margin-top:10px" cellpadding="5px" cellspacing="10px">';
  130. if(!is_numeric($applicant_row_id) || ((int)$applicant_row_id < 1) ){
  131. $returnVal .= '<tr style="border: solid 1px;"><td colspan="2">Error while retrieving the work experience information: <strong>"Invalid Applicant ID"</strong></td></tr>';
  132. }else{
  133. $q = "SELECT workingexpid, employer, positionheld, responsibilities, datefrom, dateto ";
  134. $q .= "FROM tblapplicantsworkexperience WHERE appaccountrowid = $applicant_row_id ORDER BY datefrom DESC";
  135. $query = mysql_query($q);
  136. $foundRecord = mysql_num_rows($query);
  137. $returnVal .= '<table border="1px" style="border-collapse: collapse; width:100%; margin-top:10px" cellpadding="5px" cellspacing="10px">';
  138. $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>';
  139. if ($foundRecord > 0) {
  140. $i = 0;
  141. $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>';
  142. while($row = mysql_fetch_assoc($query)){
  143. $i++;
  144. $ePointer = $row['workingexpid'] + 1024;
  145. $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>';
  146. }//end while
  147. }else {
  148. $returnVal .= '<tr style="border: solid 1px;"><td colspan="4">No previous work experience information found.</td></tr>';
  149. }//end if ($foundRecord == 1)
  150. }
  151. $returnVal .= '</table></br>';
  152. echo $returnVal;
  153. }
  154. function load_gender(){
  155. $cmb = '<option value = "-1">-- Please Select --</option>';
  156. if(isset($_SESSION['bio_Gender']) && $_SESSION['bio_Gender'] == 'M'){
  157. $cmb .= '<option value = "M" selected="selected">Male</option>';
  158. }else{
  159. $cmb .= '<option value = "M">Male</option>';
  160. }
  161. if(isset($_SESSION['bio_Gender']) && $_SESSION['bio_Gender'] == 'F'){
  162. $cmb .= '<option value = "F" selected="selected">Female</option>';
  163. }else{
  164. $cmb .= '<option value = "F">Female</option>';
  165. }
  166. echo $cmb;
  167. }
  168. function load_marital_status(){
  169. $cmb = '<option value = "-1">-- Please Select --</option>';
  170. if(isset($_SESSION['bio_Marital']) && $_SESSION['bio_Marital'] == 'Divorced'){
  171. $cmb .= '<option value = "Divorced" selected="selected">Divorced</option>';
  172. }else{
  173. $cmb .= '<option value = "Divorced">Divorced</option>';
  174. }
  175. if(isset($_SESSION['bio_Marital']) && $_SESSION['bio_Marital'] == 'Engaged'){
  176. $cmb .= '<option value = "Engaged" selected="selected">Engaged</option>';
  177. }else{
  178. $cmb .= '<option value = "Engaged">Engaged</option>';
  179. }
  180. if(isset($_SESSION['bio_Marital']) && $_SESSION['bio_Marital'] == 'Married'){
  181. $cmb .= '<option value = "Married" selected="selected">Married</option>';
  182. }else{
  183. $cmb .= '<option value = "Married">Married</option>';
  184. }
  185. if(isset($_SESSION['bio_Marital']) && $_SESSION['bio_Marital'] == 'Single'){
  186. $cmb .= '<option value = "Single" selected="selected">Single</option>';
  187. }else{
  188. $cmb .= '<option value = "Single">Single</option>';
  189. }
  190. if(isset($_SESSION['bio_Marital']) && $_SESSION['bio_Marital'] == 'Widowed'){
  191. $cmb .= '<option value = "Widowed" selected="selected">Widowed</option>';
  192. }else{
  193. $cmb .= '<option value = "Widowed">Widowed</option>';
  194. }
  195. echo $cmb;
  196. }
  197. function load_physical_challenge(){
  198. $cmb = '<option value = "-1">-- Please Select --</option>';
  199. if(isset($_SESSION['bio_Disability']) && $_SESSION['bio_Disability'] == 'None'){
  200. $cmb .= '<option value = "None" selected="selected">None</option>';
  201. }else{
  202. $cmb .= '<option value = "None">None</option>';
  203. }
  204. if(isset($_SESSION['bio_Disability']) && $_SESSION['bio_Disability'] == 'Partially Sighted'){
  205. $cmb .= '<option value = "Partially Sighted" selected="selected">Partially Sighted</option>';
  206. }else{
  207. $cmb .= '<option value = "Partially Sighted">Partially Sighted</option>';
  208. }
  209. if(isset($_SESSION['bio_Disability']) && $_SESSION['bio_Disability'] == 'Impaired Hearing'){
  210. $cmb .= '<option value = "Impaired Hearing" selected="selected">Impaired Hearing</option>';
  211. }else{
  212. $cmb .= '<option value = "Impaired Hearing">Impaired Hearing</option>';
  213. }
  214. if(isset($_SESSION['bio_Disability']) && $_SESSION['bio_Disability'] == 'Impaired Speech'){
  215. $cmb .= '<option value = "Impaired Speech" selected="selected">Impaired Speech</option>';
  216. }else{
  217. $cmb .= '<option value = "Impaired Speech">Impaired Speech</option>';
  218. }
  219. if(isset($_SESSION['bio_Disability']) && $_SESSION['bio_Disability'] == 'Mobility Difficulties'){
  220. $cmb .= '<option value = "Mobility Difficulties" selected="selected">Mobility Difficulties</option>';
  221. }else{
  222. $cmb .= '<option value = "Mobility Difficulties">Mobility Difficulties</option>';
  223. }
  224. if(isset($_SESSION['bio_Disability']) && $_SESSION['bio_Disability'] == 'Others'){
  225. $cmb .= '<option value = "Others" selected="selected">Others</option>';
  226. }else{
  227. $cmb .= '<option value = "Others">Others</option>';
  228. }
  229. echo $cmb;
  230. }
  231. ?>