Файл: adultscript-2.0.3-pro/files/admin/modules/nuevo/components/overlay.php
Строк: 35
<?php
defined('_VALID') or die('Restricted Access!');
class VComponent_Admin_nuevo_overlay
{
private $db;
private $cache;
private $filter;
public function __construct()
{
$this->db = VF::factory('database');
$this->cache = VF::factory('cache');
$this->filter = VF::factory('filter');
}
public function render()
{
$errors = array();
$messages = array();
$warnings = array();
$data = array();
if(isset($_GET['delete'])) {
if(intval($_GET['delete'])>0) {
$this->db->query("DELETE FROM nuevo__overlay WHERE ID = ".$_GET['delete']." LIMIT 1");
header("Location: ".ADMIN_URL.'/index.php?q=nuevo/overlay');
die();
}
}
if(isset($_GET['activate'])) {
if(intval($_GET['activate'])>0) {
$this->db->query("UPDATE nuevo__overlay SET active = '1' WHERE ID = ".$_GET['activate']." LIMIT 1");
$messages[] = 'Overlay ad activated!';
}
}
if(isset($_GET['suspend'])) {
if(intval($_GET['suspend'])>0) {
$this->db->query("UPDATE nuevo__overlay SET active = '0' WHERE ID = ".$_GET['suspend']." LIMIT 1");
$messages[] = 'Overlay ad suspended!';
}
}
$ads = $this->db->get_rows("SELECT * FROM nuevo__overlay ORDER BY ID DESC");
$tpl = &VF::factory('template');
$tpl->menu = 'nuevo';
$tpl->submenu = 'nuevo_overlay';
$tpl->meta_title = 'Admin::Nuevo::Overlay Ads';
$tpl->errors = $errors;
$tpl->messages = $messages;
$tpl->ads = $ads;
$tpl->pmenu = 'overlay';
$tpl->load(array('header', 'nuevo_overlay', 'footer'));
$tpl->display();
}
}
?>