Esempio n. 1
0
if ($action) {
    require_once '_models/AdminPost.class.php';
    $postAction = filter_input(INPUT_GET, 'post', FILTER_VALIDATE_INT);
    $postUpdate = new AdminPost();
    switch ($action) {
        case 'active':
            $postUpdate->ExeStatus($postAction, '1');
            WSErro("O status do membro foi atualizado para <b>ativo</b>. Membro publicado!", WS_ACCEPT);
            break;
        case 'inative':
            $postUpdate->ExeStatus($postAction, '0');
            WSErro("O status do membro foi atualizado para <b>inativo</b>. Membro agora é um rascunho!", WS_ACCEPT);
            break;
        case 'delete':
            $postUpdate->ExeDelete($postAction);
            WSErro('O membro ' . $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=membros/index&page=");
$Pager->ExePager($getPage, 5);
$Read = new Controle();
$Read->FullRead("SELECT * FROM ws_posts WHERE post_type = 'membros' ORDER by post_status ASC, post_date DESC LIMIT :limit OFFSET :offset", "limit={$Pager->getLimit()}&offset={$Pager->getOffset()}", true);
if (!$Read->getResult()) {
    $Pager->ReturnPage();
    WSErro("Desculpa, ainda não temos membros cadastrados", WS_INFOR);
Esempio n. 2
0
if ($action) {
    require_once '_models/AdminPost.class.php';
    $postAction = filter_input(INPUT_GET, 'post', FILTER_VALIDATE_INT);
    $postUpdate = new AdminPost();
    switch ($action) {
        case 'active':
            $postUpdate->ExeStatus($postAction, '1');
            WSErro("O status do post foi atualizado para <b>ativo</b>. Post publicado!", WS_ACCEPT);
            break;
        case 'inative':
            $postUpdate->ExeStatus($postAction, '0');
            WSErro("O status do post foi atualizado para <b>inativo</b>. Post agora é um rascunho!", WS_ACCEPT);
            break;
        case 'delete':
            $postUpdate->ExeDelete($postAction);
            WSErro('O post ' . $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=posts/index&page=");
$Pager->ExePager($getPage, 6);
$Read = new Controle();
$Read->FullRead("SELECT * FROM ws_posts WHERE post_type = 'post' ORDER by post_status ASC, post_date DESC LIMIT :limit OFFSET :offset", "limit={$Pager->getLimit()}&offset={$Pager->getOffset()}", true);
if (!$Read->getResult()) {
    $Pager->ReturnPage();
    WSErro("Desculpa, ainda não temos posts cadastrados", WS_INFOR);
$post = filter_input_array(INPUT_POST, FILTER_DEFAULT);
if (isset($post) && $post['SendPostForm']) {
    $post['post_status'] = $post['SendPostForm'] == 'Cadastrar' ? '0' : '1';
    $post['post_cover'] = $_FILES['post_cover']['tmp_name'] ? $_FILES['post_cover'] : null;
    unset($post['SendPostForm']);
    require '_models/AdminPost.class.php';
    $cadastra = new AdminPost();
    $cadastra->ExeCreate($post);
    if ($cadastra->getResult()) {
        if (!empty($_FILES['gallery_covers']['tmp_name'])) {
            $sendGallery = new AdminPost();
            $sendGallery->gbSend($_FILES['gallery_covers'], $cadastra->getResult());
        }
        header('Location: painel.php?exe=posts/update&create=true&postId=' . $cadastra->getResult());
    } else {
        WSErro($cadastra->getError()[0], $cadastra->getError()[1]);
    }
}
?>

        <form name="PostForm" action="" method="post" enctype="multipart/form-data">

            <label class="label">
                <span class="field">Enviar Capa:</span>
                <input type="file" name="post_cover" />
            </label>

            <label class="label">
                <span class="field">Titulo:</span>
                <input type="text" name="post_title" value="<?php 
if (isset($post['post_title'])) {
Esempio n. 4
0
                </ul>                
            </div>

            <div class="label gbform">
                <label class="label">
                    <span class="field">Enviar Arquivos:</span>
                    <input type="file" multiple name="files[]" />
                </label>

                <?php 
$delfl = filter_input(INPUT_GET, 'fldel', FILTER_VALIDATE_INT);
if ($delfl) {
    require_once '_models/AdminPost.class.php';
    $DellGallery = new AdminPost();
    $DellGallery->flRemove($delfl);
    WSErro($DellGallery->getError()[0], $DellGallery->getError()[1]);
}
?>
               

                <ul class="gallery">
                    <?php 
$gbi = 0;
$Files = new WsPostsFile();
$Files->setPost_id($postid);
$Files->Execute()->Query("#post_id#");
if ($Files->Execute()->getResult()) {
    foreach ($Files->Execute()->getResult() as $gb) {
        $gbi++;
        ?>
                            <li<?php 
Esempio n. 5
0
if ($action) {
    require_once '_models/AdminPost.class.php';
    $postAction = filter_input(INPUT_GET, 'post', FILTER_VALIDATE_INT);
    $postUpdate = new AdminPost();
    switch ($action) {
        case 'active':
            $postUpdate->ExeStatus($postAction, '1');
            WSErro("O status da cartilha foi atualizado para <b>ativo</b>. Post publicado!", WS_ACCEPT);
            break;
        case 'inative':
            $postUpdate->ExeStatus($postAction, '0');
            WSErro("O status da cartilha foi atualizado para <b>inativo</b>. Post agora é um rascunho!", WS_ACCEPT);
            break;
        case 'delete':
            $postUpdate->ExeDelete($postAction);
            WSErro('A cartilha ' . $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=cartilhas/index&page=");
$Pager->ExePager($getPage, 6);
$Read = new Controle();
$Read->FullRead("SELECT * FROM ws_posts WHERE post_type = 'cartilhas' ORDER by post_status ASC, post_date DESC LIMIT :limit OFFSET :offset", "limit={$Pager->getLimit()}&offset={$Pager->getOffset()}", true);
if (!$Read->getResult()) {
    $Pager->ReturnPage();
    WSErro("Desculpa, ainda não temos posts cadastrados", WS_INFOR);
Esempio n. 6
0
if ($action) {
    require_once '_models/AdminPost.class.php';
    $postAction = filter_input(INPUT_GET, 'post', FILTER_VALIDATE_INT);
    $postUpdate = new AdminPost();
    switch ($action) {
        case 'active':
            $postUpdate->ExeStatus($postAction, '1');
            WSErro("O status do post foi atualizado para <b>ativo</b>. Post publicado!", WS_ACCEPT);
            break;
        case 'inative':
            $postUpdate->ExeStatus($postAction, '0');
            WSErro("O status do post foi atualizado para <b>inativo</b>. Post 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=posts/index&page=");
$Pager->ExePager($getPage, 5);
$Read = new Controle();
$Read->FullRead("SELECT * FROM ws_posts ORDER by post_status ASC, post_date DESC LIMIT :limit OFFSET :offset", "limit={$Pager->getLimit()}&offset={$Pager->getOffset()}", true);
if ($Read->getResult()) {
    foreach ($Read->getResult() as $post) {
        $posti++;