2021-09-02 08:27:03 -03:00

49 lines
1.5 KiB
PHP

<?php
session_start();
include_once("../conexao.php");
$id = filter_input(INPUT_GET, 'id', FILTER_SANITIZE_NUMBER_INT);
$result = "SELECT * FROM categoria WHERE id = '$id'";
$resultado = mysqli_query($con, $result);
$row = mysqli_fetch_assoc($resultado);
include('../menu.php');
?>
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="utf-8">
<title>Alterar Categoria</title>
<link rel="stylesheet" href="../css/menu.css">
<link rel="stylesheet" href="../css/forms.css">
<link rel="stylesheet" href="../css/article.css">
<link rel="stylesheet" href="../css/input.css">
</head>
<body>
<?php
echo $nav;
?>
<article>
<section class='center'>
<a href="index.php">Listar</a>
<?php if(isset($_SESSION['msg'])){?>
<div class="msg">
<?php echo $_SESSION['msg'];
unset($_SESSION['msg']);?>
</div>
<?php }?>
<h1>Alteração - Categoria</h1>
<form method="POST" action="proc_edit_cat.php">
<input type="hidden" name="id" value="<?php echo $row['id']; ?>">
<label>Categoria: </label>
<input type="text" name="nome" placeholder="Digite a categoria" value="<?php echo $row['categoria']; ?>"><br><br>
<table class='input'>
<td><input class='buttons' type="submit" value="Salvar"></td>
<td><input class='buttons' type="reset" value="Limpar"></td>
</table>
</form>
</section>
</article>
<?php echo $footer;?>
</body>
</html>