banco_projeto/orcamento/edit_prestador.php
2021-09-02 08:27:03 -03:00

60 lines
1.8 KiB
PHP

<?php
session_start();
include_once("../conexao.php");
include('../menu.php');
$id = filter_input(INPUT_GET, 'id', FILTER_SANITIZE_NUMBER_INT);
$id_pre = filter_input(INPUT_GET, 'id_pre', FILTER_SANITIZE_NUMBER_INT);
$result = "SELECT * FROM prestadores;";
$resultado = mysqli_query($con, $result);
$row = mysqli_fetch_assoc($resultado);
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title> Editar orçamento - Prestador </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>
<a href="javascript:history.back()">Voltar</a>
<?php if(isset($_SESSION['msg'])){?>
<div class="msg">
<?php echo $_SESSION['msg'];
unset($_SESSION['msg']);?>
</div>
<?php }?>
<h1> Alterar Prestador </h1>
<form method="POST" action="edit_servico.php">
<input type="hidden" name="id" value="<?php echo $id; ?>">
<label> Prestadores: </label>
<select name="id_prestador">
<?php
$query= 'SELECT * from prestadores ORDER BY nome;';
$resu = mysqli_query($con,$query) or die(mysqli_connect_error());
while ($reg = mysqli_fetch_array($resu)){
?>
<option value="<?php echo $reg['id'];?>" <?php if($reg['id'] == $id_pre) echo "selected";?>> <?php echo $reg['nome'];?> </option>
<?php
}
?>
</select>
<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>