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["especialidade"] == ""){
echo "Preencha o campo Instituição
";
}
if($_POST["nome"] == ""){
echo "Preencha a campo Contato
";
}
if($_POST["url"] == ""){
echo "Preencha a campo Url
";
}
if($_POST["email"] == ""){
echo "Preencha a campo E-mail
";
}
if($_POST["telefone"] == ""){
echo "Preencha a campo Telefone
";
}
if($_POST["especialidade"] != "" && $_POST["nome"] != "" && $_POST["url"] != "" && $_POST["email"] != "" && $_POST["telefone"] != ""){
if($_POST["action"] == "gravar"){
echo "Instituição Cadastrada com Sucesso
";
include "inc_insert.php";
include "inc_list.php";
$form = "";
}elseif($_POST["action"] == "update"){
echo "Instituição Atualizada com Sucesso
";
include "inc_update.php";
include "inc_list.php";
$form = "";
}
}
echo $form;
}
mysql_close($link);
?>