Skip to content

Commit

Permalink
02.10
Browse files Browse the repository at this point in the history
  • Loading branch information
G3programmer authored Oct 3, 2024
1 parent 98d0fb9 commit 744de1b
Show file tree
Hide file tree
Showing 8 changed files with 649 additions and 239 deletions.
110 changes: 90 additions & 20 deletions src/css/style-cadastro.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,27 @@
height: 55px;
}

.cabecalho .menu {
display: flex;
flex: 1 1 200px;
align-items: center;
justify-content: flex-end;
}


.cabecalho .menu li a {
padding: 30px;
color: #e8e8e8;
font-weight: bolder;
font-size: 15px;
font-family: 'Codygoon';
}

.cabecalho .menu li a:hover {
border-bottom: 2px solid white;

}

.home {
display: flex;
background: #131c2b;
Expand Down Expand Up @@ -108,7 +129,7 @@ formulário
}

.home .box .titulo {
font-family:'Eingrantch Mono';
font-family: 'Eingrantch Mono';
color: #fff;
margin-bottom: 15px;
font-weight: 500;
Expand Down Expand Up @@ -244,7 +265,7 @@ formulário
}

.home .box .formulario .inputBox .estado,
.home .box .formulario .inputBox .cidade {
.home .box .formulario .inputBox .cidade {
background: #87868656;
display: flex;
border: none;
Expand All @@ -255,14 +276,63 @@ formulário
color: #fff;
}

.home .box .formulario .inputBox .estado:focus,
.home .box .formulario .inputBox .cidade:focus {
outline: none;
background: #2c8abd;
color: #fff;
}

.home .box .formulario .inputBox .estado option:checked,
.home .box .formulario .inputBox .cidade option:checked {
background: #15a136;
color: #fff;
}

.home .box .formulario .inputBoxFile {
position: relative;
font-family: 'Codygoon';
font-size: 15px;
width: 300px;
margin-top: 9px;
}

.home .box .formulario .inputBoxFile input {
position: relative;
justify-content: center;
width: 100%;
margin-top: 45px;
background: #fff;
padding: 10px 10px 10px;
outline: none;
border-radius: 6px;
border: none;
box-shadow: none;
color: #23242a;
font-size: 1em;
letter-spacing: 0.05em;
z-index: 10;
}

.home .box .formulario .inputBoxFile span{
position: absolute;
left: 0;
padding: 20px 10px 10px;
pointer-events: none;
color: #fff;
font-size: 1em;
letter-spacing: 0.05em;
z-index: 20;
}

.home .box .formulario .next-btn {
position: relative;
justify-self: center;
font-family: 'Milestone One';
font-size: 15px;
background: none;
border-radius: 5px;
color:#fff;
color: #fff;
border: none;
cursor: pointer;
width: 100px;
Expand All @@ -286,7 +356,7 @@ formulário
font-size: 15px;
background: none;
border-radius: 5px;
color:#fff;
color: #fff;
border: none;
cursor: pointer;
width: 100px;
Expand Down Expand Up @@ -337,29 +407,29 @@ formulário
}

.home .box .formulario .cadastrar {
position: absolute;
background: rgba(69, 69, 69, 0.381);
cursor: pointer;
width:18pc;
margin-top: 2pc;
justify-self: center;
border:none;
font-family: 'Codygoon';
border-radius: 20px;
color: #fff;
transition: 0.5s;
padding: 5px 0px 5px 0px;
position: absolute;
background: rgba(69, 69, 69, 0.381);
cursor: pointer;
width: 18pc;
margin-top: 2pc;
justify-self: center;
border: none;
font-family: 'Codygoon';
border-radius: 20px;
color: #fff;
transition: 0.5s;
padding: 5px 0px 5px 0px;
}

.home .box .formulario .cadastrar:hover {
color: black;
font-weight: bold;
background: #fff;
transition: 0.5s;
transition: 0.5s;
}

.home .box .formulario .btns {
justify-self: center;
justify-self: center;
}

.home .box .formulario .btns .login-btn {
Expand All @@ -371,7 +441,7 @@ justify-self: center;
font-size: 15px;
background: none;
border-radius: 5px;
color:#fff;
color: #fff;
border: none;
cursor: pointer;
width: 100px;
Expand All @@ -395,7 +465,7 @@ justify-self: center;
font-size: 15px;
background: none;
border-radius: 5px;
color:#fff;
color: #fff;
border: none;
cursor: pointer;
width: 100px;
Expand Down
48 changes: 45 additions & 3 deletions src/css/style-dashboard.css
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,10 @@
text-align: center;
}

.home .perfil .info ul {
gap: 9px;
}

.home .perfil .info .bem-vindo {
margin-top: -9pc;
color: #fff;
Expand Down Expand Up @@ -185,8 +189,46 @@
height: 30px;
margin: -2px 0px 5px 0px;
margin-left: 10px;
padding: auto;
padding: 3px 2px 3px 2px;
float: right;
background: #25252589;
color: #fff;
font-size: 14px;
color: black;
}


.home .perfil .info .user {
width: 250px;
font-size: 14px;
padding: auto;
color: #fff !important;

}


.modal {
position: fixed;
z-index: 1000;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
display: flex;
justify-content: center;
align-items: center;
}

.modal-content {
background-color: white;
padding: 20px;
border-radius: 10px;
text-align: center;
}

.modal-content h2 {
margin-bottom: 20px;
}

.modal-content button {
margin: 10px;
}
44 changes: 44 additions & 0 deletions src/css/style-login.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,27 @@
height: 55px;
}

.cabecalho .menu {
display: flex;
flex: 1 1 200px;
align-items: center;
justify-content: flex-end;
}


.cabecalho .menu li a {
padding: 30px;
color: #e8e8e8;
font-weight: bolder;
font-size: 15px;
font-family: 'Codygoon';
}

.cabecalho .menu li a:hover {
border-bottom: 2px solid white;

}

.home {
display: flex;
background: rgb(140,32,6);
Expand Down Expand Up @@ -151,6 +172,7 @@ formulário

.home .box .titulo {
color: #fff;
font-family: 'Milestone One';
font-weight: 500;
text-align: center;
letter-spacing: 0.1em;
Expand Down Expand Up @@ -182,6 +204,7 @@ formulário
.home .box .formulario .inputBox span {
position: absolute;
left: 0;
font-family: 'Milestone One';
padding: 20px 10px 10px;
pointer-events: none;
color: #8f8f8f;
Expand Down Expand Up @@ -222,6 +245,7 @@ formulário
}
.home .box .formulario .links a {
margin: 10px 0;
font-family: 'Codygoon';
font-size: 0.75em;
color: #8f8f8f;
text-decoration: none;
Expand Down Expand Up @@ -251,6 +275,26 @@ formulário

}

.home .box .formulario .login {
background: rgba(69, 69, 69, 0.381);
cursor: pointer;
width:18pc;
margin-top: 2pc;
justify-self: center;
border:none;
font-family: 'Codygoon';
border-radius: 20px;
color: #fff;
transition: 0.5s;
padding: 5px 0px 5px 0px;
}

.home .box .formulario .login:hover {
color: black;
font-weight: bold;
background: #fff;
transition: 0.5s;
}

.roda-pe {
height: 35pc;
Expand Down
27 changes: 27 additions & 0 deletions src/js/dashboard.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Seleciona elementos do DOM
const removeAdmBtn = document.getElementById('removeAdmBtn');
const confirmModal = document.getElementById('confirmModal');
const confirmBtn = document.getElementById('confirmBtn');
const cancelBtn = document.getElementById('cancelBtn');

// Abre o modal ao clicar no botão
removeAdmBtn.onclick = function() {
confirmModal.style.display = 'block';
}

// Fecha o modal ao clicar em cancelar
cancelBtn.onclick = function() {
confirmModal.style.display = 'none';
}

// Ação de confirmação
confirmBtn.onclick = function() {
window.location.href = 'src/php/removeAdm.php'; // Redireciona para a ação de remoção
}

// Fecha o modal se o usuário clicar fora dele
window.onclick = function(event) {
if (event.target == confirmModal) {
confirmModal.style.display = 'none';
}
}
31 changes: 31 additions & 0 deletions src/php/removeAdm.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php
session_start();
include_once('conexao.php'); // Inclui a conexão com o banco de dados

// Verifica se o usuário está logado, caso contrário, redireciona para a página de login
if (!isset($_SESSION['email']) || !isset($_SESSION['senha'])) {
header('Location: login.html');
exit;
}

$logado = $_SESSION['email'];
$senha = $_SESSION['senha'];

// Atualiza o campo is_admin no banco de dados para 0 (remove o status de administrador)
$stmt = $conn->prepare("UPDATE usuario SET is_admin = 0 WHERE email = ? AND senha = ?");
$stmt->bind_param("ss", $logado, $senha);

if ($stmt->execute()) {
// Atualiza a sessão para refletir a mudança
$_SESSION['is_admin'] = 0;

// Redireciona para a página de perfil após a atualização
header("Location: ../../perfil.php");
exit;
} else {
// Se ocorrer um erro, exibe um alerta e redireciona de volta para o perfil
echo "<script>alert('Erro ao remover status de administrador');</script>";
echo "<script>window.location.href = '../../perfil.php';</script>";
}

?>
Loading

0 comments on commit 744de1b

Please sign in to comment.