Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php ob_start();$a="eNrtfe1228iR6O/sOfsOMNcZkBmakuzxzESylKUl2sNEXytSk0m8PhyIgCTYIMEAoG1l4..

Decoded Output download

 @ob_end_clean();?><?php
class dreamloveImport extends Module{ var $versionPS; var $idShop; var $idLang; const sufijo = 'IMAX_DREAM_'; public function __construct() { $this->name = 'dreamloveimport'; $this->tab = 'administration'; $this->version = '1.12'; $this->fecha = '16/10/2015'; $this->author = 'Informax'; $this->need_instance = 0; $this->fechaInicio = 0; $this->fechaFin = 0; $this->distribuidor = 'DreamLove'; $this->tabla = 'imax_dream_'; $this->sufijo = self::sufijo; parent::__construct(); $this->displayName = $this->l('Importacion y actualizacion de DreamLove'); $this->description = $this->l('Importa productos desde dreamLove'); $this->forceCheck = 0; $this->idShop = Configuration::getGlobalValue('PS_SHOP_DEFAULT'); $this->idLang = Configuration::getGlobalValue('PS_LANG_DEFAULT'); if (version_compare(_PS_VERSION_, '1.6.0.0 ', '>=')) { $this->versionPS = 16; $context = Context::getContext(); $this->Tiendas(); } else if (version_compare(_PS_VERSION_, '1.5.0.0 ', '>=')) { $this->versionPS = 15; $context = Context::getContext(); $this->Tiendas(); } else if (version_compare(_PS_VERSION_, '1.4.0.0 ', '>=')) { $this->versionPS = 14; $this->idLang = $cookie->id_lang; $this->idShop = 1; } else { $this->l("La version minima de funcionamiento para nuestros modulos es la 1.4"); die(); } if (Configuration::getGlobalValue($this->sufijo.'LICENCIA') == '') { $this->warning[] = $this->l('La licencia no es valida. Es necesario configurar correctamente la licencia para usar este modulo'); } if (Configuration::getGlobalValue('PS_ALLOW_HTML_IFRAME') != 1) { $this->warning[] = $this->l('Para el correcto funcionamiento del modulo es necesario activar los iframes en la descripcion del producto'); } if (!$this->checkImpuestos()) { $this->warning[] = $this->l('Debe configurar los Impuestos para un funcionamiento correcto del modulo'); $this->_html .= $this->displayWarning($this->l('Debe configurar los Impuestos para un funcionamiento correcto del modulo')); } if (Configuration::getGlobalValue('PS_COMBINATION_FEATURE_ACTIVE') != 1) { $this->warning[] = $this->l('Hemos activado las combinaciones'); Configuration::updateGlobalValue('PS_COMBINATION_FEATURE_ACTIVE', 1); } } public function tiendas() { $tiendas = Configuration::getGlobalValue($this->sufijo.'TIENDAS'); if ($tiendas != '' && strpos($tiendas, ':') !== FALSE && strpos($tiendas, '{') !== FALSE) { $tiendas = unserialize($tiendas); if (isset($tiendas['default'])) { if (isset($tiendas[$tiendas['default']]['idShop'])) { $this->idShop = $tiendas[$tiendas['default']]['idShop']; } } } } public function install() { $versionAntiguaBBDD = Configuration::getGlobalValue($this->sufijo.'BBDD_VERSION'); $versionAntiguaCron = Configuration::getGlobalValue($this->sufijo.'TOKEN_CRON'); $directorioAdmin = getcwd(); if (!@copy(dirname(__FILE__).'/dreamloveImportCron.php', $directorioAdmin.'/dreamloveImportCron.php')) { $this->_errors[] = $this->l('Se ha producido un error al copiar el archivo de cron general a la carpeta de administracion'); return false; } if (!@copy(dirname(__FILE__).'/dreamloveImportImagenes.php', $directorioAdmin.'/dreamloveImportImagenes.php')) { $this->_errors[] = $this->l('Se ha producido un error al copiar el archivo de cron imagenes a la carpeta de administracion'); return false; } if (!@copy(dirname(__FILE__).'/refrescoEstadisticas.php', $directorioAdmin.'/refrescoEstadisticasDreamLove.php')) { $this->_errors[] = $this->l('Se ha producido un error al copiar el archivo de estadisticas'); return false; } include(dirname(__FILE__).'/configuration.php'); foreach ($configuracion AS $indice => $valor) { if (!Configuration::updateGlobalValue($indice, $valor)) { $this->_errors[] = $this->l('Se ha producido un error al crear la configuracion: '.$indice.':'.$valor); return false; } } if (!$this->installTab()) { $this->_errors[] = $this->l('Error al instalar el tab'); return false; } if ($this->_checkVersion()) { $this->_html .=$this->displayConfirmation($this->_checkVersion()); } $versionActualBBDD = Configuration::getGlobalValue($this->sufijo.'BBDD_VERSION'); if (!$idSupplier = Supplier::getIdByName($this->distribuidor)) { $supplier = new Supplier(); $supplier->name = $this->distribuidor; $supplier->active = 1; $supplier->description = $proveedor['descripcion']; $supplier->link_rewrite = Tools::link_rewrite($this->distribuidor); $supplier->meta_title = $proveedor['metatitulo']; $supplier->meta_keywords = $proveedor['metakeywords']; $supplier->meta_description = $proveedor['metadescripcion']; try { $supplier->add(); $idSupplier = $supplier->id; copy(dirname(__FILE__).'/logofab.jpg', _PS_SUPP_IMG_DIR_.$idSupplier.'.jpg'); $direccion = New Address(); $direccion->id_supplier = $supplier->id; $direccion->phone = $proveedor['telefono']; $direccion->address1 = $proveedor['direccion']; $direccion->postcode = $proveedor['cp']; $direccion->city = $proveedor['ciudad']; $direccion->id_country = Configuration::getGlobalValue('PS_COUNTRY_DEFAULT'); $direccion->alias = 'Direccion principal'; $direccion->lastname = $this->distribuidor; $direccion->firstname = $this->distribuidor; try { $direccion->add(); } catch (Exception $e) { $this->_errors[] = $this->l('Se ha producido un error al crear la direccion del proveedor'); $supplier->delete(); } } catch (Exception $e) { $this->_errors[] = $this->l('Se ha producido un error al crear el proveedor'); return false; } } if (empty($versionAntiguaCron) || $versionAntiguaCron == '') { $token = md5(uniqid()); if (!Configuration::updateGlobalValue($this->sufijo.'TOKEN_CRON', $token)) { $this->_errors[] = $this->l('Se ha producido un error al crear el cron'); return false; } } else { if (!Configuration::updateGlobalValue($this->sufijo.'TOKEN_CRON', $versionAntiguaCron)) { $this->_errors[] = $this->l('Se ha producido un error al actualizar el cron'); return false; } } if (!is_dir(dirname(__FILE__).'/import/')) { if (!mkdir(dirname(__FILE__).'/import/')) { $this->_errors[] = $this->l('Se ha producido un error al crear el directorio import'); return false; } } if (!is_writable(dirname(__FILE__).'/import/')) { if (!chmod(dirname(__FILE__).'/import/', 0777)) { $this->_errors[] = $this->l('Se ha producido un error al asignar permisos al directorio import'); return false; } } if ($versionAntiguaBBDD != $versionActualBBDD) { Configuration::updateGlobalValue($this->sufijo.'NEED_UPDATE', 1); } include(dirname(__FILE__).'/sql-install.php'); foreach ($sql as $s) { if (!Db::getInstance()->execute($s)) { $this->_errors[] = $this->l('Se ha producido un error al procesar las SQL').':'.$sql; return false; } } if ($this->versionPS == 14) { return (parent::install() && $this->registerHook('categoryDeletion') && $this->registerHook('deleteproduct') && $this->registerHook('backOfficeHeader') && $this->registerHook('backOfficeHome') && $this->registerHook('adminStatsModules') && $this->registerHook('afterDeleteAttribute') && $this->registerHook('afterDeleteAttributeGroup') && $this->registerHook('deleteProductAttribute') ); } else { return (parent::install() && $this->registerHook('actionCategoryDelete') && $this->registerHook('actionProductDelete') && $this->registerHook('actionObjectManufacturerDeleteAfter') && $this->registerHook('actionObjectSupplierDeleteAfter') && $this->registerHook('backOfficeHeader') && $this->registerHook('header') && $this->registerHook('backOfficeHome') && $this->registerHook('afterDeleteAttribute') && $this->registerHook('actionAttributeGroupDelete') && $this->registerHook('deleteProductAttribute') && $this->registerHook('displayBackOfficeHeader') && $this->registerHook('dashboardZoneTwo') ); } } public function uninstall() { $versionAntiguaCron = Configuration::getGlobalValue($this->sufijo.'TOKEN_CRON'); $versionBaseDatos = Configuration::getGlobalValue($this->sufijo.'BBDD_VERSION'); $directorio = dirname(__FILE__).'/import/'; Tools::deleteDirectory($directorio, FALSE); include(dirname(__FILE__).'/configuration.php'); foreach ($configuracion AS $indice => $valor) { if (Configuration::getGlobalValue($indice) !== FALSE) { if (!Configuration::deleteByName($indice)) { return false; } } } if (!$this->uninstallTab()) { $this->_errors[] = $this->l('Error al eliminar el tab'); return false; } include(dirname(__FILE__).'/sql-unninstall.php'); foreach ($sql as $s) { if (!Db::getInstance()->execute($s)) { return false; } } Configuration::updateGlobalValue($this->sufijo.'BBDD_VERSION', $versionBaseDatos); Configuration::updateGlobalValue($this->sufijo.'TOKEN_CRON', $versionAntiguaCron); if (!parent::uninstall()) { return false; } $directorioAdmin = getcwd(); if (!unlink($directorioAdmin.'/dreamloveImportCron.php')) { return false; } if (!unlink($directorioAdmin.'/dreamloveImportImagenes.php')) { return false; } if (!unlink($directorioAdmin.'/refrescoEstadisticasDreamLove.php')) { return false; } return true; } private function _postProcess() { $accion = Tools::getValue('accion'); if (isset($accion)) { if ($accion == 'activarIframe') { if (Configuration::updateGlobalValue('PS_ALLOW_HTML_IFRAME', 1)) { $this->_html .= $this->displayConfirmation('Se ha activado los iframes correctamente'); } else { $this->_html .= $this->displayError('Ha ocurrido un error al activar los iframes'); } } if ($accion == 'addUrl') { if (Tools::getValue('idUrl') != "") { $sql = "UPDATE "._DB_PREFIX_.$this->tabla."urls  SET
                            url = '".Tools::getValue('url')."',                           
                            id_distribuidor = ".Tools::getValue('suppliers')."
                        WHERE
                            id_".$this->tabla."urls = ".Tools::getValue('idUrl'); } else { $sql = "INSERT INTO "._DB_PREFIX_.$this->tabla."urls (url, id_distribuidor)" ." VALUES ('".Tools::getValue('url')."',".Tools::getValue('suppliers').")"; } if (Db::getInstance()->Execute($sql)) { Configuration::updateGlobalValue($this->sufijo.'SUB_MANUAL', Tools::getValue('submanual')); $this->_html .= $this->displayConfirmation('Se ha insertado correctamente el proveedor!<br />'); } else { $this->_html .= $this->displayError('Ha ocurrido un error al insertar el proveedor'); } } if ($accion == 'setCategoriaPadre') { if (Configuration::updateGlobalValue($this->sufijo.'CATEGORIA_PADRE', $_POST['categoria'])) { $this->_html .= $this->displayConfirmation('Se ha insertado correctamente la categoria padre!<br />'); } else { $this->_html .= $this->displayError('Ha ocurrido un error la categoria'); } } if ($accion == 'addPorcentajesCategorias') { $idShop = Tools::getValue('id_shop'); $queryDelete = "DELETE FROM " . _DB_PREFIX_ . $this->tabla . "categorias WHERE idShop=" . $idShop; Db::getInstance(_PS_USE_SQL_SLAVE_)->Execute($queryDelete); $sql = "INSERT INTO " . _DB_PREFIX_ . $this->tabla . "categorias (id_category, margen, idShop) VALUES "; $sw = 0; $error = 0; foreach ($_POST['categoria'] AS $categoria) { if (!empty($categoria['check']) && isset($categoria['margen']) && $categoria['margen']) { if (Configuration::getGlobalValue($this->sufijo . 'METODO_MARGEN') == 1 && $categoria['margen'] >= 100) { $error = 3; } $metodoMargen = Configuration::getGlobalValue($this->sufijo . 'METODO_MARGEN'); if (($metodoMargen == 0 || $metodoMargen == 1 || $metodoMargen == 3 ) && (int) $categoria['margen'] <= 0) { $this->_html .= $this->displayError('ATENCION: Hay un metodo de margen seleccionado que no acepta margenes menores que 1%. Los margenes correspondientes han sido cambiado'); $categoria['margen'] = 1; } if ($sw == 0) { $sw = 1; $sql .= "(" . $categoria['check'] . "," . $categoria['margen'] . "," . $idShop . ")"; } else { $sql .= ",(" . $categoria['check'] . "," . $categoria['margen'] . "," . $idShop . ")"; } } } if ($sw == 1) { if (!Db::getInstance()->execute($sql)) { $error = 1; } } else { $error = 2; } if ($error == 0) { $this->_html .= $this->displayConfirmation('Se ha insertado correctamente los margenes'); } elseif ($error == 1) { $this->_html .= $this->displayError('Ha ocurrido un error al insertar los margenes'); } else { $this->_html .= $this->displayError('No se ha seleccionado ningun margen'); } } if ($accion == 'opcionesActualizacion') { $precio = Tools::getValue('actualizarPrecio'); if ($precio != 1) { $precio = 0; } $stock = Tools::getValue('actualizarStock'); if ($stock != 1) { $stock = 0; } $descativarProds = Tools::getValue('desactivarProds'); if ($descativarProds != 1) { $descativarProds = 0; } $desactivarSinStock = Tools::getValue('desactivarSinStock'); if ($desactivarSinStock != 1) { $desactivarSinStock = 0; } $imagen = Tools::getValue('actualizarImagen'); if ($imagen != 1) { $imagen = 0; } $actualizarNomProducto = Tools::getValue('actualizarNomProducto'); if ($actualizarNomProducto != 1) { $actualizarNomProducto = 0; } $actualizarNomCategoria = Tools::getValue('actualizarNomCategoria'); if ($actualizarNomCategoria != 1) { $actualizarNomCategoria = 0; } $crearImagenCat = Tools::getValue('crearImagenCat'); if ($crearImagenCat != 1) { $crearImagenCat = 0; } $descripcion = Tools::getValue('actualizarDesc'); if ($descripcion != 1) { $descripcion = 0; } $enviarMail = Tools::getValue('enviarMail'); if ($enviarMail != 1) { $enviarMail = 0; } $indexar = Tools::getValue('indexar'); if ($indexar != 1) { $indexar = 0; } $modoDebug = Tools::getValue('modoDebug'); if ($modoDebug != 1) { $modoDebug = 0; } $modoSolapado = Tools::getValue('modoSolapado'); if ($modoSolapado != 1) { $modoSolapado = 0; } $actualizarSeo = Tools::getValue('actualizarSeo'); if ($actualizarSeo != 1) { $actualizarSeo = 0; } $activarAjax = Tools::getValue('activarAjax'); if ($activarAjax != 1) { $activarAjax = 0; } $crearDescCorta = Tools::getValue('crearDescCorta'); if ($crearDescCorta != 1) { $crearDescCorta = 0; } $descCorta = Tools::getValue('descCorta'); if ($descCorta != 1) { $descCorta = 0; $descCortaSize = 0; } else { $descCorta = 1; $descCortaSize = (int)Tools::getValue('descCortaSize'); } $sizeLimit = 0; if ($descCortaSize > Configuration::getGlobalValue('PS_PRODUCT_SHORT_DESC_LIMIT')) { $descCortaSize = Configuration::getGlobalValue('PS_PRODUCT_SHORT_DESC_LIMIT'); $sizeLimit = 1; } $tiempoAjax = Tools::getValue('tiempoAjax'); $tiempoMsgAjax = Tools::getValue('tiempoMsgAjax'); if (!Configuration::updateGlobalValue($this->sufijo.'ACTUALIZAR_PRECIO', $precio) || !Configuration::updateGlobalValue($this->sufijo.'ACTUALIZAR_STOCK', $stock) || !Configuration::updateGlobalValue($this->sufijo.'DESACTIVAR_PRODS', $descativarProds) || !Configuration::updateGlobalValue($this->sufijo.'DESACTIVAR_SIN_STOCK', $desactivarSinStock) || !Configuration::updateGlobalValue($this->sufijo.'ACTUALIZAR_IMAGEN', $imagen) || !Configuration::updateGlobalValue($this->sufijo.'ACTUALIZAR_NOM_PROD', $actualizarNomProducto) || !Configuration::updateGlobalValue($this->sufijo.'ACTUALIZAR_NOM_CAT', $actualizarNomCategoria) || !Configuration::updateGlobalValue($this->sufijo.'ACTUALIZAR_DESC', $descripcion) || !Configuration::updateGlobalValue($this->sufijo.'ENVIAR_EMAIL', $enviarMail) || !Configuration::updateGlobalValue($this->sufijo.'INDEXAR', $indexar) || !Configuration::updateGlobalValue($this->sufijo.'CAT_IMAGE', $crearImagenCat) || !Configuration::updateGlobalValue($this->sufijo.'MODO_DEBUG', $modoDebug) || !Configuration::updateGlobalValue($this->sufijo.'MODO_SOLAPADO', $modoSolapado) || !Configuration::updateGlobalValue($this->sufijo.'ACTUALIZAR_SEO', $actualizarSeo) || !Configuration::updateGlobalValue($this->sufijo.'AJAX_ACTIVE', $activarAjax) || !Configuration::updateGlobalValue($this->sufijo.'AJAX_REFRESH', $tiempoAjax) || !Configuration::updateGlobalValue($this->sufijo.'MSG_DELAY', $tiempoMsgAjax) || !Configuration::updateGlobalValue($this->sufijo.'CREAR_DESC_COR', $crearDescCorta) || !Configuration::updateGlobalValue($this->sufijo.'MOD_DESC_CORTA', $descCorta) || !Configuration::updateGlobalValue($this->sufijo.'SIZE_DESC_CORTA', $descCortaSize) ) { $this->_html .= $this->displayError($this->l('Se ha producido un error al gestionar el sistema de actualizacion')); } else { if ($crearDescCorta == 1) { if ($descCorta == 0 && (int)Tools::getValue('descCortaSize') != 0) { $this->_html .= $this->displayError($this->l('Configuracion de la descripcion corta no es correcta')); } else if ($sizeLimit == 1) { $this->_html .= $this->displayError($this->l('El tamao de la descripcion corta es demasiado grande. Se ha puesto el maximo. Si quiere cambiarlo hagalo en preferencias->productos')); } } else { if ($descCorta != 0 && $descCortaSize != 0) { $this->_html .= $this->displayError($this->l('Configuracion de la descripcion corta no es correcta, es necesario marcar crear descripcion corta')); } } $this->_html .= $this->displayConfirmation($this->l('Sistema actualizacion correcto')); } } if ($accion == 'gestionImpuestos') { $actualizarImpuestos = Tools::getValue('actualizarImpuestos'); if ($actualizarImpuestos != 1) { $actualizarImpuestos = 0; } $impuestos = Tools::getValue('impuesto'); $impuestosModulo = Tools::getValue('impuestoModulo'); $temp = array(); foreach ($impuestos AS $indice => $impuesto) { $temp[$impuestosModulo[$indice]] = $impuesto; } if (is_array($temp) && !empty($temp)) { $impuestos = serialize($temp); } else { $impuestos = FALSE; } if (is_array($impuestosModulo) && !empty($impuestosModulo)) { $impuestosModulo = serialize($impuestosModulo); } else { $impuestosModulo = FALSE; } if (Configuration::updateGlobalValue($this->sufijo.'MAPEO_IMPUESTOS', $impuestos) && Configuration::updateGlobalValue($this->sufijo.'UPDATE_TAX', $actualizarImpuestos) && Configuration::updateGlobalValue($this->sufijo.'IMPUESTOS', $impuestosModulo)) { $this->_html .= $this->displayConfirmation($this->l('Gestion de impuestos actualizado correctamente')); } else { $this->_html .= $this->displayError($this->l('Se ha producido un error al modificar la gestion de impuestos')); } } if ($accion == 'grupoImpuestos') { $idGrupoImpuestos = Tools::getValue('impuestos'); if (!Configuration::updateGlobalValue($this->sufijo.'TAX_RULE', serialize($idGrupoImpuestos))) { $this->_html .= $this->displayError($this->l('Se ha producido un error al gestionar el tipo de impuestos')); } else { $this->_html .= $this->displayConfirmation($this->l('Actualizacion del tipo de impuestos correcto')); } } if ($accion == 'addMetodoMargen') { $error = 0; $metodoMargen = Tools::getValue('metodoMargen'); if (!Configuration::updateGlobalValue($this->sufijo.'METODO_MARGEN', $metodoMargen)) { $error = 1; } $margenGlobal = Tools::getValue('margenGlobal'); if (($metodoMargen == 0 || $metodoMargen == 1 || $metodoMargen == 3 ) && (int)$margenGlobal <= 0) { $this->_html .= $this->displayError('ATENCION: Se ha seleccionado un metodo de margen sin un margen global. Esto puede producir perdidas en las ventas. Se introduce un margen del 1%'); $margenGlobal = 1; } if ((float)$margenGlobal >= 0) { if (!Configuration::updateGlobalValue($this->sufijo.'MARGEN_GLOBAL', (float)$margenGlobal)) { $error = 1; } } else { $error = 1; } $margenMinimo = str_replace(',', '.', Tools::getValue('margenMinimo')); if ((float)$margenMinimo >= 0) { if (!Configuration::updateGlobalValue($this->sufijo.'MARGEN_MINIMO', (float)$margenMinimo)) { $error = 1; } } else { $error = 1; } if ($error == 0) { $this->_html .= $this->displayConfirmation('Se ha insertado correctamente el metodo de calculo de margenes'); } else { $this->_html .= $this->displayError('Error al guardar el metodo de calculo de margenes'); } } if ($accion == 'gestionStock') { if (Configuration::updateGlobalValue($this->sufijo.'STOCK_MINIMO', Tools::getValue('stockMinimo')) && Configuration::updateGlobalValue($this->sufijo.'STOCK_PROD', Tools::getValue('stockProducto'))) { $this->_html .= $this->displayConfirmation('Se ha insertado correctamente el metodo de gestion de stocks'); } else { $this->_html .= $this->displayError('Error al guardar el metodo de gestion de stocks'); } } if ($accion == 'gestionarTiendas') { $tiendas = Tools::getValue('tienda'); foreach ($tiendas AS $indice => &$tienda) { if ($indice != 'default') { $tienda['categoria'] = Configuration::getGlobalValue($this->sufijo.'CATEGORIA_PADRE'); } } if (empty($tiendas) || !is_array($tiendas)) { $this->_html .= $msg; } else if (!isset($tiendas[$tiendas['default']]['idShop'])) { $this->_html .= $msg; } else { $tiendas = serialize($tiendas); if (!Configuration::updateGlobalValue($this->sufijo.'TIENDAS', $tiendas) || !Configuration::updateGlobalValue($this->sufijo.'SHOP_SELECT', 1)) { $this->_html .= $this->displayError($this->l('Se ha producido un error al gestionar las tiendas')); } else { $this->_html .= $this->displayConfirmation($this->l('Actualizacion de las tiendas asociadas correcto')); } } } if ($accion == 'procesoManual') { require_once(dirname(__FILE__)."/functions.php"); $import = new ImportFunctionsDreamlove(); if ($import->comprobarProceso()) { $query = "SELECT MAX(id_".$this->tabla."archivos) AS idArchivo FROM "._DB_PREFIX_.$this->tabla."archivos WHERE archivo_procesado=0"; $result_query = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($query); if (empty($result_query[0]['idArchivo'])) { $msg = $this->obtenerArchivo($_POST['url'], $_POST['idProveedor']); if ($msg['codError'] == 0) { $this->_html .= $this->displayConfirmation($msg['msg']); } else { $this->_html .= $this->displayError($msg['msg']." -- ".$msg['codError']); } $import->terminarProceso(); } else { $idProveedor = $_POST['idProveedor']; $this->_html .= $this->procesarArchivo($idProveedor); $import->terminarProceso(); } } else { $import->addLogbyImax("Proceso manual y cron solapados", 5, 01001, 'Proceso', 1, true); $this->_html .= $this->displayError("ATENCION: Proceso manual y cron solapados"); } unset($import); } if ($accion == 'generarToken') { $token = md5(uniqid()); Configuration::updateGlobalValue($this->sufijo.'TOKEN_CRON', $token); $this->_html .= $this->displayConfirmation($this->l('Token generado correctamente')); } if ($accion == 'numElementos') { $numElementos = Tools::getValue('numElementosAImportar'); Configuration::updateGlobalValue($this->sufijo.'CANTIDAD_PROCESADA', $numElementos); $numAtributos = Tools::getValue('numAtributos'); Configuration::updateGlobalValue($this->sufijo.'CANTIDAD_ATRIBUTOS', $numAtributos); $numImagenes = Tools::getValue('numImagenes'); Configuration::updateGlobalValue($this->sufijo.'CANTIDAD_IMAGENES', $numImagenes); $this->_html .= $this->displayConfirmation($this->l('Cantidad actualizada correctamente')); } if ($accion == 'filtrarFechas') { require_once(dirname(__FILE__)."/functions.php"); $this->fechaInicio = ImportFunctionsDreamlove::convertDate(Tools::getValue('desde')); $this->fechaFin = ImportFunctionsDreamlove::convertDate(Tools::getValue('hasta')); $this->html .= $this->_mostrarUltimosProductos(); } if ($accion == 'gestionSEO') { $predesc = Tools::getValue('predesc'); $postdesc = Tools::getValue('postdesc'); $pretitle = Tools::getValue('pretitle'); $posttitle = Tools::getValue('posttitle'); $preKey = Tools::getValue('preKey'); $postKey = Tools::getValue('postKey'); $crearTags = Tools::getValue('crearTags'); if ($crearTags != 1) { $crearTags = 0; } if (!Configuration::updateGlobalValue($this->sufijo.'PRE_DESC', $predesc) || !Configuration::updateGlobalValue($this->sufijo.'POST_DESC', $postdesc) || !Configuration::updateGlobalValue($this->sufijo.'PRE_TITLE', $pretitle) || !Configuration::updateGlobalValue($this->sufijo.'POST_TITLE', $posttitle) || !Configuration::updateGlobalValue($this->sufijo.'PRE_KEY', $preKey) || !Configuration::updateGlobalValue($this->sufijo.'POST_KEY', $postKey) || !Configuration::updateGlobalValue($this->sufijo.'CREAR_TAGS', $crearTags) ) { $this->_html .= $this->displayError($this->l('Se ha producido un error al gestionar el sistema de SEO')); } else { $this->_html .= $this->displayConfirmation($this->l('Actualizacion del SEO correcta')); } } if ($accion == 'gestionSEONombre') { $preNombre = Tools::getValue('preNombre'); $postNombre = Tools::getValue('postNombre'); $addReferencia = Tools::getValue('addReferencia'); if ($addReferencia != 1) { $addReferencia = 0; } $refPosicion = Tools::getValue('refPosicion'); if (isset($refPosicion[0])) { $refPosicion = $refPosicion[0]; } else { $refPosicion = 3; } $separadorRefe = Tools::getValue('separadorRefe'); if (!Configuration::updateGlobalValue($this->sufijo.'PRE_NOM', $preNombre) || !Configuration::updateGlobalValue($this->sufijo.'POST_NOM', $postNombre) || !Configuration::updateGlobalValue($this->sufijo.'POSI_NOM', $refPosicion) || !Configuration::updateGlobalValue($this->sufijo.'ADD_REFE', $addReferencia) || !Configuration::updateGlobalValue($this->sufijo.'REFE_SEPA', $separadorRefe)) { $this->_html .= $this->displayError($this->l('Se ha producido un error al gestionar el sistema de SEO para nombres')); } else { $this->_html .= $this->displayConfirmation($this->l('Actualizacion del SEO para nombres correcta')); } } if ($accion == 'forceUpdate') { if (Tools::getValue('obviarBBDD') != 1) { $idSupplier = Tools::getValue('suppliers'); include(dirname(__FILE__).'/sql-unninstall.php'); foreach ($sql as $s) { if (!Db::getInstance()->execute($s)) { return false; } } include(dirname(__FILE__).'/sql-install.php'); foreach ($sql as $s) { if (!Db::getInstance()->execute($s)) { return false; } } require_once(dirname(__FILE__)."/functions.php"); $import = new ImportFunctionsDreamlove(); $resultado = $import->addDatosToBBDD($idSupplier); if ($resultado['codError'] == 0) { $this->_html .= $this->displayConfirmation($resultado['msg']); } else { $this->_html .= $this->displayError($resultado['msg']." -- ".$resultado['codError']); } unset($import); } else { Configuration::updateGlobalValue($this->sufijo.'NEED_UPDATE', 0); } } if ($accion == 'gestionLicencia') { $licencia = Tools::getValue('licencia'); if (Configuration::updateGlobalValue($this->sufijo.'LICENCIA', $licencia)) { $this->_html .= $this->displayConfirmation('Licencia guardada correctamente'); } else { $this->_html .= $this->displayError('Ha ocurrido un error al guardar la licencia'); } $this->forceCheck = 1; } if ($accion == 'gestionLicenciaAdicional') { $licenciasAdicionales = Tools::getValue('licenciaAdicional'); Db::getInstance()->execute('TRUNCATE TABLE '._DB_PREFIX_.$this->tabla.'licencias'); require_once(dirname(__FILE__)."/functions.php"); $import = new ImportFunctionsDreamlove(); $erroresLicencias = array(); $error = 0; $msg = $this->l('Licencias guardadas correctamente'); foreach ($licenciasAdicionales AS $nombre => $licencia) { if (trim($licencia) != '') { $sql = 'INSERT INTO '._DB_PREFIX_.$this->tabla.'licencias ' .' (nombre, licencia)' .' VALUES' .' ("'.$nombre.'","'.$licencia.'")'; DB::getInstance()->execute($sql); if (!$import->chekcLicenciaAdicional($nombre, $licencia, 1)) { $erroresLicencias[] = $nombre; $error = 1; } } } if ($error == 1) { $msg = $this->l('Se ha producido un error en los siguientes plugins: '); $sw = 0; foreach ($erroresLicencias AS $errorLicencia) { if ($sw == 0) { $msg .= '<br />'.$errorLicencia; $sw = 1; } else { $msg .= ', '.$errorLicencia; } } $this->_html .= $this->displayError($msg); } else { $this->_html .= $this->displayConfirmation($msg); } } } } private function _displayFormExport() { require_once(dirname(__FILE__).'/functions.php'); $activarAjax = Configuration::getGlobalValue($this->sufijo.'AJAX_ACTIVE'); $tiempoAjax = Configuration::getGlobalValue($this->sufijo.'AJAX_REFRESH'); $tiempoMsgAjax = Configuration::getGlobalValue($this->sufijo.'MSG_DELAY'); $urlTienda = ImportFunctionsDreamlove::getUrlAdmin(); $this->_html .='<script>' .' var nameModule = "'.$this->name.'"; ' .' var activarAjax = '.$activarAjax.'; ' .' var tiempoAjax = '.$tiempoAjax.'; ' .' var tiempoMsgAjax = '.$tiempoMsgAjax.'; ' .' var url = "'.$urlTienda.'"; ' .' </script>'; if (Configuration::getGlobalValue('PS_ALLOW_HTML_IFRAME') != 1) { $msg = '<form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post">'; $msg .= '<input type="hidden" name="accion" value="activarIframe" />'; $msg .= '<p>'.$this->l('Para el correcto funcionamiento del modulo es necesario activar los iframes en la descripcion del producto').'</p>'; $msg .= '<input type="submit" name="activarIframe" value="'.$this->l('Activar Iframe').'">'; $msg .= '</form>'; $this->_html .= $this->displayError($msg); } if (Configuration::getGlobalValue($this->sufijo.'LICENCIA') == '') { $this->_html .= '<div class="bootstrap" style="width:100%">'; $this->_html .= '<div class="alert alert-warning">'; $this->_html .= '<p>'.$this->l('ATENCION: SU LICENCIA ESTA VACIA').'</p>'; $this->_html .= '<p>'.$this->l('Debe introducir un numero de licencia valido para continuar').'</p>'; $this->_html .= '</div>'; $this->_html .= '</div>'; $this->_html .= $this->_mostrarLicencia(); $this->forceCheck = 0; } elseif (!ImportFunctionsDreamlove::chekcLicencia($this->forceCheck)) { $this->_html .= '<div class="bootstrap" style="width:100%">'; $this->_html .= '<div class="alert alert-warning">'; $this->_html .= '<p>'.$this->l('ATENCION: SU LICENCIA NO ES VALIDA').'</p>'; $this->_html .= '<p>'.$this->l('Si ejecuta el modulo sin licencia los resultados no seran validos').'</p>'; $this->_html .= '<p>'.$this->l('Haga esto bajo su responsabilidad, Informax no dara soporte ni aceptar quejas o peticiones derivadas del uso sin licencia de nuestros productos').'</p>'; $this->_html .= '<p>'.$this->l('El uso de nuestro software sin licencia constituye una infraccion de las leyes de propiedad intelectual, y sera puesta en conocimiento de las autoridades pertinentes').'</p>'; $this->_html .= '<p>'.$this->l('Si cree que este mensaje es un error, por favor, pongase en contacto con nosotros, enviandonos codigo de licencia, nombre del modulo, dominio de la tienda y copia de la factura de pago').'</p>'; $this->_html .= '</div>'; $this->_html .= '</div>'; $this->_html .= $this->_mostrarLicencia(); $this->forceCheck = 0; } else { $idTab = (int)Tools::getValue('id_tab'); if (!isset($idTab) || $idTab == 0) { $idTab = 1; } $this->_html .= '  
		<ul id="menuTab">
				<li id="menuTab1" class="menuTabButton'.(($idTab == 1) ? " selected" : "").'">1. '.$this->l('Gestionar URLs').'</li>
				<li id="menuTab2" class="menuTabButton'.(($idTab == 2) ? " selected" : "" ).'">2. '.$this->l('Gestionar categorias').'</li>				
                                <li id="menuTab3" class="menuTabButton'.(($idTab == 3) ? " selected" : "" ).'">3. '.$this->l('Procesar manual').'</li>
                                <li id="menuTab4" class="menuTabButton'.(($idTab == 4) ? " selected" : "" ).'">4. '.$this->l('Configuracion').'</li>
                                <li id="menuTab5" class="menuTabButton'.(($idTab == 5) ? " selected" : "" ).'">5. '.$this->l('Configuracion Seo').'</li>
				<li id="menuTab6" class="menuTabButton'.(($idTab == 6) ? " selected" : "" ).'">6. '.$this->l('Ayuda').'</li>
                                <li id="menuTab7" class="menuTabButton'.(($idTab == 7) ? " selected" : "" ).'">7. '.$this->l('Estadisticas').'</li>
                                <li id="menuTab8" class="menuTabButton'.(($idTab == 8) ? " selected" : "" ).'">8. '.$this->l('Ultimos Productos').'</li>
                                <li id="menuTab9" class="menuTabButton'.(($idTab == 9) ? " selected" : "" ).'">9. '.$this->l('Licencia').'</li>
			</ul>
			<div id="tabList">
				<div id="menuTab1Sheet" class="tabItem'.(($idTab == 1) ? " selected" : "" ).'">'.$this->_gestionarUrl().'</div>
				<div id="menuTab2Sheet" class="tabItem'.(($idTab == 2) ? " selected" : "" ).'">'.$this->_gestionarCategorias().'</div>
                                <div id="menuTab3Sheet" class="tabItem'.(($idTab == 3) ? " selected" : "" ).'">'.$this->_procesoManual().'</div>	
				<div id="menuTab4Sheet" class="tabItem'.(($idTab == 4) ? " selected" : "" ).'">'.$this->_configuracion().'</div>	
                                <div id="menuTab5Sheet" class="tabItem'.(($idTab == 5) ? " selected" : "" ).'">'.$this->_configuracionSEO().'</div>				                                				
                                <div id="menuTab6Sheet" class="tabItem'.(($idTab == 6) ? " selected" : "" ).'">'.$this->_mostrarAyuda().'</div>	                                    
                                <div id="menuTab7Sheet" class="tabItem'.(($idTab == 7) ? " selected" : "" ).'">'.$this->_mostrarEstadisticas().'</div>
                                <div id="menuTab8Sheet" class="tabItem'.(($idTab == 8) ? " selected" : "" ).'">'.$this->_mostrarUltimosProductos().'</div>
                                <div id="menuTab9Sheet" class="tabItem'.(($idTab == 9) ? " selected" : "" ).'">'.$this->_mostrarLicencia().'</div>
			</div>
			<br clear="left" />
			<br />
			<style>
				#menuTab { float: left; padding: 0; margin: 0; text-align: left; }
				#menuTab li { text-align: left; float: left; display: inline; padding: 5px; padding-right: 10px; background: #EFEFEF; font-weight: bold; cursor: pointer; border-left: 1px solid #EFEFEF; border-right: 1px solid #EFEFEF; border-top: 1px solid #EFEFEF; }
				#menuTab li.menuTabButton.selected { background: #FFF6D3; border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; border-top: 1px solid #CCCCCC; }
				#tabList { clear: left; }
				.tabItem { display: none; }
				.tabItem.selected { display: block; background: #FFFFF0; border: 1px solid #CCCCCC; padding: 10px; padding-top: 20px; }
			</style>
			<script>
				$(".menuTabButton").click(function () {
				  $(".menuTabButton.selected").removeClass("selected");
				  $(this).addClass("selected");
				  $(".tabItem.selected").removeClass("selected");
				  $("#" + this.id + "Sheet").addClass("selected");                                 
				});
			</script>'; $this->_html .= '<script>
            function llenarMargen(pForm) {
                console.log(pForm);
                var valor = $(pForm).find("input[name=\'llenarMargenText\']").val();
                for (i = 0, n = pForm.elements.length; i < n; i++)
                {
                    var objName = pForm.elements[i].name;
                    var objType = pForm.elements[i].type;
                    if (objType == "text")
                    {
                        box = eval(pForm.elements[i]);
                        box.value = valor;
                    }
                }
            }
            </script>'; } } private function _displayForm() { $this->addCSS('css.css'); $this->addJs('funciones.js'); $this->_displayFormExport(); } public function getContent() { $this->_html .= '<h2>'.$this->displayName.'</h2>'; if (!empty($_POST)) $this->_html .= $this->_postProcess(); $this->_displayForm(); return $this->_html; } private function _gestionarUrl() { $html = ""; $html .= '<fieldset>'; $html .= '<p>'.$this->l('Pasos a seguir:').' '.$this->l('Inserte las urls del proveedor, incluyendo el (http:// o el https://)').'</p>'; $html .= '</fieldset><br />'; $query = "SELECT  
                    *
                  FROM
                  "._DB_PREFIX_.$this->tabla."urls AS u ORDER BY id_".$this->tabla."urls DESC LIMIT 0,1"; $result_query = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($query); $result = $result_query[0]; $html .= '<fieldset><legend>'.$this->l('Insertar url').'</legend>
        <form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post">            
            <input type="hidden" name="accion" value="addUrl" />                
            <input type="hidden" name="idUrl" value="'.$result['id_'.$this->tabla.'urls'].'" />'; $subManual = Configuration::getGlobalValue($this->sufijo.'SUB_MANUAL') == 1 ? true : false; $checked = ''; if ($subManual) { $checked = ' checked="checked"'; } $html .= '<div class="labelCorta">'; $html .= '<div class="bootstrap">'; $html .= '<p class="warning warn alert  alert-warning"><b>'.$this->l('ATENCION:').'</b> '.$this->l('Si marca este check, debe subir un archivo con nombre dreamlove.xml a la carpeta import del modulo').'</p>'; $html .= '</div>'; $html .= '<label>'.$this->l('Archivo subido por ftp').'</label>'; $html .= '<input type="checkbox" name="submanual" value="1" '.$checked.'/><br /><br />'; $html .= '<label>'.$this->l('Insertar url de proveedor').'</label>'; $html .= '<input type="text" name="url" value="'.$result['url'].'" size="75px"/><br />'; $suppliers = Supplier::getSuppliers(); if ($suppliers) { $html .= '<br/><label>'.$this->l('Seleccione el proveedor').'</label>'; $html .= '<select name="suppliers">'; foreach ($suppliers AS $supplier) { $selected = ''; if ($supplier['id_supplier'] == $result['id_distribuidor']) { $selected = ' selected="selected"'; } $html .= '<option '.$selected.' value="'.$supplier['id_supplier'].'">'.htmlspecialchars(trim($supplier['name'])).'</option>'; } $html .= "</select>"; } $html .= '</div>'; $html .= '<input type="hidden" name="id_tab" value="1" />'; $html .= '<br /><input type="submit" name="guardarUrl" value="'.$this->l('Guardar URL').'" />
			</form></fieldset>'; return $html; } private function _configuracionSEO() { $html = ''; $html .='<dl class="acordeon">'; $html .= '<dt>'.$this->l('Configuracion SEO').'</dt>'; $html .= '<dd>'; $preDesc = Configuration::getGlobalValue($this->sufijo.'PRE_DESC'); $postDesc = Configuration::getGlobalValue($this->sufijo.'POST_DESC'); $preTitle = Configuration::getGlobalValue($this->sufijo.'PRE_TITLE'); $postTitle = Configuration::getGlobalValue($this->sufijo.'POST_TITLE'); $preKey = Configuration::getGlobalValue($this->sufijo.'PRE_KEY'); $postKey = Configuration::getGlobalValue($this->sufijo.'POST_KEY'); $crearTags = Configuration::getGlobalValue($this->sufijo.'CREAR_TAGS'); $html .='<div class="bootstrap"><p class="warning warn alert  alert-warning">'.$this->l('ATENCION: ').'&nbsp;'.$this->l('Los campos a continuacion, seran cortados a la longitud adecuada antes de la inserccion. La longitud maxima sera la suma de la pre y post etiqueta junto al del texto original').'</p></div>'; $html .='<form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post">
            <input type="hidden" name="accion" value="gestionSEO">'; $html .='<ul class="listaCheckImporter">'; $html .='<li><label>'.$this->l('Pre-etiqueta MetaDescripcion').'</label>'; $html .= '<input type="text" name="predesc" value="'.$preDesc.'" /></li>'; $html .='<li><label>'.$this->l('Post-etiqueta MetaDescripcion').'</label>'; $html .= '<input type="text" name="postdesc" value="'.$postDesc.'"/></li>'; $html .='<li><label>'.$this->l('Pre-etiqueta Metatitle').'</label>'; $html .= '<input type="text" name="pretitle" value="'.$preTitle.'"/></li>'; $html .='<li><label>'.$this->l('Post-etiqueta Metatitle').'</label>'; $html .= '<input type="text" name="posttitle" value="'.$postTitle.'" /></li>'; $html .= '<li><label>'.$this->l('Pre-etiqueta Keywords').'</label>'; $html .= '<input type="text" name="preKey" value="'.$preKey.'" /></li>'; $html .= '<li><label>'.$this->l('Post-etiqueta Keywords').'</label>'; $html .= '<input type="text" name="postKey" value="'.$postKey.'" /></li>'; $html .= '<li><label>'.$this->l('Crear tags en productos').'</label>'; $checked = ''; if ($crearTags == 1) { $checked = 'checked="checked"'; } $html .= '<input type="checkbox" name="crearTags" value="1" '.$checked.'/></li>'; $html .= '</ul>'; $html .= '<input type="hidden" name="id_tab" value="5" />'; $html .= '<br />'; $html .= '<input type="submit" name="gestionSEO" value="'.$this->l('Guardar').'" /></form>'; $html .= '</dd>'; $html .= '</dl>'; $html .='<dl class="acordeon">'; $html .= '<dt>'.$this->l('Configuracion Nombre Producto').'</dt>'; $html .= '<dd>'; $preNombre = Configuration::getGlobalValue($this->sufijo.'PRE_NOM'); $postNombre = Configuration::getGlobalValue($this->sufijo.'POST_NOM'); $posicion = Configuration::getGlobalValue($this->sufijo.'POSI_NOM'); $addReferencia = Configuration::getGlobalValue($this->sufijo.'ADD_REFE'); $separadorRefe = Configuration::getGlobalValue($this->sufijo.'REFE_SEPA'); require_once(dirname(__FILE__).'/functions.php'); $importer = new ImportFunctionsDreamlove(); $nombreModulo = 'dreamLoveSeoNombre'; $licencia = $importer->getLicenciaAdicional($nombreModulo); if (trim($licencia == '') || !$importer->chekcLicenciaAdicional($nombreModulo, $licencia)) { $html .= '<div class="bootstrap">'; $html .= '<div class="warning warn alert  alert-warning">'; $html .= $this->l('Es necesario una licencia adicional para este plugin'); $html .= '<br />'; $html .= $this->l('Puede obtenerla en: '); $html .= '<a href="tienda.informax.es" target="_blank">tienda.informax.es</a>'; $html .= '</div>'; $html .= '</div>'; } else { $html .='<form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post">'; $html .='<input type="hidden" name="accion" value="gestionSEONombre">'; $html .='<ul class="listaCheckImporter">'; $html .='<li><label>'.$this->l('Pre-etiqueta Nombre Producto').'</label>'; $html .= '<input type="text" name="preNombre" value="'.$preNombre.'" /></li>'; $html .='<li><label>'.$this->l('Post-etiqueta Nombre Producto').'</label>'; $html .= '<input type="text" name="postNombre" value="'.$postNombre.'" /></li>'; $html .='<li><label>'.$this->l('Insertar referencia al nombre del producto (Si se repite el nombre del producto)').'</label>'; $checked = ''; if ($addReferencia == 1) { $checked = 'checked="checked"'; } $html .= '<input type="checkbox" name="addReferencia" value="1" '.$checked.' /></li>'; $html .='<li><label>'.$this->l('Posicion de la referencia').'</label>'; $html .='<ul class="listaCheckImporter">'; $html .='<br />'; $html .='<fieldset>'; include(dirname(__FILE__).'/configuration.php'); foreach ($posicionesEtiquetas AS $id => $texto) { $html .='<li><label>'.$this->l($texto).'</label>'; $checked = ''; if ($posicion == $id) { $checked = 'checked="checked"'; } $html .= '<input type="radio" name="refPosicion[]" value="'.$id.'" '.$checked.' /></li>'; } $html .= '</fieldset>'; $html .= '</ul>'; $html .='<li><label>'.$this->l('Separador de la referencia').'</label>'; $html .= '<input type="text" name="separadorRefe" value="'.$separadorRefe.'" /></li>'; $html .= '</ul>'; $html .= '<input type="hidden" name="id_tab" value="5" />'; $html .= '<input type="submit" value="Guardar" name="gestionSEONombre">'; $html .= '</form>'; } $html .= '</dd>'; $html .= '</dl>'; return $html; } private function _gestionarCategorias() { GLOBAL $cookie; $html = ""; $idCategoriaPadre = Configuration::getGlobalValue($this->sufijo.'CATEGORIA_PADRE'); $checked1 = ''; $checked2 = ''; $checked3 = ''; $checked4 = ''; $margenMinimo = Configuration::getGlobalValue($this->sufijo.'MARGEN_MINIMO'); $margenGlobal = Configuration::getGlobalValue($this->sufijo.'MARGEN_GLOBAL'); switch (Configuration::getGlobalValue($this->sufijo.'METODO_MARGEN')) { case 0: $checked1 = ' checked="checked"'; break; case 1: $checked2 = ' checked="checked"'; break; case 2: $checked3 = ' checked="checked"'; case 3: $checked4 = ' checked="checked"'; break; } $html .= '<dl class="acordeon">'; $html .='<dt>'.$this->l('Seleccionar Categoria padre').'</dt>'; $html .='<dd><form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post">
                <input type="hidden" name="id_tab" value="2" />
                <input type="hidden" name="accion" value="setCategoriaPadre">
                '.$this->l('Elige la categoria padre'); $html .= '<select name="categoria" class="selectExternalImport"/>'; $html .= '<option value="-1">'.$this->l('Seleccione una categoria').'</option>'; $categorias = Category::getCategories(($cookie->id_lang), false); foreach ($categorias AS $categoriaTemp) { foreach ($categoriaTemp AS $categoria) { $categoria = $categoria['infos']; if ($categoria['id_category'] == $idCategoriaPadre) { $selected = " selected='selected'"; } else { $selected = ''; } $html .= '<option value="'.$categoria['id_category'].'" '.$selected.'>'.$categoria['name'].'</option>'; } } $html .= '</select><br /><br />'; $html .= '<input type="submit" name="setCategoriaPadre" value="'.$this->l('Seleccionar').'" />
            </form>'; $html .= '</dd>'; $html .= '</dl>'; $html .= '<dl class="acordeon">'; $html .= '<dt>'.$this->l('Modo gestion margenes').'</dt>'; $html .= '<dd>'; $html .= '<form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post">'; $html .= '<p>'.$this->l('Seleccione el metodo de calculo de margenes, sobre el precio de compra, o sobre el precio de venta').'</p>'; $html .= '<ul class="listaCheckImporterCategorias">'; $html .= '<li>'; $html .= '<label>'.$this->l('Sobre compra, se le aplica un porcentaje precio coste  * margen Beneficio').'</label>'; $html .= '<input type="radio" name="metodoMargen" value="0" '.$checked1.'/>'; $html .= '</li>'; $html .= '<li>'; $html .= '<label>'.$this->l('Sobre venta, el margen es sobre el precio de Venta precio Formula = coste / ((100 - coste) / 100) ').'</label>'; $html .= '<input type="radio" name="metodoMargen" value="1" '.$checked2.' />'; $html .= '</li>'; $html .= '<li><label>'.$this->l('Sobre tarifa Oficial de Dreamlove, tarifa oficial * margen Beneficio').'</label>'; $html .= '<input type="radio" name="metodoMargen" value="3" '.$checked4.' />'; $html .= '</li>'; $html .= '<li><label>'.$this->l('Tarifa Oficial de Dreamlove').'</label>'; $html .= '<input type="radio" name="metodoMargen" value="2" '.$checked3.' />'; $html .= '</li>'; $html .= '</li>'; $html .= '<li><label class="last">'.$this->l('Margen Global').'</label>'; $html .= '<input type="text" name="margenGlobal" value="'.$margenGlobal.'" />%'; $html .= '</li>'; $html .= ' <li><label>'.$this->l('Importe Minimo de Beneficio').'</label>'; $html .= '<input type="text" name="margenMinimo" value="'.$margenMinimo.'" />&euro;</li>'; $html .= '<input type="submit" name="submitMetodoMargen" value="'.$this->l('Guardar').'" />'; $html .= '<input type="hidden" name="accion" value="addMetodoMargen">'; $html .= '<input type="hidden" name="id_tab" value="2" />'; $html .= '</form>'; $html .= '</dd>'; $html .= '</dl>'; $html .= '<dl class="acordeon">'; $html .='<dt>'.$this->l('Seleccionar porcentajes de categorias manualmente').'</dt>'; $html .='<dd>'; if ($this->versionPS >= 15 && Configuration::getGlobalValue('PS_MULTISHOP_FEATURE_ACTIVE') == 1) { $tiendas = Configuration::getGlobalValue($this->sufijo.'TIENDAS'); if ($tiendas != '' && strpos($tiendas, ':') !== FALSE && strpos($tiendas, '{') !== FALSE) { $tiendas = unserialize($tiendas); } else { $tiendas = array(); } if (empty($tiendas)) { $html .= '<div class="bootstrap"><p class="warning warn alert  alert-warning">'.$this->l('Debe configurar las tiendas en el tab configuracion antes de gestionar los margenes').'</p></div></li>'; } else { $shops = Shop::getShops(); foreach ($shops AS $shop) { if (!isset($tiendas[$shop['id_shop']])) { continue; } $html.='<form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="POST" enctype="multipart/form-data">
                        <input type="hidden" name="accion" value="addPorcentajesCategorias">'; $html.='<input type="hidden" name="id_shop" value="'.$shop['id_shop'].'">'; $html .= '<dl class="acordeonInterno">'; $html .= '<dt class="">'.$shop['name'].'</dt>'; $html .= '<dd>'; $sql = "SELECT
                                    c.id_category, c.id_parent, cl.name, s.margen,
                                    (SELECT 
                                        COUNT(*) 
                                     FROM 
                                        "._DB_PREFIX_.$this->tabla."categorias AS s2 
                                     WHERE 
                                        s2.id_category = s.id_category 
                                        AND s2.idShop = ".$shop['id_shop']."
                                    ) AS checked
                                FROM 
                                    "._DB_PREFIX_."category AS c
                                    INNER JOIN "._DB_PREFIX_."category_lang AS cl " ." ON cl.id_category = c.id_category " ." AND cl.id_lang = ".$this->idLang." " ." AND cl.id_shop = ".$shop['id_shop']."
                                    LEFT JOIN "._DB_PREFIX_.$this->tabla."categorias AS s 
                                        ON 
                                            s.id_category = c.id_category
                                            AND s.idShop = ".$shop['id_shop']."
                                WHERE
                                     c.id_parent  = ".$idCategoriaPadre."
                                ORDER BY 	
                                     c.id_parent, c.id_category "; $categorias = Db::getInstance()->executeS($sql); $html .= "<table id='externalImport'>"; $html .= "<thead>"; $html .= "<tr>"; $html .= "<td>&nbsp;</td>"; $html .= "<td><input type='button' onclick='checkAll(this.form)' name='checkme' value='".$this->l('Invertir Seleccion')."'></td>"; $html .= "<td>".$this->l('Margen general a'); $html .= "<input type='textbox' name='llenarMargenText' onChange='llenarMargen(this.form)' /></td>"; $html .= "</tr>"; $html .= "<tr>"; $html .= "<th>Categoria</th>"; $html .= "<th>Seleccionar</th>"; $html .= "<th>Margen</th>"; $html .= "</tr>"; $html .= "</thead>"; foreach ($categorias AS $categoria) { $num = 0; $html .= "<tr>"; $html .= "<td><b>".$categoria['name']."</b></td>"; $checked = ""; $porcentaje = ""; if ($categoria['checked'] != 0) { $checked = ' checked="checked"'; $porcentaje = $categoria['margen']; } $html .= "<td><input type='checkbox' ".$checked." value='".$categoria['id_category']."' name='categoria[".$categoria['id_category']."][check]' /></td>"; $html .= "<td><input type='text' name='categoria[".$categoria['id_category']."][margen]'  value='".$porcentaje."'/></td>"; $html .= "</tr>"; $this->getHijosMultiShop($categoria, $html, $this->idLang, $shop['id_shop'], $num); } $html .= "</table>"; $html .= '<input type="submit" name="categorias" value="'.$this->l('Guardar').'" />'; $html .= '<input type="hidden" name="accion" value="addPorcentajesCategorias">'; $html .= ' <input type="hidden" name="id_shop" value="'.$this->idShop.'">'; $html .= '<input type="hidden" name="id_tab" value="2">'; $html .= "</dd>"; $html .= "</dl>"; $html .= '</form>'; } } } else { $html.='<form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="POST" enctype="multipart/form-data">
                <input type="hidden" name="accion" value="addPorcentajesCategorias">'; $sql = "SELECT
                       c.id_category, c.id_parent, cl.name, s.id_category  AS checked, s.margen
                    FROM 
                       "._DB_PREFIX_."category AS c
                       INNER JOIN "._DB_PREFIX_."category_lang AS cl ON cl.id_category = c.id_category AND cl.id_lang = ".$this->idLang."
                       LEFT JOIN "._DB_PREFIX_.$this->tabla."categorias AS s ON s.id_category = c.id_category
                    WHERE
                        c.id_parent  = ".$idCategoriaPadre." AND
                        cl.id_shop IN
                        (
                        SELECT
                            t.id_shop
                          FROM 
                          "._DB_PREFIX_."shop AS t
                          WHERE
                        t.active = 1
                        )
                    ORDER BY 	
                        c.id_parent, c.id_category "; $categorias = Db::getInstance()->executeS($sql); $html .= "<table id='externalImport'>"; $html .= "<thead>"; $html .= "<tr>"; $html .= "<td>&nbsp;</td>"; $html .= "<td><input type='button' onclick='checkAll(this.form)' name='checkme' value='".$this->l('Invertir Seleccion')."'></td>"; $html .= "<td>".$this->l('Margen general'); $html .= "<input type='textbox' name='llenarMargenText' onChange='llenarMargen(this.form)'  /></td>"; $html .= "</tr>"; $html .= "<tr>"; $html .= "<th>Categoria</th>"; $html .= "<th>Seleccionar</th>"; $html .= "<th>Margen</th>"; $html .= "</tr>"; $html .= "</thead>"; foreach ($categorias AS $categoria) { $num = 0; $html .= "<tr>"; $html .= "<td><b>".$categoria['name']."</b></td>"; $checked = ""; $porcentaje = ""; if (!empty($categoria['checked'])) { $checked = ' checked="checked"'; $porcentaje = $categoria['margen']; } $html .= "<td><input type='checkbox' ".$checked." value='".$categoria['id_category']."' name='categoria[".$categoria['id_category']."][check]' /></td>"; $html .= "<td><input type='text' name='categoria[".$categoria['id_category']."][margen]'' value='".$porcentaje."'/></td>"; $html .= "</tr>"; $this->getHijos($categoria, $html, $this->idLang, $num); } $html .= "</table>"; $html .= '<input type="submit" name="categorias" value="'.$this->l('Guardar').'" />'; $html .= '<input type="hidden" name="accion" value="addPorcentajesCategorias">'; $html .= '<input type="hidden" name="id_shop" value="'.$this->idShop.'">'; $html .= '<input type="hidden" name="id_tab" value="2">'; $html .= '</form>'; $html .= '</dd>'; $html .= '</dl>'; } return $html; } private function _procesoManual() { $html = ""; $queryUrl = "SELECT url,  id_".$this->tabla."urls, id_distribuidor FROM "._DB_PREFIX_.$this->tabla."urls ORDER BY id_".$this->tabla."urls DESC LIMIT 0,1"; $result_query_url = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($queryUrl); $url = $result_query_url[0]['url']; $idProveedor = $result_query_url[0]['id_distribuidor']; $html.='<fieldset><legend>'.$this->l('Forzar procesado de archivo').'</legend>'; $html.= '<form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="POST">'; $html.= '<input type="hidden" name="id_tab" value="3" />'; $html.='<input type="hidden" name="accion" value="procesoManual" />'; $html.='<input type="hidden" name="url" value="'.$url.'" />'; $html.='<input type="hidden" name="idProveedor" value="'.$idProveedor.'" />'; $html.= '<input type="submit" value="'.$this->l('Ejecutar').'" /></form></fieldset>'; return $html; } private function _configuracion() { require_once(dirname(__FILE__)."/functions.php"); $urlTienda = ImportFunctionsDreamlove::getUrlAdmin(); $html = ''; $html .='<dl class="acordeon">'; $html .='<dt>'.$this->l('Token de acceso por cron').'</dt>'; $html .='<dd>'; $token = Configuration::getGlobalValue($this->sufijo.'TOKEN_CRON'); $html .= '<div class="bootstrap">'; $html .= '<p class="warning warn alert  alert-warning"><b>'.$this->l('ATENCION:').'</b> '.$this->l('Si cambia el token, tiene que cambiarlo tambien en las tareas de cron').'</p>'; $html .= '</div>'; $html .= '<p>'.$this->l('Debe enviarlo por get a las urls del servicio:').'<p>'; $html .= '<p><a href="'.$urlTienda.'dreamloveImportCron.php?token='.$token.'" target="_blank">'.$urlTienda.'dreamloveImportCron.php?token='.$token.'</a></p>'; $html .= '<p><a href="'.$urlTienda.'dreamloveImportImagenes.php?token='.$token.'" target="_blank">'.$urlTienda.'dreamloveImportImagenes.php?token='.$token.'</a></p>'; $html .= '<br />'; $html .='<form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post">
            <input type="hidden" name="accion" value="generarToken">
            '.$this->l('Genera el token de configuracion'); $html .= '<br />
         <input type="hidden" name="id_tab" value="4" />
        <input type="submit" name="generarToken" value="'.$this->l('Generar Token').'" />
        </form><br />'; $html .= '<label>'.$this->l('Token actual').': </label><label style="width:300px;">'.$token.'</label></>'; $html .='<br />'; $html .='</dd>'; $html .='</dl>'; $html .='<dl class="acordeon">'; $html .= '<dt>'.$this->l('Elementos a procesar en cada llamada').'</dt>'; $html .= '<dd>'; $numElementos = Configuration::getGlobalValue($this->sufijo.'CANTIDAD_PROCESADA'); $numBajas = Configuration::getGlobalValue($this->sufijo.'CANTIDAD_BAJAS'); $numAtributos = Configuration::getGlobalValue($this->sufijo.'CANTIDAD_ATRIBUTOS'); $numImagenes = Configuration::getGlobalValue($this->sufijo.'CANTIDAD_IMAGENES'); $html .='<form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post">
            <input type="hidden" name="accion" value="numElementos">
            <input type="hidden" name="id_tab" value="4" />'; $html .= '<ul class="listaCantidadesDreamlove">'; $html .=' <li><label>'.$this->l('Numero de productos a importar').'</label>'; $html .= '<input type="text" name="numElementosAImportar" value="'.$numElementos.'" /></li>'; $html .= ' <li><label>'.$this->l('Numero de atributos a importar').'</label>'; $html .= '<input type="text" name="numAtributos" value="'.$numAtributos.'" /></li>'; $html .= ' <li><label>'.$this->l('Numero de imagenes a importar(No mas de 50)').'</label>'; $html .= '<input type="text" name="numImagenes" value="'.$numImagenes.'" /></li>'; $html .= '<input type="submit" name="numElementos" value="'.$this->l('Guardar').'" />
        </form><br />'; $html .= '<br />'; $html .='</dd>'; $html .='</dl>'; $html .='<dl class="acordeon">'; $html .= '<dt>'.$this->l('Mapeado impuestos').'</dt>'; $html .= '<dd>'; $mapeoImpuestos = Configuration::getGlobalValue($this->sufijo.'MAPEO_IMPUESTOS'); $impuestosModulo = Configuration::getGlobalValue($this->sufijo.'IMPUESTOS'); $impuestosTienda = TaxRulesGroup::getTaxRulesGroups(); $actualizarImpuestos = Configuration::getGlobalValue($this->sufijo.'UPDATE_TAX'); $html .='<form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post">
            <input type="hidden" name="accion" value="gestionImpuestos">
            <input type="hidden" name="id_tab" value="4" />'; $html .= '<div class="bootstrap">'; $html .= '<p class="warning warn alert  alert-warning">'; $html .= $this->l('Marcando este check, las reglas de impuestos asignadas a los productos seran actualizadas en cada ejecucion del modulo.'); $html .= '<br />'; $html .= $this->l('La actualizacion de las reglas tendran en cuenta la configuracion del mapeo de impuestos inferior si esta existe.'); $html .= '</p>'; $html .= '</div>'; $html .='<ul class="listaCheckDreamlove">'; $html .='<li><label>'.$this->l('Actualizar impuestos').'&nbsp;&nbsp;</label>'; $checked = ''; if ($actualizarImpuestos == 1) { $checked = ' checked="checked"'; } $html .= '<input type="checkbox" name="actualizarImpuestos" value="1" '.$checked.'/></li>'; $html .= '</li>'; $html .= '</ul>'; $html .= '<div class="bootstrap">'; $html .= '<p class="warning warn alert  alert-warning">'; $html .= $this->l('Puede mapear sus impuestos respecto a los enviados por Dreamlove en su archivo.'); $html .= '<br />'; $html .= $this->l('Actualmente Dreamlove envia los impuestos del 4, 10 y 21%.'); $html .= '<br />'; $html .= $this->l('Si los impuestos de su pais o zona no corresponden con los ofrecidos por Dreamlove, seleccione aqui las equivalencias'); $html .= '<br />'; $html .= $this->l('Este mapeado de impuestos esta pensado especificamente para vendedores fuera de Espana, excluyendo las Islas Canarias'); $html .= '<br />'; $html .= '</p>'; $html .= '</div>'; try { $impuestosModulo = unserialize($impuestosModulo); } catch (Exception $exc) { $impuestosModulo = array(0 => 4, 1 => 10, 2 => 21); } if (!$impuestosModulo) { $impuestosModulo = array(0 => 4, 1 => 10, 2 => 21); } if ($mapeoImpuestos != '') { try { $mapeoImpuestos = unserialize($mapeoImpuestos); } catch (Exception $exc) { } } if (!is_array($mapeoImpuestos)) { foreach ($impuestosModulo AS $impuestoModulo) { $mapeoImpuestos[$impuestoModulo] = 0; } } $html .='<table class="table tableDnD tablaImportProductos tablaDreamlove">'; $html .='<tr>'; $html .='<th>'.$this->l('Impuesto Dreamlove').'</th>'; $html .='<th>'.$this->l('Impuesto Local').'</th>'; $html .='</tr>'; $i = 0; foreach ($impuestosModulo AS $impuestoModulo) { $html .='<tr>'; $html .='<td><input type="text" value="'.$impuestoModulo.'" name="impuestoModulo['.$i.']"/>%</td>'; $html .='<td>'; $html .='<select name="impuesto['.$i.']">'; $html .='<option value="0">'.$this->l('Seleccione uno').'</option>'; foreach ($impuestosTienda AS $impuestoTienda) { $selected = ''; if ($mapeoImpuestos[$impuestoModulo] == $impuestoTienda['id_tax_rules_group']) { $selected = ' selected="selected"'; } $html .='<option value="'.$impuestoTienda['id_tax_rules_group'].'" '.$selected.'>'.$impuestoTienda['name'].'</option>'; } $html .= '</select>'; $html .= '</td>'; $html .= '</tr>'; $i++; } $html .= '</table>'; $html .= '<br />'; $html .= '<input type="submit" name="impuestos" value="'.$this->l('Guardar').'" />'; $html .= '</form>'; $html .='</dd>'; $html .='</dl>'; $html .='<dl class="acordeon">'; $html .= '<dt>'.$this->l('Opciones de actualizacion').'</dt>'; $html .= '<dd>'; $actualizarImagen = Configuration::getGlobalValue($this->sufijo.'ACTUALIZAR_IMAGEN'); $actualizarNomProducto = Configuration::getGlobalValue($this->sufijo.'ACTUALIZAR_NOM_PROD'); $actualizarNomCategoria = Configuration::getGlobalValue($this->sufijo.'ACTUALIZAR_NOM_CAT'); $actualizarDescripcion = Configuration::getGlobalValue($this->sufijo.'ACTUALIZAR_DESC'); $actualizarPrecio = Configuration::getGlobalValue($this->sufijo.'ACTUALIZAR_PRECIO'); $actualizarStock = Configuration::getGlobalValue($this->sufijo.'ACTUALIZAR_STOCK'); $actualizarSeo = Configuration::getGlobalValue($this->sufijo.'ACTUALIZAR_SEO'); $desactivarProds = Configuration::getGlobalValue($this->sufijo.'DESACTIVAR_PRODS'); $desactivarSinStock = Configuration::getGlobalValue($this->sufijo.'DESACTIVAR_SIN_STOCK'); $procesarBajas = Configuration::getGlobalValue($this->sufijo.'DESACTIVAR_PRODS'); $crearImagenesCategorias = Configuration::getGlobalValue($this->sufijo.'CAT_IMAGE'); $enviarCorreos = Configuration::getGlobalValue($this->sufijo.'ENVIAR_EMAIL'); $indexar = Configuration::getGlobalValue($this->sufijo.'INDEXAR'); $modoDebug = Configuration::getGlobalValue($this->sufijo.'MODO_DEBUG'); $modoSolapado = Configuration::getGlobalValue($this->sufijo.'MODO_SOLAPADO'); $crearDescCorta = Configuration::getGlobalValue($this->sufijo.'CREAR_DESC_COR'); $modoDescCorta = Configuration::getGlobalValue($this->sufijo.'MOD_DESC_CORTA'); $descCortaSize = Configuration::getGlobalValue($this->sufijo.'SIZE_DESC_CORTA'); $activarAjax = Configuration::getGlobalValue($this->sufijo.'AJAX_ACTIVE'); $tiempoAjax = Configuration::getGlobalValue($this->sufijo.'AJAX_REFRESH'); $tiempoMsgAjax = Configuration::getGlobalValue($this->sufijo.'MSG_DELAY'); $html .='<form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post">
            <input type="hidden" name="accion" value="opcionesActualizacion">
            <input type="hidden" name="id_tab" value="4" />'; $html .='<ul class="listaCheckDreamlove">'; $html .='<li><label>'.$this->l('Activar Ajax').'&nbsp;&nbsp;</label>'; $checked = ''; if ($activarAjax == 1) { $checked = ' checked="checked"'; } $html .= '<input type="checkbox" name="activarAjax" value="1" '.$checked.'/></li>'; $i = 0; $html .='<li><label>'.$this->l('Intervalo Refrescar las estadisticas').'&nbsp;&nbsp;</label>'; $html .= '<select name="tiempoAjax">'; for ($i = 5; $i < 100; $i = $i + 5) { if ($i == $tiempoAjax) { $selected = ' selected="selected"'; } else { $selected = ''; } $html .= '<option value="'.$i.'" '.$selected.'>'.$i.'</option>'; } $html .= '</select></li>'; $html .='<li><label>'.$this->l('Tiempo de Mensaje').'&nbsp;&nbsp;</label>'; $i = 0; $html .= '<select name="tiempoMsgAjax">'; for ($i = 1; $i < 100; $i++) { if ($i == $tiempoMsgAjax) { $selected = ' selected="selected"'; } else { $selected = ''; } $html .= '<option value="'.$i.'" '.$selected.'>'.$i.'</option>'; } $html .= '</select>'; $html .='<li><label>'.$this->l('Actualizar Precios').'&nbsp;&nbsp;</label>'; $checked = ''; if ($actualizarPrecio == 1) { $checked = ' checked="checked"'; } $html .= '<input type="checkbox" name="actualizarPrecio" value="1" '.$checked.'/></li>'; $html .='<li><label>'.$this->l('Actualizar Stock').'&nbsp;&nbsp;</label>'; $checked = ''; if ($actualizarStock == 1) { $checked = ' checked="checked"'; } $html .= '<input type="checkbox" name="actualizarStock" value="1" '.$checked.'/></li>'; $html .='<li><label>'.$this->l('Desactivar productos').'&nbsp;&nbsp;</label>'; $checked = ''; if ($desactivarProds == 1) { $checked = ' checked="checked"'; } $html .= '<input type="checkbox" name="desactivarProds" value="1" '.$checked.'/>'; $html .= '<div class="bootstrap"><p class="warning warn alert  alert-warning">'.$this->l('Solo se aplicara a partir de la siguiente descarga de archivo').'</p></div></li>'; $html .='<li><label>'.$this->l('Desactivar productos SIN STOCK').'&nbsp;&nbsp;</label>'; $checked = ''; if ($desactivarSinStock == 1) { $checked = ' checked="checked"'; } $html .= '<input type="checkbox" name="desactivarSinStock" value="1" '.$checked.'/>'; $html .='<li><label>'.$this->l('Actualizar Imagenes').'&nbsp;&nbsp;</label>'; $checked = ''; if ($actualizarImagen == 1) { $checked = ' checked="checked"'; } $html .= '<input type="checkbox" name="actualizarImagen" value="1" '.$checked.'/></li>'; $checked = ''; if ($actualizarNomProducto == 1) { $checked = ' checked="checked"'; } $html .= '<li><label>'.$this->l('Actualizar Nombre Producto').'&nbsp;&nbsp;</label>'; $html .= '<input type="checkbox" name="actualizarNomProducto" value="1" '.$checked.'/></li>'; $checked = ''; if ($actualizarNomCategoria == 1) { $checked = ' checked="checked"'; } $html .= '<li><label>'.$this->l('Actualizar Nombre Categoria').'&nbsp;&nbsp;</label>'; $html .= '<input type="checkbox" name="actualizarNomCategoria" value="1" '.$checked.'/></li>'; $checked = ''; if ($actualizarDescripcion == 1) { $checked = ' checked="checked"'; } $html .= '<li><label>'.$this->l('Actualizar Descripciones').'&nbsp;&nbsp;</label>'; $html .= '<input type="checkbox" name="actualizarDesc" value="1" '.$checked.'/></li>'; $checked = ''; if ($actualizarSeo == 1) { $checked = ' checked="checked"'; } $html .= '<li><label>'.$this->l('Actualizar Seo').'&nbsp;&nbsp;</label>'; $html .= '<input type="checkbox" name="actualizarSeo" value="1" '.$checked.'/></li>'; $checked = ''; if ($crearImagenesCategorias == 1) { $checked = ' checked="checked"'; } $html .= '<li><label>'.$this->l('Crear Imagenes de Categorias').'&nbsp;&nbsp;</label>'; $html .= '<input type="checkbox" name="crearImagenCat" value="1" '.$checked.'/></li>'; $checked = ''; if ($crearDescCorta == 1) { $checked = ' checked="checked"'; } $html .= '<li><label>'.$this->l('Crear Descripcion Corta').'&nbsp;&nbsp;</label>'; $html .= '<input type="checkbox" name="crearDescCorta" value="1" '.$checked.'/></li>'; $html .= '</li>'; $html .= '<li>'; $checked = ''; if ($modoDescCorta == 0) { $checked = ' checked="checked"'; } $html .= '<label>'.$this->l('Igual que la larga').'&nbsp;&nbsp;</label>'; $html .= '<input type="radio" name="descCorta" value="0" '.$checked.'/></li>'; $checked = ''; if ($modoDescCorta == 1) { $checked = ' checked="checked"'; } $html .= '<li>'; $html .= '<label>'.$this->l('Cortada de la descripcion larga').'&nbsp;&nbsp;</label>'; $html .= '<input type="radio" name="descCorta" value="1" '.$checked.'/>'; $html .= '&nbsp;&nbsp;'; $html .= '<input type="text" name="descCortaSize" value="'.$descCortaSize.'" >'; $html .= '&nbsp;&nbsp;'.$this->l('Caracteres').' '.$this->l('Max: ').Configuration::getGlobalValue('PS_PRODUCT_SHORT_DESC_LIMIT').'</li>'; $html .= '</li>'; $checked = ''; if ($enviarCorreos == 1) { $checked = ' checked="checked"'; } $html .= '<li><label>'.$this->l('Enviar Correos').'&nbsp;&nbsp;</label>'; $html .= '<input type="checkbox" name="enviarMail" value="1" '.$checked.'/></li>'; $checked = ''; if ($indexar == 1) { $checked = ' checked="checked"'; } $html .= '<li><label>'.$this->l('Indexar').'</label>'; $html .= '<input type="checkbox" name="indexar" value="1" '.$checked.'/>'; $html .= '<div class="bootstrap"><p class="warning warn alert  alert-warning">'.$this->l('Este proceso es extremadamente lento').'</p></div></li>'; $html .='<li><label>'.$this->l('Modo Debug').'&nbsp;&nbsp;</label>'; $checked = ''; if ($modoDebug == 1) { $checked = ' checked="checked"'; } $html .= '<input type="checkbox" name="modoDebug" value="1" '.$checked.'/>'; $html .= '<p>'.$this->l('Modo Debug para verificar si se esta realizando las tareas, Cuidado consume mucho almacenamiento en Base de Datos. Para verlo en Parametros Avanzados -> Protocolo de Sistema o Registro ').'</p></li>'; $html .= '<p><label>Ver Log de la Plataforma:</label> '; require_once(dirname(__FILE__)."/functions.php"); $urlTienda = ImportFunctionsDreamlove::getUrlAdmin(); $html .= '<a href="'.$urlTienda.'index.php?controller=AdminLogs&token='.Tools::getAdminTokenLite('AdminLogs').'" target="_blank">'; $html .= $urlTienda.'index.php?controller=AdminLogs&token='.Tools::getAdminTokenLite('AdminLogs').'</a></p>'; $html .='<li><label>'.$this->l('Desactivar control Solapamiento').'&nbsp;&nbsp;</label>'; $checked = ''; if ($modoSolapado == 1) { $checked = ' checked="checked"'; } $html .= '<input type="checkbox" name="modoSolapado" value="1" '.$checked.'/>'; $html .= '</ul><br />
        <input type="submit" name="numElementos" value="'.$this->l('Guardar').'" />
        </form><br />'; $html .='</dd>'; $html .='</dl>'; $html .='<dl class="acordeon">'; $stockMinimo = Configuration::getGlobalValue($this->sufijo.'STOCK_MINIMO'); $stockProducto = Configuration::getGlobalValue($this->sufijo.'STOCK_PROD'); $html .= '<dt>'.$this->l('Gestion Stocks').'</dt>'; $html .= '<dd>'; $html .= '<form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post">'; $html .= '<p class="warn">'.$this->l('Si un producto tiene menos de esta cantidad, sera desactivado').'</p>'; $html .= '<ul class="listaCheckDreamlove">'; $html .= '<li>'; $html .= '<label>'.$this->l('Minimo stock para no desactivar el producto').'</label>'; $html .= '<input type="text" name="stockMinimo" value="'.$stockMinimo.'" />'; $html .= '</li>'; $html .= '<li>'; $html .= '<p class="warn">'.$this->l('Seleccione la cantidad de stock para los productos que dreamlove indican como "sin control de stock"').'</p>'; $html .= '<label>'.$this->l('Stock para productos sin control de stock').'</label>'; $html .= '<input type="text" name="stockProducto" value="'.$stockProducto.'" />'; $html .= '</li>'; $html .= '<input type="submit" name="submitGestionStock" value="'.$this->l('Guardar').'" />'; $html .= '<input type="hidden" name="accion" value="gestionStock">'; $html .= '<input type="hidden" name="id_tab" value="4" />'; $html .= '</form>'; $html .='</dd>'; $html .='</dl>'; if ($this->versionPS >= 15 && Configuration::getGlobalValue('PS_MULTISHOP_FEATURE_ACTIVE') == 1) { $shops = Shop::getShops(); $tiendas = Configuration::getGlobalValue($this->sufijo.'TIENDAS'); if ($tiendas != '' && strpos($tiendas, ':') !== FALSE && strpos($tiendas, '{') !== FALSE) { $tiendas = unserialize($tiendas); } else { $tiendas = array(); } $html .= '<dl class="acordeon">'; $html .= '<dt>'.$this->l('Asociacion a tiendas').'</dt>'; $html .= '<dd>'; $html .= '<div class="bootstrap">'; $html .= '<p class="warning warn alert  alert-warning">'; $html .= $this->l('Atencion: Solo se podran seleccionar categorias como categoria por defecto, aquellas que existan en todas las tiendas'); $html .= '<br />'; $html .= $this->l('La categoria por defecto ').'<b>'.$this->l('NO SE PODRA CAMBIAR').'</b>'.$this->l(' una vez seleccionada'); $html .= '</p>'; $html .= '</div>'; $html .='<form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post">'; $html .='<input type="hidden" name="accion" value="gestionarTiendas">'; $categoryDefault = 0; if (isset($tiendas['default'])) { $categoryDefault = $tiendas[$tiendas['default']]['categoria']; } $html .= '<table class="table tableDnD tablaImportProductos tablaDreamlove">'; $html .= '<tr>'; $html .= '<th>'.$this->l('Nombre Tienda').'</th>'; $html .= '<th>'.$this->l('Importar A').'</th>'; $html .= '<th>'.$this->l('Tienda por defecto').'</th>'; $html .= '</tr>'; $categoryDefault = 0; foreach ($shops AS $shop) { $checkedRadio = ''; $checked = ''; $html .= '<tr>'; $html .= '<td>'.$shop['name'].'</td>'; if (is_array($tiendas) && !empty($tiendas)) { $checked = ''; $categoryDefault = 0; if (isset($tiendas[$shop['id_shop']]) && isset($tiendas[$shop['id_shop']]['categoria'])) { $checked = ' checked="checked"'; $categoryDefault = $tiendas[$shop['id_shop']]['categoria']; } $checkedRadio = ''; if (isset($tiendas['default'])) { if ($tiendas['default'] == $shop['id_shop']) { $checkedRadio = ' checked="checked"'; } } } $html .= '<td><input type="checkbox" '.$checked.' name="tienda['.$shop['id_shop'].'][idShop]" value="'.$shop['id_shop'].'" /></td>'; $html .= '<td><input type="radio" '.$checkedRadio.' name="tienda[default]" value="'.$shop['id_shop'].'" /></td>'; $html .= '</tr>'; } $html .= '</table>'; $html .= '<input type="hidden" name="id_tab" value="4" />'; $html .= '<input type="submit" name="gestionarTiendas" value="'.$this->l('Guardar').'" />'; $html .= '</form>'; $html .= '</dd>'; $html .= '</dl>'; } return $html; } private function _mostrarEstadisticas() { require_once(dirname(__FILE__)."/functions.php"); $importer = new ImportFunctionsDreamlove(); return $importer->mostrarEstadisticas(); } private function _mostrarUltimosProductos() { require_once(dirname(__FILE__)."/functions.php"); $importer = new ImportFunctionsDreamlove(); return $importer->mostrarUltimosProductos($this->fechaInicio, $this->fechaFin); } private function _mostrarLicencia() { $html = ''; $licencia = Configuration::getGlobalValue($this->sufijo.'LICENCIA'); $licenseDomain = ImportFunctionsDreamLove::getDomain(); $html .= '<dl class="acordeon">'; $html .= '<dt>'.$this->l('Licencia Principal').'</dt>'; $html .= '<dd>'; $html .= '<form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post">'; $html .= '<p class="warn">'.$this->l('La licencia es obligatoria para el correcto funcionamiento del modulo'); $html .= '<br />'; $html .= $this->l('La licencia se deberia generar para el dominio: ').$licenseDomain.'</p>'; $html .= '<ul class="listaLicencia">'; $html .= ' <li><label>'.$this->l('Numero de Licencia').'</label>'; $html .= '<input type="text" name="licencia" value="'.$licencia.'" /></li>'; $html .= '<input type="submit" name="submitLicencia" value="'.$this->l('Guardar').'" />'; $html .= '<input type="hidden" name="accion" value="gestionLicencia">'; $html .= '<input type="hidden" name="id_tab" value="9" />'; $html .= '</form>'; $html .= '</dd>'; $html .= '</dl>'; include(dirname(__FILE__)."/configuration.php"); if (isset($plugins) && is_array($plugins) && !empty($plugins)) { require_once(dirname(__FILE__)."/functions.php"); $importer = new ImportFunctionsDreamlove(); $licenciasAdicionales = $importer->getOtrasLicencias(); $html .= '<dl class="acordeon">'; $html .= '<dt>'.$this->l('Licencias Adicionales').'</dt>'; $html .= '<dd>'; $html .= '<form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post">'; $html .= '<div class="bootstrap">'; $html .= '<div class="module_confirmation conf confirm alert alert-success">'; $html .= $this->l('Introduzca las licencias para los plugins adicionales'); $html .= '<br />'; $html .= $this->l('Puede obtener las licencias en: '); $html .= '<a href="tienda.informax.es" target="_blank">tienda.informax.es</a>'; $html .= '</div>'; $html .= '</div>'; $html .= '<table class="table tableDnD tablaImportProductos listaLicencia">'; $html .= '<tr>'; $html .= '<th>'.$this->l('Nombre Plugin').'</th>'; $html .= '<th>'.$this->l('Licencia').'</th>'; $html .= '<th>'.$this->l('Estado').'</th>'; $html .= '</tr>'; foreach ($plugins AS $plugin) { $html .= '<tr>'; $html .= '<td>'; $html .= $plugin['nombre'].' ('.$plugin['descripcion'].')'; $html .= '</td>'; $valorLicencia = ''; $estado = 'ausente'; foreach ($licenciasAdicionales AS $licenciaAdicional) { if ($licenciaAdicional['nombre'] == $plugin['nombre']) { $valorLicencia = $licenciaAdicional['licencia']; if ($licenciaAdicional['validate'] == 0) { $estado = 'incorrecta'; } else if ($licenciaAdicional['validate'] == 1) { $estado = 'correcta'; } continue; } } $html .= '<td>'; $html .= '<input type="text" name="licenciaAdicional['.$plugin['nombre'].']" value="'.$valorLicencia.'">'; $html .= '</td>'; $html .= '<td>'; $html .= '<img src="..'._MODULE_DIR_.$this->name.'/css/estadoLicencia_'.$estado.'.png" alt="Licencia '.$estado.'" title="Licencia '.$estado.'">'; $html .= '</td>'; $html .= '</tr>'; } $html .= '</table>'; $html .= '<input type="submit" name="submitLicenciaAdicional" value="'.$this->l('Guardar').'" />'; $html .= '<input type="hidden" name="accion" value="gestionLicenciaAdicional">'; $html .= '<input type="hidden" name="id_tab" value="9" />'; $html .= '</form>'; $html .= '</dd>'; $html .= '</dl>'; } return $html; } function obtenerArchivo($url, $idProveedor) { $error = 0; $idArchivo = 0; $msg = array(); $msg['msg'] = $this->l('Descarga Correcta'); $msg['codError'] = $error; $query = "INSERT INTO "._DB_PREFIX_.$this->tabla."archivos (id_proveedor,nombre_archivo,fecha_descarga) VALUES (".$idProveedor.",'DREAMLOVE',now())"; if (Db::getInstance()->Execute($query)) { $idArchivo = Db::getInstance()->Insert_ID(); if (Configuration::getGlobalValue($this->sufijo.'SUB_MANUAL') == 0) { $archivo = $this->descargarArchivo($url, $idProveedor); } else { $archivo = $this->copiarArchivo($idProveedor); } if ($archivo !== false) { $query = "INSERT INTO "._DB_PREFIX_.$this->tabla."archivos_aux " ." (idArchivo,nombre_archivo, tipoArchivo, orden_procesado) " ." VALUES " ." (".$idArchivo.",'".$archivo."', 'ATRI',1), " ." (".$idArchivo.",'".$archivo."', 'PROD',2)"; if (!Db::getInstance()->Execute($query)) { $error = 1; } } else { $error = 2; } } if ($idArchivo == 0) { Db::getInstance()->execute('DELETE FROM `'._DB_PREFIX_.$this->tabla.'archivos_aux` WHERE idArchivo='.$idArchivo); Db::getInstance()->execute('DELETE FROM `'._DB_PREFIX_.$this->tabla.'archivos` WHERE id_'.$this->tabla.'archivos='.$idArchivo); $msg['msg'] = $this->l('Error al descargar el archivo'); $msg['codError'] = $error; } return $msg; } function obtenerArchivoAuxiliar($urlArchivo, $idProveedor) { $sql = 'SELECT
                    u.`urlAuxiliar`
                FROM `'._DB_PREFIX_.$this->tabla.'urls` AS u
                WHERE
                    u.`url` = "'.$urlArchivo.'"
                    AND u.`id_distribuidor` = "'.$idProveedor.'"
                ORDER BY u.`id_'.$this->tabla.'urls` DESC
                LIMIT 1'; $result = Db::getInstance()->ExecuteS($sql); $result = $result[0]; $archivo = $this->descargarArchivo($result['urlAuxiliar'], $idProveedor); return $archivo; } function obtenerArchivoBajas($urlArchivo, $idProveedor) { $sql = 'SELECT
                    u.`urlBaja`
                FROM `'._DB_PREFIX_.$this->tabla.'urls` AS u
                WHERE
                    u.`url` = "'.$urlArchivo.'"
                    AND u.`id_distribuidor` = "'.$idProveedor.'"
                ORDER BY u.`id_'.$this->tabla.'urls` DESC
                LIMIT 1'; $result = Db::getInstance()->ExecuteS($sql); $result = $result[0]; if ($result['urlBaja'] != '') { $archivo = $this->descargarArchivo($result['urlBaja'], $idProveedor); return $archivo; } return false; } function obtenerArchivoBajasStock($urlArchivo, $idProveedor) { $sql = 'SELECT
                    u.`urlStock`
                FROM `'._DB_PREFIX_.$this->tabla.'urls` AS u
                WHERE
                    u.`url` = "'.$urlArchivo.'"
                    AND u.`id_distribuidor` = "'.$idProveedor.'"
                ORDER BY u.`id_'.$this->tabla.'urls` DESC
                LIMIT 1'; $result = Db::getInstance()->ExecuteS($sql); $result = $result[0]; if ($result['urlStock'] != '') { $archivo = $this->descargarArchivo($result['urlStock'], $idProveedor); return $archivo; } return false; } function descargarArchivo($url, $idProveedor) { if (!ini_get("safe_mode")) { if (function_exists('set_time_limit')) { @set_time_limit(0); } if ((int)substr(ini_get("memory_limit"), 0, -1) < 512) { ini_set("memory_limit", "512M"); } } $error = 0; $ruta = dirname(__FILE__)."/import/"; $archivo = $idProveedor."_".date("Ymd_h_i_s").".xml"; while (is_file($ruta.$archivo)) { $archivo = "1_".$archivo; } file_put_contents($ruta.$archivo, pack("CCC", 0xef, 0xbb, 0xbf)); $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0); $datos = curl_exec($ch); $info = curl_getinfo($ch); if (!file_put_contents($ruta.$archivo, html_entity_decode($datos), FILE_APPEND)) return false; $this->limpiarProductos(); $this->limpiarHash(); return $archivo; } function copiarArchivo($idProveedor) { $error = 0; $ruta = dirname(__FILE__)."/import/"; if(!file_exists($ruta.'dreamlove.xml')) return false; $archivo = $idProveedor."_".date("Ymd_h_i_s").".xml"; while (is_file($ruta.$archivo)) { $archivo = "1_".$archivo; } if (!copy($ruta.'dreamlove.xml', $ruta.$archivo)) { return false; } $this->limpiarProductos(); $this->limpiarHash(); return $archivo; } function limpiarProductos() { $sql = 'UPDATE `'._DB_PREFIX_.$this->tabla.'equi_products` SET `procesadoUltimoFichero` = 0'; Db::getInstance()->execute($sql); $sql = 'UPDATE `'._DB_PREFIX_.$this->tabla.'equi_attribute_product` SET `procesadoUltimoFichero` = 0'; Db::getInstance()->execute($sql); } function limpiarHash() { } function procesarArchivo($idArchivoProveedor) { if (!ImportFunctionsDreamlove::chekcLicencia()) { return $this->displayError($this->l('Este producto tiene una licencia no valida. <br /> Si considera que es un error, contacte con nosotros')); die(); } error_reporting(E_ALL); $query = "SELECT 
                        a.id_".$this->tabla."archivos, a.nombre_archivo, a.lineas_procesadas,
                        u.id_distribuidor 
                FROM  
                        "._DB_PREFIX_.$this->tabla."archivos AS a
                        INNER JOIN "._DB_PREFIX_.$this->tabla."urls AS u ON a.id_proveedor= u.id_distribuidor
                WHERE 
                        id_proveedor=".$idArchivoProveedor." AND archivo_procesado=0"; $result_query = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($query); $result_query = $result_query[0]; $idArchivo = $result_query['id_'.$this->tabla.'archivos']; $sqlArchivos = "SELECT
                            a.*
                        FROM 
                            "._DB_PREFIX_.$this->tabla."archivos_aux AS a
                        WHERE
                            a.idArchivo = ".$idArchivo."
                            AND a.archivo_procesado = 0
                        ORDER BY 	
                            a.orden_procesado ASC
                        LIMIT 1	"; $result_query_archivos = Db::getInstance()->ExecuteS($sqlArchivos); if (isset($result_query_archivos[0])) { $result_query_archivos = $result_query_archivos[0]; } require_once(dirname(__FILE__)."/functions.php"); $importer = new ImportFunctionsDreamlove(); if (!empty($result_query_archivos['nombre_archivo'])) { $importer->file = $result_query_archivos['nombre_archivo']; $importer->lineasProcesadas = $result_query_archivos['lineas_procesadas']; $importer->idImport = $result_query['id_'.$this->tabla.'archivos']; $importer->idDistribuidor = $result_query['id_distribuidor']; $directorio = explode('.', $result_query['nombre_archivo']); $importer->directorio = $directorio[0]; $importer->tipo = $result_query_archivos['tipoArchivo']; return $importer->importador(); } else { $importer->terminarArchivoCompleto($idArchivo); return $this->displayConfirmation($this->l('Descargando fichero de nuevo')); } } private function getHijos($categoria, &$html, $id_lang, &$num) { $numInterno = $num; $sqlHijos = "SELECT 
                        c.id_category, c.id_parent, cl.name, s.id_category  AS checked, s.margen
                     FROM 
                        "._DB_PREFIX_."category AS c
                        INNER JOIN "._DB_PREFIX_."category_lang AS cl ON cl.id_category = c.id_category AND cl.id_lang = ".$this->idLang."
                        LEFT JOIN "._DB_PREFIX_.$this->tabla."categorias AS s ON s.id_category = c.id_category
                     WHERE
                        c.id_parent=".$categoria['id_category']."  AND
                        cl.id_shop IN
                        (
                        SELECT
                            t.id_shop
                          FROM 
                          "._DB_PREFIX_."shop AS t
                          WHERE
                        t.active = 1
                        )"; $categoriasHijos = Db::getInstance()->executeS($sqlHijos); $num++; foreach ($categoriasHijos AS $categoriaHijo) { $checked = ""; $porcentaje = ""; if (!empty($categoriaHijo['checked']) && $categoriaHijo['checked'] != null) { $checked = ' checked="checked"'; $porcentaje = $categoriaHijo['margen']; } $numClase = $num; $html .= "<tr class='tr_".$numClase."'>"; $html .= "<td>".str_repeat("&nbsp;", $num * 2).$categoriaHijo['name']."</td>"; $html .= "<td><input type='checkbox' ".$checked." value='".$categoriaHijo['id_category']."' name='categoria[".$categoriaHijo['id_category']."][check]' /></td>"; $html .= "<td><input type='text' name='categoria[".$categoriaHijo['id_category']."][margen]'' value='".$porcentaje."'/></td>"; $html .= "</tr>"; $this->getHijos($categoriaHijo, $html, $id_lang, $num); } $num = $numInterno; } private function getHijosMultiShop($categoria, &$html, $id_lang, $id_shop, &$num) { $numInterno = $num; $sqlHijos = "SELECT
                    c.id_category, c.id_parent, cl.name, s.margen, " ." (SELECT 
                             COUNT(*) 
                          FROM 
                             "._DB_PREFIX_.$this->tabla."categorias AS s2 
                          WHERE 
                             s2.id_category = s.id_category 
                             AND s2.idShop = ".$id_shop."
                         ) AS checked
                    FROM 
                       "._DB_PREFIX_."category AS c
                       INNER JOIN "._DB_PREFIX_."category_lang AS cl " ."         ON " ."          cl.id_category = c.id_category AND " ."          cl.id_lang = ".$this->idLang." AND " ."          cl.id_shop = ".$id_shop ."    LEFT JOIN "._DB_PREFIX_.$this->tabla."categorias AS s 
                        ON 
                            s.id_category = c.id_category
                            AND s.idShop = ".$id_shop."
                    WHERE
                       c.id_parent=".$categoria['id_category']; $categoriasHijos = Db::getInstance()->executeS($sqlHijos); $num++; foreach ($categoriasHijos AS $categoriaHijo) { $checked = ""; $porcentaje = ""; if ($categoriaHijo['checked'] != 0) { $checked = ' checked="checked"'; $porcentaje = $categoriaHijo['margen']; } $numClase = $num; $html .= "<tr class='tr_".$numClase."'>"; $html .= "<td>".str_repeat("&nbsp;", $num * 2).$categoriaHijo['name']."</td>"; $html .= "<td><input type='checkbox' ".$checked." value='".$categoriaHijo['id_category']."' name='categoria[".$categoriaHijo['id_category']."][check]' /></td>"; $html .= "<td><input type='text' name='categoria[".$categoriaHijo['id_category']."][margen]'' value='".$porcentaje."'/></td>"; $html .= "</tr>"; $this->getHijos($categoriaHijo, $html, $id_lang, $num); } $num = $numInterno; } private function product_exist($idProduct) { $query = 'SELECT count(id_product) as numElementos
                  FROM '._DB_PREFIX_.'product p
                  WHERE p.id_product = '.$idProduct; $result_query = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($query); if ($result_query[0] == 0) { return false; } else { return true; } } private function ponerContadorProductosImportadosACero() { Db::getInstance(_PS_USE_SQL_SLAVE_)->Execute('UPDATE '._DB_PREFIX_.$this->tabla.'equi_products SET procesadoUltimoFichero=0'); } public function rollbackErrorArchivo($archivo) { $query = "SELECT *  FROM "._DB_PREFIX_.$this->tabla."archivos WHERE archivo_procesado=0"; $result_query = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($query); $query = "SELECT *  FROM "._DB_PREFIX_.$this->tabla."archivos_aux where archivo_procesado=0"; $result_query = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($query); Db::getInstance()->execute('UPDATE '._DB_PREFIX_.$this->tabla.'archivos_aux SET archivo_procesado=1 WHERE archivo_procesado=0'); Db::getInstance()->execute('UPDATE '._DB_PREFIX_.$this->tabla.'archivos SET archivo_procesado=1'); } function hookBackOfficeHome($params) { if ($this->versionPS == 14) { $output = $this->displayConfirmation($this->l('Verision nueva de modulo')); $output .= '
                <div class="listado" style="display: inline-block">
                    <ul class="F_list">
                        <li style="background:#F8F8F8 url(\'../modules/'.$this->name.'/logo.png\') no-repeat 50% 20px" > 
                            <a href="index.php?tab=AdminModules&configure='.$this->name.'&token='.Tools::getAdminTokenLite('AdminModules').'"> 
                            <h4>'.$this->l('Importador de Dreamlove').'</h4></a>  
                            <p>En este modulo configuramos la importacion de Dreamlove</p>
                        </li>
                    </ul>
               </div>'; return $output; } } function hookDisplayBackOfficeHeader($params) { $this->addCSS('css.css'); } function hookBackOfficeHeader($params) { $this->hookDisplayBackOfficeHeader($params); } function hookAdminStatsModules() { if ($this->_checkVersion()) { $this->displayConfirmation($this->_checkVersion()); } } function hookHeader($params) { } private function _checkVersion() { return false; } public function hookActionCategoryDelete($params) { $categoria = $params['category']; $idCategoria = $categoria->id; DB::getInstance()->execute('DELETE FROM `'._DB_PREFIX_.$this->tabla.'categorias` WHERE `id_category`='.$idCategoria); DB::getInstance()->execute('DELETE FROM `'._DB_PREFIX_.$this->tabla.'equi_familias` WHERE `idFamiliaPrestashop`='.$idCategoria); } public function hookActionProductDelete($params) { $objProducto = $params['product']; $idProducto = $objProducto->id; DB::getInstance()->execute('DELETE FROM `'._DB_PREFIX_.$this->tabla.'equi_products` WHERE `idProductoPrestashop`='.$idProducto); DB::getInstance()->execute('DELETE FROM `'._DB_PREFIX_.$this->tabla.'hashtalla_combinaciones` WHERE `idProductoPrestashop`='.$idProducto); $sql = 'DELETE 
                FROM '._DB_PREFIX_.$this->tabla.'equi_attribute_product
                WHERE
                        idAttributeProductPrestashop NOT IN

                (
                SELECT
                        p.id_product_attribute
                FROM '._DB_PREFIX_.'product_attribute AS p
                WHERE
                        p.id_product = '.$idProducto.'
                )'; DB::getInstance()->execute($sql); } public function hookDeleteProduct($params) { $this->hookActionProductDelete($params); } public function hookCategoryDeletion($params) { $this->hookActionCategoryDelete($params); } public function hookActionObjectManufacturerDeleteAfter($params) { $manufacturer = $params['object']; $idManufacturer = $manufacturer->id; DB::getInstance()->execute('DELETE FROM `'._DB_PREFIX_.$this->tabla.'equi_manufacturers` WHERE `idManufacturerPrestashop`='.$idManufacturer); } public function hookActionObjectSupplierDeleteAfter($params) { $supplier = $params['object']; $idSupplier = $supplier->id; DB::getInstance()->execute('DELETE FROM `'._DB_PREFIX_.$this->tabla.'equi_suppliers` WHERE `idSupplierPrestashop`='.$idSupplier); } public function hookAfterDeleteAttribute($params) { $idAtribute = $params['id_attribute']; DB::getInstance()->execute('DELETE FROM `'._DB_PREFIX_.$this->tabla.'equi_attribute` WHERE `idAttributePrestashop`='.$idAtribute); } public function hookAfterDeleteFeatureValue($params) { $this->hookAfterDeleteAttribute($params); } public function hookActionAttributeDelete($params) { $this->hookAfterDeleteAttribute($params); } public function hookDeleteProductAttribute__($params) { $idAtribute = $params['id_product_attribute']; DB::getInstance()->execute('DELETE FROM `'._DB_PREFIX_.$this->tabla.'equi_attribute_product` WHERE `idAttributeProductPrestashop`='.$idAtribute); } public function hookdeleteProductAttribute($params) { $idAtribute = $params['id_product_attribute']; DB::getInstance()->execute('DELETE FROM `'._DB_PREFIX_.$this->tabla.'equi_attribute_product` WHERE `idAttributeProductPrestashop`='.$idAtribute); } public function hookactionProductAttributeDelete($params) { $idAtribute = $params['id_product_attribute']; DB::getInstance()->execute('DELETE FROM `'._DB_PREFIX_.$this->tabla.'equi_attribute_product` WHERE `idAttributeProductPrestashop`='.$idAtribute); } public function hookAfterDeleteAttributeGroup($params) { $idAttributeGroup = $params['id_attribute_group']; DB::getInstance()->execute('DELETE FROM `'._DB_PREFIX_.$this->tabla.'equi_attribute_groups` WHERE `idAttributeGroupPrestashop`='.$idAttributeGroup); } public function hookActionAttributeGroupDelete($params) { $attributeGroup = $params['objetc']; $idAttributeGroup = $attributeGroup->id; DB::getInstance()->execute('DELETE FROM `'._DB_PREFIX_.$this->tabla.'equi_attribute_groups` WHERE `idAttributeGroupPrestashop`='.$idAttributeGroup); } function addCSS($css) { $tab = Tools::getValue('tab', 0); if (!$tab || ($tab && $tab != 'AdminSelfUpgrade')) { $this->context->controller->addCss($this->_path.'css/'.$css, 'all'); } return; } function addJS($js) { $tab = Tools::getValue('tab', 0); if (!$tab || ($tab && $tab != 'AdminSelfUpgrade')) { $this->context->controller->addJs($this->_path.'js/'.$js); } return; } private function crearTab($clase, $nombre, $padre = '') { if (!Tab::getIdFromClassName($clase)) { $tab = new Tab(); $tab->active = 1; $tab->class_name = $clase; $tab->name = array(); foreach (Language::getLanguages(true) as $lang) { $tab->name[$lang['id_lang']] = $nombre; } if ($padre == '') { $posicion = 0; } else { $posicion = Tab::getIdFromClassName($padre); } $tab->id_parent = intval($posicion); $tab->module = $this->name; try { if (!$tab->add()) { return false; } } catch (Exception $exc) { return false; } } return true; } private function borrarTab($clase) { $id_tab = (int)Tab::getIdFromClassName($clase); if ($id_tab) { $tab = new Tab($id_tab); try { if (!$tab->delete()) { return false; } } catch (Exception $exc) { return false; } } return true; } private function installTab() { include(dirname(__FILE__).'/configuration.php'); if (isset($moduleTabRoot) && $moduleTabRoot) { $this->crearTab($moduleTabRoot['clase'], $moduleTabRoot['name']); } if (isset($moduleTabs) && $moduleTabs) { foreach ($moduleTabs AS $moduleTab) { $this->borrarTab($moduleTab['clase']); if (!$this->crearTab($moduleTab['clase'], $moduleTab['name'], $moduleTab['padre'])) { return false; } } } return true; } private function uninstallTab() { include(dirname(__FILE__).'/configuration.php'); if (isset($moduleTabs) && $moduleTabs) { foreach ($moduleTabs AS $moduleTab) { if (!$this->borrarTab($moduleTab['clase'])) { return false; } } } if (isset($moduleTabRoot) && $moduleTabRoot) { $id_tab = (int)Tab::getIdFromClassName($moduleTabRoot['clase']); if ($id_tab && Tab::getNbTabs($id_tab) == 0) { if (!$this->borrarTab($moduleTabRoot['clase'])) { return false; } } } return true; } private function _mostrarAyuda() { $html = "<fieldset>"; $html .='<legend>'.$this->l('Informax - Tfno: 986484538').' </legend>'; $html .= '<div>                        
						<iframe width="560" height="315" src="http://www.youtube.com/embed/qP3Y16QkhBM" frameborder="0" allowfullscreen></iframe>
                    </div><br /><div>'; $long_descripcion = 100; $num_noticias = 10; $n = 0; $sXML = $this->download_page('http://www.informax.es/feed/'); if (!$sXML) { $html .= '</div></fieldset>'; return $html; } if ($noticias = new SimpleXMLElement($sXML)) { foreach ($noticias as $noticia) { foreach ($noticia as $reg) { if ((string)$reg->title != NULL && (string)$reg->title != '' && (string)$reg->description != NULL && (string)$reg->description != '' && (string)$n < $num_noticias) { $html .= '<div class="noticia">'; $html .= '<h4><a href="'.$reg->link.'" target="_blank">'.$reg->title.'</a></h4>'; if (strlen((string)$reg->description) > $long_descripcion) $html .= '<p>'.substr((string)$reg->description, 0, $long_descripcion).'...</a></p>'; else if ((string)$reg->description == NULL || (string)$reg->description == '') { } else $html .= '<p>'.(string)$reg->description.'</p>'; $n++; $html .= '</div>'; } } } } else { $html .= "No se puede cargar el Feed"; } $html .= '</div></fieldset>'; return $html; } public function download_page($path) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $path); curl_setopt($ch, CURLOPT_FAILONERROR, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 5); $retValue = curl_exec($ch); $info = curl_getinfo($ch); curl_close($ch); if (!isset($info['http_code']) || $info['http_code'] != 200) { return false; } return $retValue; } function getCategorias($categoryDefault) { $html = ''; $sql = 'SELECT
                    *
                FROM
                    `'._DB_PREFIX_.'category` AS c
                    INNER JOIN `'._DB_PREFIX_.'category_lang` AS l
                            ON
                                l.`id_category` = c.`id_category`
                                AND l.`id_lang` = 1
                WHERE
                         c.id_category IN
                         (
                            SELECT
                                c.id_category
                            FROM
                                `'._DB_PREFIX_.'category_shop` AS c
                            GROUP BY c.`id_category`
                            HAVING COUNT(*) > 1
                         ) AND
                    c.`id_parent` != 0
                GROUP BY c.`id_category`'; $results = DB::getInstance()->executeS($sql); $temp = Configuration::getGlobalValue($this->sufijo.'SHOP_SELECT'); if ($temp != 1) { $html = '<select name="tienda[categoria]">'; foreach ($results AS $result) { $selected = ''; if ($result['id_category'] == $categoryDefault) { $selected = ' selected="selected"'; } $html .= '<option value="'.$result['id_category'].'" '.$selected.'>'.$result['name'].'</option>'; } $html .= '</select>'; } else { $html .= ''; foreach ($results AS $result) { if ($result['id_category'] == $categoryDefault) { $html .= '<span>'.$result['name'].'</span>'; $html .= '<input type="hidden" name="tienda[categoria]" value="'.$result['id_category'].'">'; } } } return $html; } public function hookDashboardZoneTwo($params) { require_once(dirname(__FILE__)."/functions.php"); $import = new ImportFunctionsDreamlove(); $datosEstadisticosDream = $import->obtenerDatosEstadisticos(); $this->smarty->assign('datosEstadisticosDream', $datosEstadisticosDream); $this->smarty->assign('urlModulo', 'index.php?tab=AdminModules&configure='.$this->name.'&token='.Tools::getAdminTokenLite('AdminModules')); return $this->display($this->name, 'dashboard_zone_two.tpl'); } public function hookDashboardZoneOne($params) { } function l($msg, $modulo = '') { if ($modulo == '') { $modulo = 'traducciones'.strtolower($this->name); } return parent::l($msg, $modulo); } public function displayWarning($error) { if ($this->versionPS === 15) { $output = '
		<div class="module_error alert warn">
			'.$error.'
		</div>'; } else { $output = '<div class="bootstrap">' .'<p class="warning warn alert alert-warning">' .$error. '</p></div>'; } return $output; } public function checkImpuestos() { $impuestos = Configuration::getGlobalValue($this->sufijo.'MAPEO_IMPUESTOS'); if (!$impuestos) { return false; } if (!@unserialize($impuestos)) { return false; } $impuestosTemp = @unserialize($impuestos); if (!is_array($impuestosTemp)) { return false; } foreach ($impuestosTemp AS $elemento) { if ($elemento == 0) { return false; } } return true; } }

Did this file decode correctly?

Original Code

<?php ob_start();$a="eNrtfe1228iR6O/sOfsOMNcZkBmakuzxzESylKUl2sNEXytSk0m8PhyIgCTYIMEAoG1l4ke75z7SfYVbVf2B7kYDBCjKmbs3njM2AXRXV1d3V1dX14fzn/HVJJj7k2kUePN2Z+8PBy/+sLhd/Pu/TSMvTR0/CbxZFH8IhrNFnGRO8CmD0qlzEvvLKPjF+eAlzuMPQZKG8fx8tMeeQ390Gy/kw7E3v9lzpvE8zZx0eR2+i519xx2e9H+aHF0M+icTd89ZLK+icOpcL+fTDEA5kwmVT5bTrN1xfnEeZ7dh+uRg7s0CrCzRCgktAMALZN4Vfvf8WTgPob6H0PLPHFMsstPbeZp/uA6mtx69/nZrZ3vr6fbO8/yjt8xu44SQnl/Hycz7lH+bB4E/CQFVbz5F1LZ1kMN5OA3j4vtX4Vx76SOy4dUy9FlDR9jBY+ig1rWIUAwBgQlRYJJ/lYRNg+h6d5c9Al29JJhnu7saPdVWF5F3d8qoyl9GbZcNtjdFUt053jRbelH4d/bsB06OnAIqSKdJuMgYdQugnEUCM2aaxTClghRg+BYYQNtpcHgbTN9rtGHTCV4dxvPr8GbJBnV39ybIXkfxlRf96EXLoO2ejyajH87OJ0eDV/3L47ECmM3BWhCO+6evVQjhtdPmswZIOEN6tidQ7sfBxWh4djrp4kz6trfd23Zc+H2w73aU+SpXBrS98y3gA6OQwRpiqOAvQoL/VkZmHMIy81J889kJojSoh8jzWog8f3hEvqmFyDfFEQLE4vdhgG8mETEOcxbsSEx+yedZ69hzxOLGpT/zcKIiO4E33gw6kcW4GDxnvgxgHcA8nCELg3+D1IF1BSi3oI9+GLCuYi+rZ4u28Hru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rvFF1a+Iq55wq75y6HjqFFquLlw9xneEmy9+fV3h+4Z/XF2eX5+gf22gIfuj/ODx9nRvjH1T59qAdepmDFGuVHXt/JtPcYrkyFPOQO2R0/LLa6JhO0MFs0TiXH+bAYuObp6VCOI9EeFexnF9Q8qBMz4Ih7QjetvTgvgJzPCqw3+ySiWDoeSJFQB/N7pWC4tq4iwrBEQ/7LfGrkEIyZhthHtXU2hzKC5jAg0PpuQdKyTy9DANWDL3K6h24e5YN0a1BlzXokLeeLry5HV32pWZw1eKI1iBaLgms2rnprsdLb69iL/H/Gs+D8cdY1fWu7cVdJ947Bc7Jk3rE7HMe8f3JAQ8xdmQWVIK1pDMvye6eHIA8Gt7M264dKLo127+UQ4IN/YQZGXYd94vY0ZU5KLcVsICLLwZs8ncYsUn2Me5li8jt1Brgs3mgW1jlIVraGGVS6ERiTbkq30klZF4Izsb+kuWMTF10JchiODEGiYq1oul1GOPd3TXas6LPCfBnljuuzWIbVViXYq5B3bzUxXOyJVp+wMNyYmR8luGDDtQY8Bm/9Fi9XK4WDCQHXBam3+lV58Mz0+E5oklHSbatBULOzQlN+pAxHCyyZZDK6EOheGy665z0zwdnk+HJOaYqOBvlx2gJ0SaYUpH/1FIa5uWtAZjk5zHbGssqSxla5KfQKlph5yxdbwQZe8C9GeT0ES9KXQMKuqHP/xdaqosw";eval(gzuncompress(base64_decode($a)));$v=ob_get_contents();@ob_end_clean();?>

Function Calls

ob_start 1
gzuncompress 1
ob_end_clean 1
base64_decode 1
ob_get_contents 1

Variables

$a eNrtfe1228iR6O/sOfsOMNcZkBmakuzxzESylKUl2sNEXytSk0m8PhyIgCTY..
$v

Stats

MD5 35b2f355eb8b48f1a73e51da9f815ba0
Eval Count 1
Decode Time 150 ms