Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 514 | Rev 516 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 514 Rev 515
Línea 405... Línea 405...
405
     */
405
     */
406
    public function renderPDF($companySelfEvaluationForm, $companySelfEvaluationTest, $userMapper) {
406
    public function renderPDF($companySelfEvaluationForm, $companySelfEvaluationTest, $userMapper) {
Línea 407... Línea 407...
407
 
407
 
408
        // Set Data
408
        // Set Data
409
        $headerFormName = utf8_decode($companySelfEvaluationForm->name);
409
        $headerFormName = utf8_decode($companySelfEvaluationForm->name);
410
        $headerUserName = utf8_decode('Informe de Auto-evaluación: ' . trim($userMapper->first_name . ' ' . $userMapper->last_name) . ' al ' . date("m-d-Y H:i:s", strtotime($companySelfEvaluationTest->added_on)));
410
        $headerUserName = utf8_decode('LABEL_SELF_EVALUATION_INFORM' . trim($userMapper->first_name . ' ' . $userMapper->last_name) . ' al ' . date("m-d-Y H:i:s", strtotime($companySelfEvaluationTest->added_on)));
411
        $sections = json_decode($companySelfEvaluationTest->content, true);
411
        $sections = json_decode($companySelfEvaluationTest->content, true);
412
        $comments = '';
412
        $comments = '';
Línea 413... Línea 413...
413
        $labels = ['Total', 'Logrado'];
413
        $labels = ['LABEL_TOTAL', 'LABEL_SUCCES'];
414
 
414
 
Línea 415... Línea 415...
415
 
415
 
416
        //Generate New PDF
416
        //Generate New PDF
417
        $pdf = new Pdf();
417
        $pdf = new Pdf();
418
 
418
 
419
        $pdf->AliasNbPages();
419
        $pdf->AliasNbPages();
Línea 420... Línea 420...
420
        $pdf->AddPage();
420
        $pdf->AddPage();
421
 
421
        
Línea 440... Línea 440...
440
            $valueSection = floatval($sections[$i]['value']);
440
            $valueSection = floatval($sections[$i]['value']);
441
            $valueFormSections = $valueFormSections + $valueSection;
441
            $valueFormSections = $valueFormSections + $valueSection;
Línea 442... Línea 442...
442
 
442
 
443
            for ($j = 0; $j < count($sections[$i]['questions']); $j++) {
443
            for ($j = 0; $j < count($sections[$i]['questions']); $j++) {
444
                $totalQuestion = $totalQuestion + $this->getPtosAnswer($sections[$i]['questions'][$j]);
444
                $totalQuestion = $totalQuestion + $this->getPtosAnswer($sections[$i]['questions'][$j]);
445
                if (isset($sections[$i]['questions'][$j]['comment'])) {
445
                if(isset($sections[$i]['questions'][$j]['comment'])){
446
                    $comments = $comments.' '.$sections[$i]['questions'][$j]['comment'];
446
                    $comments = $comments.' '.$sections[$i]['questions'][$j]['comment'];
447
                }
447
                }
Línea 448... Línea 448...
448
            }
448
            }
449
 
449
 
Línea 450... Línea 450...
450
            $values = [$valueSection, $totalQuestion];
450
            $values = [$valueSection, $totalQuestion];
451
            $valueFormQuestions = $valueFormQuestions + $totalQuestion;
451
            $valueFormQuestions = $valueFormQuestions + $totalQuestion;
452
 
452
 
453
 
453
 
454
            $filename = 'data' . DIRECTORY_SEPARATOR . 'self-evaluation' . $sections[$i]['slug_section'] . '.png';
454
            $filename = 'data' . DIRECTORY_SEPARATOR . 'self-evaluation'. $sections[$i]['slug_section'] . '.png';
455
            $pdf->barChart($labels, $values, '', $filename);
455
            $pdf->barChart($labels, $values,'',$filename);
456
            $pdf->SetFont('Arial', '', 8);
456
            $pdf->SetFont('Arial', '', 8);
Línea 465... Línea 465...
465
 
465
 
466
        $pdf->AddPage();
466
        $pdf->AddPage();
Línea 467... Línea 467...
467
        $pdf->pageHeader($headerFormName, $headerUserName);
467
        $pdf->pageHeader($headerFormName, $headerUserName);
468
 
468
 
469
        $pdf->SetFont('Arial', 'B', 10);
469
        $pdf->SetFont('Arial', 'B', 10);
Línea 470... Línea 470...
470
        $pdf->Cell(190, 10, utf8_decode('Desempeño General'), 0, 0, 'C');
470
        $pdf->Cell(190, 10, utf8_decode('LABEL_OVERAL_PERFORMANCE'), 0, 0, 'C');
Línea 471... Línea 471...
471
        $pdf->setY($pdf->getY() + 10);
471
        $pdf->setY($pdf->getY() + 10);
472
 
472
 
473
 
473
 
474
        $values = [$valueFormSections, $valueFormQuestions];
474
        $values = [$valueFormSections, $valueFormQuestions];
Línea 475... Línea 475...
475
 
475
 
476
        $filenameGeneral = 'data' . DIRECTORY_SEPARATOR . 'self-evaluation' . uniqid() . '.png';
476
        $filenameGeneral = 'data' . DIRECTORY_SEPARATOR . 'self-evaluation'. uniqid() . '.png';
477
        $pdf->barChart($labels, $values, '', $filenameGeneral);
477
        $pdf->barChart($labels, $values, '', $filenameGeneral);
478
        $pdf->Image($filenameGeneral, 60, $pdf->getY(), 90);
478
        $pdf->Image($filenameGeneral, 60, $pdf->getY(), 90);
479
        $pdf->setY($pdf->getY() + 60);
479
        $pdf->setY($pdf->getY() + 60);
480
 
480
 
481
        $pdf->SetFont('Arial', 'B', 10);
481
        $pdf->SetFont('Arial','B', 10);
Línea 482... Línea 482...
482
        $pdf->Cell(190, 10, utf8_decode('Comentarios finales'), 0, 0, 'C');
482
        $pdf->Cell(190,10, utf8_decode('LABEL_FINAL_COMMENT'),0,0,'C');
483
        $pdf->setY($pdf->getY() + 10);
483
        $pdf->setY($pdf->getY() + 10);