<?php 
error_reporting(0);
ini_set(“display_errors”, 0 );
include "protege_professor.php";

 $idusuario         = $_SESSION['id_usuario'];
 $img 	   			= $_GET["img"];
 $nome              = $_GET['nome'];


	  // echo "<pre>";
   //    print_r($_GET);
   //    echo "</pre>"; die();

include "conexao.php";


$deleta_album = mysqli_query($db,"DELETE FROM slide_empreendimentos WHERE idslide_empreendimentos='$img'");
//#########################################  Funcoes Grava Log   #############################################

function nome_user1($id){
            include "conexao.php";
                 $query_igpm = "SELECT nome_cli FROM cliente where idcliente = $id";

                 $executa_igpm = mysqli_query ($db, $query_igpm);


                   while ($buscar_amigoc = mysqli_fetch_assoc($executa_igpm)) {//--verifica se são amigos

                          $nome_cli        = $buscar_amigoc['nome_cli'];
                   }
                   return $nome_cli;

         } 


        function grava_log($data_log,$usuario_id,$descricao_log){
           include "conexao.php";
          
                $query_log = "insert into log (data_log,usuario_id,descricao_log) values('$data_log','$usuario_id','$descricao_log')";
                $executa_log = mysqli_query($db, $query_log);
                return 1;
        }

               // $numero_parcela   = implode(',', $_POST['antecipar']);

                date_default_timezone_set('America/Sao_Paulo');              
                $data_log = date('d-m-Y H:i:s');         // data e hr no momento
                $nome_usuario = nome_user1($idusuario); //nome usuario sessao
                $cli_nome     = nome_user1($proprietario_id);
                $descricao_log = "Usuário ".$nome_usuario ." excluiu o arquivo : ".$nome;
                grava_log($data_log,$idusuario,$descricao_log);
                //echo "cheguei aqui...;".$descricao_log; die();

//######################################### " FIM " Funcoes Grava Log   ######################################




?>
<script>
window.location ="adicionar_destaque.php";
</script>