banco_projeto/rels/pes_prestadores_cli.php

47 lines
1.5 KiB
PHP
Raw Permalink Normal View History

2021-09-02 08:27:03 -03:00
<?php
if (session_status() !== PHP_SESSION_ACTIVE){
session_start();
}
include("../conexao.php");
include('../menu.php');
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Pesquisar Prestador</title>
<link rel="stylesheet" href="../css/menu.css">
<link rel="stylesheet" href="../css/article.css">
<link rel="stylesheet" href="../css/input.css">
</head>
<body>
<?php echo $nav; ?>
<article>
<section class='center'>
<h1>Pesquisar Prestador</h1>
<form method="POST" action="">
<label>Prestador: </label>
<input type="text" name="nome" placeholder="Digite um prestador" size="30"><br><br>
<input type="submit" class='buttons' name="SendPesqUser" value="Pesquisar">
</form><br><br>
<?php
$SendPesqUser = filter_input(INPUT_POST, 'SendPesqUser', FILTER_SANITIZE_STRING);
if($SendPesqUser){
$nome = filter_input(INPUT_POST, 'nome', FILTER_SANITIZE_STRING);
$query = "SELECT * FROM consulta_prestador_servico WHERE prestador like '%$nome%'";
$resultado = mysqli_query($con, $query);
while($row = mysqli_fetch_assoc($resultado)){
echo "ID do prestador:" . $row['id_prestador'] . "<br>";
echo "Prestador:" . $row['prestador'] . "<br>";
echo "ID do serviço: " . $row['id_servico'] . "<br>";
echo "Serviço:" . $row['servico'] . "<br>";
echo "Categoria: " . $row['categoria'] . "<br><hr>";
}
}
?>
</section>
</article>
<?php echo $footer; ?>
</body>
</html>