Mini Shell

Direktori : /home/funerariamayer/www/cms/
Upload File :
Current File : /home/funerariamayer/www/cms/excluir-entidade.php

<?
session_start();
$cod_empresa=$_SESSION['cod_empresa_user'];

$cod_entidade=$_GET['cod_entidade'];

require_once('conexao.php');
$sql="delete from mayer_entidades where cod_entidade='$cod_entidade'";
$query=mysqli_query($con,$sql);



//Exclui as fotos da pasta ---------------------------------------
require_once('conexao.php');
$sql="select cod_entidade_foto,foto
      from mayer_entidades_fotos
      where
      cod_entidade='$cod_entidade'
      ORDER BY ordem ASC
      ;";
//echo "<pre>".$sql."</pre>";
$query=mysqli_query($con,$sql);
$totitens=@mysqli_num_rows($query);
if ($totitens!="")
{
 while($row = mysqli_fetch_array($query))
 {
   $foto=$row['foto'];
   unlink ("../images/portfolio/entidades/$foto");
 }
}
//Exclui as fotos da pasta ---------------------------------------

require_once('conexao.php');
$sql="delete from mayer_entidades_fotos where cod_entidade='$cod_entidade'";
$query=mysqli_query($con,$sql);

//header('location:gerenciar-entidade');
?>

<META HTTP-EQUIV="REFRESH" CONTENT="0;URL='gerenciar-entidade'">

Zerion Mini Shell 1.0