banco_projeto/rels/pes_servicos_cli.php

45 lines
1.4 KiB
PHP
Raw 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 Serviço</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 Serviço</h1>
<form method="POST" action="">
<label>Serviço: </label>
<input type="text" name="nome" placeholder="Digite um serviço" 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_servicos WHERE descricao like '%$nome%'";
$resultado = mysqli_query($con, $query);
while($row = mysqli_fetch_assoc($resultado)){
echo "ID:" . $row['servico'] . "<br>";
echo "Serviço: " . $row['descricao'] . "<br>";
echo "Categoria: " . $row['categoria'] . "<br><hr>";
}
}
?>
</section>
</article>
<?php echo $footer; ?>
</body>
</html>