session_start();
if ($_SESSION["id_user"] == ""){
header ("location: http://dalloul.com.br");
}
include "../global/inc_mysql.php";
if($_GET["action"] == "" && $_POST["action"] == ""){
include "inc_list.php";
}
if($_GET["action"] == "excluir"){
include "inc_delete.php";
include "inc_list.php";
}
if($_POST["action"] == "update" || $_GET["action"] == "alterar"){
$botao = "Alterar";
$acao = "update";
$hidden_id_news = "";
}else{
$botao = "Gravar";
$acao = "gravar";
}
$form = "
";
if($_GET["action"] == "alterar"){
include "inc_select.php";
echo "
";
exit;
};
//include "../global/inc_check_cnpj.php";
if ($_GET["action"] == "inserir") {
echo $form;
}elseif($_POST["action"] == "gravar" || $_POST["action"] == "update"){
if($_POST["titulo_news"] == ""){
echo "Preencha o Título do Vídeo
";
}
if($_POST["integra_news"] == ""){
echo "Preencha o Embed
";
}
if($_POST["titulo_news"] != "" && $_POST["integra_news"] != ""){
if($_POST["action"] == "gravar"){
echo "Vídeo Cadastrado com Sucesso
";
include "inc_insert.php";
include "inc_list.php";
$form = "";
}elseif($_POST["action"] == "update"){
echo "Vídeo Atualizado com Sucesso
";
include "inc_update.php";
include "inc_list.php";
$form = "";
}
}
echo $form;
}
mysql_close($link);
?>