Exemple #1
0
 /**
  * __construct()
  *
  * @access public
  * @param {class} $os The os.
  */
 public function __construct(os $os)
 {
     if (!$os->session_exists()) {
         die('Session does not exist!');
     }
     $this->os = $os;
 }
Exemple #2
0
 /**
  * __construct()
  *
  * @access public
  * @param {class} $os The os.
  */
 public function __construct(os $os)
 {
     if (!$os->session_exists()) {
         die('Session does not exist!');
     }
     $this->document_root = $os->get_document_root();
     $this->library_dir = $os->get_library_dir();
     $this->os = $os;
 }
Exemple #3
0
 /**
  * __construct()
  *
  * @access public
  * @param {class} $os The os.
  */
 public function __construct(os $os)
 {
     if (!$os->session_exists()) {
         die('Session does not exist!');
     }
     $this->member_id = $os->get_member_id();
     $this->group_id = $os->get_group_id();
     if (!isset($this->member_id, $this->group_id)) {
         die('Member/Group not found!');
     }
     $this->os = $os;
     $this->member_info = $this->get_member_info();
     $this->preferences = $this->get_preferences();
 }
Exemple #4
0
<?php

require_once '../../../../server/os.php';
$os = new os();
if (!$os->session_exists()) {
    die('No existe sesión!');
}
function selectCanal()
{
    global $os;
    $os->db->conn->query("SET NAMES 'utf8'");
    $sql = "SELECT * FROM xmltv_canal ORDER BY id";
    $result = $os->db->conn->query($sql);
    $data = array();
    while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
        $data[] = $row;
    }
    echo json_encode(array("success" => true, "data" => $data));
}
function insertCanal()
{
    global $os;
    $os->db->conn->query("SET NAMES 'utf8'");
    $data = json_decode(stripslashes($_POST["data"]));
    $sql = "INSERT INTO xmltv_canal(nombre , descripcion , icono)\n\tvalues('{$data->nombre}', '{$data->descripcion}', '{$data->icono}');";
    $sql = $os->db->conn->prepare($sql);
    $sql->execute();
    echo json_encode(array("success" => $sql->errorCode() == 0, "msg" => $sql->errorCode() == 0 ? "insertado exitosamente" : $sql->errorCode(), "data" => array(array("id" => $os->db->conn->lastInsertId(), "nombre" => $data->nombre, "descripcion" => $data->descripcion, "icono" => $data->icono))));
}
function updateCanal()
{