if ($eventoAnt == "SETUP") { $tempoSetup += $tempoAcumulado; $tempoAcumulado = 0; } else { if ($eventoAnt == "STOP") { $tempoStop += $tempoAcumulado; $tempoAcumulado = 0; } else { if ($eventoAnt == "RUN") { $tempoRun += $tempoAcumulado; $tempoAcumulado = 0; } } } } $hora2 = $hora; echo "</tr>"; } } $porcentagemDesligado = calculaPorcentagem($tempoDesligado, $tempoTotal); $porcentagemSetup = calculaPorcentagem($tempoSetup, $tempoTotal); $porcentagemStop = calculaPorcentagem($tempoStop, $tempoTotal); $porcentagemRun = calculaPorcentagem($tempoRun, $tempoTotal); $quantCiclos = floor($quantCiclos / 2); imprimeEventos($tempoDesligado, $tempoRun, $tempoRun, $tempoSetup, $tempoStop, $porcentagemDesligado, $porcentagemSetup, $porcentagemStop, $porcentagemRun, $quantCiclos); echo "</table>"; fclose($f); $conn->Close(); $conn = null; echo "</div>"; }
$tempoTotalAcumulado += $tempoTotal; $porTotalAcumulado += $porcentagemTotal; $quantCiclos = floor($quantCiclos / 2); imprimeEventos($numInjetora, $tempoDesligado, $tempoRun, $tempoRun, $tempoSetup, $tempoStop, $porcentagemDesligado, $porcentagemSetup, $porcentagemStop, $porcentagemRun, $tempoTotal, $porcentagemTotal); fclose($f); } echo "<tr>"; echo "<th>TOTAL</th>"; echo '<th>' . transformaTempo($runAcumulado) . '</th>'; echo '<th>' . transformaTempo($setupAcumulado) . '</th>'; echo '<th>' . transformaTempo($stopAcumulado) . '</th>'; echo '<th>' . transformaTempo($desligadoAcumulado) . '</th>'; echo "<th>{$porRunAcumulado} %</th>"; echo "<th>{$porSetupAcumulado} %</th>"; echo "<th>{$porStopAcumulado} %</th>"; echo "<th>{$porDesAcumulado} %</th>"; echo '<th>' . transformaTempo($tempoTotalAcumulado) . '</th>'; echo "<th>{$porTotalAcumulado} %</th>"; echo "</tr>"; echo "</table>"; echo "<table class='table'>"; echo "<tr><td>Tempo total de Produção: " . transformaTempo($runAcumulado); echo "<br>% Total de Produção: " . calculaPorcentagem($porRunAcumulado, $porTotalAcumulado) . "%</td>"; echo "<td>Tempo total de Setup: " . transformaTempo($setupAcumulado); echo "<br>% Total de Setup: " . calculaPorcentagem($porSetupAcumulado, $porTotalAcumulado) . "%</td>"; echo "<td>Tempo total de Stop: " . transformaTempo($stopAcumulado); echo "<br>% Total de Stop: " . calculaPorcentagem($porStopAcumulado, $porTotalAcumulado) . "%</td>"; echo "<td>Tempo total Desligado: " . transformaTempo($desligadoAcumulado); echo "<br>% Total Desligado: " . calculaPorcentagem($porDesAcumulado, $porTotalAcumulado) . "%</tr></td>"; echo "</table>"; echo "</div>";