Rev 4267 | Autoría | Ultima modificación | Ver Log |
<?phpnamespace LeadersLinked\Library;use Fpdf\Fpdf;class InterviewPDF extends FPDF {/*** Header PDF*/function Header() {if ($this->header != '') {$this->Image($this->header, 10, 8, 190);$this->SetY(55);}}/*** Footer PDF*/function Footer() {if ($this->footer != '') {$this->SetY(-40);$this->Image($this->footer, 10, $this->getY(), 190);}}/*** Section Scale*/function sectionScale() {$this->SetFillColor(225, 255, 255);$this->SetTextColor(0);$this->SetFont('Arial', 'B', 9);$this->Cell(35, 8, utf8_decode(' Escala/Niveles:'), 1, 0, 'L', false);$this->SetFillColor(225, 255, 255);$this->SetTextColor(0);$this->SetFont('Arial', '', 9);$this->Cell(155, 8, utf8_decode(' 1: Mínimo 2: Medio 3: Medio-Alto 4: Alto N/A: No aplica'), 1, 'L', false);$this->Ln(15);}/*** Create Table* @param string $title* @param array $content*/function borderTable($title, $content) {// Header Table$this->SetFillColor(204, 204, 204);$this->SetDrawColor(0, 0, 0);$this->SetLineWidth(0);$this->SetFont('Arial', 'B', 9);$this->Cell(190, 6, utf8_decode($title), 1, 0, 'L', true);$this->Ln();// Body Table$this->SetFillColor(225, 255, 255);$this->SetTextColor(0);foreach ($content as $rs) {if (isset($rs['title'])) {$this->SetFont('Arial', 'B', 9);$this->Cell(50, 10, utf8_decode($rs['title']), 1, 0, 'L', false);$this->MultiCell(140, 10, utf8_decode($rs['content']), 1, 'L', false);$this->Ln();} else {$this->SetFont('Arial', '', 9);$this->MultiCell(190, 6, utf8_decode($rs['content']), 1, 'L', false);}}$this->Ln(5);}/*** title option table* @param string $title*/function titleOptionTable($title) {if ($title != '') {// Body Table$this->SetFillColor(204, 204, 204);$this->SetDrawColor(0, 0, 0);$this->SetLineWidth(0);$this->SetFont('Arial', 'B', 9);$this->Cell(190, 6, utf8_decode($title), 1, 0, 'L', true);$this->Ln();}}/*** Create Table* @param string $title* @param array $content*/function singleTable($title, $content) {// Header Table$this->SetFillColor(255, 255, 255);$this->SetDrawColor(0, 0, 0);$this->SetLineWidth(0);$this->SetFont('Arial', 'B', 9);$this->Cell(190, 6, utf8_decode($title), 0, 0, 'L', true);$this->Ln();// Body Table$this->SetFillColor(225, 255, 255);$this->SetTextColor(0);$this->SetFont('Arial', '', 9);foreach ($content as $rs) {if (isset($rs['title'])) {$this->Cell(40, 6, utf8_decode($rs['title']), 0, 0, 'L', false);$this->Cell(150, 6, utf8_decode($rs['content']), 0, 'L', false);$this->Ln();} else {if ($rs['content'] != "") {$this->MultiCell(190, 6, utf8_decode($rs['content']), 0, 'L', false);}}}$this->Ln(5);}/*** Create Competency Table* @param int $index* @param array $competency*/function competencyTable($index, $competency) {// Header Table$this->SetFillColor(255, 255, 255);$this->SetDrawColor(0, 0, 0);$this->SetLineWidth(0);$this->SetFont('Arial', 'B', 9);$this->MultiCell(190, 5, $index . '- ' . utf8_decode($competency['type']) . ': ' . utf8_decode($competency['name']), 0, 'L', false);// Body Table$this->SetFillColor(225, 255, 255);$this->SetTextColor(0);$this->SetFont('Arial', '', 9);$this->MultiCell(190, 6, utf8_decode(strip_tags($competency['description'])), 0, 'L', false);$this->Ln(3);$this->SetFillColor(204, 204, 204);$this->SetDrawColor(0, 0, 0);$this->SetLineWidth(0);$this->SetFont('Arial', 'B', 9);$behaviors = $competency['behaviors'];if (count($behaviors) > 0) {$this->Cell(150, 6, utf8_decode('Conductas observables :'), 1, 0, 'L', true);$this->Cell(16, 6, 'Nivel', 1, 0, 'C', true);$this->Cell(24, 6, utf8_decode('Evaluación'), 1, 0, 'C', true);$this->Ln();// Body Table$this->SetFillColor(225, 255, 255);$this->SetTextColor(0);for ($i = 0; $i < count($behaviors); $i++) {switch ($behaviors[$i]['evaluation']) {case "0":$evaluation = "0%";break;case "1":$evaluation = "25%";break;case "2":$evaluation = "50%";break;case "3":$evaluation = "75%";break;case "4":$evaluation = "100%";break;default :$evaluation = "ERROR";break;}$this->SetFont('Arial', '', 8.5);$this->Cell(150, 6, utf8_decode($behaviors[$i]['description']), 1, 0, 'L', false);$this->Cell(16, 6, $behaviors[$i]['level'] == '0' ? 'N/A' : $behaviors[$i]['level'], 1, 0, 'C', false);$this->Cell(24, 6, $evaluation, 1, 0, 'C', false);$this->Ln();$this->SetFont('Arial', '', 9);$this->Cell(190, 6, utf8_decode('Comentarios: ') . utf8_decode($behaviors[$i]['comment']), 1, 0, 'B', false);$this->Ln();}}$this->Ln();}}