Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 16747 Rev 16749
Línea 557... Línea 557...
557
                'question'  => $fastSurvey->question,
557
                'question'  => $fastSurvey->question,
558
                'labels'    => [$fastSurvey->answer1, $fastSurvey->answer2],
558
                'labels'    => [$fastSurvey->answer1, $fastSurvey->answer2],
559
                'values'    => [$fastSurvey->votes1, $fastSurvey->votes2],
559
                'values'    => [$fastSurvey->votes1, $fastSurvey->votes2],
560
            ];
560
            ];
Línea -... Línea 561...
-
 
561
            
561
            
562
            
562
            if($fastSurvey->number_of_answers >= 3) {
563
            if($fastSurvey->number_of_answers >= 3) {
563
                array_push($data['labels'], $fastSurvey->answer3);
564
                array_push($data['labels'], $fastSurvey->answer3);
-
 
565
                array_push($data['values'], $fastSurvey->votes3);
564
                array_push($data['values'], $fastSurvey->votes3);
566
            }  
565
            }  else if($fastSurvey->number_of_answers >= 4) {
567
            if($fastSurvey->number_of_answers >= 4) {
566
                array_push($data['labels'], $fastSurvey->answer4);
568
                array_push($data['labels'], $fastSurvey->answer4);
-
 
569
                array_push($data['values'], $fastSurvey->votes4);
567
                array_push($data['values'], $fastSurvey->votes4);
570
            }  
568
            }  else if($fastSurvey->number_of_answers == 5) {
571
            if($fastSurvey->number_of_answers == 5) {
569
                array_push($data['labels'], $fastSurvey->answer5);
572
                array_push($data['labels'], $fastSurvey->answer5);
570
                array_push($data['values'], $fastSurvey->votes5);
573
                array_push($data['values'], $fastSurvey->votes5);
-
 
574
            }
-
 
575
            
Línea 571... Línea 576...
571
            }
576
           
572
                
577
                
573
            return new JsonModel([
578
            return new JsonModel([
574
                'success' => true,
579
                'success' => true,
Línea 631... Línea 636...
631
            
636
            
632
            $spreadsheet = new Spreadsheet();
637
            $spreadsheet = new Spreadsheet();
Línea -... Línea 638...
-
 
638
            $spreadsheet->getProperties()->setTitle($fastSurvey->question);
-
 
639
            
633
            $spreadsheet->getProperties()->setTitle($fastSurvey->question);
640
 
634
            
641
           
-
 
642
            
-
 
643
            $spreadsheet->setActiveSheetIndex(0);
Línea -... Línea 644...
-
 
644
            $spreadsheet->getActiveSheet()->SetCellValue('A1', strtoupper($fastSurvey->question));
635
 
645
            $spreadsheet->getActiveSheet()->getCell('A1')->getStyle()->getAlignment()->setHorizontal( 'center');
636
            $spreadsheet->setActiveSheetIndex(0);
-
 
637
            $spreadsheet->getActiveSheet()->SetCellValue('A1', 'TOTAL DE VOTOS');
-
 
638
            
-
 
639
            if($fastSurvey->number_of_answers >= 3) {
-
 
640
                $spreadsheet->getActiveSheet()->mergeCells('A1:G1');
646
            $spreadsheet->getActiveSheet()->getCell('A1')->getStyle()->getFont()->setBold(true);
-
 
647
            
-
 
648
            
-
 
649
            if($fastSurvey->number_of_answers == 5) {
-
 
650
                $spreadsheet->getActiveSheet()->mergeCells('A1:I1');
-
 
651
            } else if($fastSurvey->number_of_answers == 4) {
-
 
652
                $spreadsheet->getActiveSheet()->mergeCells('A1:H1');
641
            }  else if($fastSurvey->number_of_answers >= 4) {
653
            } else if($fastSurvey->number_of_answers == 3) {
Línea 642... Línea 654...
642
                $spreadsheet->getActiveSheet()->mergeCells('A1:H1');
654
                $spreadsheet->getActiveSheet()->mergeCells('A1:G1');
-
 
655
            } else {
643
            }  else if($fastSurvey->number_of_answers == 5) {
656
                $spreadsheet->getActiveSheet()->mergeCells('A1:F1');
-
 
657
            }
-
 
658
            
-
 
659
            $spreadsheet->getActiveSheet()->SetCellValue('A3', 'TOTAL DE VOTOS');
-
 
660
            $spreadsheet->getActiveSheet()->getCell('A3')->getStyle()->getAlignment()->setHorizontal( 'center');
-
 
661
            $spreadsheet->getActiveSheet()->getCell('A3')->getStyle()->getFont()->setBold(true);
-
 
662
            
-
 
663
            
-
 
664
            if($fastSurvey->number_of_answers == 5) {
-
 
665
                $spreadsheet->getActiveSheet()->mergeCells('A3:I3');
-
 
666
            } else if($fastSurvey->number_of_answers == 4) {
-
 
667
                $spreadsheet->getActiveSheet()->mergeCells('A3:H3');
Línea -... Línea 668...
-
 
668
            } else if($fastSurvey->number_of_answers == 3) {
-
 
669
                $spreadsheet->getActiveSheet()->mergeCells('A3:G3');
Línea -... Línea 670...
-
 
670
            } else {
644
                $spreadsheet->getActiveSheet()->mergeCells('A1:I1');
671
                $spreadsheet->getActiveSheet()->mergeCells('A3:F3');
645
            }
672
            }
Línea 646... Línea 673...
646
            
673
            
647
            $spreadsheet->getActiveSheet()->SetCellValue('A2', $fastSurvey->answer1);
674
            $spreadsheet->getActiveSheet()->SetCellValue('A4', $fastSurvey->answer1);
648
            $spreadsheet->getActiveSheet()->SetCellValue('A3', $fastSurvey->votes1);
675
            $spreadsheet->getActiveSheet()->SetCellValue('A5', $fastSurvey->votes1);
Línea -... Línea 676...
-
 
676
            
649
            
677
            
Línea 650... Línea 678...
650
            
678
            $spreadsheet->getActiveSheet()->SetCellValue('B4', $fastSurvey->answer2);
651
            $spreadsheet->getActiveSheet()->SetCellValue('B2', $fastSurvey->answer2);
679
            $spreadsheet->getActiveSheet()->SetCellValue('B5', $fastSurvey->votes2);
Línea -... Línea 680...
-
 
680
            
652
            $spreadsheet->getActiveSheet()->SetCellValue('B3', $fastSurvey->votes2);
681
            if($fastSurvey->number_of_answers >= 3) {
Línea 653... Línea 682...
653
            
682
                $spreadsheet->getActiveSheet()->SetCellValue('C4', $fastSurvey->answer3);
654
            if($fastSurvey->number_of_answers >= 3) {
683
                $spreadsheet->getActiveSheet()->SetCellValue('C5', $fastSurvey->votes3);
655
                $spreadsheet->getActiveSheet()->SetCellValue('C2', $fastSurvey->answer3);
684
               
Línea 656... Línea 685...
656
                $spreadsheet->getActiveSheet()->SetCellValue('C3', $fastSurvey->votes3);
685
                
-
 
686
            }  
-
 
687
            if($fastSurvey->number_of_answers >= 4) {
657
               
688
                
658
                
689
                $spreadsheet->getActiveSheet()->SetCellValue('D4', $fastSurvey->answer4);
659
            }  else if($fastSurvey->number_of_answers >= 4) {
690
                $spreadsheet->getActiveSheet()->SetCellValue('D5', $fastSurvey->votes4);
660
                
691
                
661
                $spreadsheet->getActiveSheet()->SetCellValue('D2', $fastSurvey->answer4);
692
            } 
662
                $spreadsheet->getActiveSheet()->SetCellValue('D3', $fastSurvey->votes4);
693
            if($fastSurvey->number_of_answers == 5) {
-
 
694
                
-
 
695
                $spreadsheet->getActiveSheet()->SetCellValue('E4', $fastSurvey->answer5);
663
                
696
                $spreadsheet->getActiveSheet()->SetCellValue('E5', $fastSurvey->votes5);
664
            }  else if($fastSurvey->number_of_answers == 5) {
697
            }
Línea 665... Línea 698...
665
                
698
            
666
                $spreadsheet->getActiveSheet()->SetCellValue('E2', $fastSurvey->answer5);
699
            $spreadsheet->getActiveSheet()->SetCellValue('A7', 'DETALLE DE LOS USUARIOS');
667
                $spreadsheet->getActiveSheet()->SetCellValue('E3', $fastSurvey->votes5);
700
            $spreadsheet->getActiveSheet()->getCell('A7')->getStyle()->getAlignment()->setHorizontal( 'center');
668
            }
701
            $spreadsheet->getActiveSheet()->getCell('A7')->getStyle()->getFont()->setBold(true);
669
            
702
            
670
            $spreadsheet->getActiveSheet()->SetCellValue('A5', 'DETALLE DE LOS USUARIOS');
703
            if($fastSurvey->number_of_answers == 5) {
671
            
704
                $spreadsheet->getActiveSheet()->mergeCells('A7:I7');
672
            if($fastSurvey->number_of_answers >= 3) {
705
            } else if($fastSurvey->number_of_answers == 4) {
-
 
706
                $spreadsheet->getActiveSheet()->mergeCells('A7:H7');
673
                $spreadsheet->getActiveSheet()->mergeCells('A5:G5');
707
            } else if($fastSurvey->number_of_answers == 3) {
674
            }  else if($fastSurvey->number_of_answers >= 4) {
708
                $spreadsheet->getActiveSheet()->mergeCells('A7:G7');
-
 
709
            } else {
675
                $spreadsheet->getActiveSheet()->mergeCells('A5:H5');
710
                $spreadsheet->getActiveSheet()->mergeCells('A7:F7');
676
            }  else if($fastSurvey->number_of_answers == 5) {
711
            }
677
                $spreadsheet->getActiveSheet()->mergeCells('A5:I5');
712
            
Línea 678... Línea -...
678
            }
-
 
679
            
-
 
680
            
-
 
681
            $spreadsheet->getActiveSheet()->SetCellValue('A6', 'Fecha');
-
 
682
            $spreadsheet->getActiveSheet()->SetCellValue('B6', 'Nombre');
-
 
683
            $spreadsheet->getActiveSheet()->SetCellValue('C6', 'Apellido');
-
 
Línea 684... Línea 713...
684
            $spreadsheet->getActiveSheet()->SetCellValue('D6', 'Correo electrónico');
713
            
685
            $spreadsheet->getActiveSheet()->SetCellValue('E6', $fastSurvey->answer1);
714
            $spreadsheet->getActiveSheet()->SetCellValue('A8', 'Fecha');
686
            $spreadsheet->getActiveSheet()->SetCellValue('F6', $fastSurvey->answer2);
715
            $spreadsheet->getActiveSheet()->SetCellValue('B8', 'Nombre');
687
            if($fastSurvey->number_of_answers >= 3) {
716
            $spreadsheet->getActiveSheet()->SetCellValue('C8', 'Apellido');
688
                $spreadsheet->getActiveSheet()->SetCellValue('G6', $fastSurvey->answer3);
717
            $spreadsheet->getActiveSheet()->SetCellValue('D8', 'Correo electrónico');
689
            }  else if($fastSurvey->number_of_answers >= 4) {
718
            $spreadsheet->getActiveSheet()->SetCellValue('E8', $fastSurvey->answer1);
690
                $spreadsheet->getActiveSheet()->SetCellValue('H6', $fastSurvey->answer4);
719
            $spreadsheet->getActiveSheet()->SetCellValue('F8', $fastSurvey->answer2);
Línea 691... Línea 720...
691
            }  else if($fastSurvey->number_of_answers == 5) {
720
            if($fastSurvey->number_of_answers >= 3) {
692
                $spreadsheet->getActiveSheet()->SetCellValue('I6', $fastSurvey->answer5);
721
                $spreadsheet->getActiveSheet()->SetCellValue('G8', $fastSurvey->answer3);
693
            }
722
            }  
694
            
723
            if($fastSurvey->number_of_answers >= 4) {
695
            /*
724
                $spreadsheet->getActiveSheet()->SetCellValue('H8', $fastSurvey->answer4);