Example #1
0
 public function __construct()
 {
     $this->componente = new \models\admin\componente();
     $this->model = new \models\admin\producto_imagen();
     $this->clase = "producto_imagen";
     $this->archivoNombre = "producto_imagen.php";
     $this->archivo["raiz"]["componente_archivo"] = $this->archivoNombre;
     $this->archivo["raiz"]["componente_enlace"] = ADMIN . "producto_imagen";
     $this->archivo["raiz"]["componente_url"] = DIR . ADMIN . "producto/imagenes";
     $this->archivo["raiz"]["componente_nombre"] = "Imagenes del producto";
     $this->archivo["raiz"]["componente_slug"] = url::generateSafeSlug($this->archivo["raiz"]["componente_nombre"]);
     $this->archivo["imagenes_producto"]["componente_archivo"] = $this->archivoNombre;
     $this->archivo["imagenes_producto"]["componente_enlace"] = ADMIN . "producto/imagenes/imagenes_producto";
     $this->archivo["imagenes_producto"]["componente_url"] = DIR . ADMIN . "producto/imagenes/imagenes_producto";
     $this->archivo["imagenes_producto"]["componente_nombre"] = "Lista de Imagenes del producto";
     $this->archivo["imagenes_producto"]["componente_slug"] = url::generateSafeSlug($this->archivo["imagenes_producto"]["componente_nombre"]);
     $this->archivo["nuevo"]["componente_archivo"] = $this->archivoNombre;
     $this->archivo["nuevo"]["componente_enlace"] = ADMIN . "producto/imagenes/agregar_imagen";
     $this->archivo["nuevo"]["componente_url"] = DIR . ADMIN . "producto/imagenes/agregar_imagen";
     $this->archivo["nuevo"]["componente_nombre"] = "Agregar imagen del producto";
     $this->archivo["nuevo"]["componente_slug"] = url::generateSafeSlug($this->archivo["nuevo"]["componente_nombre"]);
     $this->archivo["borrar"]["componente_archivo"] = $this->archivoNombre;
     $this->archivo["borrar"]["componente_enlace"] = ADMIN . "producto/imagenes/borrar_imagen";
     $this->archivo["borrar"]["componente_url"] = DIR . ADMIN . "producto/imagenes/borrar";
     $this->archivo["borrar"]["componente_nombre"] = "Borrar imagen del producto";
     $this->archivo["borrar"]["componente_slug"] = url::generateSafeSlug($this->archivo["borrar"]["componente_nombre"]);
     $this->archivo["publicar"]["componente_archivo"] = $this->archivoNombre;
     $this->archivo["publicar"]["componente_enlace"] = ADMIN . "producto/imagenes/publicar_imagen";
     $this->archivo["publicar"]["componente_url"] = DIR . ADMIN . "producto/imagenes/publicar_imagen";
     $this->archivo["publicar"]["componente_nombre"] = "publicar imagen del producto";
     foreach ($this->archivo as $componente) {
         $this->componente->createComponente($componente["componente_nombre"], $componente["componente_enlace"], $componente["componente_url"], $componente);
     }
     $this->componente->controlAcceso();
 }
Example #2
0
 public function __construct()
 {
     //initialise the views object
     $this->view = new View();
     //initialise the language object
     $this->language = new Language();
     //form search
     if (!is_null(filter_input(INPUT_POST, 'submit_form')) || !is_null(filter_input(INPUT_POST, 'projectSubmit')) || !is_null(filter_input(INPUT_POST, 'sortSubmit'))) {
         $type = trim(filter_input(INPUT_POST, 'type'));
         $_SESSION[$type] = array();
         $_SESSION[$type]["location"] = trim(filter_input(INPUT_POST, "location_" . $type));
         $_SESSION[$type]["rooms"] = trim(filter_input(INPUT_POST, 'rooms'));
         $_SESSION[$type]["sleeps"] = trim(filter_input(INPUT_POST, 'sleeps'));
         $_SESSION[$type]["has_internet"] = trim(filter_input(INPUT_POST, 'has_internet'));
         $_SESSION[$type]["has_longstay"] = trim(filter_input(INPUT_POST, 'has_longstay'));
         $_SESSION[$type]["has_safe"] = trim(filter_input(INPUT_POST, 'has_safe'));
         $_SESSION[$type]["has_smoking"] = trim(filter_input(INPUT_POST, 'has_smoking'));
         $_SESSION[$type]["has_animals"] = trim(filter_input(INPUT_POST, 'has_animals'));
         $_SESSION[$type]["has_bbq"] = trim(filter_input(INPUT_POST, 'has_bbq'));
         $_SESSION[$type]["has_pool"] = trim(filter_input(INPUT_POST, 'has_pool'));
         $_SESSION[$type]["project_id"] = trim(filter_input(INPUT_POST, 'project_id'));
         $_SESSION[$type]["order"] = trim(filter_input(INPUT_POST, 'order'));
         $_SESSION["type"] = $type;
         if ($_SESSION["type"] == "rentals") {
             Url::redirect($_SESSION['site_lang'] . '/location.php');
         } elseif ($_SESSION["type"] == "sales") {
             Url::redirect($_SESSION['site_lang'] . '/vente.php');
         } else {
             Url::redirect($_SESSION['site_lang']);
         }
     }
 }
Example #3
0
 public function __construct()
 {
     $this->_componente = new \models\admin\componente();
     $this->_model = new \models\admin\grupo();
     $this->clase_grupo = "permisos";
     $this->_archivoNombre = "permisos.php";
     $this->_archivo["raiz"]["componente_archivo"] = $this->_archivoNombre;
     $this->_archivo["raiz"]["componente_enlace"] = ADMIN . $this->clase_grupo;
     $this->_archivo["raiz"]["componente_url"] = DIR . "admin/permisos";
     $this->_archivo["raiz"]["componente_nombre"] = "Gestor de Permisos";
     $this->_archivo["raiz"]["componente_slug"] = url::generateSafeSlug($this->_archivo["raiz"]["componente_nombre"]);
     $this->_archivo["crear"]["componente_archivo"] = $this->_archivoNombre;
     $this->_archivo["crear"]["componente_enlace"] = ADMIN . "permisos_crear";
     $this->_archivo["crear"]["componente_url"] = DIR . "admin/permisos/add";
     $this->_archivo["crear"]["componente_nombre"] = "Agregar Permisos";
     $this->_archivo["crear"]["componente_slug"] = url::generateSafeSlug($this->_archivo["crear"]["componente_nombre"]);
     $this->_archivo["editar"]["componente_archivo"] = $this->_archivoNombre;
     $this->_archivo["editar"]["componente_enlace"] = ADMIN . "permisos_editar";
     $this->_archivo["editar"]["componente_url"] = DIR . "admin/permisos/edit/";
     $this->_archivo["editar"]["componente_nombre"] = "Modificar Permisos";
     $this->_archivo["editar"]["componente_slug"] = url::generateSafeSlug($this->_archivo["editar"]["componente_nombre"]);
     $this->_archivo["borrar"]["componente_archivo"] = $this->_archivoNombre;
     $this->_archivo["borrar"]["componente_enlace"] = ADMIN . $this->clase_grupo . "/delete";
     $this->_archivo["borrar"]["componente_url"] = DIR . "admin/permisos/delete/";
     $this->_archivo["borrar"]["componente_nombre"] = "Eliminar Permisos";
     $this->_archivo["borrar"]["componente_slug"] = url::generateSafeSlug($this->_archivo["borrar"]["componente_nombre"]);
     $this->_componente->controlAcceso();
 }
Example #4
0
 public function __construct()
 {
     parent::__construct();
     //file lang
     $this->language->load('gestion');
     //instance db object
     $this->_model_t = new \models\testimonials();
     $this->_model_f = new \models\form_search();
     // Language
     if (isset($_SESSION['site_lang'])) {
         if (!is_null(filter_input(INPUT_POST, 'languageEN')) && filter_input(INPUT_POST, 'languageEN') == 1) {
             $_SESSION['site_lang'] = 'en';
             if (filter_input(INPUT_POST, 'lang_var') == "index") {
                 Url::redirect($_SESSION['site_lang'] . "/gestion.php");
             }
         } else {
             if (!is_null(filter_input(INPUT_POST, 'languageFR')) && filter_input(INPUT_POST, 'languageFR') == 2) {
                 $_SESSION['site_lang'] = 'fr';
                 if (filter_input(INPUT_POST, 'lang_var') == "index") {
                     Url::redirect($_SESSION['site_lang'] . "/gestion.php");
                 }
             } else {
                 if (!is_null(filter_input(INPUT_POST, 'languageES')) && filter_input(INPUT_POST, 'languageES') == 3) {
                     $_SESSION['site_lang'] = 'es';
                     if (filter_input(INPUT_POST, 'lang_var') == "index") {
                         Url::redirect($_SESSION['site_lang'] . "/gestion.php");
                     }
                 }
             }
         }
     } else {
         $_SESSION['site_lang'] = 'en';
         Url::redirect($_SESSION['site_lang'] . "/gestion.php");
     }
 }
Example #5
0
 public function logout()
 {
     session_unset();
     session_destroy();
     session_write_close();
     setcookie(session_name(), '', 0, '/');
     url::redirect('admin/login');
 }
Example #6
0
 public function __construct()
 {
     $this->componente = new \models\admin\componente();
     $this->model = new \models\admin\producto();
     $this->clase = "producto";
     $this->archivoNombre = "producto.php";
     $this->archivo["raiz"]["componente_archivo"] = $this->archivoNombre;
     $this->archivo["raiz"]["componente_enlace"] = ADMIN . "producto";
     $this->archivo["raiz"]["componente_url"] = DIR . ADMIN . "producto";
     $this->archivo["raiz"]["componente_nombre"] = "Administrador de Productos";
     $this->archivo["raiz"]["componente_slug"] = url::generateSafeSlug($this->archivo["raiz"]["componente_nombre"]);
     $this->archivo["elementos"]["componente_archivo"] = $this->archivoNombre;
     $this->archivo["elementos"]["componente_enlace"] = ADMIN . "elementos";
     $this->archivo["elementos"]["componente_url"] = DIR . ADMIN . "producto/elementos";
     $this->archivo["elementos"]["componente_nombre"] = "Lista de productos";
     $this->archivo["elementos"]["componente_slug"] = url::generateSafeSlug($this->archivo["elementos"]["componente_nombre"]);
     $this->archivo["nuevo"]["componente_archivo"] = $this->archivoNombre;
     $this->archivo["nuevo"]["componente_enlace"] = ADMIN . "elemento_nuevo";
     $this->archivo["nuevo"]["componente_url"] = DIR . ADMIN . "producto/elemento_nuevo";
     $this->archivo["nuevo"]["componente_nombre"] = "Agregar producto";
     $this->archivo["nuevo"]["componente_slug"] = url::generateSafeSlug($this->archivo["nuevo"]["componente_nombre"]);
     $this->archivo["editar"]["componente_archivo"] = $this->archivoNombre;
     $this->archivo["editar"]["componente_enlace"] = ADMIN . "elemento_editar";
     $this->archivo["editar"]["componente_url"] = DIR . ADMIN . "producto/elemento_editar";
     $this->archivo["editar"]["componente_nombre"] = "Editar producto";
     $this->archivo["editar"]["componente_slug"] = url::generateSafeSlug($this->archivo["editar"]["componente_nombre"]);
     $this->archivo["borrar"]["componente_archivo"] = $this->archivoNombre;
     $this->archivo["borrar"]["componente_enlace"] = ADMIN . "elemento_borrar";
     $this->archivo["borrar"]["componente_url"] = DIR . ADMIN . "producto/elemento_borrar";
     $this->archivo["borrar"]["componente_nombre"] = "Borrar producto";
     $this->archivo["borrar"]["componente_slug"] = url::generateSafeSlug($this->archivo["borrar"]["componente_nombre"]);
     $this->archivo["publicar"]["componente_archivo"] = $this->archivoNombre;
     $this->archivo["publicar"]["componente_enlace"] = ADMIN . "elemento_publicar";
     $this->archivo["publicar"]["componente_url"] = DIR . ADMIN . "producto/elemento_publicar";
     $this->archivo["publicar"]["componente_nombre"] = "Publicar producto";
     $this->archivo["publicar"]["componente_slug"] = url::generateSafeSlug($this->archivo["publicar"]["componente_nombre"]);
     $this->archivo["destacar"]["componente_archivo"] = $this->archivoNombre;
     $this->archivo["destacar"]["componente_enlace"] = ADMIN . "elemento_destacar";
     $this->archivo["destacar"]["componente_url"] = DIR . ADMIN . "producto/elemento_destacar";
     $this->archivo["destacar"]["componente_nombre"] = "Destacar producto";
     $this->archivo["destacar"]["componente_slug"] = url::generateSafeSlug($this->archivo["destacar"]["componente_nombre"]);
     $this->archivo["grupo"]["componente_archivo"] = $this->archivoNombre;
     $this->archivo["grupo"]["componente_enlace"] = ADMIN . "producto_grupo";
     $this->archivo["grupo"]["componente_url"] = DIR . ADMIN . "producto/producto_grupo";
     $this->archivo["grupo"]["componente_nombre"] = "Grupos de productos";
     $this->archivo["grupo"]["componente_slug"] = url::generateSafeSlug($this->archivo["grupo"]["componente_nombre"]);
     $this->archivo["categoria"]["componente_archivo"] = $this->archivoNombre;
     $this->archivo["categoria"]["componente_enlace"] = ADMIN . "producto_categoria";
     $this->archivo["categoria"]["componente_url"] = DIR . ADMIN . "producto/producto_categoria";
     $this->archivo["categoria"]["componente_nombre"] = "Categorias de producto";
     $this->archivo["categoria"]["componente_slug"] = url::generateSafeSlug($this->archivo["categoria"]["componente_nombre"]);
     foreach ($this->archivo as $componente) {
         $this->componente->createComponente($componente["componente_nombre"], $componente["componente_enlace"], $componente["componente_url"], $componente);
     }
     $this->componente->controlAcceso();
 }
Example #7
0
 public function __construct()
 {
     $this->_model = new \models\pick();
     $session = \helpers\session::id();
     if (!$this->_model->get_session($session)) {
         url::redirect('login');
     } else {
         $this->user_id = $this->_model->get_session($session);
     }
 }
Example #8
0
 public function __construct()
 {
     $this->_model = new \models\admin\archive();
     $session = \helpers\session::id();
     if (!$this->_model->get_session($session)) {
         url::redirect('admin/login');
     }
     $this->_acl = new \helpers\acl();
     $this->_rights = $this->_acl->is_allow();
     if (json_decode($this->_rights[0]->pages)->{'archive'}->acl_level == 0) {
         url::redirect('admin/login');
     }
 }
Example #9
0
 public function controlAccesoArchivo()
 {
     if (!session::get("autenticado")) {
         url::redirect(ARCHIVOLOGIN);
     }
     if (!$this->verificarAcceso(session::get("usuario"), "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'])) {
         $data["error"] = "NO TIENE PERMISO PARA ACCEDER A ESTA PAGINA";
         view::archivotemplate('header', $data);
         view::render('error/404', $data);
         view::archivotemplate('footer', $data);
         exit;
     }
 }
Example #10
0
 public function __construct()
 {
     $this->_componente = new \models\admin\componente();
     $this->_model = new \models\admin\auth();
     $this->clase = "admin";
     $this->_archivoNombre = "admin.php";
     $this->_archivo["raiz"]["componente_archivo"] = $this->_archivoNombre;
     $this->_archivo["raiz"]["componente_enlace"] = ADMIN . "admin";
     $this->_archivo["raiz"]["componente_url"] = DIR . ADMIN;
     $this->_archivo["raiz"]["componente_nombre"] = "Panel de Control del Sistema";
     $this->_archivo["raiz"]["componente_slug"] = url::generateSafeSlug($this->_archivo["raiz"]["componente_nombre"]);
     $this->_componente->controlAcceso();
 }
Example #11
0
 public function index()
 {
     //SEO
     $data['title'] = Language::show('title', 'contact', $_SESSION['site_lang']);
     $data['meta_description'] = Language::show('meta_description', 'contact', $_SESSION['site_lang']);
     $data['meta_keywords'] = '';
     $data['sitename_before'] = "Y";
     //title for de hover in navbar
     $data['title_page'] = "contact";
     //contacts
     $data['contacts'] = $this->_model->fetchContacts($_SESSION['site_lang']);
     // Envio de correo
     if (!is_null(filter_input(INPUT_POST, 'submit'))) {
         $name = filter_input(INPUT_POST, 'name');
         $email_contact = filter_input(INPUT_POST, 'email_contact');
         $email_client = filter_input(INPUT_POST, 'email_client');
         $phone = filter_input(INPUT_POST, 'phone');
         $comment = filter_input(INPUT_POST, 'message');
         if ($name == '' || !isset($name) || $email_client == '' || !isset($email_client) || $comment == '' || !isset($comment)) {
             $error = "";
             Url::redirect($_SESSION['site_lang'] . "/contact.php?error=1");
         }
         if (!$error) {
             $mail = new \helpers\phpmailer\mail();
             $mail->CharSet = 'UTF-8';
             $mail->setFrom($email_client);
             $mail->addAddress($email_contact);
             $mail->addAddress(EMAIL_PIERRE);
             $mail->addAddress(EMAIL_INFO);
             $subject = "Govacationmaya Contact";
             $subject .= date("Y-m-d");
             $mail->subject($subject);
             $message = "Language: " . $_SESSION['site_lang'] . "<br><br>";
             $message .= "Name: " . $name . "<br>";
             $message .= "Email: " . $email_client . "<br>";
             $message .= "Phone: " . $phone . "<br>";
             $message .= "Comment: " . $comment;
             $mail->body($message);
             if (!$mail->send()) {
                 Url::redirect($_SESSION['site_lang'] . "/contact.php?error=2");
             } else {
                 Url::redirect($_SESSION['site_lang'] . "/contact.php?send=1");
             }
         }
     }
     //tender views
     View::rendertemplate('header', $data);
     View::render('contact/contact', $data, $error);
     View::rendertemplate('footer', $data);
 }
Example #12
0
 /**
  * define page title and load template files
  */
 public function index()
 {
     $action = $_GET['action'];
     // var_dump($_GET['action']);
     $this->data['title'] = 'All Pages';
     $page = new \models\pages();
     $pagecategory = new \models\pagecategory();
     if (isset($_POST) && !empty($_POST)) {
         $pagename = $_POST['pagename'];
         $category = $_POST['category'];
         $sort_order = $_POST['sort_order'];
         $slug = \helpers\url::generateSafeSlug($pagename);
         $insert_array = array('pagename' => $pagename, 'categoryid' => $category, 'sort_order' => $sort_order, 'page_alias' => $slug);
         $insert_id = $page->create($insert_array);
         if ($insert_id > 0) {
             $message = 'ok';
         } else {
             $message = 'no';
         }
     }
     if (isset($action) && !empty($action)) {
         switch ($action) {
             case 'delete':
                 $where_array = array('id' => $_GET['id']);
                 $delete = $page->delete($where_array);
                 if ($delete > 0) {
                     $message = 'ok';
                 } else {
                     $message = 'no';
                 }
                 break;
             default:
                 # code...
                 break;
         }
     }
     if ($message == 'ok') {
         $this->data['success'] = 'Record Added!';
     } else {
         if ($message == 'no') {
             $this->data['error'] = 'Operation Fails!';
         }
     }
     $this->data['pages'] = $page->allPages();
     $this->data['page_categories'] = $pagecategory->all();
     View::rendertemplate('home_header', $this->data);
     View::rendertemplate('sidebar', $this->data);
     View::render('pages/pages.index', $this->data);
     View::rendertemplate('footer', $this->data);
 }
Example #13
0
 public function __construct()
 {
     $this->componente = new \models\admin\componente();
     $this->model = new \models\admin\producto();
     $this->clase = "producto";
     $this->archivoNombre = "producto.php";
     $this->archivo["raiz"]["componente_archivo"] = $this->archivoNombre;
     $this->archivo["raiz"]["componente_enlace"] = ADMIN . "producto";
     $this->archivo["raiz"]["componente_url"] = DIR . ADMIN . "producto";
     $this->archivo["raiz"]["componente_nombre"] = "Administrador de Productos";
     $this->archivo["raiz"]["componente_slug"] = url::generateSafeSlug($this->archivo["raiz"]["componente_nombre"]);
     foreach ($this->archivo as $componente) {
         $this->componente->createComponente($componente["componente_nombre"], $componente["componente_enlace"], $componente["componente_url"], $componente);
     }
     $this->componente->controlAcceso();
 }
Example #14
0
 public function __construct()
 {
     $this->_model = new \models\admin\auth();
     $this->_componente = new \models\admin\componente();
     $this->clase = "inicio";
     $this->_archivoNombre = "inicio.php";
     $this->_archivo["raiz"]["componente_archivo"] = $this->_archivoNombre;
     $this->_archivo["raiz"]["componente_enlace"] = "inicio";
     $this->_archivo["raiz"]["componente_url"] = DIR;
     $this->_archivo["raiz"]["componente_nombre"] = "Cambios el Saman";
     $this->_archivo["raiz"]["componente_slug"] = url::generateSafeSlug($this->_archivo["raiz"]["componente_nombre"]);
     foreach ($this->_archivo as $componente) {
         $this->_componente->createComponente($componente["componente_nombre"], $componente["componente_enlace"], $componente["componente_url"], $componente);
     }
     $this->_componente->controlAcceso();
 }
Example #15
0
 public function login()
 {
     \helpers\Session::init();
     if (!isset($_POST['submit'])) {
         header("Location: .");
     } else {
         $pass = $_POST['pass'];
         $uname = htmlspecialchars($_POST['username']);
         $auth_data = $this->login->get_admin_auth_by_uname($uname);
         $admin = true;
         if (!$auth_data->userName) {
             $auth_data = $this->login->get_trip_auth_by_uname($uname);
             $admin = false;
         }
         if ($auth_data->userName) {
             if ($auth_data->pass == $this->password_model->get_hash($pass, $auth_data->salt)) {
                 if (!$admin) {
                     \helpers\Session::set('tripId', $auth_data->tripId);
                     $trip_info = $this->trip->get_trip_information($auth_data->tripId);
                     $issueId = $trip_info->issueId;
                     $seasonId = $trip_info->seasonId;
                     $issue = $this->tripBoard->trip_issue_information($issueId);
                     $season = $this->tripBoard->season_information($seasonId);
                     \helpers\Session::set('season', $season[0]->name);
                     \helpers\Session::set('issue', $issue[0]->issueName);
                     \helpers\Session::set('issueId', $issue[0]->issueId);
                     \helpers\Session::set('nickname', $trip_info->nickname);
                     //children - DHvix4j2bf
                     //RUSHGM - ww5oJeFtZz
                     //mickeyds - mW56oQQ4eD
                 }
                 \helpers\Session::set('username', $auth_data->userName);
                 \helpers\Session::set('admin', $admin);
                 if ($admin) {
                     \helpers\url::redirect('exec');
                 } else {
                     \helpers\url::redirect('welcome');
                 }
             } else {
                 header('Location: .?error');
             }
         } else {
             header('Location: .?error');
         }
     }
 }
Example #16
0
 public function __construct()
 {
     $this->componente = new \models\admin\componente();
     $this->model = new \models\admin\novedades();
     $this->clase = "novedades";
     $this->archivoNombre = "novedades.php";
     $this->archivo["raiz"]["componente_archivo"] = $this->archivoNombre;
     $this->archivo["raiz"]["componente_enlace"] = ADMIN . "novedades";
     $this->archivo["raiz"]["componente_url"] = DIR . ADMIN . "novedades";
     $this->archivo["raiz"]["componente_nombre"] = "Publicación de Novedades";
     $this->archivo["raiz"]["componente_slug"] = url::generateSafeSlug($this->archivo["raiz"]["componente_nombre"]);
     $this->archivo["lista"]["componente_archivo"] = $this->archivoNombre;
     $this->archivo["lista"]["componente_enlace"] = ADMIN . "novedades_lista";
     $this->archivo["lista"]["componente_url"] = DIR . ADMIN . "novedades/elementos";
     $this->archivo["lista"]["componente_nombre"] = "Lista de Novedades";
     $this->archivo["lista"]["componente_slug"] = url::generateSafeSlug($this->archivo["lista"]["componente_nombre"]);
     $this->archivo["nuevo"]["componente_archivo"] = $this->archivoNombre;
     $this->archivo["nuevo"]["componente_enlace"] = ADMIN . "novedades_agregar";
     $this->archivo["nuevo"]["componente_url"] = DIR . ADMIN . "novedades/elemento_nuevo";
     $this->archivo["nuevo"]["componente_nombre"] = "Nueva Novedad";
     $this->archivo["nuevo"]["componente_slug"] = url::generateSafeSlug($this->archivo["nuevo"]["componente_nombre"]);
     $this->archivo["editar"]["componente_archivo"] = $this->archivoNombre;
     $this->archivo["editar"]["componente_enlace"] = ADMIN . "novedades_editar";
     $this->archivo["editar"]["componente_url"] = DIR . ADMIN . "novedades/elemento_editar";
     $this->archivo["editar"]["componente_nombre"] = "Editar Novedad";
     $this->archivo["editar"]["componente_slug"] = url::generateSafeSlug($this->archivo["editar"]["componente_nombre"]);
     $this->archivo["borrar"]["componente_archivo"] = $this->archivoNombre;
     $this->archivo["borrar"]["componente_enlace"] = ADMIN . "novedades_borrar";
     $this->archivo["borrar"]["componente_url"] = DIR . ADMIN . "novedades/elemento_borrar";
     $this->archivo["borrar"]["componente_nombre"] = "Borrar Novedad";
     $this->archivo["borrar"]["componente_slug"] = url::generateSafeSlug($this->archivo["borrar"]["componente_nombre"]);
     $this->archivo["publicar"]["componente_archivo"] = $this->archivoNombre;
     $this->archivo["publicar"]["componente_enlace"] = ADMIN . "novedades_publicar";
     $this->archivo["publicar"]["componente_url"] = DIR . ADMIN . "novedades/elemento_publicar";
     $this->archivo["publicar"]["componente_nombre"] = "Publicar Novedad";
     $this->archivo["publicar"]["componente_slug"] = url::generateSafeSlug($this->archivo["publicar"]["componente_nombre"]);
     $this->archivo["destacar"]["componente_archivo"] = $this->archivoNombre;
     $this->archivo["destacar"]["componente_enlace"] = ADMIN . "novedades_destcar";
     $this->archivo["destacar"]["componente_url"] = DIR . ADMIN . "novedades/elemento_destacar";
     $this->archivo["destacar"]["componente_nombre"] = "Destacar Novedad";
     $this->archivo["destacar"]["componente_slug"] = url::generateSafeSlug($this->archivo["destacar"]["componente_nombre"]);
     foreach ($this->archivo as $componente) {
         $this->componente->createComponente($componente["componente_nombre"], $componente["componente_enlace"], $componente["componente_url"], $componente);
     }
     $this->componente->controlAcceso();
 }
Example #17
0
 public function __construct()
 {
     $this->componente = new \models\admin\componente();
     $this->model = new \models\admin\carrusel();
     $this->clase = "carrusel";
     $this->archivoNombre = "carrusel.php";
     $this->archivo["raiz"]["componente_archivo"] = $this->archivoNombre;
     $this->archivo["raiz"]["componente_enlace"] = ADMIN . "carrusel";
     $this->archivo["raiz"]["componente_url"] = DIR . ADMIN . "carrusel";
     $this->archivo["raiz"]["componente_nombre"] = "Administrador de Imagenes del Carrusel";
     $this->archivo["raiz"]["componente_slug"] = url::generateSafeSlug($this->archivo["raiz"]["componente_nombre"]);
     $this->archivo["elementos"]["componente_archivo"] = $this->archivoNombre;
     $this->archivo["elementos"]["componente_enlace"] = ADMIN . "elementos";
     $this->archivo["elementos"]["componente_url"] = DIR . ADMIN . "carrusel/elementos";
     $this->archivo["elementos"]["componente_nombre"] = "Lista de elementos del carrusel";
     $this->archivo["elementos"]["componente_slug"] = url::generateSafeSlug($this->archivo["elementos"]["componente_nombre"]);
     $this->archivo["nuevo"]["componente_archivo"] = $this->archivoNombre;
     $this->archivo["nuevo"]["componente_enlace"] = ADMIN . "elemento_nuevo";
     $this->archivo["nuevo"]["componente_url"] = DIR . ADMIN . "carrusel/elemento_nuevo";
     $this->archivo["nuevo"]["componente_nombre"] = "Agregar elemento al carrusel";
     $this->archivo["nuevo"]["componente_slug"] = url::generateSafeSlug($this->archivo["nuevo"]["componente_nombre"]);
     $this->archivo["editar"]["componente_archivo"] = $this->archivoNombre;
     $this->archivo["editar"]["componente_enlace"] = ADMIN . "elemento_editar";
     $this->archivo["editar"]["componente_url"] = DIR . ADMIN . "carrusel/elemento_editar";
     $this->archivo["editar"]["componente_nombre"] = "Editar elemento al carrusel";
     $this->archivo["editar"]["componente_slug"] = url::generateSafeSlug($this->archivo["editar"]["componente_nombre"]);
     $this->archivo["borrar"]["componente_archivo"] = $this->archivoNombre;
     $this->archivo["borrar"]["componente_enlace"] = ADMIN . "elemento_borrar";
     $this->archivo["borrar"]["componente_url"] = DIR . ADMIN . "carrusel/elemento_borrar";
     $this->archivo["borrar"]["componente_nombre"] = "Borrar elemento al carrusel";
     $this->archivo["borrar"]["componente_slug"] = url::generateSafeSlug($this->archivo["borrar"]["componente_nombre"]);
     $this->archivo["publicar"]["componente_archivo"] = $this->archivoNombre;
     $this->archivo["publicar"]["componente_enlace"] = ADMIN . "elemento_publicar";
     $this->archivo["publicar"]["componente_url"] = DIR . ADMIN . "carrusel/elemento_publicar";
     $this->archivo["publicar"]["componente_nombre"] = "Publicar elemento al carrusel";
     $this->archivo["publicar"]["componente_slug"] = url::generateSafeSlug($this->archivo["publicar"]["componente_nombre"]);
     foreach ($this->archivo as $componente) {
         $this->componente->createComponente($componente["componente_nombre"], $componente["componente_enlace"], $componente["componente_url"], $componente);
     }
     $this->componente->controlAcceso();
 }
Example #18
0
 public function __construct()
 {
     $this->componente = new \models\admin\componente();
     $this->model = new \models\admin\estilos();
     $this->clase = "estilos";
     $this->archivoNombre = "estilos.php";
     $this->archivo["raiz"]["componente_archivo"] = $this->archivoNombre;
     $this->archivo["raiz"]["componente_enlace"] = ADMIN . "estilos";
     $this->archivo["raiz"]["componente_url"] = DIR . ADMIN . "estilos";
     $this->archivo["raiz"]["componente_nombre"] = "Estilos de la Pagina";
     $this->archivo["raiz"]["componente_slug"] = url::generateSafeSlug($this->archivo["raiz"]["componente_nombre"]);
     $this->archivo["cambiar"]["componente_archivo"] = $this->archivoNombre;
     $this->archivo["cambiar"]["componente_enlace"] = ADMIN . "estilos_cambiar";
     $this->archivo["cambiar"]["componente_url"] = DIR . ADMIN . "estilos/cambiar";
     $this->archivo["cambiar"]["componente_nombre"] = "Modificar Estilos de la Pagina";
     $this->archivo["cambiar"]["componente_slug"] = url::generateSafeSlug($this->archivo["cambiar"]["componente_nombre"]);
     foreach ($this->archivo as $componente) {
         $this->componente->createComponente($componente["componente_nombre"], $componente["componente_enlace"], $componente["componente_url"], $componente);
     }
     $this->componente->controlAcceso();
 }
Example #19
0
 public function submit()
 {
     if (!isset($_POST['submit'])) {
         \helpers\url::redirect('apply');
     }
     $inputData = array();
     foreach ($_POST as $key => $input) {
         if ($key == "dob") {
             $dobArray = explode("/", $input);
             $inputData[$key] = $dobArray[2] . "-" . $dobArray[0] . "-" . $dobArray[1];
         } else {
             $inputData[$key] = $input;
         }
     }
     if ($inputData['issue1'] == $inputData['issue2'] || $inputData['issue1'] == $inputData['issue3'] || $inputData['issue2'] == $inputData['issue3']) {
         \helpers\url::redirect('apply?failure=issue');
     }
     if ($this->apply_model->addApplication($inputData)) {
         \helpers\url::redirect('apply?success');
     } else {
         \helpers\url::redirect('apply?failure=stunum');
     }
 }
Example #20
0
 public function index()
 {
     //SEO
     $data['title'] = Language::show('title', 'testimonials', $_SESSION['site_lang']);
     $data['meta_description'] = Language::show('meta_description', 'testimonials', $_SESSION['site_lang']);
     $data['meta_keywords'] = Language::show('meta_keywords', 'testimonials', $_SESSION['site_lang']);
     $data['sitename_before'] = "N";
     //title for de hover in navbar
     $data['title_page'] = "testimonials";
     //column result
     $data['testimonials'] = $this->_model->fetchTestimonials('Y', $_SESSION['site_lang']);
     $data['result'] = filter_input(INPUT_GET, 'result');
     //envio de testimonios
     if (!is_null(filter_input(INPUT_POST, 'submit'))) {
         $name = filter_input(INPUT_POST, 'name');
         $message = filter_input(INPUT_POST, 'message');
         $property = filter_input(INPUT_POST, 'property');
         $residence = filter_input(INPUT_POST, 'residence');
         $langSelect = filter_input(INPUT_POST, 'langSelect');
         $typeSelect = filter_input(INPUT_POST, 'typeSelect');
         $date = date("M Y");
         if ($name == '' || !isset($name) || $message == '' || !isset($message) || $langSelect == '' || !isset($langSelect) || $typeSelect == '' || !isset($typeSelect) || $property == '' || !isset($property) || $residence == '' || !isset($residence)) {
             $error = "";
             Url::redirect($_SESSION['site_lang'] . "/testimonials.php?error=1");
         }
         if (!$error) {
             $dataTestimonial = array('type' => $typeSelect, 'lang' => $langSelect, 'comment' => $message, 'name' => $name, 'property' => $property, 'residence' => $residence, 'date' => $date, 'online' => 'N');
             $this->_model->insert_testimonial($dataTestimonial);
             Url::redirect($_SESSION['site_lang'] . "/testimonials.php?send=1");
         }
     }
     //render views
     View::rendertemplate('header', $data);
     View::render('testimonials/testimonials', $data);
     View::rendertemplate('footer', $data);
 }
Example #21
0
 public function add()
 {
     if (json_decode($this->_rights[0]->pages)->{'cities'}->acl_level <= 1) {
         url::redirect('admin/login');
     }
     $data['pages'] = json_decode($this->_rights[0]->pages);
     $data['rights'] = json_decode($this->_rights[0]->rights);
     $data['title'] = "Добавить город";
     $data['breadcrumbs'] = array();
     $data['breadcrumb'][] = array('text' => 'Главная', 'href' => '/admin/');
     $data['breadcrumb'][] = array('text' => 'Города', 'href' => '/admin/cities/');
     $data['statuses'] = $this->_model->show_statuses();
     if (json_decode($this->_rights[0]->pages)->{'cities'}->acl_level == 3) {
         $data['url'] = '/admin/cities/add';
         $data['url_title'] = 'Новый город';
     }
     if (isset($_POST['submit'])) {
         $city = trim(stripslashes(strip_tags($_POST['city'])));
         if ($city == '') {
             $error[] = 'Укажите город';
         }
         $status = trim(stripslashes(strip_tags($_POST['status'])));
         if ($status == '') {
             $error[] = 'Укажите статус города';
         }
         $comment = trim(stripslashes(strip_tags($_POST['comment'])));
         if (!$error) {
             $data = array('city' => $city, 'status_id' => $status, 'comment' => $comment);
             $where = array('id' => $id);
             $this->_model->insert_city($data);
             url::redirect('admin/cities');
         }
     }
     view::rendertemplate('header', $data);
     view::rendertemplate('admin_menu', $data);
     view::render('admin/city_add_form', $data, $error);
     view::rendertemplate('footer');
 }
Example #22
0
 public function logout()
 {
     session::destroy("autenticado");
     session::destroy("usuario");
     url::redirect(ADMINLOGIN);
 }
Example #23
0
 public function edit($id)
 {
     $data['title'] = 'Просмотр данных заказа';
     $data['breadcrumbs'] = array();
     $data['breadcrumb'][] = array('text' => 'Заказы', 'href' => '/');
     $data['order'] = $this->_model->get_order($id, $this->user_id);
     $data['comment'] = $this->_model->get_comment($id, $this->user_id, "1");
     $data['statuses'] = $this->_model->show_statuses();
     $data['formula'] = $this->_model->salary_formula($data['order'][0]->salary_id);
     if (!empty($_POST)) {
         if (!isset($_POST['status'])) {
             $error[] = 'Ошибка, данные формы не отправленны';
         }
         $data['current_sort'] = $this->_model->show_status_order($data['order'][0]->status_id);
         $data['expected_sort'] = $this->_model->show_status_order(trim($_POST['status']));
         if ($data['expected_sort'] < $data['current_sort']) {
             $error[] = 'Статус заказа не может быть ниже чем уже имеющийся';
         } else {
             if ($data['expected_sort'] > $data['current_sort']) {
                 $status = trim($_POST['status']);
                 $update_status = true;
                 if ($status == 2) {
                     $problem_viewed = 1;
                 } else {
                     $problem_viewed = 0;
                 }
             } else {
                 $status = $data['order'][0]->status_id;
             }
         }
         if ($data['order'][0]->profit > 0) {
             $profit = $data['order'][0]->profit;
         }
         /*    
         }else{
             if(preg_match('/[0-9]+(?:\.[0-9]*)?/',trim($_POST['profit']))){
                 $profit = trim($_POST['profit']);
             }else{
                 $profit = $data['order'][0]->profit;
             }
         }
         */
         if ($data['order'][0]->total > 0) {
             $total = $data['order'][0]->total;
         } else {
             if (preg_match('/[0-9]+(?:\\.[0-9]*)?/', trim($_POST['total']))) {
                 $total = trim($_POST['total']);
                 //
                 if ($data['order'][0]->salary_id == 1) {
                     if ($total > 0 && $total <= 199) {
                         $profit = $total * 0.5;
                     } elseif ($total >= 200 && $total <= 250) {
                         $profit = $total - 100;
                     } elseif ($total >= 251 && $total <= 399) {
                         $profit = $total * 0.6;
                     } else {
                         $profit = $total * 0.5;
                     }
                 } elseif ($data['order'][0]->salary_id == 2) {
                     $profit = $total * 0.5;
                 } elseif ($data['order'][0]->salary_id == 3) {
                     $profit = $total * 0.6;
                 } elseif ($data['order'][0]->salary_id == 4) {
                     $profit = $total * 0.7;
                 }
                 //
             } else {
                 $total = $data['order'][0]->total;
             }
         }
         $comment = trim(stripslashes(strip_tags(trim($_POST['worker_comment']))));
         $where = array('id' => $id, 'worker_id' => $this->user_id);
         if (!$error) {
             //update order
             $data = array('status_id' => $status, 'problem_viewed' => $problem_viewed, 'profit' => round($profit, 2), 'total' => $total);
             $this->_model->update_order($data, $where);
             //update status
             if ($update_status) {
                 $status_log['creation_date'] = date("Y-m-d H:i:s");
                 $where = array('order_id' => $id, 'status_id' => $status);
                 $this->_model->update_status_log($status_log, $where);
             }
             //insert comment
             if ($comment) {
                 //$old_comment = $this->_model->get_comment($id, $this->user_id);
                 //if($old_comment && $old_comment->status == 1){
                 //}
                 $data = array('order_id' => $id, 'worker_id' => $this->user_id, 'comment' => $comment, 'status' => '1', 'creation_date' => date("Y-m-d H:i:s"));
                 $this->_model->insert_order_comment($data);
             } else {
                 if ($this->_model->get_comment($id, $this->user_id, "1")) {
                     $where = array('order_id' => $id, 'worker_id' => $this->user_id);
                     $data = array('status' => '0');
                     $this->_model->update_order_comment($data, $where);
                 }
             }
             if (\helpers\session::get('url')) {
                 url::redirect(\helpers\session::get('url'));
             } else {
                 url::redirect('');
             }
         }
     }
     view::rendertemplate('header', $data);
     view::rendertemplate('user_menu', $data);
     view::render('order_edit_form', $data, $error);
     view::rendertemplate('footer');
 }
Example #24
0
 public function add()
 {
     if (json_decode($this->_rights[0]->pages)->{'orders'}->acl_level != 3) {
         url::redirect('admin/login');
     }
     $data['pages'] = json_decode($this->_rights[0]->pages);
     $data['rights'] = json_decode($this->_rights[0]->rights);
     $data['title'] = 'Новый заказ';
     $data['breadcrumbs'] = array();
     $data['breadcrumb'][] = array('text' => 'Главная', 'href' => '/admin/');
     $data['breadcrumb'][] = array('text' => 'Заказы', 'href' => '/admin/orders/');
     $data['cities'] = $this->_model->show_cities();
     $data['workers'] = $this->_model->show_workers();
     $data['statuses'] = $this->_model->show_statuses();
     $data['url'] = '/admin/orders/add';
     $data['url_title'] = 'Новый заказ';
     if (isset($_POST['submit'])) {
         //print_r($_POST);
         if ($data['rights']->contact_name == 1) {
             $output['client_name'] = trim(stripslashes(strip_tags($_POST['contact_name'])));
         }
         if ($data['rights']->order_description == 1) {
             if (!isset($_POST['order_description']) || empty($_POST['order_description'])) {
                 $error[] = 'Описание заказа не может быть пустым';
             } else {
                 $output['description'] = trim(stripslashes(strip_tags($_POST['order_description'])));
             }
         }
         if ($data['rights']->order_description_hidden == 1) {
             $output['description_hidden'] = trim(stripslashes(strip_tags($_POST['order_description_hidden'])));
         }
         if ($data['rights']->status == 1) {
             if (!isset($_POST['status']) || empty($_POST['status'])) {
                 $error[] = 'Статус заказа не может быть пустым';
             } else {
                 $output['status_id'] = trim(stripslashes(strip_tags($_POST['status'])));
             }
         }
         if ($data['rights']->phone1 == 1) {
             if (!isset($_POST['phone1']) || empty($_POST['phone1'])) {
                 $error[] = 'Необходимо указать как минимум один телефон';
             } else {
                 $output['phone1'] = preg_replace('/\\D+/', '', trim(stripslashes(strip_tags($_POST['phone1']))));
             }
         }
         if ($data['rights']->phone2 == 1) {
             $output['phone2'] = preg_replace('/\\D+/', '', trim(stripslashes(strip_tags($_POST['phone2']))));
         }
         if ($data['rights']->phone3 == 1) {
             $output['phone3'] = preg_replace('/\\D+/', '', trim(stripslashes(strip_tags($_POST['phone3']))));
         }
         if ($data['rights']->worker == 1) {
             if (!isset($_POST['worker']) || empty($_POST['worker'])) {
                 $error[] = 'Назначьте рабочего';
             } else {
                 $output['worker_id'] = trim(stripslashes(strip_tags($_POST['worker'])));
             }
         }
         if ($data['rights']->city == 1) {
             if (!isset($_POST['city']) || empty($_POST['city'])) {
                 $error[] = 'Выберите город';
             } else {
                 $output['city_id'] = trim(stripslashes(strip_tags($_POST['city'])));
             }
         }
         if ($data['rights']->profit == 1) {
             $output['profit'] = trim(stripslashes(strip_tags($_POST['profit'])));
         }
         if ($data['rights']->total == 1) {
             $output['total'] = trim(stripslashes(strip_tags($_POST['total'])));
         }
         if ($data['rights']->spare == 1) {
             $output['spare'] = trim(stripslashes(strip_tags($_POST['spare'])));
         }
         if ($data['rights']->advert == 1) {
             $output['advert'] = trim(stripslashes(strip_tags($_POST['advert'])));
         }
         if ($data['rights']->check == 1) {
             $output['check_order'] = trim(stripslashes(strip_tags($_POST['check'])));
         }
         if (!$error) {
             $order_id = $this->_model->insert_order($output);
             $this->_model->insert_status_log($order_id, $output['status_id']);
             if (\helpers\session::get('url')) {
                 url::redirect(\helpers\session::get('url'));
             } else {
                 url::redirect('admin/orders');
             }
         }
     }
     view::rendertemplate('header', $data);
     view::rendertemplate('admin_menu', $data);
     view::render('admin/order_add_form', $data, $error);
     view::rendertemplate('footer');
 }
Example #25
0
										<ul class="nav navbar-nav">
											<li><a href="index.php">Home</a></li>
											<li><a href="visa.php">Travel Visa</a></li>
											<li><a href="passport_photo.php">Passport Photo</a></li>
											<li><a href="about.php">About</a></li>
											<li><a href="contact.php">Contact</a></li>
										</ul>
									</div>
								</nav>
							</div>
						</div>
					</div>
				</div> -->
				<!-- .subfooter end -->

			</footer>
			<!-- footer end -->

		</div>
		<!-- page-wrapper end -->

		<!-- JavaScript files placed at the end of the document so the pages load faster
		================================================== -->
		<!-- Jquery and Bootstap core js files -->


		<?php 
assets::js(array(url::template_path() . 'plugins/jquery.min.js', url::template_path() . 'bootstrap/js/bootstrap.min.js', url::template_path() . 'plugins/datepicker/bootstrap-datepicker.js', url::template_path() . 'plugins/modernizr.js', url::template_path() . 'plugins/rs-plugin/js/jquery.themepunch.tools.min.js', url::template_path() . 'plugins/rs-plugin/js/jquery.themepunch.revolution.min.js', url::template_path() . 'plugins/isotope/isotope.pkgd.min.js', url::template_path() . 'plugins/owl-carousel/owl.carousel.js', url::template_path() . 'plugins/magnific-popup/jquery.magnific-popup.min.js', url::template_path() . 'plugins/jquery.appear.js', url::template_path() . 'plugins/jquery.countTo.js', url::template_path() . 'plugins/jquery.parallax-1.1.3.js', url::template_path() . 'plugins/jquery.validate.js', 'https://maps.googleapis.com/maps/api/js?v=3.exp&amp;sensor=false', url::template_path() . 'js/google.map.config.js', url::template_path() . 'js/template.js', url::template_path() . 'js/custom.js'));
?>
	</body>
</html>
Example #26
0
 public function grupo()
 {
     $data["title"] = $this->_archivo["grupo"]["componente_nombre"];
     $data["raiz"] = $this->_archivo["raiz"]["componente_enlace"];
     $data["url"] = $this->_archivo["grupo"]["componente_url"];
     if (null != filter_input(INPUT_POST, "submit")) {
         $nombre = filter_input(INPUT_POST, "nombre");
         $fecha = filter_input(INPUT_POST, "fecha");
         if ($nombre === "") {
             $error[] = "Nombre de grupo requerido.";
         }
         if (!$error) {
             $grupo_datos = array('menu_grupo_nombre' => $nombre, 'menu_grupo_fecha' => $fecha);
             $this->_model->crearGrupo($grupo_datos);
             session::set("estado", "Clase Creada");
             url::redirect($this->_archivo["raiz"]["componente_enlace"]);
         }
     }
     view::admintemplate("header", $data);
     view::render($this->_archivo["grupo"]["componente_enlace"], $data, $error);
     view::admintemplate("footer", $data);
 }
Example #27
0
 public function delete($id)
 {
     $data["title"] = $this->_archivo["borrar"]["componente_nombre"];
     $this->_model->deleteCategoria(array("documento_tipo_id" => $id));
     session::set("estado", "Categoria Eliminada");
     url::redirect($this->_archivo["raiz"]["componente_enlace"]);
 }
Example #28
0
 public function addmedia($parameter)
 {
     $media_type = $parameter[0];
     $this->data['media_type'] = $media_type;
     $this->data['album_categories'] = $this->category_model->get(array('category_slug' => 'album'));
     $category = $this->category_model->getColRow('category_title', $media_type);
     $this->data['title'] = 'Add ' . ucfirst($media_type);
     if (isset($_POST['title']) && !empty($_POST['title'])) {
         $title = $_POST['title'];
         $artist = $_POST['artist'];
         $description = $_POST['description'];
         $youtubelink = $_POST['youtubelink'];
         $category_id = $_POST['category'];
         // $status_id = $status->status_id;
         $slug = \helpers\url::generateSafeSlug($title);
         if (isset($youtubelink) && $youtubelink != '') {
             $exp = explode('=', $youtubelink);
             if (count($exp) > 1) {
                 $youtubelink = $exp[1];
             }
         }
         $insert_array = array('album_item_album_id' => \helpers\session::get('user')->user_album_id, 'album_item_category_id' => $category->category_id, 'album_item_user_id' => \helpers\session::get('user')->user_id, 'album_item_title' => $title, 'album_item_artist' => $artist, 'album_item_description' => $description, 'album_item_youtubelink' => $youtubelink, 'album_item_created' => time(), 'album_item_alias' => $slug);
         $insert_array = \helpers\gump::xss_clean($insert_array);
         $insert_array = \helpers\gump::sanitize($insert_array);
         $insert_id = $this->albumitem_model->create($insert_array);
         if ($insert_id > 0) {
             $message = 'ok';
         } else {
             $message = 'no';
         }
         //check if item is a video
         // $category_type = $this->category_model->find($_POST['category']);
         if ($media_type == 'video' && isset($youtubelink) && $youtubelink != '') {
             $youtube_url = "https://i.ytimg.com/vi/" . $youtubelink . "/maxresdefault.jpg";
             if (!file_exists($youtube_url)) {
                 $youtube_url = "https://i.ytimg.com/vi/" . $youtubelink . "/hqdefault.jpg";
             }
             //resize youtube image into uploads folder
             \helpers\upload::setName(time());
             \helpers\upload::resizeUrl($youtube_url, UPLOAD_PATH, '480px');
             $image_name = \helpers\upload::getFileName('images');
             $update_data = array('album_item_file' => $image_name);
             $where_array = array('album_item_id' => $insert_id);
             $this->albumitem_model->update($update_data, $where_array);
         }
         //UPLOAD ATTACHMENT
         if ($_FILES["image"]["tmp_name"] != '') {
             //upload image into uploads folder
             \helpers\upload::setName(uniqid());
             \helpers\upload::resizeUpload($_FILES["image"], UPLOAD_PATH, '480px');
             $image_name = \helpers\upload::getFileName('images');
             $update_data = array('album_item_file' => $image_name);
             $where_array = array('album_item_id' => $insert_id);
             $this->albumitem_model->update($update_data, $where_array);
         }
     }
     if ($message == 'ok') {
         \helpers\session::set('success', 'record edited');
         $url = 'user/' . $media_type;
         \helpers\url::redirect($url);
     } else {
         if ($message == 'no') {
             $this->data['error'] = 'Operation Fails!';
         }
     }
     View::rendertemplate('header', $this->data);
     View::rendertemplate('mobile-menu', $this->data);
     View::render('user/user.media', $this->data);
     View::rendertemplate('footer', $this->data);
 }
Example #29
0
 public function delete($id)
 {
     $data["title"] = $this->_archivo["borrar"]["componente_nombre"];
     $datos = array("articulo_id" => $id);
     $this->_model->deleteArticulo($datos);
     session::set("estado", "Articulo Eliminado");
     url::redirect($this->_archivo["raiz"]["componente_enlace"]);
 }
Example #30
0
</div>

<script src="<?php 
echo \helpers\url::get_template_path();
?>
js/jquery.js"></script>
<?php 
echo $data['js'] . "\n";
?>

<script>
$(document).ready(function(){
	<?php 
echo $data['jq'] . "\n";
?>
});
</script>

</body>
</html>