if ($action) { require_once '_models/AdminYoutube.class.php'; $tubeAction = filter_input(INPUT_GET, 'post', FILTER_VALIDATE_INT); $tubeUpdate = new AdminYoutube(); switch ($action) { case 'active': $tubeUpdate->ExeStatus($tubeAction, '1'); WSErro("O status do video foi atualizado para <b>ativo</b>. Video publicado!", WS_ACCEPT); break; case 'inative': $tubeUpdate->ExeStatus($tubeAction, '0'); WSErro("O status do video foi atualizado para <b>inativo</b>. Video agora é um rascunho!", WS_ACCEPT); break; case 'delete': $tubeUpdate->ExeDelete($tubeAction); WSErro($tubeUpdate->getError()[0], $tubeUpdate->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=youtube/index&page="); $Pager->ExePager($getPage, 6); $Read = new Controle(); $Read->FullRead("SELECT * FROM app_youtube ORDER by youtube_status ASC, youtube_date DESC LIMIT :limit OFFSET :offset", "limit={$Pager->getLimit()}&offset={$Pager->getOffset()}", true); if ($Read->getResult()) { foreach ($Read->getResult() as $post) { $posti++;
<header> <h1>Criar Videos do youtube:</h1> </header> <?php $tube = filter_input_array(INPUT_POST, FILTER_DEFAULT); if (isset($tube) && $tube['SendPostForm']) { $tube['youtube_status'] = $tube['SendPostForm'] == 'Cadastrar' ? '0' : '1'; unset($tube['SendPostForm']); require '_models/AdminYoutube.class.php'; $cadastra = new AdminYoutube(); $cadastra->ExeCreate($tube); if ($cadastra->getResult()) { header('Location: painel.php?exe=youtube/update&create=true&tubeId=' . $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">Titulo:</span> <input type="text" name="youtube_title" value="<?php if (isset($tube['youtube_title'])) { echo $tube['youtube_title']; } ?> " /> </label>