Exemplo n.º 1
0
 function isPermited(Host &$host, VM &$vm)
 {
     if (is_null($this->matrix)) {
         throw new Exception("TestingWithoutMatrix", 1);
     }
     return isset($this->matrix[$host->getId()][$vm->getId()]) ? $this->matrix[$host->getId()][$vm->getId()] : false;
 }
Exemplo n.º 2
0
 public function __construct($url = null)
 {
     if ($url) {
         $parts = parse_url($url);
         if (isset($parts["scheme"])) {
             $this->setScheme(new Scheme($parts["scheme"]));
         } else {
             if (substr($url, 0, 2) === '//') {
                 $this->makeSchemeless();
             }
         }
         if (isset($parts["user"]) || isset($parts["pass"])) {
             $this->setAuthInfo(new AuthInfo($parts["user"], $parts["pass"]));
         }
         if (isset($parts["host"])) {
             $this->setHost(new Host($parts["host"]));
             if (isset($parts["port"])) {
                 $this->host->setPort($parts["port"]);
             }
         }
         if (isset($parts["path"])) {
             $this->setPath(new Path($parts["path"]));
         }
         if (isset($parts["query"])) {
             $this->setQuery(new Query($parts["query"]));
         }
         if (isset($parts["fragment"])) {
             $this->setFragment(new Fragment($parts["fragment"]));
         }
     }
 }
Exemplo n.º 3
0
 protected function obtener_ofertas()
 {
     $this->usuario = $_SESSION['id'];
     $this->sucursal = $_SESSION['sucursal'];
     $this->empresa = $_SESSION['empresa'];
     $this->propias = $_POST['propias'];
     $this->filtro = mysqli_real_escape_string($this->sql_con, $_POST['filtro']);
     if ($this->propias == 'true') {
         $hosteo = new Host();
         $hosteo->obtener_conexion(0);
         $this->set_conexion($hosteo->datos_conexion['host'], $hosteo->datos_conexion['user'], $hosteo->datos_conexion['pass'], $hosteo->datos_conexion['bd']);
     }
     $this->obtener_filtro();
     $result_ofertas = $this->sql_con->query($this->query);
     if ($result_ofertas === false) {
         trigger_error("Ha ocurrido un error");
     } else {
         while ($row_ofertas = $result_ofertas->fetch_assoc()) {
             $dato = array();
             foreach ($row_ofertas as $indice => $valor) {
                 $dato[$indice] = $valor;
             }
             array_push($this->datos, $dato);
         }
     }
 }
Exemplo n.º 4
0
 public function __construct($accion)
 {
     session_start();
     require '../hosts.php';
     require 'conexion_new.php';
     date_default_timezone_set('America/Buenos_Aires');
     $this->tipo_cuenta = $_SESSION['tipo_cuenta'];
     $this->usuario = $_SESSION['id'];
     $hosteo = new Host();
     $hosteo->obtener_conexion(0);
     $this->set_conexion($hosteo->datos_conexion['host'], $hosteo->datos_conexion['user'], $hosteo->datos_conexion['pass'], $hosteo->datos_conexion['bd']);
     for ($i = 0; $i < count($accion); $i++) {
         switch ($accion[$i]) {
             case 'ventas_tiempo_real':
                 $this->obtener_ventas_tiempo_real();
                 break;
             case 'ventas_minuto':
                 $this->obtener_ventas_minuto();
                 break;
             case 'ventas_hora':
                 $this->ventas_hora();
                 break;
             case 'ventas_dia':
                 $this->ventas_dia();
                 break;
             case 'ventas_mes':
                 $this->ventas_mes();
                 break;
             case 'ranking_semanal':
                 $this->ranking_semanal();
                 break;
             case 'comparativo_mes':
                 $this->comparativo_mes();
                 break;
             case 'ranking_vendedores':
                 $this->ranking_vendedores();
                 break;
             case 'fluctuacion_mes':
                 $this->fluctuacion_mes();
                 break;
             case 'promedio_compra':
                 $this->promedio_compra();
                 break;
             case 'total_ventas_dia':
                 $this->total_ventas_dia();
                 break;
             case 'total_ventas_mes':
                 $this->total_ventas_mes();
                 break;
             case 'total_productos_dia':
                 $this->total_productos_dia();
                 break;
             case 'total_productos_mes':
                 $this->total_productos_mes();
                 break;
         }
     }
 }
 public function search_post()
 {
     unset($this->headerData[0], $this->headerData[5], $this->attributes[0], $this->attributes[5], $this->templates[0], $this->templates[5]);
     foreach ((array) $this->getClass('TaskManager')->search() as $Task) {
         $Host = new Host($Task->get('hostID'));
         $this->data[] = array('task_id' => $Task->get('id'), 'task_name' => $Task->get('name'), 'host_name' => $Task->get('isForced') ? '* ' . $Host->get('name') : $Host->get('name'), 'task_type' => $Task->getTaskTypeText(), 'task_state' => $Task->getTaskStateText());
     }
     $this->render();
 }
Exemplo n.º 6
0
 public function __construct()
 {
     session_start();
     require_once '../hosts.php';
     require_once 'conexion_new.php';
     $hosteo = new Host();
     $hosteo->obtener_conexion(0);
     $this->set_conexion($hosteo->datos_conexion['host'], $hosteo->datos_conexion['user'], $hosteo->datos_conexion['pass'], $hosteo->datos_conexion['bd']);
 }
Exemplo n.º 7
0
 protected function conexion()
 {
     session_start();
     require '../hosts.php';
     require 'conexion_new.php';
     $hosteo = new Host();
     $hosteo->obtener_conexion(1);
     $this->set_conexion($hosteo->datos_conexion['host'], $hosteo->datos_conexion['user'], $hosteo->datos_conexion['pass'], $hosteo->datos_conexion['bd']);
 }
Exemplo n.º 8
0
 protected function set_host($host)
 {
     if ($host != $this->host_anterior) {
         $hosteo = new Host();
         $hosteo->obtener_conexion($host);
         $this->set_conexion($hosteo->datos_conexion['host'], $hosteo->datos_conexion['user'], $hosteo->datos_conexion['pass'], $hosteo->datos_conexion['bd']);
     }
     $this->host_anterior = $host;
 }
Exemplo n.º 9
0
 function save($id = FALSE)
 {
     if ($_POST) {
         $host = new Host($id);
         $host->from_array($_POST);
         $host->save();
         set_notify('success', lang('save_data_complete'));
     }
     redirect('hosts');
 }
Exemplo n.º 10
0
 /**
  * 
  * @param \webignition\Url\Host\Host $comparator
  * @param array $excludeParts
  * @return boolean
  */
 public function isEquivalentTo(Host $comparator, $excludeParts = array())
 {
     $thisHost = new Host(idn_to_ascii((string) $this));
     $comparatorHost = new Host(idn_to_ascii((string) $comparator));
     if (!is_array($excludeParts) || count($excludeParts) == 0) {
         return $thisHost->equals($comparatorHost);
     }
     $thisParts = $this->excludeParts($thisHost->getParts(), $excludeParts);
     $comparatorParts = $this->excludeParts($comparatorHost->getParts(), $excludeParts);
     return $thisParts == $comparatorParts;
 }
Exemplo n.º 11
0
 public function __construct($cat_desc)
 {
     $this->categoria = $cat_desc;
     session_start();
     require '../hosts.php';
     require 'conexion_new.php';
     $hosteo = new Host();
     $hosteo->obtener_conexion(0);
     $this->set_conexion($hosteo->datos_conexion['host'], $hosteo->datos_conexion['user'], $hosteo->datos_conexion['pass'], $hosteo->datos_conexion['bd']);
     $this->obtener_ofertas();
 }
Exemplo n.º 12
0
 public function __construct()
 {
     session_start();
     require '../hosts.php';
     require 'conexion_new.php';
     ini_set('display_errors', 'on');
     $hosteo = new Host();
     $hosteo->obtener_conexion(0);
     $this->set_conexion($hosteo->datos_conexion['host'], $hosteo->datos_conexion['user'], $hosteo->datos_conexion['pass'], $hosteo->datos_conexion['bd']);
     $this->procesar();
 }
Exemplo n.º 13
0
 public function __construct()
 {
     session_start();
     require '../../hosts.php';
     require 'conexion_new.php';
     $hosteo = new Host();
     $hosteo->obtener_conexion(7);
     $this->set_conexion($hosteo->datos_conexion['host'], $hosteo->datos_conexion['user'], $hosteo->datos_conexion['pass'], $hosteo->datos_conexion['bd']);
     $this->obtener_parametros();
     // $this->verificar_cliente();
 }
Exemplo n.º 14
0
 public function __construct()
 {
     session_start();
     ini_set('display_errors', 'off');
     require '../hosts.php';
     require '../classes/conexion_new.php';
     $hosteo = new Host();
     $hosteo->obtener_conexion(7);
     $this->set_conexion($hosteo->datos_conexion['host'], $hosteo->datos_conexion['user'], $hosteo->datos_conexion['pass'], $hosteo->datos_conexion['bd']);
     $this->traer_fichas();
 }
Exemplo n.º 15
0
 public function __construct()
 {
     session_start();
     $this->sucursal = $_SESSION["sucursal"];
     require '../hosts.php';
     require 'conexion_new.php';
     $hosteo = new Host();
     $hosteo->obtener_conexion(0);
     $this->set_conexion($hosteo->datos_conexion['host'], $hosteo->datos_conexion['user'], $hosteo->datos_conexion['pass'], $hosteo->datos_conexion['bd']);
     $this->obtener_planes();
 }
Exemplo n.º 16
0
 public function __construct()
 {
     $this->id = $_POST['cId'];
     session_start();
     require '../hosts.php';
     require 'conexion_new.php';
     $hosteo = new Host();
     $hosteo->obtener_conexion(0);
     $this->set_conexion($hosteo->datos_conexion['host'], $hosteo->datos_conexion['user'], $hosteo->datos_conexion['pass'], $hosteo->datos_conexion['bd']);
     $this->obtener_marcas();
 }
Exemplo n.º 17
0
 /**
  * get the output
  *
  * @since 2.4.0
  *
  * @return string
  */
 public function getOutput()
 {
     $protocol = new Protocol($this->_request);
     $host = new Host($this->_request);
     $directory = new Directory($this->_request);
     /* collect output */
     $output = $protocol->getOutput() . '://' . $host->getOutput();
     if ($directory->getOutput() !== '/' && $directory->getOutput() !== '\\') {
         $output .= $directory->getOutput();
     }
     return $output;
 }
 public function __construct($cat_desc)
 {
     session_start();
     $this->categoria = $cat_desc;
     require '../hosts.php';
     require 'conexion_new.php';
     $hosteo = new Host();
     $hosteo->obtener_conexion(0);
     $this->set_conexion($hosteo->datos_conexion['host'], $hosteo->datos_conexion['user'], $hosteo->datos_conexion['pass'], $hosteo->datos_conexion['bd']);
     $this->sql_con = new mysqli($this->link['host'], $this->link['user'], $this->link['pass'], $this->link['bd']);
     $this->obtener_productos();
 }
Exemplo n.º 19
0
 public function __construct()
 {
     session_start();
     //ini_set('display_errors', 'on');
     require '../hosts.php';
     require 'conexion_new.php';
     $this->tipo_cuenta = $_SESSION['tipo_cuenta'];
     $this->usuario = $_SESSION['id'];
     $hosteo = new Host();
     $hosteo->obtener_conexion(0);
     $this->set_conexion($hosteo->datos_conexion['host'], $hosteo->datos_conexion['user'], $hosteo->datos_conexion['pass'], $hosteo->datos_conexion['bd']);
     $this->obtener_parametros();
 }
Exemplo n.º 20
0
 protected function conexion()
 {
     session_start();
     require '../hosts.php';
     require 'conexion_new.php';
     $hosteo = new Host();
     $hosteo->obtener_conexion(0);
     $this->set_conexion($hosteo->datos_conexion['host'], $hosteo->datos_conexion['user'], $hosteo->datos_conexion['pass'], $hosteo->datos_conexion['bd']);
     $hosteo = new Host();
     $hosteo->obtener_conexion(1);
     $this->sql_con_admin = new mysqli($hosteo->datos_conexion['host'], $hosteo->datos_conexion['user'], $hosteo->datos_conexion['pass'], $hosteo->datos_conexion['bd']);
     $this->sql_con_admin->set_charset('utf8');
 }
Exemplo n.º 21
0
 public function __construct()
 {
     session_start();
     require 'conexion_new.php';
     require '../hosts.php';
     $hosteo = new Host();
     $hosteo->obtener_conexion(0);
     $this->set_conexion($hosteo->datos_conexion['host'], $hosteo->datos_conexion['user'], $hosteo->datos_conexion['pass'], $hosteo->datos_conexion['bd']);
     $this->obtener_parametros();
     $this->obtener_productos();
     if (count($this->extras) > 0) {
         $this->push_extras();
     }
 }
Exemplo n.º 22
0
 /**
  * 录入
  *
  */
 public function actionCreate()
 {
     parent::_acl();
     $model = new Host();
     if (isset($_POST['Host'])) {
         $acl = $this->_gets->getPost('acl');
         $model->attributes = $_POST['Host'];
         if ($model->save()) {
             AdminLogger::_create(array('catalog' => 'create', 'intro' => '录入内容,ID:' . $model->id));
             $this->redirect(array('index'));
         }
     }
     $this->render('host_create', array('model' => $model));
 }
Exemplo n.º 23
0
 public function __construct($cat_desc, $codigo)
 {
     session_start();
     $this->categoria = $cat_desc;
     $this->codigo = $codigo;
     require '../hosts.php';
     require 'conexion_new.php';
     $hosteo = new Host();
     $hosteo->obtener_conexion(0);
     $this->set_conexion($hosteo->datos_conexion['host'], $hosteo->datos_conexion['user'], $hosteo->datos_conexion['pass'], $hosteo->datos_conexion['bd']);
     $this->sql_con = new mysqli($this->link['host'], $this->link['user'], $this->link['pass'], $this->link['bd']);
     $this->tipo_cuenta = $_SESSION['tipo_cuenta'];
     $this->sucursal = $_SESSION['sucursal'];
     $this->obtener_detalle();
 }
Exemplo n.º 24
0
 public function __construct()
 {
     session_start();
     header("Content-Type:   application/vnd.ms-excel; charset=utf-8");
     header("Content-Disposition: attachment; filename=cierre_caja.xls");
     //File name extension was wrong
     header("Expires: 0");
     header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
     header("Cache-Control: private", false);
     require '../hosts.php';
     require 'conexion_new.php';
     $hosteo = new Host();
     $hosteo->obtener_conexion(0);
     $this->set_conexion($hosteo->datos_conexion['host'], $hosteo->datos_conexion['user'], $hosteo->datos_conexion['pass'], $hosteo->datos_conexion['bd']);
     $this->procesar();
 }
 public function current()
 {
     $count = Host::where("id", "!=", 0)->get()->count();
     $backups = Backup::where(DB::raw('YEAR(created_at)'), '=', "2013")->where(DB::raw('MONTH(created_at)'), '=', "01")->where(DB::raw('DAY(created_at)'), '=', "21")->where('type', '=', 'cron')->get(array('id', 'host_id', 'hostname', 'status', 'files_original_size', 'db_original_size', 'total_size'));
     $report = "";
     foreach ($backups as $backup) {
         $backup["files_original_size"] = $this->ghs($backup["files_original_size"]);
         $backup["db_original_size"] = $this->ghs($backup["db_original_size"]);
         $backup["total_size"] = $this->ghs($backup["total_size"]);
         if ($backup["status"] == "ok") {
             $row = '<tr class="success">';
         }
         if ($backup["status"] == "broken") {
             $row = '<tr class="danger">';
         }
         if ($backup["status"] == "removed") {
             $row = '<tr class="warning">';
         }
         $row .= "<td>" . $backup["id"] . "</td>";
         $row .= "<td>" . $backup["host_id"] . "</td>";
         $row .= "<td>" . $backup["hostname"] . "</td>";
         $row .= "<td>" . $backup["files_original_size"] . "</td>";
         $row .= "<td>" . $backup["db_original_size"] . "</td>";
         $row .= "<td>" . $backup["total_size"] . "</td>";
         $row .= "</tr>";
         $report .= $row;
     }
     return View::make('reports.daily')->with('report', $report)->with('hosts_count', $count)->with('email', Auth::user()->email);
 }
Exemplo n.º 26
0
 public function __construct()
 {
     session_start();
     require '../hosts.php';
     require 'conexion_new.php';
     $hosteo = new Host();
     $hosteo->obtener_conexion(1);
     $this->set_conexion($hosteo->datos_conexion['host'], $hosteo->datos_conexion['user'], $hosteo->datos_conexion['pass'], $hosteo->datos_conexion['bd']);
     $this->obtener_parametros();
     $this->obtener_comprador();
     $host = $this->obtener_origen_datos();
     $hosteo = new Host();
     $hosteo->obtener_conexion($host);
     $this->set_conexion($hosteo->datos_conexion['host'], $hosteo->datos_conexion['user'], $hosteo->datos_conexion['pass'], $hosteo->datos_conexion['bd']);
     $this->obtener_productos_orden();
 }
Exemplo n.º 27
0
 public function __construct()
 {
     session_start();
     require '../hosts.php';
     require 'conexion_new.php';
     ini_set('display_errors', 'on');
     $hosteo = new Host();
     $hosteo->obtener_conexion(0);
     $this->set_conexion($hosteo->datos_conexion['host'], $hosteo->datos_conexion['user'], $hosteo->datos_conexion['pass'], $hosteo->datos_conexion['bd']);
     $this->id = mysqli_real_escape_string($this->sql_con, $_POST['cId']);
     if ($this->id != 'all') {
         $this->obtener_marcas();
     } else {
         $this->obtener_todas();
     }
 }
Exemplo n.º 28
0
 public function fire()
 {
     $hosts = Host::where('state', '!=', 'disabled')->where('cron', '=', 'yes')->get(array('id'));
     foreach ($hosts as $host) {
         Queue::push('BackupController@dailyBackup', array('id' => $host->id));
     }
 }
Exemplo n.º 29
0
 function invia_commento()
 {
     try {
         $nome = Params::get("nome");
         $subject = Params::get("subject");
         $email = Params::get("email");
         $testo = Params::get("testo");
         //$codice_hidden = Params::get("codice_hidden");
         //$codice = Params::get("codice");
         //if ($codice_hidden!=$codice)
         //    throw new InvalidParameterException("Il codice non e' impostato correttamente!!");
         if ($nome != null && $subject != null && $email != null && $testo != null && isset(Config::instance()->EMAIL_COMMENT_RECEIVED)) {
             $e = new EMail("no_reply@" . Host::current_no_www(), Config::instance()->EMAIL_COMMENT_RECEIVED, "[Nuova commento da : " . $nome . "] - " . Host::current(), EMail::HTML_FORMAT);
             $e->render_and_send("include/messages/mail/alert/" . Lang::current() . "/nuovo_commento.php.inc", array("nome" => $nome, "email" => $email, "subject" => $subject, "testo" => $testo));
             return Redirect::success();
         } else {
             if (!isset(Config::instance()->EMAIL_COMMENT_RECEIVED)) {
                 throw new InvalidDataException("Il parametri di configurazione EMAIL_COMMENT_RECEIVED non e' impostato correttamente!!");
             } else {
                 throw new InvalidDataException("I dati immessi nella form non sono validi!!");
             }
         }
     } catch (Exception $ex) {
         Flash::error($ex->getMessage());
         return Redirect::failure();
     }
 }
 /**
  * @see	Form::save()
  */
 public function save()
 {
     ACPForm::save();
     // read form data
     $this->host->title = $this->title;
     $this->host->hostname = $this->hostname;
     $this->host->isFallback = $this->isFallback;
     $this->host->languageCode = $this->languageCode;
     // save
     $this->host->update();
     // show success message
     WCF::getTPL()->assign('success', true);
     // remove cache
     HostEditor::clearCache();
     // call event
     $this->saved();
 }