Вход Регистрация
Файл: adultscript-2.0.3-pro/files/admin/modules/nuevo/components/overlaynew.php
Строк: 74
<?php
defined
('_VALID') or die('Restricted Access!');
class 
VComponent_Admin_nuevo_overlaynew
{
    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('title'=>'','media'=>'','email'=>'','owner'=>'''url'=>'','target'=>'_self','channel' =>0'start'=>'5','pause'=>1,'delay'=>0,'active'=>0);


        
$extensions = array('.png''.jpg''.jpeg''.gif''.swf''.flv''.mp4');

        if (isset(
$_POST['create_ad'])) {
            
            
$data['owner']          = trim($_POST['owner']);
            
$data['email']          = trim($_POST['email']);
            
$data['title']          = trim($_POST['title']);
            
$data['media']            = trim($_POST['media']);
            
$data['url']            = trim($_POST['url']);
            
$data['target']            = trim($_POST['target']);
            
$data['channel']        = trim($_POST['channel']);
            
$data['start']            = intval($_POST['start']);
            
$data['pause']            = intval($_POST['pause']);
            
$data['delay']            = intval($_POST['delay']);
            
$data['active']         = intval($_POST['active']);

            if ( 
strlen($data['title'])<)
                
$errors[] = "Overlay title cannot be blank";
            elseif ( 
strlen($data['media'])<)
                
$errors[] = "Overlay source URL cannot be blank";
            elseif (
$data['start']<1)
                
$errors[] = "Start time must be greater than 0";


            
            if ( !
$errors ) {

                
$sql "INSERT INTO nuevo__overlay SET title = '".mysql_real_escape_string($data['title'])."', owner = '".mysql_real_escape_string($data['owner'])."', email = '".mysql_real_escape_string($data['email'])."', media ='".mysql_real_escape_string($data['media'])."', url ='".mysql_real_escape_string($data['url'])."', target ='".mysql_real_escape_string($data['target'])."', channel ='".mysql_real_escape_string($data['channel'])."', start ='".mysql_real_escape_string($data['start'])."', pause ='".mysql_real_escape_string($data['pause'])."', delay ='".mysql_real_escape_string($data['delay'])."', addtime = '".time()."', active ='".mysql_real_escape_string($data['active'])."'";
            
                
$this->db->query($sql);
                if(
$this->db->affected_rows()) {
                    
header("Location: ".ADMIN_URL.'/index.php?q=nuevo/overlay');
                    die();
                } else {
                    
$errors[] = 'Error while saving data in database.';
                }
            }
                        
        }

        
$sql                "SELECT cat_id, parent_id, name, slug, total_videos, status
                               FROM #__video_categories
                               ORDER BY slug, parent_id ASC"
;
        
$categories            $this->db->get_rows($sql);
        
        
        
        
$tpl = &VF::factory('template');
        
$tpl->menu            'nuevo';
        
        
$tpl->submenu        'nuevo_ads';
        
$tpl->meta_title    'Admin::Nuevo::Create Overlay ad';
        
$tpl->errors        $errors;
        
$tpl->messages        $messages;
        
$tpl->ad            $data;
        
$tpl->categories    $categories;
        
$tpl->pmenu            'overlay';

        
$tpl->load(array('header''nuevo_overlaynew''footer'));
        
$tpl->display();
    }
    
}
?>
Онлайн: 1
Реклама