initial commit

This commit is contained in:
2021-09-02 08:27:03 -03:00
commit 7a18b18c39
72 changed files with 3489 additions and 0 deletions

View File

@ -0,0 +1,27 @@
<?php
session_start();
include_once("..\conexao.php");
$id = filter_input(INPUT_POST, 'id', FILTER_SANITIZE_NUMBER_INT);
$nome = filter_input(INPUT_POST, 'nome', FILTER_SANITIZE_STRING);
$verif="SELECT * from servicos WHERE id_categoria='$id'";
$resu= mysqli_query($con, $verif);
if (mysqli_affected_rows($con)){
$_SESSION['msg'] = "<p style='color:green;'>Esta categoria não pode ser excluída, pois existe serviço cadastrado</p>";
header("Location: index.php");
}else{
$result= "DELETE FROM categoria WHERE id='$id'";
$resultado= mysqli_query($con, $result);
if(mysqli_affected_rows($con)){
$_SESSION['msg'] = "<p style='color:green;'>Categoria excluida com sucesso</p>";
header("Location: index.php");
}else{
$_SESSION['msg'] = "<p style='color:red;'>Categoria não foi excluida</p>";
header("Location: edit_cat.php?id=$id");
}
}
?>