-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
35b8bc6
commit 1001059
Showing
14 changed files
with
292 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
html, | ||
body { | ||
height: 100%; | ||
} | ||
|
||
body { | ||
display: -ms-flexbox; | ||
display: flex; | ||
-ms-flex-align: center; | ||
align-items: center; | ||
padding-top: 40px; | ||
padding-bottom: 40px; | ||
background-color: #f5f5f5; | ||
} | ||
|
||
.form-signin { | ||
width: 100%; | ||
max-width: 330px; | ||
padding: 15px; | ||
margin: auto; | ||
} | ||
.form-signin .checkbox { | ||
font-weight: 400; | ||
} | ||
.form-signin .form-control { | ||
position: relative; | ||
box-sizing: border-box; | ||
height: auto; | ||
padding: 10px; | ||
font-size: 16px; | ||
} | ||
.form-signin .form-control:focus { | ||
z-index: 2; | ||
} | ||
.form-signin input[type="text"] { | ||
margin-bottom: -1px; | ||
border-bottom-right-radius: 0; | ||
border-bottom-left-radius: 0; | ||
} | ||
.form-signin input[type="password"] { | ||
margin-bottom: 10px; | ||
border-top-left-radius: 0; | ||
border-top-right-radius: 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | ||
|
||
<title>School Life - Fazer login</title> | ||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"> | ||
<link rel="stylesheet" href="/css/login.css"> | ||
</head> | ||
|
||
<body class="text-center"> | ||
<form class="form-signin" action="login.php" method="post"> | ||
<img class="mb-4" src="../../assets/brand/bootstrap-solid.svg" alt="" width="72" height="72"> | ||
<h1 class="h3 mb-3 font-weight-normal">Login - School Life</h1> | ||
<label for="user" class="sr-only">Usuário</label> | ||
<input type="texto" name="user" class="form-control" placeholder="Usuário" required autofocus> | ||
<label for="senha" class="sr-only">Senha</label> | ||
<input type="password" name="senha" class="form-control" placeholder="Senha" required> | ||
<button class="btn btn-lg btn-primary btn-block" type="submit">Logar</button> | ||
<br> | ||
<?php | ||
if (isset($_GET['erro'])){ | ||
echo '<div class="alert alert-danger" role="alert">'; | ||
echo $_GET['erro']; | ||
echo '</div>'; | ||
} | ||
?> | ||
</form> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
session_start(); | ||
|
||
if (empty($_POST['user']) || empty($_POST['senha'])){ | ||
header('location: logar.php?erro=Os campos não podem ficar vazios.'); | ||
} | ||
else{ | ||
$usuario = $_POST['user']; | ||
$senha = $_POST['senha']; | ||
|
||
include 'database/connection.php'; | ||
$SQL = 'SELECT * FROM usuario WHERE nickUsuario = :nick and senhaUsuario = :senha'; | ||
$RESULT = $conn->prepare($SQL); | ||
$RESULT->bindParam(':nick', $usuario); | ||
$RESULT->bindParam(':senha', $senha); | ||
$RESULT->execute(); | ||
$ROWS = $RESULT->fetch(PDO::FETCH_OBJ); | ||
|
||
if (($usuario == $ROWS->nickUsuario) && ($senha == $ROWS->senhaUsuario)){ | ||
$_SESSION['logado'] = true; | ||
$_SESSION['nome'] = $ROWS->nomeUsuario; | ||
$_SESSION['iduser'] = $ROWS->idUsuario; | ||
|
||
header('location: sistema/admin.php'); | ||
} | ||
else{ | ||
header('location: logar.php?erro=Usuário ou senha inválidos!'); | ||
} | ||
} | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php | ||
session_start(); | ||
|
||
if ($_SESSION['logado']){ | ||
session_unset(); | ||
} | ||
|
||
header('location: index.php'); | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
<?php | ||
session_start(); | ||
$logado = false; | ||
$mensagem = 'Você não está logado.'; | ||
|
||
if (isset($_SESSION['logado']) && $_SESSION['logado']){ | ||
$logado = true; | ||
$mensagem = 'Bem-vindo, '.$_SESSION['nome'].'.'; | ||
} | ||
?> | ||
|
||
<!doctype html> | ||
<html lang="pt-br"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | ||
<title>School Life - Painel</title> | ||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"> | ||
<link rel="stylesheet" href="/css/base.css"> | ||
</head> | ||
|
||
<body> | ||
<nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark"> | ||
<a class="navbar-brand" href="index.php">School Life</a> | ||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsExampleDefault" aria-controls="navbarsExampleDefault" aria-expanded="false" aria-label="Toggle navigation"> | ||
<span class="navbar-toggler-icon"></span> | ||
</button> | ||
|
||
<div class="collapse navbar-collapse"> | ||
<ul class="navbar-nav mr-auto"> | ||
<li class="nav-item"> | ||
<a class="nav-link" href="../index.php">Início</a> | ||
</li> | ||
<li class="nav-item"> | ||
<a class="nav-link current" href="admin.php">Painel</a> | ||
</li> | ||
<li class="nav-item dropdown"> | ||
<a class="nav-link dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Cadastrar</a> | ||
<div class="dropdown-menu" aria-labelledby="dropdown01"> | ||
<a class="dropdown-item" href="cadastrar_professor.php">Professor</a> | ||
<a class="dropdown-item" href="#">Matéria</a> | ||
<a class="dropdown-item" href="#">Tipo de Atividade</a> | ||
<a class="dropdown-item" href="#">Atividade</a> | ||
</div> | ||
</li> | ||
<li class="nav-item dropdown"> | ||
<a class="nav-link dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Listar</a> | ||
<div class="dropdown-menu" aria-labelledby="dropdown01"> | ||
<a class="dropdown-item" href="listar_professor.php">Professor</a> | ||
<a class="dropdown-item" href="#">Matéria</a> | ||
<a class="dropdown-item" href="#">Tipo de Atividade</a> | ||
<a class="dropdown-item" href="#">Atividade</a> | ||
</div> | ||
</li> | ||
<li class="nav-item"> | ||
<a class="nav-link" href="../logout.php">Sair</a> | ||
</li> | ||
</ul> | ||
</form> | ||
</div> | ||
</nav> | ||
|
||
<main role="main"> | ||
|
||
<div class="jumbotron jumbotron-fluid" id="elefantebot"> | ||
<div class="container"> | ||
<br> | ||
<h1 class="display-3"><?= $mensagem ?></h1> | ||
</div> | ||
</div> | ||
|
||
</main> | ||
|
||
<footer class="container"> | ||
<p>School Life | Continuação do projeto de 2017.</p> | ||
</footer> | ||
|
||
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"></script> | ||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script> | ||
<script>function voltar() {window.history.back();}</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.