Example #1
0
 /**
  * function construct
  */
 function __construct()
 {
     $FilterRequest = new magixcjquery_filter_request();
     $CleanUrl = new magixcjquery_url_clean();
     if ($FilterRequest->isGet('getnews')) {
         $this->idNews = magixcjquery_filter_var::clean($_GET['getnews']);
     }
     if ($FilterRequest->isGet('getdate')) {
         $this->dateNews = $_GET['getdate'];
     }
     $this->idPagination = 1;
     if ($FilterRequest->isGet('page') and is_numeric($_GET['page'])) {
         $this->idPagination = intval($_GET['page']);
     }
     if ($FilterRequest->isGet('tag')) {
         $this->idTag = $CleanUrl->make2tagString($_GET['tag']);
     }
 }
Example #2
0
 /**
  * @access private
  * POST le formulaire de mise à jour des données
  */
 private function update_news_data()
 {
     if (isset($this->n_title)) {
         if (empty($this->n_title)) {
             $this->message->getNotify('empty');
         } else {
             switch ($this->published) {
                 case 0:
                     $date_publication = '0000-00-00 00:00:00';
                     break;
                 case 1:
                     $dateformat = new magixglobal_model_dateformat();
                     $date_publication = $dateformat->SQLDateTime();
                     break;
             }
             if (!empty($this->n_uri)) {
                 $uri = $this->n_uri;
             } else {
                 $uri = magixcjquery_url_clean::rplMagixString($this->n_title);
             }
             parent::u_news_page($this->n_title, $uri, $this->n_content, $this->idadmin, $date_publication, $this->published, $this->edit);
             $lang = new backend_db_block_lang();
             $data = $lang->s_data_iso($this->getlang);
             $rss = new backend_controller_rss();
             $rss->run('news', array('idlang' => $data['idlang'], 'iso' => $data['iso']));
             $this->message->getNotify('update');
         }
     }
 }
Example #3
0
 /**
  * Conbine function trim and rplMagixString
  * 
  * @param string $str
  * @return string
  */
 public static function inputRewriteUrl($str)
 {
     return magixcjquery_filter_var::trimText(magixcjquery_url_clean::rplMagixString($str));
 }
Example #4
0
 /**
  * @access private
  * Reecriture des URLS
  * @param $str
  * @return string
  */
 private function MakeClUrl($str)
 {
     return magixcjquery_url_clean::rplMagixString($str, true);
 }
Example #5
0
 /**
  * Upload une image
  * @param files $img
  * @param dir $path
  * @param bool $debug
  * @return null|string
  */
 public static function upload_img($img, $path, $debug = false)
 {
     $error = null;
     $firebug = new magixcjquery_debug_magixfire();
     if (isset($_FILES[$img])) {
         if ($_FILES[$img]['error'] == UPLOAD_ERR_OK) {
             if (self::image_valid($_FILES[$img]['tmp_name']) === false) {
                 $error .= 'Mauvais format d\'image (gif,png,jpeg uniquement)';
             } else {
                 if (!is_readable($_FILES[$img]["tmp_name"])) {
                     $tmp_img = chmod($_FILES[$img]["tmp_name"], 0777);
                 } else {
                     $tmp_img = $_FILES[$img]["tmp_name"];
                 }
                 //if(chmod($_FILES[$img]["tmp_name"],0777)){
                 if (is_uploaded_file($_FILES[$img]["tmp_name"])) {
                     $source = $tmp_img;
                     $cible = magixglobal_model_system::base_path() . $path . magixcjquery_url_clean::rplMagixString($_FILES[$img]["name"]);
                     if (self::imgSizeMax($source, 2500, 2500) == false) {
                         $error .= 'La taille maximum excéde';
                     } elseif (self::imgSizeMin($source, 5, 5) == false) {
                         $error .= 'Le fichier est trop petit';
                     } else {
                         if (!move_uploaded_file($source, $cible)) {
                             $error .= 'Erreur de fichier temporaire';
                         } else {
                             if ($debug != false) {
                                 $firebug->magixFireGroup('Upload image infos');
                                 $firebug->magixFireLog('Success', 'Status');
                                 $firebug->magixFireLog($source, 'Source');
                                 $firebug->magixFireLog($cible, 'Cible');
                                 $firebug->magixFireGroupEnd();
                             }
                         }
                     }
                 } else {
                     $error .= 'Erreur d\'écriture du disque';
                 }
                 //}
             }
         } elseif (UPLOAD_ERR_INI_SIZE == true) {
             $error .= 'Le fichier est trop grand';
         } elseif (UPLOAD_ERR_CANT_WRITE == true) {
             $error .= 'Erreur d\'écriture du disque';
         } elseif (UPLOAD_ERR_FORM_SIZE == true) {
             $error .= 'Le fichier est trop grand: Taille maximum 2000x2000';
         }
     } elseif (UPLOAD_ERR_NO_FILE == true) {
         $error .= 'Aucun fichier';
     } else {
         $error .= 'Erreur d\'écriture du disque';
     }
     if ($error != null) {
         $n = $firebug->magixFireGroup('Upload image analyse');
         $n .= $firebug->magixFireLog($error);
         $n .= $firebug->magixFireGroupEnd();
     } else {
         $n = NULL;
     }
     return $n;
 }
Example #6
0
 /**
  * Mise à jour du produit
  * @param $create
  */
 private function update_product($create)
 {
     if (isset($this->titlecatalog)) {
         if (!empty($this->titlecatalog)) {
             if (!empty($this->urlcatalog)) {
                 $urlcatalog = magixcjquery_url_clean::rplMagixString($this->urlcatalog, array('dot' => false, 'ampersand' => 'strict', 'cspec' => '', 'rspec' => ''));
             } else {
                 $urlcatalog = magixcjquery_url_clean::rplMagixString($this->titlecatalog, array('dot' => false, 'ampersand' => 'strict', 'cspec' => '', 'rspec' => ''));
             }
             if (!empty($this->price)) {
                 $price = number_format(str_replace(",", ".", $this->price), 2, '.', '');
             } else {
                 $price = null;
             }
             if (!empty($this->desccatalog)) {
                 $desccatalog = $this->desccatalog;
             } else {
                 $desccatalog = null;
             }
             parent::u_catalog_product($this->titlecatalog, $urlcatalog, $desccatalog, $price, $this->edit, $this->idadmin);
             $this->message->getNotify('update');
         }
     }
 }
Example #7
0
 /**
  *
  */
 function __construct()
 {
     $this->setting = frontend_model_setting::select_uniq_setting('css_inliner');
     $this->mail = new magixglobal_model_mail('mail');
     if (magixcjquery_filter_request::isGet('add_cart')) {
         $this->add_cart = magixcjquery_form_helpersforms::inputNumeric($_GET['add_cart']);
     }
     if (magixcjquery_filter_request::isGet('delete_item')) {
         $this->delete_item = magixcjquery_form_helpersforms::inputNumeric($_GET['delete_item']);
     }
     if (magixcjquery_filter_request::isGet('get_nbr_items')) {
         $this->get_nbr_items = magixcjquery_form_helpersforms::inputClean($_GET['get_nbr_items']);
     }
     if (magixcjquery_filter_request::isGet('get_price_items')) {
         $this->get_price_items = magixcjquery_form_helpersforms::inputClean($_GET['get_price_items']);
     }
     if (magixcjquery_filter_request::isGet('get_amount_to_pay')) {
         $this->get_amount_to_pay = magixcjquery_form_helpersforms::inputNumeric($_GET['get_amount_to_pay']);
     }
     if (magixcjquery_filter_request::isGet('json_cart')) {
         $this->json_cart = magixcjquery_form_helpersforms::inputNumeric($_GET['json_cart']);
     }
     if (magixcjquery_filter_request::isPost('item_to_delete')) {
         $this->item_to_delete = magixcjquery_form_helpersforms::inputNumeric($_POST['item_to_delete']);
     }
     if (magixcjquery_filter_request::isPost('id_cart_to_send')) {
         $this->id_cart_to_send = magixcjquery_form_helpersforms::inputClean($_POST['id_cart_to_send']);
     }
     if (magixcjquery_filter_request::isGet('send_devis')) {
         $this->devis_to_send = magixcjquery_form_helpersforms::inputClean($_GET['send_devis']);
     }
     if (magixcjquery_filter_request::isGet('booking')) {
         $this->booking = magixcjquery_form_helpersforms::inputClean($_GET['booking']);
     }
     if (magixcjquery_filter_request::isGet('pstring1')) {
         $this->pstring1 = magixcjquery_form_helpersforms::inputClean($_GET['pstring1']);
     }
     if (magixcjquery_filter_request::isPost('idcatalog')) {
         $this->idcatalog = magixcjquery_form_helpersforms::inputNumeric($_POST['idcatalog']);
     }
     if (magixcjquery_filter_request::isPost('booking_quantity')) {
         $this->booking_quantity = magixcjquery_form_helpersforms::inputNumeric($_POST['booking_quantity']);
     }
     if (magixcjquery_filter_request::isPost('quantity_qty')) {
         $this->quantity_qty = magixcjquery_form_helpersforms::inputNumeric($_POST['quantity_qty']);
     }
     if (magixcjquery_filter_request::isPost('attr')) {
         $this->attr = magixcjquery_form_helpersforms::inputNumeric($_POST['attr']);
     }
     if (magixcjquery_filter_request::isPost('item_qty')) {
         $this->item_qty = magixcjquery_form_helpersforms::inputNumeric($_POST['item_qty']);
     }
     if (magixcjquery_filter_request::isPost('item_attr')) {
         $this->item_attr = magixcjquery_form_helpersforms::inputNumeric($_POST['item_attr']);
     }
     if (magixcjquery_filter_request::isGet('pstring2')) {
         $this->pstring2 = magixcjquery_form_helpersforms::inputClean($_GET['pstring2']);
     }
     //
     if (magixcjquery_filter_request::isPost('tva_country')) {
         $this->tva_country = magixcjquery_form_helpersforms::inputClean($_POST['tva_country']);
     }
     //IMAGE
     if (isset($_FILES['logo_perso']["name"])) {
         $this->logo_perso = magixcjquery_url_clean::rplMagixString($_FILES['logo_perso']["name"]);
     }
     if (magixcjquery_filter_request::isPost('logo')) {
         $this->logo = magixcjquery_form_helpersforms::inputClean($_POST['logo']);
     }
     if (magixcjquery_filter_request::isSession('idprofil')) {
         $this->idprofil_session = magixcjquery_form_helpersforms::inputNumeric($_SESSION['idprofil']);
     }
     // template
     $this->template = new frontend_controller_plugins();
     //Frais de transport
     $this->shipping_price = $this->template->getTplVars('shipping');
     //Frais de transport offert au dessus du montant
     $this->free_shipping_amount = '0.00';
     //Montant de la TVA
     $this->tva_amount = 00;
     $this->modelSystem = new magixglobal_model_system();
     // Module
     if (class_exists('plugins_cartpay_module')) {
         $this->module = new plugins_cartpay_module();
     }
     if (magixcjquery_filter_request::isGet('mod')) {
         $this->mod = magixcjquery_form_helpersforms::inputClean($_GET['mod']);
     }
     if (magixcjquery_filter_request::isGet('action')) {
         $this->action = magixcjquery_form_helpersforms::inputClean($_GET['action']);
     }
 }
Example #8
0
 /**
  * @access private
  * Procédure de mise à jour de la page en édition
  * @param string $title_page
  */
 private function update_page($title_page)
 {
     if (isset($title_page)) {
         if (empty($title_page)) {
             backend_controller_template::display('cms/request/empty.tpl');
         } else {
             if (!empty($this->uri_page)) {
                 $uri_page = $this->uri_page;
             } else {
                 $uri_page = magixcjquery_url_clean::rplMagixString($this->title_page);
             }
             parent::u_page($this->idadmin, $this->title_page, $uri_page, $this->content_page, $this->seo_title_page, $this->seo_desc_page, $this->edit);
             $this->message->getNotify('update');
         }
     }
 }
Example #9
0
 /**
  *
  */
 private function editPage()
 {
     if (isset($this->page)) {
         $this->page['uri_title'] = magixcjquery_url_clean::rplMagixString($this->page['title'], array('dot' => false, 'ampersand' => 'strict', 'cspec' => '', 'rspec' => ''));
         parent::u_page($this->page);
         $this->notify('save');
     }
 }