diff --git a/css/login.css b/css/login.css
new file mode 100644
index 0000000..7441e03
--- /dev/null
+++ b/css/login.css
@@ -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;
+}
diff --git a/database/connection.php b/database/connection.php
index 130c347..a1103f4 100644
--- a/database/connection.php
+++ b/database/connection.php
@@ -1,6 +1,6 @@
bindParam(':id', $id);
$RESULT = $ALTERAR->execute();
- header('location:../listar_professor.php');
+ header('location:../sistema/listar_professor.php');
}
?>
diff --git a/database/insert_professor.php b/database/insert_professor.php
index 73d56d5..1aff8ea 100644
--- a/database/insert_professor.php
+++ b/database/insert_professor.php
@@ -1,19 +1,21 @@
Os campos não podem ficar vazios.';
}
else{
- $SQL = "INSERT INTO professor(nome, email) VALUES(:nome, :email)";
+ $SQL = "INSERT INTO professor(nome, email, idUserFK) VALUES(:nome, :email, :iduser)";
$INSERIR = $conn->prepare($SQL);
$INSERIR->bindParam(':nome', $nome);
$INSERIR->bindParam(':email', $email);
+ $INSERIR->bindParam(':iduser', $iduser);
$RESULTADO = $INSERIR->execute();
if (! $RESULTADO){
@@ -23,7 +25,7 @@
}
else{
echo '
Pessoa salva com sucesso!
';
- header('location:../listar_professor.php');
+ header('location: ../sistema/listar_professor.php');
}
}
diff --git a/database/select_professor.php b/database/select_professor.php
index 101274c..ece7ae4 100644
--- a/database/select_professor.php
+++ b/database/select_professor.php
@@ -2,18 +2,17 @@
include 'connection.php';
//Select no Banco de Dados
-$SQL = "SELECT * FROM professor";
+$SQL = 'SELECT * FROM professor WHERE idUserFK = '.$_SESSION['iduser'];
$RESULT = $conn->query($SQL);
//Exibindo os resultados
$ROWS = $RESULT->fetchAll(PDO::FETCH_OBJ);
foreach($ROWS as $VALUE){
echo '';
- echo ''.$VALUE->idProfessor.' | ';
echo ''.$VALUE->nome.' | ';
echo ''.$VALUE->email.' | ';
echo '';
- echo '    | ';
+ echo '   ';
echo '
';
}
diff --git a/index.php b/index.php
index 0ae4d72..272f6e9 100644
--- a/index.php
+++ b/index.php
@@ -18,29 +18,9 @@
-
+
@@ -52,7 +32,7 @@
Bem-vindo ao School Life!
Esta é a versão web do gerenciador de atividades com o mesmo nome.
- Ver atividades
+ Fazer login
diff --git a/logar.php b/logar.php
new file mode 100644
index 0000000..c88f60a
--- /dev/null
+++ b/logar.php
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+ School Life - Fazer login
+
+
+
+
+
+
+
+
diff --git a/login.php b/login.php
new file mode 100644
index 0000000..56d327b
--- /dev/null
+++ b/login.php
@@ -0,0 +1,30 @@
+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!');
+ }
+}
+?>
diff --git a/logout.php b/logout.php
new file mode 100644
index 0000000..8a157e0
--- /dev/null
+++ b/logout.php
@@ -0,0 +1,9 @@
+
diff --git a/sistema/admin.php b/sistema/admin.php
new file mode 100644
index 0000000..c8d93ef
--- /dev/null
+++ b/sistema/admin.php
@@ -0,0 +1,83 @@
+
+
+
+
+
+
+
+ School Life - Painel
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/cadastrar_professor.php b/sistema/cadastrar_professor.php
similarity index 91%
rename from cadastrar_professor.php
rename to sistema/cadastrar_professor.php
index 432acaf..1583c7d 100644
--- a/cadastrar_professor.php
+++ b/sistema/cadastrar_professor.php
@@ -1,5 +1,14 @@
@@ -22,7 +31,7 @@