Rev 1336 | Rev 15447 | Ir a la última revisión | Autoría | Comparar con el anterior | Ultima modificación | Ver Log |
<?phpnamespace LeadersLinked\Library;use Fpdf\Fpdf;class PerformanceEvaluationPdf extends FPDF {/*** Header PDF*/function Header() {$this->Image($_SERVER['DOCUMENT_ROOT'] . '/pdf/header_background.png', 10, 8, 190);$this->Image($_SERVER['DOCUMENT_ROOT'] . '/pdf/header_logo.png', 130, 20, 60);}/*** Footer PDF*/function Footer() {$this->SetY(-30);$this->Image($_SERVER['DOCUMENT_ROOT'] . '/pdf/footer_background.jpg', 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->Cell(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 Section Option Table* @param string $content*/function optionTable($title) {// Body Table$this->SetFillColor(225, 255, 255);$this->SetTextColor(0);$this->SetFont('Arial', 'B', 9);$this->Cell(50, 10, utf8_decode($title), 1, 0, 'L', false);$this->Cell(140, 10, '', 1, 'L', false);$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++) {$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, '', 1, 0, 'C', false);$this->Ln();$this->SetFont('Arial', 'B', 9);$this->Cell(190, 6, utf8_decode('Comentarios:'), 1, 0, 'L', false);$this->Ln();}}$this->Ln();}}