header("Location:login.php"); } /** * autenticações */ $filterGET = array('action' => array('filter' => FILTER_VALIDATE_REGEXP, 'options' => array("regexp" => "/^(excluir|imprimir)\$/")), 'id' => array('filter' => FILTER_VALIDATE_INT), 'page' => array('filter' => FILTER_VALIDATE_INT), 'financeiro_id' => array('filter' => FILTER_VALIDATE_INT)); $argsPost = array('action' => array('filter' => FILTER_VALIDATE_REGEXP, 'options' => array("regexp" => "/^(excluir|imprimir|exportar_xls)\$/")), 'page' => array('filter' => FILTER_VALIDATE_INT)); $inputPOST = filter_input_array(INPUT_POST, $argsPost); $dataGet = filter_input_array(INPUT_GET, $filterGET); try { $count = financeiroBO::getListaCount(); if (!$dataGet['page']) { $dataGet['page'] = 1; } $paginador = new paginador($dataGet['page'], $count, 20, ''); $dados = financeiroBO::getLista($paginador->getPage()); /** * action via post EXCLUIR */ if (isset($dataGet['action'])) { if ($dataGet['action'] == 'excluir') { if (isset($dataGet['id'])) { try { $result = financeiroBO::deletar($dataGet['id']); $response['success'][] = 'Financeiro excluído com sucesso!'; $response['link'] = 'financeiro.php?page=' . $dataGet['page']; } catch (Exception $err) { $response['error'][] = $err->getMessage(); } } }