$dependTerc += $row_status['segundos']; $row_status['codStat'] == $row['status'] ? $dependTerc += $segundosNovos : ''; } else { if ($row_status['cod_dependencia'] == 4) { //dependente de terceiros $dependNone += $row_status['segundos']; $row_status['codStat'] == $row['status'] ? $dependNone += $segundosNovos : ''; } } } } //print "</td>"; print "<td>"; //coluna do tempo vinculado ao usuário if ($dependUser != 0) { $dependUser = $dtS->secToHour($dependUser); } else { $dependUser = "******"; } print $dependUser; print "</td>"; print "<td>"; //coluna do tempo vinculado a terceiros if ($dependTerc != 0) { $dependTerc = $dtS->secToHour($dependTerc); } else { $dependTerc = "-"; } print $dependTerc; print "</td>"; print "<td>";
//.....// } $codStatAtual = $row['codStatAtual']; $statAtual = $row['status_atual']; if ($row['codStat'] != $row['codStatAtual']) { //vou imprimir o status atual fora do loop print "<tr><td class='line'>" . $row['status'] . "</td><td class='line'>" . $row['tempo'] . "</td></tr>"; } else { $tempoSecStatAtual = $row['total']; } } $dt = new dateOpers(); $tempoHoraStatAtual = ""; if ($codStatAtual == 4) { //encerrada $tempoHora = $dt->secToHour($tempoTotalSec); } else { //chamados ainda não encerrados $areaChamado = 1; $dt->setData1($data); $dt->setData2($hoje); $dt->tempo_valido($dt->data1, $dt->data2, $H_horarios[$areaChamado][0], $H_horarios[$areaChamado][1], $H_horarios[$areaChamado][2], $H_horarios[$areaChamado][3], "H"); $segundos = $dt->diff["sValido"]; //segundos válidos $tempoHoraStatAtual = $dt->secToHour($segundos + $tempoSecStatAtual); $tempoHora = $dt->secToHour($segundos + $tempoTotalSec); } print "<tr><td class='line'><b><font color='green'>" . $statAtual . "</b> (Status Atual)</td><td class='line'><b><font color='green'>" . $tempoHoraStatAtual . "</b></font></td></tr>"; print "<tr><td class='line'>TEMPO TOTAL</td><td class='line'>" . $tempoHora . "</td></tr>"; print "</table>"; }
for ($i = 0; $i < count($chamados16); $i++) { $chamados .= "{$chamados16[$i]},"; } if (strlen($chamados) > 0) { $chamados = substr($chamados, 0, -1); } $total_sol_segundos += $dtS->diff["sFull"]; $total_res_segundos += $dtR->diff["sFull"]; $total_res_valido += $dtR->diff["sValido"]; $total_sol_valido += $dtS->diff["sValido"]; print "<tr id='linha" . $cont . "' onMouseOver=\"destaca('linha" . $cont . "');\" onMouseOut=\"libera('linha" . $cont . "');\" onMouseDown=\"marca('linha" . $cont . "')\">"; print "<td class='line'><a onClick= \"javascript: popup_alerta('mostra_chamados.php?popup=true&numero=" . $row['numero'] . "')\"><font color='blue'>{$row['numero']}</font></a></td>\n <td class='line'>{$row['problema']}</td>\n <td class='line'>{$row['data_abertura']}</td>\n\t\t\t\t\t\t\t\t\t\t <td class='line'>{$row['data_atendimento']}</td>\n\t\t\t\t\t\t\t\t\t\t <td class='line'>{$row['data_fechamento']}</td>\n\t\t\t\t\t\t\t\t\t\t <td class='line'><font color={$corR}>" . $dtR->tValido . "</font></td>\n\t\t\t\t\t\t\t\t\t\t <td class='line'><font color={$cor}>" . $dtS->tValido . "</font></td>\n\t\t\t\t\t\t\t\t\t\t <td class='line'>" . $dtM->tValido . "</td>\n <td class='line'>" . $row['resposta'] . " minutos</font></td>\n <td class='line'>" . $row['sla'] . "</font></td>\n <td align='center'><a onClick=\"javascript:popup('mostra_hist_status.php?popup=true&numero=" . $row['numero'] . "')\"><img height='14' width='14' src='../../includes/imgs/" . $imgSlaR . "'></a></td>\n <td align='center'><a onClick=\"javascript:popup('mostra_hist_status.php?popup=true&numero=" . $row['numero'] . "')\"><img height='14' width='14' src='../../includes/imgs/" . $imgSlaS . "'></a></td>\n <td align='center'><a onClick=\"javascript:popup('mostra_hist_status.php?popup=true&numero=" . $row['numero'] . "')\"><img height='14' width='14' src='../../includes/imgs/" . $imgSlaM . "'></a></td>\n\t\t\t\t\t\t\t\t\t </tr>"; $cont++; } //while $media_resposta_geral = $dtR->secToHour(floor($total_res_segundos / $linhas)); $media_solucao_geral = $dtS->secToHour(floor($total_sol_segundos / $linhas)); $media_resposta_valida = $dtR->secToHour(floor($total_res_valido / $linhas)); $media_solucao_valida = $dtS->secToHour(floor($total_sol_valido / $linhas)); print "<tr ><td colspan=5><b>MÉDIAS -></td><td class='line'><b>{$media_resposta_valida}</td><td class='line'><B>{$media_solucao_valida}</td></tr>"; //MEDIAS DE SOLUÇÃO $perc_ate_sla2 = round($sla_green * 100 / $linhas, 2); $perc_ate_sla3 = round($sla_yellow * 100 / $linhas, 2); $perc_mais_sla3 = round($sla_red * 100 / $linhas, 2); $perc_sla16 = round($c_slaS_16h * 100 / $linhas, 2); //MEDIAS DE RESPOSTA $perc_ate_slaR2 = round($slaR_green * 100 / $linhas, 2); $perc_ate_slaR3 = round($slaR_yellow * 100 / $linhas, 2); $perc_mais_slaR3 = round($slaR_red * 100 / $linhas, 2); $slaR2M = $slaR2 / 60; $slaR3M = $slaR3 / 60;
if ($t_resp >= $slaR2) { $slaR_yellow_hw++; } else { $slaR_green_hw++; } } $total_sol_segundos_hw += $dtS_hw->diff["sFull"]; $total_res_segundos_hw += $dtR_hw->diff["sFull"]; $total_res_valido_hw += $dtR_hw->diff["sValido"]; $total_sol_valido_hw += $dtS_hw->diff["sValido"]; } // while //$media_resposta_geral = $dtR->secToHour(floor($total_res_segundos/$linhas)); //$media_solucao_geral = $dtS->secToHour(floor($total_sol_segundos/$linhas)); if ($linhas_hw != 0) { $media_resposta_valida_hw = $dtR_hw->secToHour(floor($total_res_valido_hw / $linhas_hw)); $media_solucao_valida_hw = $dtS_hw->secToHour(floor($total_sol_valido_hw / $linhas_hw)); //MEDIAS DE SOLUÇÃO $perc_ate_sla2_hw = round($sla_green_hw * 100 / $linhas_hw, 2); $perc_ate_sla3_hw = round($sla_yellow_hw * 100 / $linhas_hw, 2); $perc_mais_sla3_hw = round($sla_red_hw * 100 / $linhas_hw, 2); //MEDIAS DE RESPOSTA $perc_ate_slaR2_hw = round($slaR_green_hw * 100 / $linhas_hw, 2); $perc_ate_slaR3_hw = round($slaR_yellow_hw * 100 / $linhas_hw, 2); $perc_mais_slaR3_hw = round($slaR_red_hw * 100 / $linhas_hw, 2); } // --------------- TABELA 15 -----------------// print "<p>MÉDIAS DE TEMPO DE RESPOSTA E DE SOLUÇÃO</p>"; print "<blockquote>"; print "<table cellspacing='0' border='1'>"; print "<tr><td class='line'><b>TIPO</b></td><td class='line'><b>MÉDIA DE RESPOSTA</b></td><td class='line'><b>MÉDIA DE SOLUÇÃO</b></td></tr>";