public function getJobDescription($req) { $html = ""; $jobTitle = new JobTitles(); $jobTitle = $jobTitle->Find('id = ?', array($req)); $jobTitleNames = new JobTitlesNames(); $jobTitleNames = $jobTitleNames->Find('id = ?', array($jobTitle[0]->name)); $reportingTo = new JobTitlesNames(); $reportingTo = $reportingTo->Find('id = ?', array($jobTitle[0]->reporting_to)); $department = new CompanyStructures(); $department = $department->Find('id = ?', array($jobTitle[0]->department)); $education = new Educations(); $education = $education->Find('id = ?', array($jobTitle[0]->education)); $generalduites = json_decode($jobTitle[0]->general_duties); foreach ($generalduites as $generalduty) { $duties = new Duties(); $duty = $duties->Find('id = ?', array($generalduty)); $general[] = $duty[0]->name . ':' . $duty[0]->description . ',<br>'; } $general = implode(',', $general); $stratgicduites = json_decode($jobTitle[0]->strategic_duties); foreach ($stratgicduites as $stratgicduty) { $duties = new Duties(); $duty = $duties->Find('id = ?', array($stratgicduty)); $stratgic[] = $duty[0]->name . ':' . $duty[0]->description . ',<br>'; } $stratgic = implode(',', $stratgic); $technicalduties = json_decode($jobTitle[0]->technical_duties); foreach ($technicalduties as $technicalduty) { $duties = new Duties(); $duty = $duties->Find('id = ?', array($technicalduty)); $technical[] = $duty[0]->name . ':' . $duty[0]->description . ',<br>'; } $technical = implode(',', $technical); $skills = json_decode($jobTitle[0]->skills); foreach ($skills as $skill) { $skill1 = new Skills(); $skill2 = $skill1->Find('id = ?', array($skill)); $allSkills[] = $skill2[0]->name; } $allSkills = implode(',', $allSkills); $languages = json_decode($jobTitle[0]->language); foreach ($languages as $language) { $lang = new Languages(); $langs = $lang->Find('id = ?', array($language)); $allLangs[] = $langs[0]->name; } $allLanguages = implode(',', $allLangs); $html .= '<style> #color{ background-color: #365f91 !important; } </style> '; $html .= '<h2 style="margin-left: 275px;"><b>' . $jobTitleNames[0]->name . '</b></h2> <h2 style="margin-left: 275px;"><b>Code: ' . $jobTitle[0]->code . '</b></p> <h4 id="color" style="background-color: #365f91 !important;color: white !important;">Job Organizational Context</h4> <table border="1" cellpadding="0" cellspacing="0" style="margin-left: 123px;width: 75%;"> <tbody> <tr> <td> <p><b>Department</b></p> </td> <td> <p>' . $department[0]->title . '</p> </td> <td> <p><b>Section</b></p> </td> <td> <p>' . $department[0]->title . '</p> </td> </tr> <tr> <td> <p><b>Reporting to</b></p> </td> <td> <p>' . $reportingTo[0]->name . '</p> </td> <td> <p><b>Job Location</b></p> </td> <td> <p>PCP Premises</p> </td> </tr> <tr> <td> <p><b>Direct Supervision</b></p> </td> <td> <p>N/A</p> </td> <td> </td> <td> </td> </tr> </tbody> </table> <h4 id="color" style="background-color: #365f91 !important;color: white !important;">Job Summary</h4> <p>§ ' . $jobTitle[0]->description . '.</p> <h4 id="color" style="background-color: #365f91 !important; color: white !important;">Job Duties and Responsibilities</h4> <h4 id="color" style="background-color: #365f91 !important; color: white !important;"><b>Strategic Duties</b></h4> <p>§ ' . $stratgic . '</p> <h4 id="color" style="background-color: #365f91 !important; color: white !important;"><b>General Administrative Duties</b></h4> <p>§ ' . $general . '</p> <h4 id="color" style="background-color: #365f91 !important; color: white !important;"><b>Technical Duties</b></h4> <p>§ ' . $technical . '</p> <p><b>For more information on roles and responsibilities, refer to company manual</b>.</p> <h4 id="color" style="background-color: #365f91 !important; color: white !important;">Job Specifications</h4> <h4 id="color" style="background-color: #365f91 !important; color: white !important;"><b>Minimum Required Education</b></h4> <p>§ ' . $education[0]->name . '</p> <h4 id="color" style="background-color: #365f91 !important; color: white !important;"><b>Language Proficiency </b></h4> <p>§ Fluent in ' . $allLanguages . ' language.</p> <h4 id="color" style="background-color: #365f91 !important; color: white !important;"><b>Skills and Abilities</b></h4> <p>§ ' . $allSkills . '</p> <h4 id="color" style="background-color: #365f91 !important; color: white !important;"><b>Professional Knowledge</b></h4> <p>§ Strong software skills include MS PowerPoint, Project & Excel</p> <p>§ Experience in proposal or grant writing</p> <br><br><br><br> <h4 id="color" style="background-color: #365f91 !important;color: white !important;">Job Interactions (Communication)</h4> <table border="1" cellpadding="0" cellspacing="0" style="style="width: 75%;height: 128px;"> <tbody> <tr> <td valign="top"> <p><b>Key Internal Interactions</b></p> </td> <td valign="top"> <p><b>Key External Interactions</b></p> </td> </tr> <tr> <td> <p>§ Supply Chain , Operation</p> </td> <td> <p>§ Customers , Outsourcing consultancy , Commercial and legal consultancy</p> </td> </tr> </tbody> </table> <p>Job Description Acknowledgment</p> <table border="1" cellpadding="0" cellspacing="0" style="width: 75%;height: 128px;"> <tbody> <tr> <td> <p><b>Employee</b></p> </td> <td> </td> <td> <p><b>Direct Manager</b></p> </td> <td> </td> <td valign="top"> <p><b>HR </b></p> </td> <td valign="top"> </td> </tr> <tr> <td> <p><b>Signature</b></p> </td> <td> </td> <td> <p><b>Signature</b></p> </td> <td> </td> <td valign="top"> <p><b>Signature</b></p> </td> <td valign="top"> </td> </tr> <tr> <td> <p><b>Date</b></p> </td> <td> </td> <td> <p><b>Date</b></p> </td> <td> </td> <td valign="top"> <p><b>Date</b></p> </td> <td valign="top"> </td> </tr> </tbody> </table> '; print_r($html); exit; }