Beispiel #1
0

<table border = '1pt' style=" border-color: white" width="900px" >
          <tr>
              <th>Id</th>
              <th>Nome</th>
              <th>Sobre nome</th>
              <th>Tipo</th>
              <th>Email</th>
              <th>Telefone</th>
              <th></th>

          </tr>
      <?php 
$bd = new BancoDeDados();
$agendaDAO = new agendaDAO($bd);
$listaUsuario = $agendaDAO->leUsuario();
foreach ($listaUsuario as $usuario) {
    echo '<tr>';
    echo '<td>' . $usuario->getId() . '</td>';
    echo '<td>' . $usuario->getNome() . '</td>';
    echo '<td>' . $usuario->getSobrenome() . '</td>';
    echo '<td>' . $usuario->getOpcao() . '</td>';
    echo '<td>' . $usuario->getEmail() . '</td>';
    echo '<td>' . $usuario->getTelefone() . '</td>';
    echo '<td><img src="' . $usuario->getImagem() . '" height="150" width="150"></td>';
    echo '</tr>';
}
$bd->fecha();
?>
<?php

$conexao = conexao::getconexao('config/mysql.ini');
$objAgendaDAO = new agendaDAO();
$objUsuarioDAO = new usuarioDAO();
$action = isset($_GET['action']) ? $_GET['action'] : 0;
$actionPost = isset($_POST['action']) ? $_POST['action'] : 0;
$idAgenda = isset($_GET['id']) ? $_GET['id'] : 0;
$idTurma = isset($_POST['comboTurma']) ? $_POST['comboTurma'] : 1;
if ($action == 2) {
    $objAgenda = $objAgendaDAO->selectIdCalendario($conexao, $idAgenda);
} else {
    $objAgenda = new agenda("", "", "", "");
}
$desc = isset($_POST['txtDesc']) ? $_POST['txtDesc'] : "";
$id_Turma = isset($_POST['comboTurma']) ? $_POST['comboTurma'] : "";
$data = isset($_POST['txtData']) ? $_POST['txtData'] : "";
if ($actionPost == 1) {
    $objAgenda = new agenda(NULL, $data, $desc, $id_Turma);
    $objAgendaDAO->insereEvento($conexao, $objAgenda);
}
if ($actionPost == 2) {
    $id_agenda = isset($_POST['idAgenda']) ? $_POST['idAgenda'] : 0;
    $objAgenda = new agenda($id_agenda, $data, $desc, $id_Turma);
    $objAgendaDAO->alteraEvento($conexao, $objAgenda);
}
$tipoAcesso = isset($_SESSION['login']['tipoAcesso']) ? $_SESSION['login']['tipoAcesso'] : 3;
if ($tipoAcesso == 3) {
    $turma = isset($_SESSION['login']['idTurma']) ? $_SESSION['login']['idTurma'] : "";
    ?>
  
Beispiel #3
0



<?php 
require_once 'bancodedados.php';
require_once 'agendaDAO.php';
$login = filter_input(INPUT_POST, 'login');
$senha = filter_input(INPUT_POST, 'senha');
$senha = md5($_POST['senha']);
$bd = new BancoDeDados();
$agendaDAO = new agendaDAO($bd);
$result = $agendaDAO->fazLogin($login, $senha);
if ($result == NULL) {
    echo "Login ou Senha incorretos, verifique se tem algum erro";
} else {
    session_start();
    $_SESSION['login'] = $login;
    $_SESSION['senha'] = $senha;
    header("Location:listacontatos.php");
    setcookie("login", $login);
}