PageRenderTime 112ms CodeModel.GetById 26ms RepoModel.GetById 1ms app.codeStats 0ms

/promotion/chklist_func.php

https://bitbucket.org/lecturer34/hrmis
PHP | 691 lines | 509 code | 110 blank | 72 comment | 23 complexity | 264be34f94515a4fd6b3573bd477b22e MD5 | raw file
Possible License(s): LGPL-2.1
  1. <?php
  2. // In this script contains various utility functions for generating the checklist of a staffs
  3. /*********************************************************************************
  4. This function (get_active_guideline_code) will return the current active guidelinecode
  5. *********************************************************************************/
  6. function get_active_guideline_code()
  7. {
  8. $sql_active_guideline_code="select guidelinecode from tblpromotionguideline where status = 1 limit 1";
  9. $result_active_guideline_code= mysql_query($sql_active_guideline_code) or die(mysql_error());
  10. $row_active_guideline_code= mysql_fetch_array($result_active_guideline_code);
  11. $active_guideline_code= $row_active_guideline_code['guidelinecode'];
  12. return $active_guideline_code;
  13. }
  14. /*********************************************************************************
  15. This function (get_active_guideline_description) will return the current active guideline description
  16. *********************************************************************************/
  17. function get_active_guideline_description()
  18. {
  19. $sql_active_guideline_description="select description from tblpromotionguideline where status = 1 limit 1";
  20. $result_active_guideline_description= mysql_query($sql_active_guideline_description) or die(mysql_error());
  21. $row_active_guideline_description= mysql_fetch_array($result_active_guideline_description);
  22. $active_guideline_description= $row_active_guideline_description['description'];
  23. return $active_guideline_description;
  24. }
  25. /************************************************************************************
  26. This function (get_category) will return the catetory based on rank, complex and guideline.
  27. Returns 0 of no category is defined for the above criteria.
  28. *************************************************************************************/
  29. function get_category($rnkid /**rank id of staff**/, $cmpxid /**complex id of staff**/, $act_guideline_code /**current guildeline**/ )
  30. {
  31. $sql_cat_id= "select categoryid from tblpromotioncategory where (rankid = $rnkid && complexid = $cmpxid && guidelinecode = $act_guideline_code)";
  32. $result_cat_id= mysql_query($sql_cat_id) or die(mysql_error());
  33. $row_cat_id= mysql_fetch_array($result_cat_id);
  34. $cat_id=$row_cat_id['categoryid'];
  35. return ($cat_id) ? $cat_id:0;
  36. }
  37. /*********************************************************************************
  38. This function (get_possible_options_count) will return the total number of options available for a staff of which a staff can get promoted
  39. Returns 0 of no option is available.
  40. *********************************************************************************/
  41. function get_possible_options_count($cat_id /**category for getting available options**/)
  42. {
  43. $sql_possible_options= "select count(categoryid) as catid from tblpromotionplan where categoryid= $cat_id";
  44. $result_possible_options= mysql_query($sql_possible_options) or die(mysql_error());
  45. $row_possible_options= mysql_fetch_array($result_possible_options);
  46. $options_count= $row_possible_options['catid'];
  47. return ($options_count) ? $options_count:0;
  48. }
  49. /*******************************************************************************
  50. This function (get_options) returns an array of plan ids which can be used to query staffs record from various requirement tables
  51. Returns null if no option is available for the category
  52. *******************************************************************************/
  53. function get_options($cat_id /**category for getting available options**/)
  54. {
  55. $sql_available_options= "select planid from tblpromotionplan where categoryid= $cat_id";
  56. $result_available_options= mysql_query($sql_available_options) or die(mysql_error());
  57. if (mysql_num_rows($result_available_options)>0) // if options are available
  58. {
  59. while($row_available_options= mysql_fetch_array($result_available_options))
  60. {
  61. $options[]= $row_available_options['planid'];
  62. }
  63. return $options;
  64. }//else return null by default
  65. }
  66. /******************************************************************************
  67. This function (get_publication_req) returns an array of requirements for publication based on plan id (option)
  68. Returns null if no requirement is specified for a specific plan
  69. ******************************************************************************/
  70. function get_publication_req($plan_id /** The plan for the publication requirement**/)
  71. {
  72. $sql_pub_req ="select publicationtype, publicationlevel, number from tblreqpublication where planid = $plan_id";
  73. $result_pub_req= mysql_query($sql_pub_req) or die(mysql_error());
  74. if (mysql_num_rows($result_pub_req)>0) // if publication requirements are available
  75. {
  76. $row_pub_req= mysql_fetch_array($result_pub_req);
  77. for($i=0; $i< count($row_pub_req); $i++)
  78. $pub_req[]= $row_pub_req[$i];
  79. return $pub_req;
  80. }//else return null by default
  81. }
  82. /*****************************************************************************
  83. This function (get_publication_achvt) returns a count of the number of publication published by a staff at a given criteria
  84. *****************************************************************************/
  85. function get_publication_achvt($empid /** The Employee's id**/, $type /**The type of publication**/)
  86. {
  87. if($type == 'Any')
  88. $sql_pub_achvt ="select count(*) as count from tbljournalspublication where employeeid = $empid";
  89. else
  90. $sql_pub_achvt ="select count(*) from tbljournalspublication where employeeid = $empid && typeid= $type";
  91. $result_pub_achvt= mysql_query($sql_pub_achvt) or die(mysql_error());
  92. $row_pub_achvt= mysql_fetch_array($result_pub_achvt);
  93. $pub_achvt= $row_pub_achvt['count'];
  94. return $pub_achvt;
  95. }
  96. /******************************************************************************
  97. This function (get_supervision_req) returns an array of requirements for supervision based on plan id (option)
  98. Returns null if no requirement is specified for a specific plan
  99. ******************************************************************************/
  100. function get_supervision_req($plan_id /** The plan for the supervsion requirement**/)
  101. {
  102. $sql_superv_req ="select supervisionlevel, number from tblreqsupervision where planid = $plan_id";
  103. $result_superv_req= mysql_query($sql_superv_req) or die(mysql_error());
  104. if (mysql_num_rows($result_superv_req)>0) // if supervision requirements are available
  105. {
  106. $row_superv_req= mysql_fetch_array($result_superv_req);
  107. for($i=0; $i< count($row_superv_req); $i++)
  108. $superv_req[]= $row_superv_req[$i];
  109. return $superv_req;
  110. }//else return null by default
  111. }
  112. /*****************************************************************************
  113. This function (get_supervision_achvt) returns a count of the number of supervision made by a staff
  114. *****************************************************************************/
  115. function get_supervision_achvt($empid /** The Employee's id**/)
  116. {
  117. $sql_superv_achvt ="select count(*) as count from tblsupervision where employeeid = $empid";
  118. $result_superv_achvt= mysql_query($sql_superv_achvt) or die(mysql_error());
  119. $row_superv_achvt= mysql_fetch_array($result_superv_achvt);
  120. $superv_achvt= $row_superv_achvt['count'];
  121. return $superv_achvt;
  122. }
  123. /******************************************************************************
  124. This function (get_qualification_req) returns an array of requirements for qualification based on plan id (option)
  125. Returns null if no requirement is specified for a specific plan
  126. ******************************************************************************/
  127. function get_qualification_req($plan_id /** The plan for the qualification requirement**/)
  128. {
  129. $sql_qual_req ="select qualification from tblreqqualification where planid = $plan_id";
  130. $result_qual_req= mysql_query($sql_qual_req) or die(mysql_error());
  131. if (mysql_num_rows($result_qual_req)>0) // if qual requirements are available
  132. {
  133. $row_qual_req= mysql_fetch_array($result_qual_req);
  134. for($i=0; $i< count($row_qual_req); $i++)
  135. $qual_req[]= $row_qual_req[$i];
  136. $sql_qual_name ="select certificate from tblqualifications_lookup where id = $qual_req[0]";
  137. $result_qual_name= mysql_query($sql_qual_name) or die(mysql_error());
  138. $row_qual_name= mysql_fetch_array($result_qual_name);
  139. $qual_name= $row_qual_name['certificate'];
  140. $qual_req[0] = $qual_name;
  141. return $qual_req;
  142. }//else return null by default
  143. }
  144. /*****************************************************************************
  145. This function (get_qualification_achvt) returns the highest qualification obtained by a staff
  146. *****************************************************************************/
  147. function get_qualification_achvt($empid /** The Employee's id**/)
  148. {
  149. $sql_qual_achvt ="select max(qualificationtype) as qualtype from tblqualification where employeeid = $empid";
  150. $result_qual_achvt= mysql_query($sql_qual_achvt) or die(mysql_error());
  151. $row_qual_achvt= mysql_fetch_array($result_qual_achvt);
  152. $qual_achvt= $row_qual_achvt['qualtype'];
  153. $sql_qual_achvt2 ="select certificate from tblqualifications_lookup where id = $qual_achvt";
  154. $result_qual_achvt2= mysql_query($sql_qual_achvt2) or die(mysql_error());
  155. $row_qual_achvt2= mysql_fetch_array($result_qual_achvt2);
  156. $qual_achvt2= $row_qual_achvt2['certificate'];
  157. return $qual_achvt2;
  158. }
  159. /******************************************************************************
  160. This function (get_waitperiod_req) returns an array of requirements for waiting based on plan id (option)
  161. Returns null if no requirement is specified for a specific plan
  162. ******************************************************************************/
  163. function get_waitperiod_req($plan_id /** The plan for the qualification requirement**/)
  164. {
  165. $sql_wait_req ="select duration from tblreqwaitingperiod where planid = $plan_id";
  166. $result_wait_req= mysql_query($sql_wait_req) or die(mysql_error());
  167. if (mysql_num_rows($result_wait_req)>0) // if qual requirements are available
  168. {
  169. $row_wait_req= mysql_fetch_array($result_wait_req);
  170. for($i=0; $i< count($row_wait_req); $i++)
  171. $wait_req[]= $row_wait_req[$i];
  172. return $wait_req;
  173. }//else return null by default
  174. }
  175. /*****************************************************************************
  176. This function (get_waitperiod_achvt) returns the highest wait period obtained by a staff since the last promotion
  177. *****************************************************************************/
  178. function get_waitperiod_achvt($empid /** The Employee's id**/)
  179. {
  180. $sql_wait_achvt ="select year(effectivedate) as yr from tblpromotions where employeeid = $empid";
  181. $result_wait_achvt= mysql_query($sql_wait_achvt) or die(mysql_error());
  182. $row_wait_achvt= mysql_fetch_array($result_wait_achvt);
  183. $wait_achvt= $row_wait_achvt['yr'];
  184. $currdate = getdate();
  185. $wait_achvt = $currdate['year'] - $wait_achvt;
  186. return $wait_achvt;
  187. }
  188. /******************************************************************************
  189. This function (get_comservice_req) returns an array of requirements for community service based on plan id (option)
  190. Returns null if no requirement is specified for a specific plan
  191. ******************************************************************************/
  192. function get_comservice_req($plan_id /** The plan for the qualification requirement**/)
  193. {
  194. $sql_cs_req ="select servicelevel from tblreqcomunityservice where planid = $plan_id";
  195. $result_cs_req= mysql_query($sql_cs_req) or die(mysql_error());
  196. if (mysql_num_rows($result_cs_req)>0) // if qual requirements are available
  197. {
  198. $row_cs_req= mysql_fetch_array($result_cs_req);
  199. for($i=0; $i< count($row_cs_req); $i++)
  200. $cs_req[]= $row_cs_req[$i];
  201. return $cs_req;
  202. }//else return null by default
  203. }
  204. /*****************************************************************************
  205. This function (get_comservice_achvt) returns the service level of the last community serivice done by a staff
  206. *****************************************************************************/
  207. function get_comservice_achvt($empid /** The Employee's id**/)
  208. {
  209. $sql_cs_achvt ="select servicelevel from tblcommunityservice where employeeid = $empid";
  210. $result_cs_achvt= mysql_query($sql_cs_achvt) or die(mysql_error());
  211. $row_cs_achvt= mysql_fetch_array($result_cs_achvt);
  212. $cs_achvt= $row_cs_achvt['servicelevel'];
  213. return $cs_achvt;
  214. }
  215. /******************************************************************************
  216. This function (get_adminduty_req) returns an array of requirements for Duty service based on plan id (option)
  217. Returns null if no requirement is specified for a specific plan
  218. ******************************************************************************/
  219. function get_adminduty_req($plan_id /** The plan for the qualification requirement**/)
  220. {
  221. $sql_ad_req ="select dutylevel from tblreqadminduty where planid = $plan_id";
  222. $result_ad_req= mysql_query($sql_ad_req) or die(mysql_error());
  223. if (mysql_num_rows($result_ad_req)>0) // if qual requirements are available
  224. {
  225. $row_ad_req= mysql_fetch_array($result_ad_req);
  226. for($i=0; $i< count($row_ad_req); $i++)
  227. $ad_req[]= $row_ad_req[$i];
  228. return $ad_req;
  229. }//else return null by default
  230. }
  231. /*****************************************************************************
  232. This function (get_adminduty_achvt) returns the duty level of the last community serivice done by a staff
  233. *****************************************************************************/
  234. function get_adminduty_achvt($empid /** The Employee's id**/)
  235. {
  236. $sql_ad_achvt ="select dutylevel from tbladminduty where employeeid = $empid";
  237. $result_ad_achvt= mysql_query($sql_ad_achvt) or die(mysql_error());
  238. $row_ad_achvt= mysql_fetch_array($result_ad_achvt);
  239. $ad_achvt= $row_ad_achvt['servicelevel'];
  240. return $ad_achvt;
  241. }
  242. /******************************************************************************
  243. This function (get_minage_req) returns an array of requirements for Duty service based on plan id (option)
  244. Returns null if no requirement is specified for a specific plan
  245. ******************************************************************************/
  246. function get_minage_req($plan_id /** The plan for the qualification requirement**/)
  247. {
  248. $sql_ma_req ="select age from tblreqage where planid = $plan_id";
  249. $result_ma_req= mysql_query($sql_ma_req) or die(mysql_error());
  250. if (mysql_num_rows($result_ma_req)>0) // if qual requirements are available
  251. {
  252. $row_ma_req= mysql_fetch_array($result_ma_req);
  253. for($i=0; $i< count($row_ma_req); $i++)
  254. $ma_req[]= $row_ma_req[$i];
  255. return $ma_req;
  256. }//else return null by default
  257. }
  258. /*****************************************************************************
  259. This function (get_minage_achvt) returns the duty level of the last community serivice done by a staff
  260. *****************************************************************************/
  261. function get_minage_achvt($empid /** The Employee's id**/)
  262. {
  263. $sql_ma_achvt ="select dateofbirth from tblemployee where employeeid = $empid";
  264. $result_ma_achvt= mysql_query($sql_ma_achvt) or die(mysql_error());
  265. $row_ma_achvt= mysql_fetch_array($result_ma_achvt);
  266. $ma_achvt= $row_ma_achvt['dateofbirth'];
  267. $currdate = getdate();
  268. $ma_achvt = $currdate['year'] - $ma_achvt;
  269. return $ma_achvt;
  270. }
  271. /*********************************************************************************
  272. This function (design_table_heading) designs and returns (as a string) the headings of the resulting table based on the number of options available.
  273. If no option is available it returns String "No options".
  274. *********************************************************************************/
  275. function design_table_heading($col_count, $yr, $cmpx)
  276. {
  277. if($col_count==0) // if there is no option defined
  278. return "No options";
  279. else
  280. {
  281. $tbdata="<tr><th rowspan='2' class='criteria'>Criteria</th>";
  282. for ($i=0; $i<$col_count; $i++)
  283. {
  284. $tbdata .= "<th colspan='3' class='options'>Option". ($i + 1) . "</th>";
  285. }
  286. $tbdata .="</tr><tr class='subtitle'>";
  287. for ($i=0; $i<$col_count; $i++)
  288. {
  289. $tbdata .= "<td class='req'>Requirement</td><td class='achieve'>Individual's Attainment</td><td class='remark'>Remark</td>";
  290. }
  291. $tbdata .= "</tr>";
  292. return $tbdata;
  293. }
  294. }
  295. /*******************************************************************************
  296. This function (design_publication_record) generates the row that holds the publication status of the staff in each option
  297. *******************************************************************************/
  298. function design_publication_record( $plans /**options available to a staff**/, $empid /**staff employee id**/)
  299. {
  300. $na=0;
  301. $row="<tr title='Publications'><td>Publications</td>";
  302. for($i=0; $i<count($plans); $i++)
  303. {
  304. $publ_req= get_publication_req($plans[$i]);
  305. if(!isset($publ_req))
  306. {
  307. $row .= "<td>N/A</td><td>N/A</td><td class='rmk'><img src = '../../assets/img/naicon.jpg' alt='not applicable' width='20px' height='20px'/></td>";
  308. $na++;
  309. continue;
  310. }
  311. $publ_ach= get_publication_achvt($empid , $publ_req[0]);
  312. $row .= "<td>".$publ_req[2]."</td><td> $publ_ach </td><td class='rmk'>";
  313. if($publ_ach >= $publ_req[2])
  314. $row .= "<img src = '../../assets/img/checkicon.jpg' alt='passed' width='20px' height='20px'/></td>";
  315. else
  316. $row .= "<img src = '../../assets/img/crossicon.jpg' alt='' width='20px' height='20px'/></td>";
  317. }
  318. $row .= "</tr>";
  319. if($na ==count($plans))
  320. return "";
  321. return $row;
  322. }
  323. /*******************************************************************************
  324. This function (design_supervision_record) generates the row that holds the supervision status of the staff in each option
  325. *******************************************************************************/
  326. function design_supervision_record( $plans /**options available to a staff**/, $empid /**staff employee id**/)
  327. {
  328. $na=0;
  329. $row="<tr title='Supervisions'><td>Supervisions</td>";
  330. for($i=0; $i<count($plans); $i++)// for each option
  331. {
  332. $superv_req= get_supervision_req($plans[$i]);
  333. if(!isset($superv_req))
  334. {
  335. $row .= "<td>N/A</td><td>N/A</td><td class='rmk'><img src = '../../assets/img/naicon.jpg' alt='not applicable' width='20px' height='20px'/></td>";
  336. $na++;
  337. continue;
  338. }
  339. $superv_ach= get_supervision_achvt($empid);
  340. $row .= "<td>".$superv_req[1]."</td><td> $superv_ach </td><td class='rmk'>";
  341. if($superv_ach >= $superv_req[1])
  342. $row .= "<img src = '../../assets/img/checkicon.jpg' alt='passed' width='20px' height='20px'/></td>";
  343. else
  344. $row .= "<img src = '../../assets/img/crossicon.jpg' alt='' width='20px' height='20px'/></td>";
  345. }
  346. $row .= "</tr>";
  347. if($na ==count($plans))
  348. return "";
  349. return $row;
  350. }
  351. /*******************************************************************************
  352. This function (design_qualification_record) generates the row that holds the qualification status of the staff in each option
  353. *******************************************************************************/
  354. function design_qualification_record( $plans /**options available to a staff**/, $empid /**staff employee id**/)
  355. {
  356. $na=0;
  357. $row="<tr title='Qualification'><td>Qualification</td>";
  358. for($i=0; $i<count($plans); $i++)
  359. {
  360. $qual_req= get_qualification_req($plans[$i]);
  361. if(!isset($qual_req))
  362. {
  363. $row .= "<td>N/A</td><td>N/A</td><td class='rmk'><img src = '../../assets/img/naicon.jpg' alt='not applicable' width='20px' height='20px'/></td>";
  364. $na++;
  365. continue;
  366. }
  367. $qual_ach= get_qualification_achvt($empid);
  368. $row .= "<td>".$qual_req[0]."</td><td> $qual_ach </td><td class='rmk'>";
  369. if($qual_ach == $qual_req[0])
  370. $row .= "<img src = '../../assets/img/checkicon.jpg' alt='passed' width='20px' height='20px'/></td>";
  371. else
  372. $row .= "<img src = '../../assets/img/crossicon.jpg' alt='' width='20px' height='20px'/></td>";
  373. }
  374. $row .= "</tr>";
  375. if($na ==count($plans))
  376. return "";
  377. return $row;
  378. }
  379. /*******************************************************************************
  380. This function (design_waitperiod_record) generates the row that holds the wait period of the staff in each option
  381. *******************************************************************************/
  382. function design_waitperiod_record( $plans /**options available to a staff**/, $empid /**staff employee id**/)
  383. {
  384. $na=0;
  385. $row="<tr title='Wait Period'><td>Wait Period</td>";
  386. for($i=0; $i<count($plans); $i++)
  387. {
  388. $wait_req= get_waitperiod_req($plans[$i]);
  389. if(!isset($wait_req))
  390. {
  391. $row .= "<td>N/A</td><td>N/A</td><td class='rmk'><img src = '../../assets/img/naicon.jpg' alt='not applicable' width='20px' height='20px'/></td>";
  392. $na++;
  393. continue;
  394. }
  395. $wait_ach= get_waitperiod_achvt($empid);
  396. $row .= "<td>".$wait_req[0]."</td><td> $wait_ach </td><td class='rmk'>";
  397. if($wait_ach >= $wait_req[0])
  398. $row .= "<img src = '../../assets/img/checkicon.jpg' alt='passed' width='20px' height='20px'/></td>";
  399. else
  400. $row .= "<img src = '../../assets/img/crossicon.jpg' alt='' width='20px' height='20px'/></td>";
  401. }
  402. $row .= "</tr>";
  403. if($na ==count($plans))
  404. return "";
  405. return $row;
  406. }
  407. /*******************************************************************************
  408. This function (design_comservice_record) generates the row that holds the community serivice achievement of the staff in each option
  409. *******************************************************************************/
  410. function design_comservice_record( $plans /**options available to a staff**/, $empid /**staff employee id**/)
  411. {
  412. $na=0;
  413. $row="<tr title='Community Service'><td>Community Service</td>";
  414. for($i=0; $i<count($plans); $i++)//for each option
  415. {
  416. $comservice_req= get_comservice_req($plans[$i]);
  417. if(!isset($comservice_req))
  418. {
  419. $row .= "<td>N/A</td><td>N/A</td><td class='rmk'><img src = '../../assets/img/naicon.jpg' alt='not applicable' width='20px' height='20px'/></td>";
  420. $na++;
  421. continue;
  422. }
  423. $comservice_ach= get_comservice_achvt($empid);
  424. $row .= "<td>".$comservice_req[0]."</td><td> $comservice_ach </td><td class='rmk'>";
  425. if($comservice_ach >= $comservice_req[0])
  426. $row .= "<img src = '../../assets/img/checkicon.jpg' alt='passed' width='20px' height='20px'/></td>";
  427. else
  428. $row .= "<img src = '../../assets/img/crossicon.jpg' alt='' width='20px' height='20px'/></td>";
  429. }
  430. $row .= "</tr>";
  431. if($na ==count($plans))
  432. return "";
  433. return $row;
  434. }
  435. /*******************************************************************************
  436. This function (design_adminduty_record) generates the row that holds the administrative duty achievement of the staff in each option
  437. *******************************************************************************/
  438. function design_adminduty_record( $plans /**options available to a staff**/, $empid /**staff employee id**/)
  439. {
  440. $na=0;
  441. $row="<tr title='Administrative Duties'><td>Administrative Duties</td>";
  442. for($i=0; $i<count($plans); $i++)//for each option
  443. {
  444. $adminduty_req= get_adminduty_req($plans[$i]);
  445. if(!isset($adminduty_req))
  446. {
  447. $row .= "<td>N/A</td><td>N/A</td><td class='rmk'><img src = '../../assets/img/naicon.jpg' alt='not applicable' width='20px' height='20px'/></td>";
  448. $na++;
  449. continue;
  450. }
  451. $adminduty_ach= get_adminduty_achvt($empid);
  452. $row .= "<td>".$adminduty_req[0]."</td><td> $adminduty_ach </td><td class='rmk'>";
  453. if($adminduty_ach >= $adminduty_req[0])
  454. $row .= "<img src = '../../assets/img/checkicon.jpg' alt='passed' width='20px' height='20px'/></td>";
  455. else
  456. $row .= "<img src = '../../assets/img/crossicon.jpg' alt='' width='20px' height='20px'/></td>";
  457. }
  458. $row .= "</tr>";
  459. if($na ==count($plans))
  460. return "";
  461. return $row;
  462. }
  463. /*******************************************************************************
  464. This function (design_minage_record) generates the row that holds the age achievement of the staff in each option
  465. *******************************************************************************/
  466. function design_minage_record( $plans /**options available to a staff**/, $empid /**staff employee id**/)
  467. {
  468. $na=0;
  469. $row="<tr title='Minimum Age'><td>Minimum Age</td>";
  470. for($i=0; $i<count($plans); $i++)//for each option
  471. {
  472. $minage_req= get_minage_req($plans[$i]);
  473. if(!isset($minage_req))
  474. {
  475. $row .= "<td>N/A</td><td>N/A</td><td class='rmk'><img src = '../../assets/img/naicon.jpg' alt='not applicable' width='20px' height='20px'/></td>";
  476. $na++;
  477. continue;
  478. }
  479. $minage_ach= get_minage_achvt($empid);
  480. $row .= "<td>".$minage_req[0]."</td><td> $minage_ach </td><td class='rmk'>";
  481. if($minage_ach >= $minage_req[0])
  482. $row .= "<img src = '../../assets/img/checkicon.jpg' alt='passed' width='20px' height='20px'/></td>";
  483. else
  484. $row .= "<img src = '../../assets/img/crossicon.jpg' alt='' width='20px' height='20px'/></td>";
  485. }
  486. $row .= "</tr>";
  487. if($na ==count($plans))
  488. return "";
  489. return $row;
  490. }
  491. function generate_cklist_Summary($employeeid, $yr, $cadreid, $complexid, $departmentid, $fullname, $rnk, $dname, $rnkinv)
  492. {
  493. $guideline_code= get_active_guideline_code();
  494. //echo $guideline_code;
  495. $category= get_category($rnkinv, $complexid, $guideline_code);
  496. $num_options= get_possible_options_count($category);
  497. //echo $category;
  498. //echo $guideline_code." ".$yr." ".$cadreid." ".$complexid." ".$departmentid." ".$rnk." ".$dname." ".$fullname." ".$employeeid;
  499. if($num_options == 0) return;
  500. $options= get_options($category);
  501. $final_table ="<table id='opttb'> <caption><h2 style='text-align:center'>AHMADU BELLO UNIVERSITY, ZARIA-NIGERIA</h2><h3>Case of Recomendation for the year " .$year. " Promotion Exercise</h3><br /><h4 style = 'text-align:left;'>CHECKLIST SHEET<br /><br />COMPLEX: ".getComplexName($complexid)."</h4><br /><h5 style = 'text-align:left;'>DEPARTMENT: ".$dname."</h5><h5 style = 'text-align:left;'><br />EMPLOYEE NAME: ".$fullname."</h5><h5 style = 'text-align:left;'><br />RANK IN VIEW: ".getRankName($rnkinv)."</h5></caption>";
  502. $table_heading= design_table_heading($num_options, $yr, $complexid);
  503. $final_table .= $table_heading;
  504. $publications= design_publication_record($options, $employeeid);
  505. $final_table .= $publications;
  506. $supervisions = design_supervision_record($options, $employeeid);
  507. $final_table .= $supervisions;
  508. $qualifications = design_qualification_record($options, $employeeid);
  509. $final_table .= $qualifications;
  510. $waitperiod= design_waitperiod_record($options, $employeeid);
  511. $final_table .= $waitperiod;
  512. $comservice = design_comservice_record($options, $employeeid);
  513. $final_table .= $comservice;
  514. $adminduty = design_adminduty_record($options, $employeeid);
  515. $final_table .= $adminduty;
  516. $minage = design_minage_record($options, $employeeid);
  517. $final_table .= $minage. "</table><br /><br />";
  518. echo $final_table;
  519. }
  520. ?>