banco_projeto/servicos/cad_ser.php

68 lines
1.9 KiB
PHP
Raw Normal View History

2021-09-02 08:27:03 -03:00
<?php
if (session_status() !== PHP_SESSION_ACTIVE){
session_start();
}
include('../menu.php');
include("../conexao.php");
?>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title> Cadastro de serviços </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 }?>
<p><h1> Serviços - inclusão</h1></p>
<form method="POST" action="inc_ser.php">
<p> Nome: <input type="text" name="nome" required>
<label> Categoria: </label>
<select name="id_categoria">
<?php
$query= 'SELECT * from categoria ORDER BY categoria;';
$resu = mysqli_query($con,$query) or die(mysqli_connect_error());
while ($reg = mysqli_fetch_array($resu)){
?>
<option value="<?php echo $reg['id'];?>"> <?php echo $reg['categoria'];?> </option>
<?php
}
?>
</select>
<label> Prestador: </label>
<select name="id_prestador">
<option value="NULL">Nenhum</option>
<?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 echo $reg['nome'];?> </option>
<?php
}
?>
</select>
<table class='input'>
<td><input class='buttons' type="submit" value="Enviar"></td>
<td><input class='buttons' type="reset" value="Limpar"></td>
</table>
</form>
</section>
</article>
<?php echo $footer;?>
</body>
</html>