Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 15544 Rev 15545
Línea 145... Línea 145...
145
                
145
                
146
 
146
 
147
                $data = [
147
                $data = [
148
                    'labels'             => [],
-
 
149
                    'users' => [
148
                    'labels'             => [],
150
                       
149
                    'users' => [
151
                        'how_are_you_feel' => [],
150
                        'how_are_you_feel' => [],
152
                        'climate_on_your_organization' => [],
151
                        'climate_on_your_organization' => [],
153
                    ],
152
                    ],
154
                    'points' => [
153
                    'points' => [
155
                        'how_are_you_feel' => [],
154
                        'how_are_you_feel' => [],
-
 
155
                        'climate_on_your_organization' => [],
-
 
156
                    ],
-
 
157
                    'average' => [
-
 
158
                        'how_are_you_feel' => [],
156
                        'climate_on_your_organization' => [],
159
                        'climate_on_your_organization' => [],
157
                    ],
160
                    ],
158
                    'how_are_you_feel' => [
161
                    'how_are_you_feel' => [
159
                        'average_points'     => 0,
162
                        'average_points'     => 0,
160
                        'average_users'      => 0,
163
                        'average_users'      => 0,
Línea 199... Línea 202...
199
                    
202
                    
200
                    
203
                    
-
 
204
                    
Línea 201... Línea 205...
201
                    
205
                    array_push($data['points']['how_are_you_feel'], $points);
202
                    array_push($data['points']['how_are_you_feel'], $points);
206
                    array_push($data['users']['how_are_you_feel'], $users);
Línea 217... Línea 221...
217
                    }
221
                    }
Línea 218... Línea 222...
218
                    
222
                    
219
                    
223
                    
-
 
224
                    array_push($data['points']['climate_on_your_organization'], $points);
Línea 220... Línea 225...
220
                    array_push($data['points']['climate_on_your_organization'], $points);
225
                    array_push($data['users']['climate_on_your_organization'], $users);
221
                    array_push($data['users']['climate_on_your_organization'], $users);
226
                    array_push($data['average']['climate_on_your_organization'], $users ?  $points / $users : 0);
Línea 315... Línea 320...
315
            
320
            
316
            
321
            
-
 
322
            
-
 
323
            $data = [
-
 
324
                'labels'             => [],
-
 
325
                'average' => [
317
            
326
                    'how_are_you_feel' => [],
318
            $data = [
-
 
319
                'labels'             => [],
327
                    'climate_on_your_organization' => [],
320
                'users' => [
328
                ],
321
                    
329
                'users' => [
322
                    'how_are_you_feel' => [],
330
                    'how_are_you_feel' => [],
323
                    'climate_on_your_organization' => [],
331
                    'climate_on_your_organization' => [],
Línea 370... Línea 378...
370
                
378
                
371
                
379
                
-
 
380
                
Línea 372... Línea 381...
372
                
381
                array_push($data['points']['how_are_you_feel'], $points);
373
                array_push($data['points']['how_are_you_feel'], $points);
382
                array_push($data['users']['how_are_you_feel'], $users);
Línea 388... Línea 397...
388
                }
397
                }
Línea 389... Línea 398...
389
                
398
                
390
                
399
                
-
 
400
                array_push($data['points']['climate_on_your_organization'], $points);
Línea 391... Línea 401...
391
                array_push($data['points']['climate_on_your_organization'], $points);
401
                array_push($data['users']['climate_on_your_organization'], $users);
392
                array_push($data['users']['climate_on_your_organization'], $users);
402
                array_push($data['average']['climate_on_your_organization'], $users ?  $points / $users : 0);
Línea 479... Línea 489...
479
                $spreadsheet->getActiveSheet()->SetCellValue('G' . $row, $data['points']['how_are_you_feel'][$i]);
489
                $spreadsheet->getActiveSheet()->SetCellValue('G' . $row, $data['points']['how_are_you_feel'][$i]);
480
                $spreadsheet->getActiveSheet()->SetCellValue('H' . $row, $data['points']['climate_on_your_organization'][$i]);
490
                $spreadsheet->getActiveSheet()->SetCellValue('H' . $row, $data['points']['climate_on_your_organization'][$i]);
481
                $row++;
491
                $row++;
482
            }
492
            }
Línea -... Línea 493...
-
 
493
            
-
 
494
            $spreadsheet->getActiveSheet()->SetCellValue('J6', 'Puntos promedios ( puntos / usuarios ) ');
-
 
495
            $spreadsheet->getActiveSheet()->setMergeCells(['J6', 'K6', 'L6']);
-
 
496
            $spreadsheet->getActiveSheet()->SetCellValue('J7', 'Fecha');
-
 
497
            $spreadsheet->getActiveSheet()->SetCellValue('K7', 'Puntos promedios');
-
 
498
            $spreadsheet->getActiveSheet()->SetCellValue('L7', 'Cantidad de usuarios');
-
 
499
            
-
 
500
            
-
 
501
            
-
 
502
            $row = 8;
-
 
503
            $max = count($data['labels']);
-
 
504
            
-
 
505
            for($i = 0; $i< $max; $i++)
-
 
506
            {
-
 
507
                $spreadsheet->getActiveSheet()->SetCellValue('J' . $row, $data['labels'][$i]);
-
 
508
                $spreadsheet->getActiveSheet()->SetCellValue('K' . $row, number_format($data['average']['how_are_you_feel'][$i], 2));
-
 
509
                $spreadsheet->getActiveSheet()->SetCellValue('L' . $row, number_format($data['average']['climate_on_your_organization'][$i], 2));
-
 
510
                $row++;
-
 
511
            }
Línea 483... Línea 512...
483
            
512
            
484
                     
513
                     
Línea 485... Línea 514...
485
            $fileName = 'reporte_pulso_diario_'  . date('d-m-Y-h-i-a', time()) . '.xls';
514
            $fileName = 'reporte_pulso_diario_'  . date('d-m-Y-h-i-a', time()) . '.xls';