/administracao/campus/cadastrar.php
https://github.com/andrerezende/SIE · PHP · 53 lines · 48 code · 4 blank · 1 comment · 6 complexity · c0f2c6b866f910bb6b40a6a403336959 MD5 · raw file
- <?php session_start("SELECAO"); ?>
- <?php
- session_start();
- include("../classes/DB.php");
- include("../classes/Campus.php");
- $nome = addslashes($_POST['nome']);
- /* Acesso ao banco de dados */
- $banco = DB::getInstance();
- $conexao = $banco->ConectarDB();
- $campus = new Campus(null, $nome);
- $resultado = $campus->Inserir($conexao);
- if ($resultado == true) {
- $_SESSION['flashMensagem'] = 'Campus cadastrado com sucesso.';
- } else {
- $_SESSION['flashMensagem'] = 'Problemas ao efetuar o transação.';
- }
- header('Location:../login/menu.php');
- ?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html lang="pt-br" xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title> <?php echo ($_SESSION["Gnomeprocessoseletivo"]);?> </title>
- <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
- <link href="../../estilo_selecao.css" rel="stylesheet" type="text/css" />
- <script type="text/javascript">
- function delayer(){
- window.location = '../login/login.php';
- }
- </script>
- </head>
- <body onload="setTimeout('delayer()', 1000)">
- <?php
- if ($resutado == true) {
- echo("<table width='90%' border='0'>");
- echo(" <tr>");
- echo(" <td height='280'><div align='center'><font size='6'><a href='../login/menu.php'>Cadastro efetuado com sucesso</font><font size='6'></font></div></td>");
- echo(" </tr>");
- echo("</table>");
- } else {
- echo("<table width='90%' border='0'>");
- echo(" <tr>");
- echo(" <td height='280'><div align='center'><font size='6'><a href='../login/menu.php'>Problemas ao efetuar o cadastro</font><font size='6'></font></div></td>");
- echo(" </tr>");
- echo("</table>");
- }
- $banco->DesconectarDB($conexao);
- ?>
- </body>
- </html>