PHP Classes

File: app/modules/news/delete_news.php

Recommend this page to a friend!
  Classes of Laudir Bispo   PHP Real Estate Website   app/modules/news/delete_news.php   Download  
File: app/modules/news/delete_news.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Real Estate Website
Manage the properties of a real estate business
Author: By
Last change:
Date: 3 years ago
Size: 947 bytes
 

Contents

Class file image Download
?<?PHP
session_name
(SESSION_NAME);
session_start();

require_once
$_SERVER['DOCUMENT_ROOT'].'/config/config.php';
require_once (
$_SERVER['DOCUMENT_ROOT'].'/config/public_functions.php');

if(
$_SESSION['level'] !== 3 and 2)
{
  die (
AlertsMensagens('warning', '<strong>'.$_SESSION['level'].' AÇÃO NÃO PERMITIDA!</strong> Você não tem autorização para completar esta ação.'));
}


if(empty(
$_POST['del']) or !isset($_POST['del']))
{
  die (
AlertsMensagens('warning', '<strong>Campo Vazio!</strong> Marque uma opção para continuar.'));
}
else
{
 
$ids = filter($_POST['del']);
 
}

function
filter( $dados )
{
 
$ids = Array();
    foreach(
$dados AS $dado ) $ids[] = (int)$dado;
    return
$ids;
}
 
require_once (
$_SERVER['DOCUMENT_ROOT'].'/controles/class/connect.class.php');
$con_db = new DB();
$con = $con_db->connect();
 
$delete = $con->query(' DELETE FROM `noticias` WHERE `id` IN('.implode( ',', $ids ).') ');
$delete->close();