Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 495 Rev 502
Línea 354... Línea 354...
354
            $CompanyUserMapper = UserMapper::getInstance($this->adapter);
354
            $CompanyUserMapper = UserMapper::getInstance($this->adapter);
355
            $userMapper = $CompanyUserMapper->fetchOne($companySelfEvaluationTest->user_id);
355
            $userMapper = $CompanyUserMapper->fetchOne($companySelfEvaluationTest->user_id);
Línea 356... Línea 356...
356
 
356
 
Línea 357... Línea -...
357
            if ($companySelfEvaluationForm && $userMapper) {
-
 
358
 
-
 
359
                $data = [
-
 
360
                    'success' => true,
-
 
361
                    'data' => [
-
 
362
                        'id' => $companySelfEvaluationTest->id,
-
 
363
                        'name' => $companySelfEvaluationForm->name,
-
 
364
                        'text' => $companySelfEvaluationForm->text,
-
 
365
                        'user' => $userMapper->first_name . ' ' . $userMapper->last_name,
-
 
366
                        'status' => $companySelfEvaluationTest->status,
-
 
367
                        'content' => json_decode($companySelfEvaluationTest->content),
-
 
368
                    ]
357
            if ($companySelfEvaluationForm && $userMapper) {
369
                ];
358
 
370
 
-
 
371
                $pdf = new Pdf();
-
 
-
 
359
               
Línea 372... Línea 360...
372
                $pdf->AliasNbPages();
360
                $pdf = new Pdf();
373
        $pdf->AddPage();
361
              
Línea 374... Línea -...
374
 
-
 
375
                $headerFormName = utf8_decode($companySelfEvaluationForm->name);
-
 
-
 
362
 
-
 
363
                $headerFormName = utf8_decode($companySelfEvaluationForm->name);
376
                $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)) );
364
                $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)) );
-
 
365
 
-
 
366
 
-
 
367
 
-
 
368
                $pdf->AliasNbPages();
-
 
369
                $pdf->AddPage();
-
 
370
                $pdf->pageHeader($headerFormName, $headerUserName);
-
 
371
                
-
 
372
                
-
 
373
                $data = json_decode($companySelfEvaluationTest->content, true);
-
 
374
                $sections = $data['sections'];
-
 
375
        
-
 
376
                
-
 
377
                $valueFormSections = 0;
-
 
378
                $valueFormQuestions = 0;
-
 
379
                
-
 
380
                $countSection = 0;
-
 
381
                for($i = 0, $maxSection = count($sections); $i < $maxSection; $i++)
-
 
382
                {
-
 
383
                    if( $countSection > 1)
-
 
384
                    {
-
 
385
                        $countSection = 0;
-
 
386
                        $pdf->AddPage();
-
 
387
                        $pdf->pageHeader($headerFormName, $headerUserName);
-
 
388
                    }
-
 
389
                    
-
 
390
                    $pdf->SetY(70 + (92 * $countSection));
-
 
391
                    $totalQuestion = 0;
-
 
392
                    
-
 
393
                    $valueSection       =  floatval($sections[$i]['value']);
-
 
394
                    $valueFormSections  = $valueFormSections  + $valueSection;
-
 
395
                    
-
 
396
                    
-
 
397
                    for($j = 0, $maxQuestion = count($sections[$i]['questions']); $j < $maxQuestion; $j++)
-
 
398
                    {
-
 
399
                        //$valueQuestion = floatval($sections[$i]['questions'][$j]['user_evaluation']);
-
 
400
                        $totalQuestion = $totalQuestion + 1;
-
 
401
                    }
-
 
402
                    
-
 
403
                    $labels = [
-
 
404
                        'Total',
-
 
405
                        'Logrado'
-
 
406
                    ];
-
 
407
                    
-
 
408
                    $values = [
-
 
409
                        $valueSection,
-
 
410
                        $totalQuestion
-
 
411
                    ];
-
 
412
                    
-
 
413
                    $valueFormQuestions = $valueFormQuestions + $totalQuestion;
-
 
414
                    
-
 
415
                    
-
 
416
                    $title = '';
-
 
417
                    //$filename = __DIR__ . '/tmp/' . $sections[$i]['slug'] . '.png';
-
 
418
                    $pdf->barChart($labels, $values, $title, $filename);
-
 
419
                    $pdf->SetFont('Arial','',8);
-
 
420
                    $pdf->Cell(190,10, utf8_decode($sections[$i]['name']),0,0,'C');
-
 
421
                    $pdf->setY($pdf->getY() + 10);
-
 
422
                    // Salto de línea
-
 
423
                    
-
 
424
                    //$pdf->Image($filename,60,$pdf->getY(),90);
-
 
425
                    $pdf->setY($pdf->getY() + 60);
-
 
426
                    
-
 
427
                    
-
 
428
                    $countSection++;
-
 
429
        
-
 
430
                }
-
 
431
                
-
 
432
                $pdf->AddPage();
-
 
433
                $pdf->pageHeader($headerFormName, $headerUserName);
-
 
434
                
-
 
435
                $pdf->SetFont('Arial','B', 10);
-
 
436
                $pdf->Cell(190,10, utf8_decode('Desempeño General'),0,0,'C');
-
 
437
                $pdf->setY($pdf->getY() + 10);
-
 
438
                
-
 
439
                
-
 
440
                $labels = [
-
 
441
                    'Total',
-
 
442
                    'Logrado'
-
 
443
                ];
-
 
444
                
-
 
445
                $values = [
-
 
446
                    $valueFormSections,
-
 
447
                    $valueFormQuestions
-
 
448
                ];
-
 
449
                
-
 
450
                //$filenameGeneral = __DIR__ . '/tmp/' . uniqid() . '.png';
-
 
451
                $pdf->barChart($labels, $values, $title, $filenameGeneral);
-
 
452
                //$pdf->Image($filenameGeneral,60,$pdf->getY(),90);
-
 
453
                $pdf->setY($pdf->getY() + 60);
-
 
454
                
-
 
455
                
-
 
456
                $pdf->SetFont('Arial','B', 10);
Línea 377... Línea -...
377
 
-
 
378
 
-
 
379
 
-
 
380
 
-
 
381
 
-
 
382
                $pdf->pageHeader($headerFormName, $headerUserName);
457
                $pdf->Cell(190,10, utf8_decode('Comentarios finales'),0,0,'C');
Línea 383... Línea 458...
383
 
458
                $pdf->setY($pdf->getY() + 10);