示例#1
0
$action = filter_input(INPUT_GET, 'action', FILTER_DEFAULT);
if ($action) {
    require_once '_models/AdminArea.class.php';
    $postAction = filter_input(INPUT_GET, 'area', FILTER_VALIDATE_INT);
    $postUpdate = new AdminArea();
    switch ($action) {
        case 'active':
            $postUpdate->ExeStatus($postAction, '1');
            WSErro("O status da área foi atualizado para <b>ativo</b>. Área publicado!", WS_ACCEPT);
            break;
        case 'inative':
            $postUpdate->ExeStatus($postAction, '0');
            WSErro("O status do área foi atualizado para <b>inativo</b>. Área agora é um rascunho!", WS_ACCEPT);
            break;
        case 'delete':
            $postUpdate->ExeDelete($postAction);
            WSErro($postUpdate->getError()[0], $postUpdate->getError()[1]);
            break;
        default:
            WSErro("Ação não foi identificada pelo sistema, favor utilize os botões", WS_ERROR);
            break;
    }
}
$posti = 0;
$getPage = filter_input(INPUT_GET, 'page', FILTER_VALIDATE_INT);
$Pager = new Pager("painel.php?exe=area_trabalho/index&page=");
$Pager->ExePager($getPage, 6);
$Read = new Controle();
$Read->FullRead("SELECT * FROM ws_area_trabalho ORDER by area_status ASC, area_date DESC LIMIT :limit OFFSET :offset", "limit={$Pager->getLimit()}&offset={$Pager->getOffset()}", true);
if (!$Read->getResult()) {
    $Pager->ReturnPage();