-
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.
Refactor: Foi alterado e adicioonado botões na pagina de visualização…
… de todos os usuário e foi configurado para que o usuário administrador não tem acesso de excluir esse usuário.
- Loading branch information
Showing
7 changed files
with
255 additions
and
77 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -18,10 +18,10 @@ | |
<!-- Header --> | ||
|
||
<header id="header" class="alt"> | ||
<div class="logo"><a href="index.html">WebSite <span>by ATK | ||
Company</span></a></div> | ||
<div class="logo"><a href="index.html">WebSite <span>by ATK Company</span></a></div> | ||
<a href="#menu"><span>Menu</span></a> | ||
</header> | ||
|
||
<!-- Nav --> | ||
<nav id="menu"> | ||
<ul class="links"> | ||
|
@@ -50,7 +50,6 @@ | |
$row_usuario = mysqli_fetch_assoc($resultado_usuario); | ||
?> | ||
<form method="POST" action="usu_exclui.php"> | ||
|
||
<?php | ||
if ($row_usuario) { | ||
echo "<h1><font color='yellow' size='+1'>Consta na nossa base de dados o usuário</font></h1>"; | ||
|
@@ -64,11 +63,16 @@ | |
echo "<label><strong>Senha:</strong></label> | ||
<span>" . $row_usuario['senha'] . "</span><br><br><br>"; | ||
|
||
// Mostra o botão "Excluir" apenas se o usuário for encontrado | ||
echo "<input type='hidden' name='id_usuario' value='" . $row_usuario['id'] . "'>"; | ||
echo "<label>Deseja excluir o usuário ? </label>"; | ||
echo "<button type='submit' style='background-color: red; color: white;'>EXCLUIR</button>"; | ||
|
||
// Verifica se o email não é do administrador | ||
if ($row_usuario['email'] !== '[email protected]') { | ||
echo "<label>Deseja excluir o usuário ? </label>"; | ||
echo "<button type='submit' style='background-color: red; color: white;'>EXCLUIR</button>"; | ||
} else { | ||
// Exibe mensagem se o usuário for o administrador | ||
echo "<h2><font color='yellow' size='+2'>Usuário não pode ser excluído</font></h2>"; | ||
} | ||
} else { | ||
echo "<h2><font color='red' size='+2'>Usuário não existe!!!!!</font></h2>"; | ||
} | ||
|
@@ -90,8 +94,9 @@ | |
</div> | ||
</section> | ||
<div class="copyright"> | ||
WebSite <a>By Company ATK</a> | ||
WebSite <a>By Allan</a> | ||
</div> | ||
|
||
<!-- Scripts --> | ||
<script src="../assets/js/jquery.min.js"></script> | ||
<script src="../assets/js/jquery.scrolly.min.js"></script> | ||
|
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,91 @@ | ||
<?php | ||
session_start(); | ||
include_once("../conexao.php"); | ||
?> | ||
<!DOCTYPE HTML> | ||
<html lang="pt"> | ||
|
||
<head> | ||
<title>WebSite SEGURADORA ATK</title> | ||
<meta charset="utf-8"> | ||
<meta name="robots" content="index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<link rel="stylesheet" href="../assets/css/main.css"> | ||
</head> | ||
|
||
<body class="subpage"> | ||
|
||
<!-- Header --> | ||
|
||
<header id="header" class="alt"> | ||
<div class="logo"><a href="index.html">WebSite <span>by ATK | ||
Company</span></a></div> | ||
<a href="#menu"><span>Menu</span></a> | ||
</header> | ||
<!-- Nav --> | ||
<nav id="menu"> | ||
<ul class="links"> | ||
<li><a href="../index.html">Home</a></li> | ||
<li><a href="../login.php">Login</a></li> | ||
</ul> | ||
</nav> | ||
|
||
<section id="post" class="wrapper bg-img" data-bg="banner4.jpg"> | ||
<div class="inner"> | ||
<article class="box"> | ||
<header> | ||
<center> | ||
<h2>DADOS DO USUÁRIO</h2> | ||
<br> | ||
<div class="form-container"> | ||
<?php | ||
$email = filter_input(INPUT_POST, 'email', FILTER_SANITIZE_STRING); | ||
$result_usuario = "SELECT id, nome, email, senha FROM e0_usuario WHERE email='" . mysqli_real_escape_string($conn, $email) . "'"; | ||
$resultado_usuario = mysqli_query($conn, $result_usuario); | ||
$row_usuario = mysqli_fetch_assoc($resultado_usuario); | ||
?> | ||
<br> | ||
<?php | ||
if ($row_usuario) { | ||
echo "<h1><font color='yellow' size='+1'>Consta na nossa base de dados o usuário</font></h1>"; | ||
echo "<div style='text-align: center;'> | ||
<label><strong>Senha:</strong></label> | ||
<span>" . $row_usuario['senha'] . "</span><br> | ||
</div>"; | ||
|
||
// Exibe o botão de login | ||
echo "<form action='../login.php' method='POST' style='text-align: center; margin-top: 10px;'> | ||
<button type='submit' style='background-color: #4CAF50; color: white;'>Login</button> | ||
</form>"; | ||
} else { | ||
echo "<h2><font color='red' size='+2'>Usuário não existe!!!!!</font></h2>"; | ||
} | ||
?> | ||
<br> | ||
<div style="text-align: center; margin-top: 5px;"> | ||
<label>Deseja fazer uma nova pesquisa?</label> | ||
<form action="usu_esqueci.php" style="display: inline;"> | ||
<button type="submit" style="background-color: #808080; color: white;">VOLTAR</button> | ||
</form> | ||
</div> | ||
</div> | ||
</body> | ||
|
||
</header> | ||
|
||
</article> | ||
</div> | ||
</section> | ||
<div class="copyright"> | ||
WebSite <a>By Company ATK</a> | ||
</div> | ||
<!-- Scripts --> | ||
<script src="../assets/js/jquery.min.js"></script> | ||
<script src="../assets/js/jquery.scrolly.min.js"></script> | ||
<script src="../assets/js/jquery.scrollex.min.js"></script> | ||
<script src="../assets/js/skel.min.js"></script> | ||
<script src="../assets/js/util.js"></script> | ||
<script src="../assets/js/main.js"></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.