Вход Регистрация
Файл: adultscript-2.0.3-pro/files/admin/modules/nuevo/components/ads.php
Строк: 69
<?php
defined
('_VALID') or die('Restricted Access!');
class 
VComponent_Admin_nuevo_ads
{
    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();
        
        
$this->db->query("SELECT * FROM nuevo__player WHERE ID = '1' LIMIT 1");
        
$player$this->db->fetch_assoc();
        
$this->db->query("SELECT * FROM nuevo__player WHERE ID = '2' LIMIT 1");
        
$player2$this->db->fetch_assoc();

        if (isset(
$_POST['submit_player_settings'])) {
            
            
$player['plugin_preroll'] = trim($_POST['plugin_preroll']);
            
$player['plugin_midroll'] = trim($_POST['plugin_midroll']);
            
$player['plugin_overlay'] = trim($_POST['plugin_overlay']);
            
$player['plugin_ticker'] = trim($_POST['plugin_ticker']);
            
            
$player2['plugin_preroll'] = trim($_POST['plugin_preroll2']);
            
$player2['plugin_midroll'] = trim($_POST['plugin_midroll2']);
            
$player2['plugin_overlay'] = trim($_POST['plugin_overlay2']);
            
$player2['plugin_ticker'] = trim($_POST['plugin_ticker2']);

            
            if (!
$errors) {
                    
$sql="UPDATE nuevo__player set 
                    plugin_preroll='"
.mysql_real_escape_string($player['plugin_preroll'])."',
                    plugin_midroll='"
.mysql_real_escape_string($player['plugin_midroll'])."',
                    plugin_overlay='"
.mysql_real_escape_string($player['plugin_overlay'])."',
                    plugin_ticker='"
.mysql_real_escape_string($player['plugin_ticker'])."' WHERE ID = 1";
                    
                    
$this->db->query($sql);

                    
$sql="UPDATE nuevo__player set 
                    plugin_preroll='"
.mysql_real_escape_string($player2['plugin_preroll'])."',
                    plugin_midroll='"
.mysql_real_escape_string($player2['plugin_midroll'])."',
                    plugin_overlay='"
.mysql_real_escape_string($player2['plugin_overlay'])."',
                    plugin_ticker='"
.mysql_real_escape_string($player2['plugin_ticker'])."' WHERE ID = 2";

                    
$this->db->query($sql);

                if(
$this->db->affected_rows()) {
                    
$messages[] = 'Nuevoplayer settings updated succesfully!';
                } else {
                    
$errors[] = 'Error while saving data in database.';
                }
            }
                        
        }
        
        
        
$tpl = &VF::factory('template');
        
$tpl->menu            'nuevo';
        
        
$tpl->submenu        'nuevo_ads';
        
$tpl->meta_title    'Admin::Nuevo::Ads';
        
$tpl->errors        $errors;
        
$tpl->messages        $messages;
        
$tpl->player        $player;
        
$tpl->player2        $player2;
        
$tpl->pmenu            'ads';


        
$tpl->load(array('header''nuevo_ads''footer'));
        
$tpl->display();
    }
    
}

?>
Онлайн: 1
Реклама