forked from rudineirossales/FTTH
-
Notifications
You must be signed in to change notification settings - Fork 0
/
grafico.php
540 lines (249 loc) · 19.2 KB
/
grafico.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
<?php
//------------------------------------------- GRAFICO TOTAL MêS GA ----------------------------------------------------------------
$sql1 = mysql_query ("SELECT count(*) as day_1 from principal where day(data_atv) = '01' and MONTH(data_atv) = MONTH(now()) and year(data_atv) = year(NOW())" );
while ($dado = mysql_fetch_assoc($sql1 )){
$day_1 = $dado["day_1"];
}
$sql2 = mysql_query ("SELECT count(*) as day_2 from principal where day(data_atv) = '02' and MONTH(data_atv) = MONTH(now()) and year(data_atv) = year(NOW())" );
while ($dado = mysql_fetch_assoc($sql2 )){
$day_2 = $dado["day_2"];
}
$sql3 = mysql_query ("SELECT count(*) as day_3 from principal where day(data_atv) = '03' and MONTH(data_atv) = MONTH(now()) and year(data_atv) = year(NOW())" );
while ($dado = mysql_fetch_assoc($sql3 )){
$day_3 = $dado["day_3"];
}
$sql4 = mysql_query ("SELECT count(*) as day_4 from principal where day(data_atv) = '04' and MONTH(data_atv) = MONTH(now()) and year(data_atv) = year(NOW())" );
while ($dado = mysql_fetch_assoc($sql4 )){
$day_4 = $dado["day_4"];
}
$sql5 = mysql_query ("SELECT count(*) as day_5 from principal where day(data_atv) = '05' and MONTH(data_atv) = MONTH(now()) and year(data_atv) = year(NOW())" );
while ($dado = mysql_fetch_assoc($sql5 )){
$day_5 = $dado["day_5"];
}
$sql6 = mysql_query ("SELECT count(*) as day_6 from principal where day(data_atv) = '06' and MONTH(data_atv) = MONTH(now()) and year(data_atv) = year(NOW())" );
while ($dado = mysql_fetch_assoc($sql6 )){
$day_6 = $dado["day_6"];
}
$sql7 = mysql_query ("SELECT count(*) as day_7 from principal where day(data_atv) = '07' and MONTH(data_atv) = MONTH(now()) and year(data_atv) = year(NOW())" );
while ($dado = mysql_fetch_assoc($sql7 )){
$day_7 = $dado["day_7"];
}
$sql8 = mysql_query ("SELECT count(*) as day_8 from principal where day(data_atv) = '08' and MONTH(data_atv) = MONTH(now()) and year(data_atv) = year(NOW())" );
while ($dado = mysql_fetch_assoc($sql8 )){
$day_8 = $dado["day_8"];
}
$sql9 = mysql_query ("SELECT count(*) as day_9 from principal where day(data_atv) = '09' and MONTH(data_atv) = MONTH(now()) and year(data_atv) = year(NOW())" );
while ($dado = mysql_fetch_assoc($sql9 )){
$day_9 = $dado["day_9"];
}
$sql10 = mysql_query ("SELECT count(*) as day_10 from principal where day(data_atv) = '10' and MONTH(data_atv) = MONTH(now()) and year(data_atv) = year(NOW())" );
while ($dado = mysql_fetch_assoc($sql10 )){
$day_10 = $dado["day_10"];
}
$sql11 = mysql_query ("SELECT count(*) as day_11 from principal where day(data_atv) = '11' and MONTH(data_atv) = MONTH(now()) and year(data_atv) = year(NOW())" );
while ($dado = mysql_fetch_assoc($sql11 )){
$day_11 = $dado["day_11"];
}
$sql12 = mysql_query ("SELECT count(*) as day_12 from principal where day(data_atv) = '12' and MONTH(data_atv) = MONTH(now()) and year(data_atv) = year(NOW())" );
while ($dado = mysql_fetch_assoc($sql12 )){
$day_12 = $dado["day_12"];
}
$sql12 = mysql_query ("SELECT count(*) as day_12 from principal where day(data_atv) = '12' and MONTH(data_atv) = MONTH(now()) and year(data_atv) = year(NOW())" );
while ($dado = mysql_fetch_assoc($sql12 )){
$day_12 = $dado["day_12"];
}
$sql15 = mysql_query ("SELECT count(*) as day_13 from principal where day(data_atv) = '13' and MONTH(data_atv) = MONTH(now()) and year(data_atv) = year(NOW())" );
while ($dado = mysql_fetch_assoc($sql15 )){
$day_13 = $dado["day_13"];
}
$sql16 = mysql_query ("SELECT count(*) as day_14 from principal where day(data_atv) = '14' and MONTH(data_atv) = MONTH(now()) and year(data_atv) = year(NOW())" );
while ($dado = mysql_fetch_assoc($sql16 )){
$day_14 = $dado["day_14"];
}
$sql17 = mysql_query ("SELECT count(*) as day_15 from principal where day(data_atv) = '15' and MONTH(data_atv) = MONTH(now()) and year(data_atv) = year(NOW())" );
while ($dado = mysql_fetch_assoc($sql17 )){
$day_15 = $dado["day_15"];
}
$sql18 = mysql_query ("SELECT count(*) as day_16 from principal where day(data_atv) = '16' and MONTH(data_atv) = MONTH(now()) and year(data_atv) = year(NOW())" );
while ($dado = mysql_fetch_assoc($sql18 )){
$day_16 = $dado["day_16"];
}
$sql19 = mysql_query ("SELECT count(*) as day_17 from principal where day(data_atv) = '17' and MONTH(data_atv) = MONTH(now()) and year(data_atv) = year(NOW())" );
while ($dado = mysql_fetch_assoc($sql19 )){
$day_17 = $dado["day_17"];
}
$sql20 = mysql_query ("SELECT count(*) as day_18 from principal where day(data_atv) = '18' and MONTH(data_atv) = MONTH(now()) and year(data_atv) = year(NOW())" );
while ($dado = mysql_fetch_assoc($sql20 )){
$day_18 = $dado["day_18"];
}
$sql21 = mysql_query ("SELECT count(*) as day_19 from principal where day(data_atv) = '19' and MONTH(data_atv) = MONTH(now()) and year(data_atv) = year(NOW())" );
while ($dado = mysql_fetch_assoc($sql21 )){
$day_19 = $dado["day_19"];
}
$sql22 = mysql_query ("SELECT count(*) as day_20 from principal where day(data_atv) = '20' and MONTH(data_atv) = MONTH(now()) and year(data_atv) = year(NOW())" );
while ($dado = mysql_fetch_assoc($sql22 )){
$day_20 = $dado["day_20"];
}
$sql23 = mysql_query ("SELECT count(*) as day_21 from principal where day(data_atv) = '21' and MONTH(data_atv) = MONTH(now()) and year(data_atv) = year(NOW())" );
while ($dado = mysql_fetch_assoc($sql23 )){
$day_21 = $dado["day_21"];
}
$sql24 = mysql_query ("SELECT count(*) as day_22 from principal where day(data_atv) = '22' and MONTH(data_atv) = MONTH(now()) and year(data_atv) = year(NOW())" );
while ($dado = mysql_fetch_assoc($sql24 )){
$day_22 = $dado["day_22"];
}
$sql25 = mysql_query ("SELECT count(*) as day_23 from principal where day(data_atv) = '23' and MONTH(data_atv) = MONTH(now()) and year(data_atv) = year(NOW())" );
while ($dado = mysql_fetch_assoc($sql25 )){
$day_23 = $dado["day_23"];
}
$sql26 = mysql_query ("SELECT count(*) as day_24 from principal where day(data_atv) = '24' and MONTH(data_atv) = MONTH(now()) and year(data_atv) = year(NOW())" );
while ($dado = mysql_fetch_assoc($sql26 )){
$day_24 = $dado["day_24"];
}
$sql27 = mysql_query ("SELECT count(*) as day_25 from principal where day(data_atv) = '25' and MONTH(data_atv) = MONTH(now()) and year(data_atv) = year(NOW())" );
while ($dado = mysql_fetch_assoc($sql27 )){
$day_25 = $dado["day_25"];
}
$sql28 = mysql_query ("SELECT count(*) as day_26 from principal where day(data_atv) = '26' and MONTH(data_atv) = MONTH(now()) and year(data_atv) = year(NOW())" );
while ($dado = mysql_fetch_assoc($sql28 )){
$day_26 = $dado["day_26"];
}
$sql29 = mysql_query ("SELECT count(*) as day_27 from principal where day(data_atv) = '27' and MONTH(data_atv) = MONTH(now()) and year(data_atv) = year(NOW())" );
while ($dado = mysql_fetch_assoc($sql29 )){
$day_27 = $dado["day_27"];
}
$sql30 = mysql_query ("SELECT count(*) as day_28 from principal where day(data_atv) = '28' and MONTH(data_atv) = MONTH(now()) and year(data_atv) = year(NOW())" );
while ($dado = mysql_fetch_assoc($sql30 )){
$day_28 = $dado["day_28"];
}
$sql31 = mysql_query ("SELECT count(*) as day_29 from principal where day(data_atv) = '29' and MONTH(data_atv) = MONTH(now()) and year(data_atv) = year(NOW())" );
while ($dado = mysql_fetch_assoc($sql31 )){
$day_29 = $dado["day_29"];
}
$sql32 = mysql_query ("SELECT count(*) as day_30 from principal where day(data_atv) = '30' and MONTH(data_atv) = MONTH(now()) and year(data_atv) = year(NOW())" );
while ($dado = mysql_fetch_assoc($sql32 )){
$day_30 = $dado["day_30"];
}
$sql33 = mysql_query ("SELECT count(*) as day_31 from principal where day(data_atv) = '31' and MONTH(data_atv) = MONTH(now()) and year(data_atv) = year(NOW())" );
while ($dado = mysql_fetch_assoc($sql33 )){
$day_31 = $dado["day_31"];
}
//---------------------------------------- GRÁFICO EQUIPES BACKLOG -------------------------------------------------
$sql13 = mysql_query ("SELECT COUNT(*) AS TOTAL, (SELECT COUNT(*) FROM principal where YEAR(data_ATV) = YEAR(NOW()) and tipo = 'BA') AS BA,(SELECT COUNT(*) FROM principal where YEAR(data_ATV) = YEAR(NOW()) and tipo = 'REPARO') AS REPARO, (SELECT COUNT(*) FROM principal where YEAR(data_ATV) = YEAR(NOW()) and tipo = 'PREVENTIVO') AS PREVENTIVO" );
while ($dado = mysql_fetch_assoc($sql13 )){
$REPARO = $dado["REPARO"];
$BA = $dado["BA"];
$PREVENTIVO = $dado["PREVENTIVO"];
}
$sql14 = mysql_query ("SELECT COUNT(*) AS TOTAL, (SELECT COUNT(*) FROM principal where YEAR(data_ATV) = YEAR(NOW()) and SERVICO = '1- RECUPERADO') AS RECUPERADO,(SELECT COUNT(*) FROM principal where YEAR(data_ATV) = YEAR(NOW()) and SERVICO = '2- PENDENTE') AS PENDENTE" );
while ($dado = mysql_fetch_assoc($sql14 )){
$RECUPERADO = $dado["RECUPERADO"];
$PENDENTE = $dado["PENDENTE"];
}
//---------------------------------------------------- GRÁFICO ANUAL ATIVIDADES ------------
$sql34 = mysql_query ("select count(*) as JAN_TOTAL from principal where MONTH(data_atv) = '01' and year(data_atv) = year(NOW())" );
while ($dado = mysql_fetch_assoc($sql34 )){
$JAN_TOTAL = $dado["JAN_TOTAL"];
}
$sql35 = mysql_query ("select count(*) as FEV_TOTAL from principal where MONTH(data_atv) = '02' and year(data_atv) = year(NOW())" );
while ($dado = mysql_fetch_assoc($sql35 )){
$FEV_TOTAL = $dado["FEV_TOTAL"];
}
$sql36 = mysql_query ("select count(*) as MAR_TOTAL from principal where MONTH(data_atv) = '03' and year(data_atv) = year(NOW())" );
while ($dado = mysql_fetch_assoc($sql36 )){
$MAR_TOTAL = $dado["MAR_TOTAL"];
}
$sql37 = mysql_query ("select count(*) as ABR_TOTAL from principal where MONTH(data_atv) = '04' and year(data_atv) = year(NOW())" );
while ($dado = mysql_fetch_assoc($sql37 )){
$ABR_TOTAL = $dado["ABR_TOTAL"];
}
$sql38 = mysql_query ("select count(*) as MAI_TOTAL from principal where MONTH(data_atv) = '05' and year(data_atv) = year(NOW())" );
while ($dado = mysql_fetch_assoc($sql38 )){
$MAI_TOTAL = $dado["MAI_TOTAL"];
}
$sql39 = mysql_query ("select count(*) as JUN_TOTAL from principal where MONTH(data_atv) = '06' and year(data_atv) = year(NOW())" );
while ($dado = mysql_fetch_assoc($sql39 )){
$JUN_TOTAL = $dado["JUN_TOTAL"];
}
$sql40 = mysql_query ("select count(*) as JUL_TOTAL from principal where MONTH(data_atv) = '07' and year(data_atv) = year(NOW())" );
while ($dado = mysql_fetch_assoc($sql40 )){
$JUL_TOTAL = $dado["JUL_TOTAL"];
}
$sql41 = mysql_query ("select count(*) as AGO_TOTAL from principal where MONTH(data_atv) = '08' and year(data_atv) = year(NOW())" );
while ($dado = mysql_fetch_assoc($sql41 )){
$AGO_TOTAL = $dado["AGO_TOTAL"];
}
$sql42 = mysql_query ("select count(*) as SETE_TOTAL from principal where MONTH(data_atv) = '09' and year(data_atv) = year(NOW())" );
while ($dado = mysql_fetch_assoc($sql42 )){
$SETE_TOTAL = $dado["SETE_TOTAL"];
}
$sql43 = mysql_query ("select count(*) as OUTU_TOTAL from principal where MONTH(data_atv) = '10' and year(data_atv) = year(NOW())" );
while ($dado = mysql_fetch_assoc($sql43 )){
$OUTU_TOTAL = $dado["OUTU_TOTAL"];
}
$sql44 = mysql_query ("select count(*) as NOV_TOTAL from principal where MONTH(data_atv) = '11' and year(data_atv) = year(NOW())" );
while ($dado = mysql_fetch_assoc($sql44 )){
$NOV_TOTAL = $dado["NOV_TOTAL"];
}
$sql45 = mysql_query ("select count(*) as DEZ_TOTAL from principal where MONTH(data_atv) = '12' and year(data_atv) = year(NOW())" );
while ($dado = mysql_fetch_assoc($sql45 )){
$DEZ_TOTAL = $dado["DEZ_TOTAL"];
}
$sql46 = mysql_query ("SELECT COUNT(*) AS TOTAL, (SELECT COUNT(*) FROM principal where YEAR(data_ATV) = YEAR(NOW()) and CAUSA = '1- Fibra Invertida') AS F_INVERTIDA,(SELECT COUNT(*) FROM principal where YEAR(data_ATV) = YEAR(NOW()) and CAUSA = '2- Splitter Danificado') AS SPLITER,(SELECT COUNT(*) FROM principal where YEAR(data_ATV) = YEAR(NOW()) and CAUSA = '3- Carga alta/cabo baixo') AS CABO,(SELECT COUNT(*) FROM principal where YEAR(data_ATV) = YEAR(NOW()) and CAUSA = '5- Chuvas Tempestadas') AS CHUVA,(SELECT COUNT(*) FROM principal where YEAR(data_ATV) = YEAR(NOW()) and CAUSA = '4- Acao de terceiros') AS ACAO,(SELECT COUNT(*) FROM principal where YEAR(data_ATV) = YEAR(NOW()) and CAUSA = '6- Vandalismo') AS VANDALISMO,(SELECT COUNT(*) FROM principal where YEAR(data_ATV) = YEAR(NOW()) and CAUSA = '7- Ataque de Roedores/Insetos') AS INSETOS,(SELECT COUNT(*) FROM principal where YEAR(data_ATV) = YEAR(NOW()) and CAUSA = '8- Falha na construcao') AS FALHA,(SELECT COUNT(*) FROM principal where YEAR(data_ATV) = YEAR(NOW()) and CAUSA = '9- Sala GPON') AS GPON,(SELECT COUNT(*) FROM principal where YEAR(data_ATV) = YEAR(NOW()) and CAUSA = '10 - Sem intervencao') AS SEM_INT,(SELECT COUNT(*) FROM principal where YEAR(data_ATV) = YEAR(NOW()) and CAUSA = 'Fibra quebrada') AS FIBRA,(SELECT COUNT(*) FROM principal where YEAR(data_ATV) = YEAR(NOW()) and CAUSA = 'Atenuacao') AS ATENU" );
while ($dado = mysql_fetch_assoc($sql46)){
$F_INVERTIDA = $dado["F_INVERTIDA"];
$SPLITER = $dado["SPLITER"];
$CABO = $dado["CABO"];
$CHUVA = $dado["CHUVA"];
$ACAO = $dado["ACAO"];
$VANDALISMO = $dado["VANDALISMO"];
$INSETOS = $dado["INSETOS"];
$FALHA = $dado["FALHA"];
$GPON = $dado["GPON"];
$SEM_INT = $dado["SEM_INT"];
$FIBRA = $dado["FIBRA"];
$ATENU = $dado["ATENU"];
}
$sql47 = mysql_query ("SELECT COUNT(*) AS TOTAL, (SELECT COUNT(*) FROM principal where atividade = 'BD' and MONTH(data_ATV) = MONTH(NOW()) and CAUSA = '1- Fibra Invertida') AS F_INVERTIDA_MES_BD,(SELECT COUNT(*) FROM principal where atividade = 'BD' and MONTH(data_ATV) = MONTH(NOW()) and CAUSA = '2- Splitter Danificado') AS SPLITER_MES_BD,(SELECT COUNT(*) FROM principal where atividade = 'BD' and MONTH(data_ATV) = MONTH(NOW()) and CAUSA = '3- Carga alta/cabo baixo') AS CABO_MES_BD,(SELECT COUNT(*) FROM principal where atividade = 'BD' and MONTH(data_ATV) = MONTH(NOW()) and CAUSA = '5- Chuvas Tempestadas') AS CHUVA_MES_BD,(SELECT COUNT(*) FROM principal where atividade = 'BD' and MONTH(data_ATV) = MONTH(NOW()) and CAUSA = '4- Acao de terceiros') AS ACAO_MES_BD,(SELECT COUNT(*) FROM principal where atividade = 'BD' and MONTH(data_ATV) = MONTH(NOW()) and CAUSA = '6- Vandalismo') AS VANDALISMO_MES_BD,(SELECT COUNT(*) FROM principal where atividade = 'BD' and MONTH(data_ATV) = MONTH(NOW()) and CAUSA = '7- Ataque de Roedores/Insetos') AS INSETOS_MES_BD,(SELECT COUNT(*) FROM principal where atividade = 'BD' and MONTH(data_ATV) = MONTH(NOW()) and CAUSA = '8- Falha na construcao') AS FALHA_MES_BD,(SELECT COUNT(*) FROM principal where atividade = 'BD' and MONTH(data_ATV) = MONTH(NOW()) and CAUSA = '9- Sala GPON') AS GPON_MES_BD,(SELECT COUNT(*) FROM principal where atividade = 'BD' and MONTH(data_ATV) = MONTH(NOW()) and CAUSA = '10 - Sem intervencao') AS SEM_INT_MES_BD,(SELECT COUNT(*) FROM principal where atividade = 'BD' and MONTH(data_ATV) = MONTH(NOW()) and CAUSA = 'Fibra quebrada') AS FIBRA_BD,(SELECT COUNT(*) FROM principal where atividade = 'BD' and MONTH(data_ATV) = MONTH(NOW()) and CAUSA = 'Atenuacao') AS ATENU_BD" );
while ($dado = mysql_fetch_assoc($sql47)){
$F_INVERTIDA_MES_BD = $dado["F_INVERTIDA_MES_BD"];
$SPLITER_MES_BD = $dado["SPLITER_MES_BD"];
$CABO_MES_BD = $dado["CABO_MES_BD"];
$CHUVA_MES_BD = $dado["CHUVA_MES_BD"];
$ACAO_MES_BD = $dado["ACAO_MES_BD"];
$VANDALISMO_MES_BD = $dado["VANDALISMO_MES_BD"];
$INSETOS_MES_BD = $dado["INSETOS_MES_BD"];
$FALHA_MES_BD = $dado["FALHA_MES_BD"];
$GPON_MES_BD = $dado["GPON_MES_BD"];
$SEM_INT_MES_BD = $dado["SEM_INT_MES_BD"];
$FIBRA_BD = $dado["FIBRA_BD"];
$ATENU_BD = $dado["ATENU_BD"];
}
$sql48 = mysql_query ("SELECT COUNT(*) AS TOTAL, (SELECT COUNT(*) FROM principal where atividade = 'OS' and MONTH(data_ATV) = MONTH(NOW()) and CAUSA = '1- Fibra Invertida') AS F_INVERTIDA_MES_OS,(SELECT COUNT(*) FROM principal where atividade = 'OS' and MONTH(data_ATV) = MONTH(NOW()) and CAUSA = '2- Splitter Danificado') AS SPLITER_MES_OS,(SELECT COUNT(*) FROM principal where atividade = 'OS' and MONTH(data_ATV) = MONTH(NOW()) and CAUSA = '3- Carga alta/cabo baixo') AS CABO_MES_OS,(SELECT COUNT(*) FROM principal where atividade = 'OS' and MONTH(data_ATV) = MONTH(NOW()) and CAUSA = '5- Chuvas Tempestadas') AS CHUVA_MES_OS,(SELECT COUNT(*) FROM principal where atividade = 'OS' and MONTH(data_ATV) = MONTH(NOW()) and CAUSA = '4- Acao de terceiros') AS ACAO_MES_OS,(SELECT COUNT(*) FROM principal where atividade = 'OS' and MONTH(data_ATV) = MONTH(NOW()) and CAUSA = '6- Vandalismo') AS VANDALISMO_MES_OS,(SELECT COUNT(*) FROM principal where atividade = 'OS' and MONTH(data_ATV) = MONTH(NOW()) and CAUSA = '7- Ataque de Roedores/Insetos') AS INSETOS_MES_OS,(SELECT COUNT(*) FROM principal where atividade = 'OS' and MONTH(data_ATV) = MONTH(NOW()) and CAUSA = '8- Falha na construcao') AS FALHA_MES_OS,(SELECT COUNT(*) FROM principal where atividade = 'OS' and MONTH(data_ATV) = MONTH(NOW()) and CAUSA = '9- Sala GPON') AS GPON_MES_OS,(SELECT COUNT(*) FROM principal where atividade = 'OS' and MONTH(data_ATV) = MONTH(NOW()) and CAUSA = '10- Sem intervencao') AS SEM_INT_MES_OS,(SELECT COUNT(*) FROM principal where atividade = 'OS' and MONTH(data_ATV) = MONTH(NOW()) and CAUSA = 'Fibra quebrada') AS FIBRA_OS,(SELECT COUNT(*) FROM principal where atividade = 'OS' and MONTH(data_ATV) = MONTH(NOW()) and CAUSA = 'Atenuacao') AS ATENU_OS" );
while ($dado = mysql_fetch_assoc($sql48)){
$F_INVERTIDA_MES_OS = $dado["F_INVERTIDA_MES_OS"];
$SPLITER_MES_OS = $dado["SPLITER_MES_OS"];
$CABO_MES_OS = $dado["CABO_MES_OS"];
$CHUVA_MES_OS = $dado["CHUVA_MES_OS"];
$ACAO_MES_OS = $dado["ACAO_MES_OS"];
$VANDALISMO_MES_OS = $dado["VANDALISMO_MES_OS"];
$INSETOS_MES_OS = $dado["INSETOS_MES_OS"];
$FALHA_MES_OS = $dado["FALHA_MES_OS"];
$GPON_MES_OS = $dado["GPON_MES_OS"];
$SEM_INT_MES_OS = $dado["SEM_INT_MES_OS"];
$FIBRA_OS = $dado["FIBRA_OS"];
$ATENU_OS = $dado["ATENU_OS"];
}
$sql49 = mysql_query ("SELECT COUNT(*) AS TOTAL, (SELECT COUNT(*) FROM principal where MONTH(data_ATV) = MONTH(NOW()) and ATIVIDADE = 'BD') AS MES_BD,(SELECT COUNT(*) FROM principal where MONTH(data_ATV) = MONTH(NOW()) and ATIVIDADE = 'OS') AS MES_OS;" );
while ($dado = mysql_fetch_assoc($sql49)){
$MES_OS = $dado["MES_OS"];
$MES_BD = $dado["MES_BD"];
}
$sql50 = mysql_query ("SELECT count(*) as total ,(select COUNT(*) from PRINCIPAL WHERE EQUIPE = '1' and MONTH(data_atv) = MONTH(NOW()) and year(data_atv) = year(NOW())) as eqp1,(select COUNT(*) from PRINCIPAL WHERE EQUIPE = '2' and MONTH(data_atv) = MONTH(NOW()) and year(data_atv) = year(NOW())) as eqp2,(select COUNT(*) from PRINCIPAL WHERE EQUIPE = '3' and MONTH(data_atv) = MONTH(NOW()) and year(data_atv) = year(NOW())) as eqp3,(select COUNT(*) from PRINCIPAL WHERE EQUIPE = '4' and MONTH(data_atv) = MONTH(NOW()) and year(data_atv) = year(NOW())) as eqp4" );
while ($dado = mysql_fetch_assoc($sql50)){
$eqp1 = $dado["eqp1"];
$eqp2 = $dado["eqp2"];
$eqp3 = $dado["eqp3"];
$eqp4 = $dado["eqp4"];
}
?>