Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 520 Rev 521
Línea 383... Línea 383...
383
     * @param type $userMapper
383
     * @param type $userMapper
384
     * @return type
384
     * @return type
385
     */
385
     */
386
    public function renderPDF($companySelfEvaluationForm, $companySelfEvaluationTest, $userMapper) {
386
    public function renderPDF($companySelfEvaluationForm, $companySelfEvaluationTest, $userMapper) {
Línea 387... Línea 387...
387
 
387
 
388
        // set Data
388
        // Set Data
389
        $headerFormName = utf8_decode($companySelfEvaluationForm->name);
389
        $headerFormName = utf8_decode($companySelfEvaluationForm->name);
390
        $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)));
390
        $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)));
-
 
391
        $sections = json_decode($companySelfEvaluationTest->content, true);
Línea 391... Línea 392...
391
        $sections = json_decode($companySelfEvaluationTest->content, true);
392
        $comments = '';
392
 
393
 
Línea 393... Línea 394...
393
 
394
 
394
        //generate PDF document
395
        //Generate New PDF
-
 
396
        $pdf = new Pdf();
-
 
397
 
395
        $pdf = new Pdf();
398
        $pdf->AliasNbPages();
Línea 396... Línea 399...
396
 
399
        $pdf->AddPage();
397
        $pdf->AliasNbPages();
400
        
Línea 416... Línea 419...
416
            $valueSection = floatval($sections[$i]['value']);
419
            $valueSection = floatval($sections[$i]['value']);
417
            $valueFormSections = $valueFormSections + $valueSection;
420
            $valueFormSections = $valueFormSections + $valueSection;
Línea 418... Línea 421...
418
 
421
 
419
            for ($j = 0; $j < count($sections[$i]['questions']); $j++) {
422
            for ($j = 0; $j < count($sections[$i]['questions']); $j++) {
-
 
423
                $totalQuestion = $totalQuestion + $this->getPtosAnswer($sections[$i]['questions'][$j]);
-
 
424
                if(isset($sections[$i]['questions'][$j]['comment'])){
-
 
425
                    $comments += $sections[$i]['questions'][$j]['comment'].'\n';
420
                $totalQuestion = $totalQuestion + $this->getPtosAnswer($sections[$i]['questions'][$j]);
426
                }
Línea 421... Línea 427...
421
            }
427
            }
422
 
428
 
423
            $labels = ['Total', 'Logrado'];
429
            $labels = ['Total', 'Logrado'];
Línea 424... Línea 430...
424
            $values = [$valueSection, $totalQuestion];
430
            $values = [$valueSection, $totalQuestion];
425
            $valueFormQuestions = $valueFormQuestions + $totalQuestion;
431
            $valueFormQuestions = $valueFormQuestions + $totalQuestion;
426
 
432
 
427
 
433
 
428
            $filename = $_SERVER['DOCUMENT_ROOT'] . '/../public/pdf/tmp/' . $sections[$i]['slug_section'] . '.png';
434
            $filename = $_SERVER['DOCUMENT_ROOT'] . '/../public/pdf/tmp/' . $sections[$i]['slug_section'] . '.png';
429
            $pdf->barChart($labels, $values,'',$filename);
435
            //$pdf->barChart($labels, $values,'',$filename);
430
            $pdf->SetFont('Arial', '', 8);
436
            $pdf->SetFont('Arial', '', 8);
Línea 447... Línea 453...
447
 
453
 
448
        $labels = ['Total', 'Logrado'];
454
        $labels = ['Total', 'Logrado'];
Línea 449... Línea 455...
449
        $values = [$valueFormSections, $valueFormQuestions];
455
        $values = [$valueFormSections, $valueFormQuestions];
450
 
456
 
451
        $filenameGeneral = $_SERVER['DOCUMENT_ROOT'] . '/../public/pdf/tmp/' . uniqid() . '.png';
457
        $filenameGeneral = $_SERVER['DOCUMENT_ROOT'] . '/../public/pdf/tmp/' . uniqid() . '.png';
452
        $pdf->barChart($labels, $values, $title, $filenameGeneral);
-
 
453
        $pdf->Image($filenameGeneral, 60, $pdf->getY(), 90);
458
        //$pdf->barChart($labels, $values, $title, $filenameGeneral);
Línea -... Línea 459...
-
 
459
        $pdf->Image($filenameGeneral, 60, $pdf->getY(), 90);
-
 
460
        $pdf->setY($pdf->getY() + 60);
-
 
461
 
-
 
462
        $pdf->SetFont('Arial','B', 10);
454
 
463
        $pdf->Cell(190,10, utf8_decode('Comentarios finales'),0,0,'C');
-
 
464
        $pdf->setY($pdf->getY() + 10);
455
        $pdf->setY($pdf->getY() + 60);
465
        
Línea 456... Línea 466...
456
 
466
        $pdf->SetFont('Arial','', 8);
457
        $pdf->SetFont('Arial', '', 8);
467
        $pdf->MultiCell(180,  8, $comments);