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; } }
/** * */ public function add() { $novedades_titulo = filter_input(INPUT_POST, "novedades_titulo"); $novedades_resumen = filter_input(INPUT_POST, "novedades_resumen"); $novedades_contenido = filter_input(INPUT_POST, "novedades_contenido"); $novedades_imagen_url = $this->componente->subir_imagen("novedades_imagen_url", "novedades"); $novedades_fecha = date("Y-m-d H:i:s"); $novedades_autor = session::get("usuario"); $novedades_estado = filter_input(INPUT_POST, "novedades_estado"); $novedades_destacado = filter_input(INPUT_POST, "novedades_destacado"); if ($novedades_titulo != "" && $novedades_resumen != "" && $novedades_contenido != "" && $novedades_imagen_url["estado"]) { $datos = ["novedades_titulo" => $novedades_titulo, "novedades_resumen" => $novedades_resumen, "novedades_contenido" => $novedades_contenido, "novedades_imagen_url" => $novedades_imagen_url["url"], "novedades_fecha" => $novedades_fecha, "novedades_autor" => $novedades_autor, "novedades_estado" => $novedades_estado, "novedades_destacado" => $novedades_destacado]; echo $this->model->addNovedad($datos); } }
public function index() { $dropdowns = ""; $elementos = ""; $grupo = ""; $data["title"] = $this->_archivo["raiz"]["componente_nombre"]; $data["raiz"] = $this->_archivo["raiz"]["componente_enlace"]; $data["editar"] = $this->_archivo["editar"]["componente_url"]; $data["clases"] = $this->_model->getClases(); $data["grupos"] = $this->_model->getGrupos(); $data["menus"] = $this->_model->getMenus(session::get("usuario")); $data["js"] = "\n <script>\n function borrar_menu(id, titulo) {\n if (confirm('Seguro de eliminar el Acceso a ' + titulo)){\n window.location.href = '" . $this->_archivo["borrar"]["componente_url"] . "..' + id;\n }\n }\n </script>"; view::admintemplate("header", $data); view::render($this->_archivo["raiz"]["componente_enlace"], $data); view::admintemplate("footer", $data); }
public function login() { foreach ($this->_archivo as $componente) { $this->_componente->createComponente($componente["componente_nombre"], $componente["componente_enlace"], $componente["componente_url"], $componente); } $data['title'] = $this->_archivo["login"]["componente_nombre"]; if (session::get("autenticado")) { url::redirect(ADMIN); } if (null != filter_input(INPUT_POST, "submit")) { $usuario = filter_input(INPUT_POST, "usuario"); $clave = filter_input(INPUT_POST, "clave"); $userData = $this->_model->getClaveHash($usuario); if ($usuario === "") { $error[] = "El usuario no puede estar en blanco."; } if ($clave === "") { $error[] = "La clave no puede estar en blanco."; } if ($usuario == "" || $clave == "") { $error[] = "No pueden haber campos en blanco."; } else { if ($userData[0]->usuario_estado != "1") { $error[] = "Esa cuenta fue deshabilitada por el Administrador."; } else { if ($usuario != "" && $clave != "" && password::verify($clave, $userData[0]->usuario_clave)) { session::set("autenticado", true); session::set("usuario", $userData[0]->usuario_sid); session::set("grupo", $userData[0]->usuario_grupo); session::set("nombre", $userData[0]->usuario_nombre . " " . $userData[0]->usuario_apellido); session::set("email", $userData[0]->usuario_email); session::set("estado", $userData[0]->usuario_estado); url::redirect(ADMIN); } else { $error[] = "Credenciales de Acceso incorrectas."; } } } } view::admintemplate("header", $data); view::render(ADMINLOGIN, $data, $error); view::admintemplate("footer", $data); }
public function index() { $password_message = ""; $password_class = ""; if (isset($_POST['submit'])) { if (isset($_POST['current_password'])) { if ($this->_users->check_user(\helpers\session::get('username'), $_POST['current_password'])['correct']) { if ($_POST['new_password_1'] == $_POST['new_password_2']) { // Change password $salt = $this->_users->generate_salt(); $hashed = hash("SHA256", $_POST['new_password_1'] . $salt); $current_user = $this->_users->get_by_username(\helpers\session::get('username')); $current_user->password = $hashed; $current_user->salt = $salt; $this->_users->upsert($current_user); $password_message = "Password Changed Successfully"; $password_class = "success"; } else { $password_message = "New Passwords Don't Match"; $password_class = "danger"; } } else { $password_message = "Current Password Incorrect"; $password_class = "danger"; } } } $pages = $this->_pages->get(); $welcomes = $this->_welcomes->get(); $data['title'] = "Page Management"; $data['pages'] = $pages; $data['welcomes'] = $welcomes; $data['css'] = array("css/manage.css"); $data['password_message'] = $password_message; $data['password_class'] = $password_class; View::renderTemplate('header', $data); View::render('page/view', $data); View::renderTemplate('footer', $data); }
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'); }
<!-- end: Main Menu --> <noscript> <div class="alert alert-block span10"> <h4 class="alert-heading">Warning!</h4> <p>You need to have <a href="http://en.wikipedia.org/wiki/JavaScript" target="_blank">JavaScript</a> enabled to use this site.</p> </div> </noscript> <?php // echo $success; // if(null !== \helpers\session::get('success')){ // $success = \helpers\session::get('success'); // } $sm = \helpers\session::get('success'); // var_dump($sm); if (isset($sm) && $sm != '' && !empty($sm)) { $success = $sm; } ?> <?php if (isset($success) && $success != '') { ?> <div class="alert alert-success"> <button type="button" class="close" data-dismiss="alert">×</button> <strong>Success!</strong> <?php echo $success; ?> </div>
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); }
public function add() { $data['pages'] = json_decode($this->_rights[0]->pages); $data['title'] = 'Новое правило доступа'; $data['breadcrumbs'] = array(); $data['breadcrumb'][] = array('text' => 'Главная', 'href' => '/admin/'); $data['breadcrumb'][] = array('text' => 'Настройки доступа', 'href' => '/admin/permissions/'); $data['url'] = '/admin/permissions/add'; $data['url_title'] = 'Новые правила доступа'; if (!empty($_POST)) { if (isset($_POST['orders'])) { $pages['orders'] = $_POST['orders']; } else { $error[] = "Необходимо выбрать уровень доступа для - Заказы"; } if (isset($_POST['workers'])) { $pages['workers'] = $_POST['workers']; } else { $error[] = "Необходимо выбрать уровень доступа для - Рабочие"; } if (isset($_POST['cities'])) { $pages['cities'] = $_POST['cities']; } else { $error[] = "Необходимо выбрать уровень доступа для - Города"; } if (isset($_POST['archive'])) { $pages['archive'] = $_POST['archive']; } else { $error[] = "Необходимо выбрать уровень доступа для - Архив"; } if (isset($_POST['permissions'])) { $pages['permissions'] = $_POST['permissions']; } else { $error[] = "Необходимо выбрать уровень доступа для - Права доступа"; } if (isset($_POST['messages'])) { $pages['messages'] = $_POST['messages']; } else { $error[] = "Необходимо выбрать уровень доступа для - Сообщения"; } if (isset($_POST['name']) && $_POST['name'] != "") { $permission['acl_name'] = $_POST['name']; } else { $error[] = "Укажите имя"; } if (isset($_POST['contact_name'])) { $output['contact_name'] = $_POST['contact_name']; } else { $error[] = "Необходимо выбрать уровень доступа для - Контактное лицо"; } if (isset($_POST['phone1'])) { $output['phone1'] = $_POST['phone1']; } else { $error[] = "Необходимо выбрать уровень доступа для - Телефон 1"; } if (isset($_POST['phone2'])) { $output['phone2'] = $_POST['phone2']; } else { $error[] = "Необходимо выбрать уровень доступа для - Телефон 2"; } if (isset($_POST['phone3'])) { $output['phone3'] = $_POST['phone3']; } else { $error[] = "Необходимо выбрать уровень доступа для - Телефон 3"; } if (isset($_POST['creation-date'])) { $output['creation-date'] = $_POST['creation-date']; } else { $error[] = "Необходимо выбрать уровень доступа для - Дата создания"; } if (isset($_POST['certain-date'])) { $output['certain-date'] = $_POST['certain-date']; } else { $error[] = "Необходимо выбрать уровень доступа для - Заказ на"; } if (isset($_POST['performed-date'])) { $output['performed-date'] = $_POST['performed-date']; } else { $error[] = "Необходимо выбрать уровень доступа для - Дата выполнения"; } if (isset($_POST['payed-date'])) { $output['payed-date'] = $_POST['payed-date']; } else { $error[] = "Необходимо выбрать уровень доступа для - Дата оплаты"; } if (isset($_POST['city'])) { $output['city'] = $_POST['city']; } else { $error[] = "Необходимо выбрать уровень доступа для - Город"; } if (isset($_POST['worker'])) { $output['worker'] = $_POST['worker']; } else { $error[] = "Необходимо выбрать уровень доступа для - Сотрудник"; } if (isset($_POST['total'])) { $output['total'] = $_POST['total']; } else { $error[] = "Необходимо выбрать уровень доступа для - Сумма заказа"; } if (isset($_POST['profit'])) { $output['profit'] = $_POST['profit']; } else { $error[] = "Необходимо выбрать уровень доступа для - Зароботок"; } if (isset($_POST['status'])) { $output['status'] = $_POST['status']; } else { $error[] = "Необходимо выбрать уровень доступа для - Статус"; } if (isset($_POST['advert'])) { $output['advert'] = $_POST['advert']; } else { $error[] = "Необходимо выбрать уровень доступа для - Метка"; } if (isset($_POST['check'])) { $output['check'] = $_POST['check']; } else { $error[] = "Необходимо выбрать уровень доступа для - Проверить?"; } if (isset($_POST['spare'])) { $output['spare'] = $_POST['spare']; } else { $error[] = "Необходимо выбрать уровень доступа для - За запчасти"; } if (isset($_POST['order_description'])) { $output['order_description'] = $_POST['order_description']; } else { $error[] = "Необходимо выбрать уровень доступа для - Описание проблемы"; } if (isset($_POST['order_description_hidden'])) { $output['order_description_hidden'] = $_POST['order_description_hidden']; } else { $error[] = "Необходимо выбрать уровень доступа для - Комментарий(скрытый)"; } if (isset($_POST['accounter_comment'])) { $output['accounter_comment'] = $_POST['accounter_comment']; } else { $error[] = "Необходимо выбрать уровень доступа для - Комментарий бухгалтера"; } if (isset($_POST['checker_comment'])) { $output['checker_comment'] = $_POST['checker_comment']; } else { $error[] = "Необходимо выбрать уровень доступа для - Комментарий проверяющего"; } if (!$error) { $permission['pages'] = json_encode($pages); $permission['rights'] = json_encode($output); $this->_model->insert_permission($permission); if (\helpers\session::get('url')) { url::redirect(\helpers\session::get('url')); } else { url::redirect('admin/permissions'); } } } view::rendertemplate('header', $data); view::rendertemplate('admin_menu', $data); view::render('admin/permissions_add_form', $data, $error); view::rendertemplate('footer'); }
$("#wishlist").tablesorter({ headers: { 0: { sorter: false } } }); }); function draft(applicationId){ $.ajax({ url: 'ajax/draft?applicationId=' + applicationId + '&tripId=<?php echo \helpers\session::get('tripId'); ?> ' }).done(function(results){ results = JSON.parse(results); if(results){ alert("Success!"); $.ajax({ url: 'ajax/updateTurn?tripId=<?php echo \helpers\session::get('tripId'); ?> ' }); }else{ alert("Failure!"); } }); } </script>
public function rendertemplate($path, $data = false) { require "app/templates/" . Session::get('template') . "/{$path}.php"; }
public function edit($id) { $data["title"] = $this->_archivo["editar"]["componente_nombre"]; $data["raiz"] = $this->_archivo["raiz"]["componente_enlace"]; $data["clase"] = $this->clase; $data["articulo"] = $this->_model->getArticulo($id); $data["js"] = "<script type='text/javascript'>" . "bkLib.onDomLoaded(function() { nicEditors.allTextAreas() });" . "</script>"; if (null != filter_input(INPUT_POST, "submit")) { $titulo = filter_input(INPUT_POST, "titulo"); $contenido = filter_input(INPUT_POST, "contenido"); $descripcion = filter_input(INPUT_POST, "descripcion"); $fecha = filter_input(INPUT_POST, "fecha"); $publicado = filter_input(INPUT_POST, "estado") ? 1 : 0; $favorito = filter_input(INPUT_POST, "especial") ? 1 : 0; $autor = session::get("usuario"); if ($titulo === "") { $error[] = "{$publicado}"; } $allowedExts = array("gif", "jpeg", "jpg", "png", "svg"); $temp = explode(".", $_FILES["image"]["name"]); $extension = strtolower(end($temp)); if ($_FILES["image"]["size"] > 0 && !in_array($extension, $allowedExts)) { $error[] = "Tipo de imagen no Soportado."; } if ($_FILES["image"]["size"] / 1024 > 500) { $error[] = "Archivo de imagen mayor a 500 KB."; } if (!$error) { $slug = url::generateSafeSlug($titulo); $articulo_datos = array('articulo_titulo' => $titulo, 'articulo_contenido' => $contenido, 'articulo_descripcion' => $descripcion, 'articulo_fecha' => $fecha, 'articulo_estado' => $publicado, 'articulo_especial' => $favorito, 'articulo_autor' => $autor, 'articulo_slug' => $slug); if ($_FILES["image"]["size"] > 0) { $file = ARTICULOIMG . $_FILES["image"]["name"]; move_uploaded_file($_FILES["image"]["tmp_name"], $file); $articulo_datos["articulo_image"] = $file; } $where = array("articulo_id" => $id); $this->_model->updateArticulo($articulo_datos, $where); session::set("estado", "Articulo Modificado"); url::redirect($this->_archivo["raiz"]["componente_enlace"]); } } view::admintemplate("header", $data); view::render($this->_archivo["editar"]["componente_enlace"], $data, $error); view::admintemplate("footer", $data); }
<div class="col-sm-10"> <select class="form-control" name="grupo"> <?php foreach ($data["grupos"] as $elemento_grupo) { echo "<option value='{$elemento_grupo->grupo_nombre}'>{$elemento_grupo->grupo_nombre}</option>"; } ?> </select> </div> </div> <div class="form-group"> <label for="propietario" class="col-sm-2 control-label">Autor:</label> <div class="col-sm-10"> <input type="text" class="form-control" name="propietario" placeholder="Nombre del Propietario" value="<?php echo \helpers\session::get("usuario"); ?> " readonly> </div> </div> <div class="form-group"> <div class="col-sm-offset-2 col-sm-10"> <div class="checkbox"> <label> <div class="btn-group" data-toggle="buttons"> <label class="btn btn-success <?php echo $active; ?> "> <input <?php echo $checked;
function require_login() { if (!\helpers\session::get('loggedin')) { header('Location: /manage/login'); } }
<div class="header_container"> <div class="letter_container"> <div class="title_letter sink" onclick="window.location = '//<?php echo SITELOCATION; ?> /';">C</div> <div class="title_letter sink" onclick="window.location = '//<?php echo SITELOCATION; ?> /';">H</div> <div class="title_letter sink" onclick="window.location = '//<?php echo SITELOCATION; ?> /';">R</div> <div class="title_letter sink" onclick="window.location = '//<?php echo SITELOCATION; ?> /manage/<?php echo \helpers\session::get('loggedin') ? "logout" : "login"; ?> ';">I</div> <div class="title_letter sink" onclick="window.location = '//<?php echo SITELOCATION; ?> /manage/';">S</div> </div> </div> <div class="container">
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'); }
<!-- Brand and toggle get grouped for better mobile display --> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#elementos-menu"> <span class="sr-only">Navegación</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="<?php echo DIR; ?> "><img height="100%" src="/saman/img/logo.png"></a> </div> <!-- Collect the nav links, forms, and other content for toggling --> <div class="collapse navbar-collapse" id="elementos-menu"> <ul class="nav navbar-nav"> <?php echo $dropdowns; ?> </ul> <ul class="nav navbar-nav navbar-right"> <?php if (null != \helpers\session::get("usuario")) { echo "<li><a href=\"" . DIR . ADMINLOGOUT . "\">Cerrar Sesion</a></li>"; } ?> </ul> </div><!-- /.navbar-collapse --> </div><!-- /.container-fluid --> </nav>
<form method="post" enctype='multipart/form-data'> <div class="row m-15"> <div class="col-sm-12"> <textarea class="form-control" rows="10" type="text" id="faq_description" name="faq_description" placeholder="Описание"><?php echo isset($_POST['faq_description']) ? $_POST['faq_description'] : $data['faq'][0]->faq_text; ?> </textarea> </div> </div> <div class="row"> <div class="col-md-12"> <div class="text-right"> <button type="submit" class="btn btn-primary" name="submit" value="">Сохранить</button> <?php if (\helpers\session::get('url')) { $previous = \helpers\session::get('url'); } else { $previous = 'admin/orders'; } ?> <a href="/<?php echo $previous; ?> " type="button" class="btn btn-default">Закрыть</a> </div> </div> </div> </form> <?php helpers\assets::js(array(helpers\url::template_path() . 'js/tinymce/tinymce.min.js')); ?>