Вход Регистрация
Файл: adultscript-2.0.3-pro/files/admin/modules/video/components/server.php
Строк: 31
<?php
defined
('_VALID') or die('Restricted Access!');
class 
VComponent_Admin_video_server
{
    private 
$db;
    public function 
__construct()
    {
        
$this->db VF::factory('database');
    }
    
    public function 
render()
    {
        
$smodel        VModel::load('server''video'true);
        
$errors        = array();
        
$messages    = array();
        
        if (isset(
$_POST['action'])) {
            
$action        trim($_POST['action']);
            
$server_id    = (isset($_POST['server_id'])) ? (int) trim($_POST['server_id']) : 0;
            if (
$server_id) {
                if (
$action == 'suspend' OR $action == 'activate') {
                    
$status        = ($action == 'activate') ? 0;
                    
$message    = ($action == 'activate') ? 'activated' 'suspended';
                    
                    
$smodel->update($server_id, array('status' => (string) $status));
                    
$messages[]    = 'Server '.$message.'!';
                } elseif (
$action == 'delete') {
                    
$smodel->del($server_id);
                    
$messages[]    = 'Server deleted!';
                } else {
                    
$errors[]    = 'Invalid action!';
                }
            } else {
                
$errors[]    = 'Invalid server id or not set!';
            }
        }
        
        
$servers    $smodel->servers();
        
        
$tpl VF::factory('template');
        
$tpl->menu            'video';
        
$tpl->submenu        'video_server';
        
$tpl->meta_title    'Admin::Video::Server::Manage';
        
$tpl->errors        $errors;
        
$tpl->messages        $messages;
        
$tpl->servers        $servers;
        
$tpl->load(array('header''video_server''footer'));
        
$tpl->display();
    }
}
Онлайн: 1
Реклама