banco_projeto/prestadores/edit_pre.php
2021-09-02 08:27:03 -03:00

66 lines
2.8 KiB
PHP

<?php
session_start();
include_once("../conexao.php");
include('../menu.php');
$id = filter_input(INPUT_GET, 'id', FILTER_SANITIZE_NUMBER_INT);
$result = "SELECT * FROM prestadores WHERE id = '$id'";
$resultado = mysqli_query($con, $result);
$row = mysqli_fetch_assoc($resultado);
?>
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="utf-8">
<title>Editar Prestadores</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 - Prestadores</h1>
<form method="POST" action="proc_edit_pre.php">
<input type="hidden" name="id" value="<?php echo $row['id']; ?>">
<label>Nome: </label>
<input type="text" name="nome" placeholder="Digite o prestador" value="<?php echo $row['nome']; ?>"><br><br>
<label>Endereço: </label>
<input type="text" name="endereco" placeholder="Digite o endereço" value="<?php echo $row['endereco']; ?>"><br><br>
<label>Complemento: </label>
<input type="text" name="complemento" placeholder="Digite o complemento" value="<?php echo $row['complemento']; ?>"><br><br>
<label>Bairro: </label>
<input type="text" name="bairro" placeholder="Digite o bairro" value="<?php echo $row['bairro']; ?>"><br><br>
<label>Cidade: </label>
<input type="text" name="cidade" placeholder="Digite a cidade" value="<?php echo $row['cidade']; ?>"><br><br>
<label>Estado: </label>
<input type="text" name="estado" placeholder="Digite o estado" value="<?php echo $row['estado']; ?>"><br><br>
<label>CEP: </label>
<input type="text" name="cep" placeholder="Digite o CEP" value="<?php echo $row['cep']; ?>"><br><br>
<label>Email: </label>
<input type="text" name="email" placeholder="Digite o email" value="<?php echo $row['email']; ?>"><br><br>
<label>Telefone: </label>
<input type="text" name="telefone" placeholder="Digite o telefone" value="<?php echo $row['telefone']; ?>"><br><br>
<label>Celular: </label>
<input type="text" name="celular" placeholder="Digite o celular" value="<?php echo $row['celular']; ?>"><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>