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'], 3, 1); // $auth->showHeader(); $exception = ""; $imgsPath = "../../includes/imgs/"; //Todas as áreas que o usuário percente $uareas = $_SESSION['s_area']; if ($_SESSION['s_uareas']) { $uareas .= "," . $_SESSION['s_uareas']; } ?> <?= APP_NAME; ?> <?= VERSAO; ?>
 
1 and s.stat_painel in (1,2) "; $execTotal = $conn->query($qryTotal); $regTotal = $execTotal->rowcount(); //Todas as áreas que o usuário percente $qryAreas = "select count(*) total, a.sistema area, a.sis_id area_cod from ocorrencias o left join sistemas a on o.sistema = a.sis_id" . " left join `status` s on s.stat_id = o.status where o.sistema in (" . $uareas . ") AND s.stat_ignored <> 1 and s.stat_painel in (1,2) " . "group by a.sistema, a.sis_id"; try { $execAreas = $conn->query($qryAreas); $regAreas = $execAreas->rowcount(); } catch (Exception $e) { $exception .= "
" . $e->getMessage(); echo message('danger', 'Ooops!', '
' . $qryAreas . $exception, '', '', 1); return; } ?>

  :

fetchAll() as $rowAreas) { ?>     :  1 GROUP BY s.status, s.stat_id"; try { $execStatus = $conn->query($qryStatus); } catch (Exception $e) { $exception .= "
" . $e->getMessage(); echo message('danger', 'Ooops!', '
' . $qryStatus . $exception, '', '', 1); return; } ?>
fetchall() as $rowStatus) { ?>
1 AND o.sistema = " . $rowAreas['area_cod'] . " and s.stat_painel in (1,2) and " . " o.status = " . $rowStatus['stat_id'] . ""; $execDetail = $conn->query($qryDetail); ?> fetchall() as $rowDetail) { /* registros */ $j++; print ""; $qryImg = "select * from imagens where img_oco = " . $rowDetail['numero'] . ""; $execImg = $conn->query($qryImg); $rowTela = $execImg->fetch(); $regImg = $execImg->rowCount(); if ($regImg != 0) { $linkImg = ""; } else $linkImg = ""; $sqlSubCall = "select * from ocodeps where dep_pai = " . $rowDetail['numero'] . " or dep_filho=" . $rowDetail['numero'] . ""; $execSubCall = $conn->query($sqlSubCall); $regSub = $execSubCall->rowCount(); if ($regSub > 0) { #É CHAMADO PAI? $_sqlSubCall = "select * from ocodeps where dep_pai = " . $rowDetail['numero'] . ""; $_execSubCall = $conn->query($_sqlSubCall); $_regSub = $_execSubCall->rowCount(); $comDeps = false; foreach ($_execSubCall->fetchall() as $rowSubPai) { $_sqlStatus = "select o.*, s.* from ocorrencias o, `status` s where o.numero=" . $rowSubPai['dep_filho'] . " and o.`status`=s.stat_id and s.stat_painel not in (3) AND s.stat_ignored <> 1"; $_execStatus = $conn->query($_sqlStatus); $_regStatus = $_execStatus->rowCount(); if ($_regStatus > 0) { $comDeps = true; } } if ($comDeps) { $imgSub = ""; } else $imgSub = ""; } else $imgSub = ""; print ""; //print ""; print ""; $clientName = (!empty($rowDetail['nickname']) ? "" . $rowDetail['nickname'] . "

" : ""); $departmentName = (!empty($rowDetail['setor']) ? "" . noHtml($rowDetail['setor']) . "

" : ""); print ""; $texto = trim(noHtml($rowDetail['descricao'])); if (strlen((string)$texto) > 200) { // $texto = substr($texto, 0, 195) . " ..... "; }; print ""; print ""; print ""; } //$a++; ?>


" . $rowDetail['numero'] . " " . $imgSub . "".$rowDetail['numero']."" . $linkImg . " " . $rowDetail['problema'] . "" . $clientName . $rowDetail['contato'] . "" . $departmentName . $texto . "" . noHtml($rowDetail['nome']) . "