top.window.location = '../../index.php'";
exit;
}
require_once __DIR__ . "/" . "../../includes/include_geral_new.inc.php";
require_once __DIR__ . "/" . "../../includes/classes/ConnectPDO.php";
require_once __DIR__ . "/" . "../../includes/classes/worktime/Worktime.php";
include_once __DIR__ . "/" . "../../includes/functions/getWorktimeProfile.php";
use includes\classes\ConnectPDO;
$conn = ConnectPDO::getInstance();
$auth = new AuthNew($_SESSION['s_logado'], $_SESSION['s_nivel'], 2, 1);
$_SESSION['s_page_ocomon'] = $_SERVER['PHP_SELF'];
$sess_client = (isset($_SESSION['s_rep_filters']['client']) ? $_SESSION['s_rep_filters']['client'] : '');
$sess_area = (isset($_SESSION['s_rep_filters']['area']) ? $_SESSION['s_rep_filters']['area'] : '-1');
$sess_d_ini = (isset($_SESSION['s_rep_filters']['d_ini']) ? $_SESSION['s_rep_filters']['d_ini'] : date('01/m/Y'));
$sess_d_fim = (isset($_SESSION['s_rep_filters']['d_fim']) ? $_SESSION['s_rep_filters']['d_fim'] : date('d/m/Y'));
$sess_state = (isset($_SESSION['s_rep_filters']['state']) ? $_SESSION['s_rep_filters']['state'] : 1);
$filter_areas = "";
$areas_names = "";
if (isAreasIsolated($conn) && $_SESSION['s_nivel'] != 1) {
/* Visibilidade isolada entre áreas para usuários não admin */
$u_areas = $_SESSION['s_uareas'];
$filter_areas = " AND sis_id IN ({$u_areas}) ";
$array_areas_names = getUserAreasNames($conn, $u_areas);
foreach ($array_areas_names as $area_name) {
if (strlen((string)$areas_names))
$areas_names .= ", ";
$areas_names .= $area_name;
}
}
$imgsPath = "../../includes/imgs/";
$config = getConfig($conn);
$percLimit = $config['conf_sla_tolerance'];
$ledGreen = "";
$ledYellow = "
";
$ledRed = "
";
$ledGray = "
";
$slaIndicatorLabel = [];
$slaIndicatorLabel[1] = TRANS('SMART_NOT_IDENTIFIED');
$slaIndicatorLabel[2] = TRANS('SMART_IN_SLA');
$slaIndicatorLabel[3] = TRANS('SMART_IN_SLA_TOLERANCE');
$slaIndicatorLabel[4] = TRANS('SMART_OUT_SLA');
$json = 0;
$json2 = 0;
$json3 = 0;
?>
= TRANS('TTL_PERIOD_FROM') . " " . dateScreen($d_ini, 1) . " " . TRANS('DATE_TO') . " " . dateScreen($d_fim, 1); ?>
fetchall() as $row) { $referenceDate = (!empty($row['oco_real_open_date']) ? $row['oco_real_open_date'] : $row['data_abertura']); $dataAtendimento = $row['data_atendimento']; //data da primeira resposta ao chamado $dataFechamento = $row['data_fechamento']; /* MÉTODOS PARA O CÁLCULO DE TEMPO VÁLIDO DE RESPOSTA E SOLUÇÃO */ $holidays = getHolidays($conn); $profileCod = getProfileCod($conn, $_SESSION['s_wt_areas'], $row['numero']); $worktimeProfile = getWorktimeProfile($conn, $profileCod); /* Objeto para o cálculo de Tempo válido de SOLUÇÃO - baseado no perfil de jornada de trabalho e nas etapas em cada status */ $newWT = new WorkTime( $worktimeProfile, $holidays ); /* Objeto para o cálculo de Tempo válido de RESPOSTA baseado no perfil de jornada de trabalho e nas etapas em cada status */ $newWTResponse = new WorkTime( $worktimeProfile, $holidays ); /* Objeto para checagem se o momento atual está coberto pelo perfil de jornada associado */ $objWT = new Worktime( $worktimeProfile, $holidays ); /* Realiza todas as checagens necessárias para retornar os tempos de resposta e solução para o chamado */ $ticketTimeInfo = getTicketTimeInfo($conn, $newWT, $newWTResponse, $row['numero'], $referenceDate, $dataAtendimento, $dataFechamento, $row['status_cod'], $objWT); // $solutionTime = $ticketTimeInfo['solution']['time']; /* Checagem sobre o filtro de SLAs */ $responseResult = getSlaResult($ticketTimeInfo['response']['seconds'], $percLimit, $row['sla_resposta_tempo']); $solutionResult = getSlaResult($ticketTimeInfo['solution']['seconds'], $percLimit, $row['sla_solucao_tempo']); $absoluteTime = absoluteTime($referenceDate, (!empty($dataFechamento) ? $dataFechamento : date('Y-m-d H:i:s')))['inTime']; $respUndentified += ($responseResult == 1 ? 1 : 0); $respGreen += ($responseResult == 2 ? 1 : 0); $respYellow += ($responseResult == 3 ? 1 : 0); $respRed += ($responseResult == 4 ? 1 : 0); $solUndentified += ($solutionResult == 1 ? 1 : 0); $solGreen += ($solutionResult == 2 ? 1 : 0); $solYellow += ($solutionResult == 3 ? 1 : 0); $solRed += ($solutionResult == 4 ? 1 : 0); } $data[0]['label'] = $slaIndicatorLabel[2]; $data[1]['label'] = $slaIndicatorLabel[3]; $data[2]['label'] = $slaIndicatorLabel[4]; $data[3]['label'] = $slaIndicatorLabel[1]; $data[0]['total'] = $respGreen; $data[1]['total'] = $respYellow; $data[2]['total'] = $respRed; $data[3]['total'] = $respUndentified; $data2[0]['label'] = $slaIndicatorLabel[2]; $data2[1]['label'] = $slaIndicatorLabel[3]; $data2[2]['label'] = $slaIndicatorLabel[4]; $data2[3]['label'] = $slaIndicatorLabel[1]; $data2[0]['total'] = $solGreen; $data2[1]['total'] = $solYellow; $data2[2]['total'] = $solRed; $data2[3]['total'] = $solUndentified; $respUndentifiedPerc = ($linhas ? round($respUndentified * 100 / $linhas,2) : 0); $respGreenPerc = ($linhas ? round($respGreen * 100 / $linhas,2) : 0); $respYellowPerc = ($linhas ? round($respYellow * 100 / $linhas,2) : 0); $respRedPerc = ($linhas ? round($respRed * 100 / $linhas,2) : 0); $solUndentifiedPerc = ($linhas ? round($solUndentified * 100 / $linhas,2) : 0); $solGreenPerc = ($linhas ? round($solGreen * 100 / $linhas,2) : 0); $solYellowPerc = ($linhas ? round($solYellow * 100 / $linhas,2) : 0); $solRedPerc = ($linhas ? round($solRed * 100 / $linhas,2) : 0); $json = json_encode($data); $json2 = json_encode($data2); ?>| = $ledGreen; ?> = mb_strtoupper($slaIndicatorLabel[2]); ?> | = $ledYellow; ?> = mb_strtoupper($slaIndicatorLabel[3]); ?> | = $ledRed; ?> = mb_strtoupper($slaIndicatorLabel[4]); ?> | = $ledGray; ?> = mb_strtoupper($slaIndicatorLabel[1]); ?> | |
| = TRANS('RESPONSE'); ?> | = $respGreen . " (" . $respGreenPerc . "%)";?> | = $respYellow . " (" . $respYellowPerc . "%)";?> | = $respRed . " (" . $respRedPerc . "%)";?> | = $respUndentified . " (" . $respUndentifiedPerc . "%)";?> |
| = TRANS('SOLUTION'); ?> | = $solGreen . " (" . $solGreenPerc . "%)";?> | = $solYellow . " (" . $solYellowPerc . "%)";?> | = $solRed . " (" . $solRedPerc . "%)";?> | = $solUndentified . " (" . $solUndentifiedPerc . "%)";?> |
| = TRANS('TOTAL_OF_TICKETS_IN_PERIOD'); ?> | = $linhas; ?> | |||