top.window.location = '../../index.php'"; exit; } require_once __DIR__ . "/" . "../../includes/include_geral_new.inc.php"; require_once __DIR__ . "/" . "../../includes/classes/ConnectPDO.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 = ""; $json = 0; $json2 = 0; ?> <?= APP_NAME; ?> <?= VERSAO; ?>
 

1 AND o.client = cl.id AND o.data_abertura >= '" . $d_ini . "' AND o.data_abertura <= '" . $d_fim . "' and o.client in (" . $row['id'] . ") {$clausule} GROUP BY cliente"; $exec_ab_sw = $conn->query($query_ab_sw); $row_ab_sw = $exec_ab_sw->fetch(); $query_fe_sw = "SELECT count(*) AS fechados, cl.nickname AS cliente, cl.id FROM ocorrencias AS o, clients cl, `status` AS st WHERE o.status = st.stat_id AND st.stat_ignored <> 1 AND o.client = cl.id AND o.data_fechamento >= '" . $d_ini . "' AND o.data_fechamento <= '" . $d_fim . "' and o.client in (" . $row['id'] . ") {$clausule} GROUP BY cliente, cl.id"; $exec_fe_sw = $conn->query($query_fe_sw); $row_fe_sw = $exec_fe_sw->fetch(); // $tAbertos += $totalAbertos += $tt_ab = $row_ab_sw['abertos']; // $tFechados += $totalFechados += $tt_fe = $row_fe_sw['fechados']; $tAbertos += $totalAbertos += $row_ab_sw['abertos'] ?? 0; $tFechados += $totalFechados += $row_fe_sw['fechados'] ?? 0; $data[$i]['cliente'] = $row['nickname']; $data[$i]['abertos'] = $totalAbertos; $data[$i]['fechados'] = $totalFechados; $totalAbertos = 0; $totalFechados = 0; ?>
$query, // 'Data' => $data, // 'Json normal' => $json, // ]); } } else { $_SESSION['flash'] = message('info', '', TRANS('MSG_COMPARE_DATE'), ''); redirect($_SERVER['PHP_SELF']); } } } ?>