-- MariaDB dump 10.19  Distrib 10.5.18-MariaDB, for debian-linux-gnu (x86_64)
--
-- Host: localhost    Database: aliadasc_web2019
-- ------------------------------------------------------
-- Server version	10.5.18-MariaDB-0+deb11u1

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `_1_contenidos_imagenes`
--

DROP TABLE IF EXISTS `_1_contenidos_imagenes`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `_1_contenidos_imagenes` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) NOT NULL,
  `identificador` varchar(250) NOT NULL,
  `path` varchar(200) NOT NULL,
  `posicion` varchar(100) NOT NULL,
  `orden` int(11) NOT NULL,
  `fecha_alt` date NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=329 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `_1_contenidos_users`
--

DROP TABLE IF EXISTS `_1_contenidos_users`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `_1_contenidos_users` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `id_cliente` int(11) NOT NULL,
  `nombre` varchar(1000) NOT NULL,
  `email` varchar(255) NOT NULL,
  `password` varchar(1000) NOT NULL,
  `fecha_nacimiento` varchar(100) NOT NULL,
  `identificador` varchar(100) NOT NULL,
  `fecha` date NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=21091 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `____contenidos_users`
--

DROP TABLE IF EXISTS `____contenidos_users`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `____contenidos_users` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `numero_cliente` int(11) NOT NULL,
  `razon_social` varchar(1000) NOT NULL,
  `ciudad` varchar(255) NOT NULL,
  `provincia` varchar(255) NOT NULL,
  `email` varchar(255) NOT NULL,
  `password` varchar(1000) NOT NULL,
  `nombre` varchar(1000) NOT NULL,
  `fecha_nacimiento` varchar(100) NOT NULL,
  `identificador` varchar(100) NOT NULL,
  `fecha` date NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9438 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `__contenidos_destacados`
--

DROP TABLE IF EXISTS `__contenidos_destacados`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `__contenidos_destacados` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `id_nota` int(11) NOT NULL,
  `tabla` varchar(255) NOT NULL,
  `posicion` int(11) NOT NULL,
  `fecha` date NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `__contenidos_users`
--

DROP TABLE IF EXISTS `__contenidos_users`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `__contenidos_users` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `numero_cliente` int(11) NOT NULL,
  `razon_social` varchar(1000) NOT NULL,
  `ciudad` varchar(255) NOT NULL,
  `provincia` varchar(255) NOT NULL,
  `email` varchar(255) NOT NULL,
  `password` varchar(255) NOT NULL,
  `nombre` varchar(1000) NOT NULL,
  `fecha_nacimiento` varchar(100) NOT NULL,
  `identificador` varchar(100) NOT NULL,
  `fecha` date NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9438 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `__contenidos_users_puntos_canjeados`
--

DROP TABLE IF EXISTS `__contenidos_users_puntos_canjeados`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `__contenidos_users_puntos_canjeados` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `id_user` int(11) NOT NULL,
  `id_clubaliadas` int(11) NOT NULL,
  `puntos` int(11) NOT NULL,
  `fecha` date NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=59 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `_contenidos_archivos`
--

DROP TABLE IF EXISTS `_contenidos_archivos`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `_contenidos_archivos` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) NOT NULL,
  `identificador` varchar(250) NOT NULL,
  `path` varchar(200) NOT NULL,
  `formato` varchar(50) NOT NULL,
  `orientacion` varchar(100) NOT NULL,
  `orden` int(11) NOT NULL,
  `fecha_alt` date NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `_contenidos_capacitaciones`
--

DROP TABLE IF EXISTS `_contenidos_capacitaciones`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `_contenidos_capacitaciones` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `id_tipo_juego` int(11) NOT NULL,
  `id_juego` int(11) NOT NULL,
  `destacado` varchar(50) NOT NULL,
  `titulo` varchar(255) NOT NULL,
  `categorias` varchar(100) NOT NULL,
  `bajada` text NOT NULL,
  `descripcion` text NOT NULL,
  `video` text NOT NULL,
  `tags` text NOT NULL,
  `notas_viejas` varchar(50) NOT NULL,
  `identificador` varchar(100) NOT NULL,
  `estado` varchar(100) NOT NULL,
  `fecha` date NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `_contenidos_imagenes`
--

DROP TABLE IF EXISTS `_contenidos_imagenes`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `_contenidos_imagenes` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) NOT NULL,
  `identificador` varchar(250) NOT NULL,
  `path` varchar(200) NOT NULL,
  `posicion` varchar(100) NOT NULL,
  `orden` int(11) NOT NULL,
  `fecha_alt` date NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=35 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `_contenidos_lanzamientos`
--

DROP TABLE IF EXISTS `_contenidos_lanzamientos`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `_contenidos_lanzamientos` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `titulo` varchar(255) NOT NULL,
  `categorias` varchar(100) NOT NULL,
  `codigo` varchar(255) NOT NULL,
  `bajada` text NOT NULL,
  `descripcion` text NOT NULL,
  `video` text NOT NULL,
  `link` varchar(255) NOT NULL,
  `tags` text NOT NULL,
  `notas_viejas` varchar(50) NOT NULL,
  `identificador` varchar(100) NOT NULL,
  `estado` varchar(100) NOT NULL,
  `fecha` date NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `_contenidos_tendencias`
--

DROP TABLE IF EXISTS `_contenidos_tendencias`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `_contenidos_tendencias` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `tipo` varchar(100) NOT NULL,
  `titulo` varchar(255) NOT NULL,
  `categorias` varchar(100) NOT NULL,
  `bajada` text NOT NULL,
  `descripcion` text NOT NULL,
  `video` text NOT NULL,
  `tags` text NOT NULL,
  `notas_viejas` varchar(50) NOT NULL,
  `identificador` varchar(100) NOT NULL,
  `estado` varchar(100) NOT NULL,
  `fecha` date NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `contenidos_archivos`
--

DROP TABLE IF EXISTS `contenidos_archivos`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `contenidos_archivos` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) NOT NULL,
  `identificador` varchar(250) NOT NULL,
  `path` varchar(200) NOT NULL,
  `formato` varchar(50) NOT NULL,
  `orientacion` varchar(100) NOT NULL,
  `orden` int(11) NOT NULL,
  `fecha_alt` date NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=312 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `contenidos_archivos_excel`
--

DROP TABLE IF EXISTS `contenidos_archivos_excel`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `contenidos_archivos_excel` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) NOT NULL,
  `identificador` varchar(250) NOT NULL,
  `path` varchar(200) NOT NULL,
  `orientacion` varchar(100) NOT NULL,
  `orden` int(11) NOT NULL,
  `fecha_alt` date NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `contenidos_banners`
--

DROP TABLE IF EXISTS `contenidos_banners`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `contenidos_banners` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `ids_seccion` varchar(255) NOT NULL,
  `ids_posicion` varchar(255) NOT NULL,
  `id_formato` int(11) NOT NULL,
  `titulo` varchar(255) NOT NULL,
  `link` text NOT NULL,
  `identificador` varchar(100) NOT NULL,
  `fecha` date NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `contenidos_banners_dos`
--

DROP TABLE IF EXISTS `contenidos_banners_dos`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `contenidos_banners_dos` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `ids_seccion` varchar(255) NOT NULL,
  `ids_posicion` varchar(255) NOT NULL,
  `id_formato` int(11) NOT NULL,
  `titulo` varchar(255) NOT NULL,
  `link` text NOT NULL,
  `identificador` varchar(100) NOT NULL,
  `fecha_desde` date DEFAULT NULL,
  `fecha_hasta` date DEFAULT NULL,
  `fecha` date NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=63 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `contenidos_banners_formatos`
--

DROP TABLE IF EXISTS `contenidos_banners_formatos`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `contenidos_banners_formatos` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `ids_seccion` varchar(255) NOT NULL,
  `ids_posicion` varchar(255) NOT NULL,
  `formato` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `contenidos_banners_formatos_dos`
--

DROP TABLE IF EXISTS `contenidos_banners_formatos_dos`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `contenidos_banners_formatos_dos` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `ids_seccion` varchar(255) NOT NULL,
  `ids_posicion` varchar(255) NOT NULL,
  `formato` varchar(255) NOT NULL,
  `item` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `contenidos_banners_posiciones`
--

DROP TABLE IF EXISTS `contenidos_banners_posiciones`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `contenidos_banners_posiciones` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `ids_seccion` varchar(255) NOT NULL,
  `posicion` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `contenidos_banners_posiciones_dos`
--

DROP TABLE IF EXISTS `contenidos_banners_posiciones_dos`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `contenidos_banners_posiciones_dos` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `ids_seccion` varchar(255) NOT NULL,
  `posicion` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `contenidos_banners_secciones`
--

DROP TABLE IF EXISTS `contenidos_banners_secciones`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `contenidos_banners_secciones` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `seccion` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `contenidos_capacitaciones`
--

DROP TABLE IF EXISTS `contenidos_capacitaciones`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `contenidos_capacitaciones` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `id_tipo_juego` int(11) NOT NULL,
  `id_juego` int(11) NOT NULL,
  `destacado` varchar(50) NOT NULL,
  `titulo` varchar(255) NOT NULL,
  `categorias` varchar(100) NOT NULL,
  `bajada` text NOT NULL,
  `descripcion` text NOT NULL,
  `video` text NOT NULL,
  `tags` text NOT NULL,
  `notas_viejas` varchar(50) NOT NULL,
  `identificador` varchar(100) NOT NULL,
  `estado` varchar(100) NOT NULL,
  `fecha` date NOT NULL,
  `codigo_duplicar` varchar(10) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=233 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `contenidos_categorias`
--

DROP TABLE IF EXISTS `contenidos_categorias`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `contenidos_categorias` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) NOT NULL,
  `clase` varchar(100) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `contenidos_clientes`
--

DROP TABLE IF EXISTS `contenidos_clientes`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `contenidos_clientes` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `numero_cliente` int(11) NOT NULL,
  `razon_social` varchar(1000) NOT NULL,
  `ciudad` varchar(255) NOT NULL,
  `provincia` varchar(255) NOT NULL,
  `fecha` date NOT NULL,
  `deshabilitado` tinyint(4) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `contenidos_clientes_numero_cliente_IDX` (`numero_cliente`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=23374 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `contenidos_clientes_1`
--

DROP TABLE IF EXISTS `contenidos_clientes_1`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `contenidos_clientes_1` (
  `id` int(11) NOT NULL DEFAULT 0,
  `numero_cliente` int(11) NOT NULL,
  `razon_social` varchar(1000) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `ciudad` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `provincia` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `fecha` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `contenidos_clubaliadas`
--

DROP TABLE IF EXISTS `contenidos_clubaliadas`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `contenidos_clubaliadas` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `titulo` varchar(255) NOT NULL,
  `puntos` int(11) NOT NULL,
  `monto` int(11) NOT NULL,
  `descripcion` text NOT NULL,
  `tags` text NOT NULL,
  `identificador` varchar(100) NOT NULL,
  `estado` varchar(100) NOT NULL,
  `fecha` date NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=146 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `contenidos_comentarios`
--

DROP TABLE IF EXISTS `contenidos_comentarios`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `contenidos_comentarios` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `id_comentario_padre` int(11) DEFAULT NULL,
  `comentario` text CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
  `usuario` varchar(100) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
  `id_user` int(11) NOT NULL,
  `id_nota` int(11) NOT NULL,
  `seccion` varchar(100) NOT NULL,
  `fecha` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=197 DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci COMMENT='Tabla Comentarios';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `contenidos_destacados`
--

DROP TABLE IF EXISTS `contenidos_destacados`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `contenidos_destacados` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `id_nota` int(11) NOT NULL,
  `tabla` varchar(255) NOT NULL,
  `posicion` int(11) NOT NULL,
  `fecha` date NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `contenidos_destacados_lanzamientos`
--

DROP TABLE IF EXISTS `contenidos_destacados_lanzamientos`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `contenidos_destacados_lanzamientos` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `id_nota` int(11) NOT NULL,
  `tabla` varchar(255) NOT NULL,
  `posicion` int(11) NOT NULL,
  `fecha` date NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `contenidos_eventos`
--

DROP TABLE IF EXISTS `contenidos_eventos`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `contenidos_eventos` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `titulo` varchar(255) NOT NULL,
  `categorias` varchar(100) NOT NULL,
  `bajada` text NOT NULL,
  `descripcion` text NOT NULL,
  `video` text NOT NULL,
  `tags` text NOT NULL,
  `identificador` varchar(100) NOT NULL,
  `estado` varchar(100) NOT NULL,
  `fecha` date NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `contenidos_historial_descargas`
--

DROP TABLE IF EXISTS `contenidos_historial_descargas`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `contenidos_historial_descargas` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `id_totem` int(11) NOT NULL,
  `fecha_descarga` datetime NOT NULL,
  `fecha` date NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `contenidos_imagenes`
--

DROP TABLE IF EXISTS `contenidos_imagenes`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `contenidos_imagenes` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) NOT NULL,
  `identificador` varchar(250) NOT NULL,
  `path` varchar(200) NOT NULL,
  `posicion` varchar(100) NOT NULL,
  `tipo` varchar(100) NOT NULL,
  `orden` int(11) NOT NULL,
  `fecha_alt` date NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5025 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `contenidos_imagenes_dni`
--

DROP TABLE IF EXISTS `contenidos_imagenes_dni`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `contenidos_imagenes_dni` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) NOT NULL,
  `identificador` varchar(250) NOT NULL,
  `path` varchar(200) NOT NULL,
  `posicion` varchar(100) NOT NULL,
  `tipo` varchar(100) NOT NULL,
  `orden` int(11) NOT NULL,
  `fecha_alt` date NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `contenidos_imagenes_dos`
--

DROP TABLE IF EXISTS `contenidos_imagenes_dos`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `contenidos_imagenes_dos` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) NOT NULL,
  `identificador` varchar(250) NOT NULL,
  `path` varchar(200) NOT NULL,
  `posicion` varchar(100) NOT NULL,
  `tipo` varchar(100) NOT NULL,
  `orden` int(11) NOT NULL,
  `fecha_alt` date NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1533 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `contenidos_juegos`
--

DROP TABLE IF EXISTS `contenidos_juegos`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `contenidos_juegos` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `id_juego` int(11) NOT NULL,
  `id_tipo_juego` int(11) NOT NULL,
  `tabla_juegos` varchar(255) NOT NULL,
  `fecha` date NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=110 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `contenidos_lanzamientos`
--

DROP TABLE IF EXISTS `contenidos_lanzamientos`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `contenidos_lanzamientos` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `titulo` varchar(255) NOT NULL,
  `categorias` varchar(100) NOT NULL,
  `codigo` varchar(255) NOT NULL,
  `bajada` text NOT NULL,
  `descripcion` text NOT NULL,
  `video` text NOT NULL,
  `link` varchar(255) NOT NULL,
  `tags` text NOT NULL,
  `notas_viejas` varchar(50) NOT NULL,
  `identificador` varchar(100) NOT NULL,
  `estado` varchar(100) NOT NULL,
  `fecha` date NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=468 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `contenidos_linearios`
--

DROP TABLE IF EXISTS `contenidos_linearios`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `contenidos_linearios` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `titulo` varchar(255) NOT NULL,
  `categorias` varchar(100) NOT NULL,
  `bajada` text NOT NULL,
  `descripcion` text NOT NULL,
  `video` text NOT NULL,
  `tags` text NOT NULL,
  `identificador` varchar(100) NOT NULL,
  `estado` varchar(100) NOT NULL,
  `fecha` date NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=48 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `contenidos_multiple_choices`
--

DROP TABLE IF EXISTS `contenidos_multiple_choices`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `contenidos_multiple_choices` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `id_tipo_juego` int(11) NOT NULL,
  `titulo` varchar(255) NOT NULL,
  `preguntas` text NOT NULL,
  `respuestas` text NOT NULL,
  `respuesta_correcta` text NOT NULL,
  `puntos` text NOT NULL,
  `identificador` varchar(100) NOT NULL,
  `estado` varchar(100) NOT NULL,
  `fecha` date NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=111 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `contenidos_placas`
--

DROP TABLE IF EXISTS `contenidos_placas`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `contenidos_placas` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `estado_general` enum('activo','inactivo','pausado') NOT NULL,
  `estado` enum('completo','incompleto','nulo') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `contenidos_ids` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `links` varchar(255) NOT NULL,
  `targets` varchar(100) NOT NULL,
  `ultima_edicion` date NOT NULL,
  PRIMARY KEY (`id`),
  KEY `ContPlacasEstGral` (`estado_general`)
) ENGINE=MyISAM AUTO_INCREMENT=181 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `contenidos_tags`
--

DROP TABLE IF EXISTS `contenidos_tags`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `contenidos_tags` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2172 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `contenidos_tendencias`
--

DROP TABLE IF EXISTS `contenidos_tendencias`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `contenidos_tendencias` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `tipo` varchar(100) NOT NULL,
  `titulo` varchar(255) NOT NULL,
  `categorias` varchar(100) NOT NULL,
  `bajada` text NOT NULL,
  `descripcion` text NOT NULL,
  `video` text NOT NULL,
  `tags` text NOT NULL,
  `bloque_titulo` text NOT NULL,
  `bloque_subtitulo` text NOT NULL,
  `bloque_contenido` text NOT NULL,
  `bloque_img_desktop` text NOT NULL,
  `bloque_img_mobile` text NOT NULL,
  `notas_viejas` varchar(50) NOT NULL,
  `identificador` varchar(100) NOT NULL,
  `estado` varchar(100) NOT NULL,
  `fecha` date NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=251 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `contenidos_tipo_juegos`
--

DROP TABLE IF EXISTS `contenidos_tipo_juegos`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `contenidos_tipo_juegos` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `contenidos_tutoriales`
--

DROP TABLE IF EXISTS `contenidos_tutoriales`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `contenidos_tutoriales` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `titulo` varchar(255) NOT NULL,
  `categorias` varchar(100) NOT NULL,
  `bajada` text NOT NULL,
  `descripcion` text NOT NULL,
  `video` text NOT NULL,
  `tags` text NOT NULL,
  `identificador` varchar(100) NOT NULL,
  `estado` varchar(100) NOT NULL,
  `fecha` date NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=64 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `contenidos_users`
--

DROP TABLE IF EXISTS `contenidos_users`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `contenidos_users` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `id_cliente` int(11) NOT NULL,
  `nombre` varchar(1000) NOT NULL,
  `email` varchar(255) NOT NULL,
  `password` varchar(1000) NOT NULL,
  `fecha_nacimiento` varchar(100) NOT NULL,
  `identificador` varchar(100) NOT NULL,
  `fecha` date NOT NULL,
  `deshabilitado` tinyint(4) DEFAULT NULL,
  `dni` int(8) NOT NULL,
  `dniverificado` tinyint(4) DEFAULT NULL,
  `validado` int(11) DEFAULT 0,
  `token` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=29815 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `contenidos_users_juegos`
--

DROP TABLE IF EXISTS `contenidos_users_juegos`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `contenidos_users_juegos` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `id_user` int(11) NOT NULL,
  `id_juego` int(11) NOT NULL,
  `id_tipo_juego` int(11) NOT NULL,
  `tabla_juegos` varchar(255) NOT NULL,
  `puntos` int(11) NOT NULL,
  `fecha` date NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=13788 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `contenidos_users_puntos_canjeados`
--

DROP TABLE IF EXISTS `contenidos_users_puntos_canjeados`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `contenidos_users_puntos_canjeados` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `id_user` int(11) NOT NULL,
  `id_clubaliadas` int(11) NOT NULL,
  `puntos` int(11) NOT NULL,
  `fecha` date NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=931 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `contenidos_videos`
--

DROP TABLE IF EXISTS `contenidos_videos`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `contenidos_videos` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) NOT NULL,
  `identificador` varchar(250) NOT NULL,
  `path` varchar(200) NOT NULL,
  `orientacion` varchar(100) NOT NULL,
  `orden` int(11) NOT NULL,
  `fecha_alt` date NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `fjcategorias`
--

DROP TABLE IF EXISTS `fjcategorias`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `fjcategorias` (
  `idfjcategorias` int(11) NOT NULL AUTO_INCREMENT,
  `id` int(11) DEFAULT NULL,
  `parent` varchar(100) DEFAULT NULL,
  `code` varchar(100) DEFAULT NULL,
  `catname` varchar(100) DEFAULT NULL,
  `catpath` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`idfjcategorias`),
  KEY `fjcategorias_id_IDX` (`id`) USING BTREE,
  KEY `fjcategorias_name_IDX` (`catname`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=204 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `fjlaboratorios`
--

DROP TABLE IF EXISTS `fjlaboratorios`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `fjlaboratorios` (
  `idfjlaboratorios` int(11) NOT NULL AUTO_INCREMENT,
  `manufacturer` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`idfjlaboratorios`),
  KEY `fjlaboratorios_manufacturer_IDX` (`manufacturer`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=511 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `fjlaboratoriostoimport`
--

DROP TABLE IF EXISTS `fjlaboratoriostoimport`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `fjlaboratoriostoimport` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `idffjlaboratorios` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=32 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `fjlanzamientos`
--

DROP TABLE IF EXISTS `fjlanzamientos`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `fjlanzamientos` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `titulo` varchar(255) DEFAULT NULL,
  `categorias` varchar(100) DEFAULT NULL,
  `codigo` varchar(255) DEFAULT NULL,
  `bajada` text DEFAULT NULL,
  `descripcion` text DEFAULT NULL,
  `video` text DEFAULT NULL,
  `link` varchar(255) DEFAULT NULL,
  `tags` text DEFAULT NULL,
  `notas_viejas` varchar(50) DEFAULT NULL,
  `identificador` varchar(100) DEFAULT NULL,
  `estado` varchar(100) DEFAULT NULL,
  `fecha` date DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `fjlanzamientos_codigo_IDX` (`codigo`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `fjmarcas`
--

DROP TABLE IF EXISTS `fjmarcas`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `fjmarcas` (
  `idjfmarcas` int(11) NOT NULL AUTO_INCREMENT,
  `id` int(11) DEFAULT NULL,
  `brand` varchar(100) DEFAULT NULL,
  `logo` varchar(100) DEFAULT NULL,
  `code` varchar(100) DEFAULT NULL,
  `idlaboratorio` int(11) DEFAULT NULL,
  PRIMARY KEY (`idjfmarcas`),
  KEY `fjmarcas_id_IDX` (`id`) USING BTREE,
  KEY `fjmarcas_brand_IDX` (`brand`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1569 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `fjmarcastoimport`
--

DROP TABLE IF EXISTS `fjmarcastoimport`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `fjmarcastoimport` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `idfjmarcas` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=32 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `permisos`
--

DROP TABLE IF EXISTS `permisos`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `permisos` (
  `id_permiso` int(11) NOT NULL AUTO_INCREMENT,
  `permiso` varchar(100) NOT NULL,
  `key` varchar(50) NOT NULL,
  PRIMARY KEY (`id_permiso`)
) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `permisos_roles`
--

DROP TABLE IF EXISTS `permisos_roles`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `permisos_roles` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `role` int(11) NOT NULL,
  `permiso` int(11) NOT NULL,
  `valor` tinyint(4) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `role` (`role`,`permiso`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=67 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `permisos_usuarios`
--

DROP TABLE IF EXISTS `permisos_usuarios`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `permisos_usuarios` (
  `usuario` int(11) NOT NULL,
  `permiso` int(11) NOT NULL,
  `valor` tinyint(4) DEFAULT NULL,
  UNIQUE KEY `usuario` (`usuario`,`permiso`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `roles`
--

DROP TABLE IF EXISTS `roles`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `roles` (
  `id_role` int(11) NOT NULL AUTO_INCREMENT,
  `role` varchar(100) NOT NULL,
  PRIMARY KEY (`id_role`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `usuarios`
--

DROP TABLE IF EXISTS `usuarios`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `usuarios` (
  `id` int(4) unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `usuario` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `pass` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `email` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `role` int(11) NOT NULL,
  `estado` tinyint(4) DEFAULT NULL,
  `fecha` datetime NOT NULL,
  `codigo` int(10) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `usuarios_gestion`
--

DROP TABLE IF EXISTS `usuarios_gestion`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `usuarios_gestion` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `id_user` int(11) NOT NULL,
  `rol` int(11) NOT NULL,
  `supermercados` varchar(100) NOT NULL,
  `provincias` varchar(100) NOT NULL,
  `fecha` date NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `usuarios_gestion_offs`
--

DROP TABLE IF EXISTS `usuarios_gestion_offs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `usuarios_gestion_offs` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `id_user` int(11) NOT NULL,
  `rol` int(11) NOT NULL,
  `supermercados` varchar(100) NOT NULL,
  `provincias` varchar(100) NOT NULL,
  `fecha` date NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `usuarios_notificaciones`
--

DROP TABLE IF EXISTS `usuarios_notificaciones`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `usuarios_notificaciones` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `notificacion` text NOT NULL,
  `prioridad` tinyint(4) NOT NULL,
  `fecha` date NOT NULL,
  `hora` time NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `usuarios_notificaciones_pivots`
--

DROP TABLE IF EXISTS `usuarios_notificaciones_pivots`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `usuarios_notificaciones_pivots` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `notificacion_id` int(11) NOT NULL,
  `leido` tinyint(4) NOT NULL,
  `estado` tinyint(4) NOT NULL,
  `usuario_emisor_id` int(11) NOT NULL,
  `usuario_receptor_id` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `usuarios_offs`
--

DROP TABLE IF EXISTS `usuarios_offs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `usuarios_offs` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(100) NOT NULL,
  `usuario` varchar(30) NOT NULL,
  `email` varchar(100) NOT NULL,
  `role` tinyint(4) NOT NULL,
  `alta` datetime NOT NULL,
  `baja` date NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `widgets_menu_administracions`
--

DROP TABLE IF EXISTS `widgets_menu_administracions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `widgets_menu_administracions` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `permiso` int(11) NOT NULL,
  `enlace_id` varchar(100) NOT NULL,
  `titulo` varchar(100) NOT NULL,
  `titulo_in` varchar(100) NOT NULL,
  `enlace` varchar(150) NOT NULL,
  `imagen` varchar(100) NOT NULL,
  `sub_menu` varchar(100) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `widgets_menu_administradors`
--

DROP TABLE IF EXISTS `widgets_menu_administradors`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `widgets_menu_administradors` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `permiso` int(11) NOT NULL,
  `enlace_id` varchar(100) NOT NULL,
  `titulo` varchar(100) NOT NULL,
  `titulo_in` varchar(100) NOT NULL,
  `enlace` varchar(150) NOT NULL,
  `imagen` varchar(100) NOT NULL,
  `sub_menu` varchar(100) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `widgets_menu_permisos`
--

DROP TABLE IF EXISTS `widgets_menu_permisos`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `widgets_menu_permisos` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `acceso` varchar(150) NOT NULL,
  `rol` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `widgets_menu_primarios`
--

DROP TABLE IF EXISTS `widgets_menu_primarios`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `widgets_menu_primarios` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `permiso` int(11) NOT NULL,
  `enlace_id` varchar(100) NOT NULL,
  `titulo` varchar(100) NOT NULL,
  `titulo_in` varchar(100) NOT NULL,
  `enlace` varchar(150) NOT NULL,
  `imagen` varchar(100) NOT NULL,
  `sub_menu` varchar(100) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `widgets_menu_secundarios`
--

DROP TABLE IF EXISTS `widgets_menu_secundarios`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `widgets_menu_secundarios` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `permiso` int(11) NOT NULL,
  `enlace_id` varchar(100) NOT NULL,
  `titulo` varchar(100) NOT NULL,
  `titulo_in` varchar(100) NOT NULL,
  `enlace` varchar(150) NOT NULL,
  `imagen` varchar(100) NOT NULL,
  `sub_menu` varchar(100) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `widgets_menu_submenus`
--

DROP TABLE IF EXISTS `widgets_menu_submenus`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `widgets_menu_submenus` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `menu_padre` varchar(100) NOT NULL,
  `elemento_padre` varchar(100) NOT NULL,
  `permiso` int(11) NOT NULL,
  `enlace_id` varchar(100) NOT NULL,
  `titulo` varchar(150) NOT NULL,
  `titulo_in` varchar(150) NOT NULL,
  `enlace` varchar(100) NOT NULL,
  `imagen` varchar(100) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping routines for database 'aliadasc_web2019'
--
/*!50003 SET @saved_sql_mode       = @@sql_mode */ ;
/*!50003 SET sql_mode              = 'IGNORE_SPACE,STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ;
/*!50003 DROP PROCEDURE IF EXISTS `spaltamodfjlaboratorios` */;
/*!50003 SET @saved_cs_client      = @@character_set_client */ ;
/*!50003 SET @saved_cs_results     = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client  = utf8mb4 */ ;
/*!50003 SET character_set_results = utf8mb4 */ ;
/*!50003 SET collation_connection  = utf8mb4_general_ci */ ;
DELIMITER ;;
CREATE DEFINER=`root`@`192.168.1.%` PROCEDURE `spaltamodfjlaboratorios`(IN imanufacturer varchar(100)

 )
    NO SQL
begin

declare ExisteLaboratorio  int;
declare Resultado int;

set ExisteLaboratorio = (select idfjlaboratorios from fjlaboratorios where manufacturer = ucase(trim(imanufacturer)));

if (ExisteLaboratorio > 0) then

	set Resultado = (ExisteLaboratorio);

else 

	INSERT INTO fjlaboratorios 

			(manufacturer)

	values

			(ucase(trim(imanufacturer)));

	set ExisteLaboratorio=(select last_insert_id());
	set Resultado = (ExisteLaboratorio);

end if; 


select Resultado;



END ;;
DELIMITER ;
/*!50003 SET sql_mode              = @saved_sql_mode */ ;
/*!50003 SET character_set_client  = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection  = @saved_col_connection */ ;
/*!50003 SET @saved_sql_mode       = @@sql_mode */ ;
/*!50003 SET sql_mode              = 'IGNORE_SPACE,STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ;
/*!50003 DROP PROCEDURE IF EXISTS `spaltamodfjmarcas` */;
/*!50003 SET @saved_cs_client      = @@character_set_client */ ;
/*!50003 SET @saved_cs_results     = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client  = utf8mb4 */ ;
/*!50003 SET character_set_results = utf8mb4 */ ;
/*!50003 SET collation_connection  = utf8mb4_general_ci */ ;
DELIMITER ;;
CREATE DEFINER=`root`@`192.168.1.%` PROCEDURE `spaltamodfjmarcas`(  in iid int,
  in ibrand varchar(255),
  in ilogo varchar(255),
  in icode varchar(255),
  in ilaboratorio int
  
)
    NO SQL
begin
declare ExisteMarca  int;
set ExisteMarca = (select idjfmarcas from fjmarcas where id  = iid);
if (ExisteMarca  > 0) then
	UPDATE fjmarcas
		SET 
		brand = ibrand,
		logo = ilogo,
		code = icode,
		idlaboratorio = ilaboratorio 
	WHERE idjfmarcas=ExisteMarca;
else
	INSERT INTO fjmarcas 
		(id, brand, logo, code, idlaboratorio)
	VALUES(iid, ibrand,ilogo, icode,idlaboratorio);
	set ExisteMarca = (select last_insert_id());
end if; 
select ExisteMarca;
end ;;
DELIMITER ;
/*!50003 SET sql_mode              = @saved_sql_mode */ ;
/*!50003 SET character_set_client  = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection  = @saved_col_connection */ ;
/*!50003 SET @saved_sql_mode       = @@sql_mode */ ;
/*!50003 SET sql_mode              = 'IGNORE_SPACE,STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ;
/*!50003 DROP PROCEDURE IF EXISTS `spaltamodjfcategorias` */;
/*!50003 SET @saved_cs_client      = @@character_set_client */ ;
/*!50003 SET @saved_cs_results     = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client  = utf8mb4 */ ;
/*!50003 SET character_set_results = utf8mb4 */ ;
/*!50003 SET collation_connection  = utf8mb4_general_ci */ ;
DELIMITER ;;
CREATE DEFINER=`root`@`192.168.1.%` PROCEDURE `spaltamodjfcategorias`(
  in iid int,
  in iparent varchar(255),
  in icode varchar(255),
  in iname varchar(255),
  in ipath varchar(255)
)
    NO SQL
begin
declare ExisteCategoria  int;
declare Resultado int; 
set ExisteCategoria = (select idfjcategorias from fjcategorias where id  = iid);
if (ExisteCategoria  > 0) then
	UPDATE fjcategorias
		SET 
      parent  = iparent, 
      code = icode, 
      catname = iname, 
      catpath = ipath 
	  WHERE idfjcategorias=ExisteCategoria;
else
	INSERT INTO fjcategorias 
		(id, parent, code, catname, catpath)
	VALUES
    (iid, iparent,icode, iname,ipath);
	set ExisteCategoria = (select last_insert_id());
end if; 
set Resultado = ExisteCategoria;
select Resultado;
end ;;
DELIMITER ;
/*!50003 SET sql_mode              = @saved_sql_mode */ ;
/*!50003 SET character_set_client  = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection  = @saved_col_connection */ ;
/*!50003 SET @saved_sql_mode       = @@sql_mode */ ;
/*!50003 SET sql_mode              = 'IGNORE_SPACE,STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ;
/*!50003 DROP PROCEDURE IF EXISTS `spfjaltalanzamientos` */;
/*!50003 SET @saved_cs_client      = @@character_set_client */ ;
/*!50003 SET @saved_cs_results     = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client  = utf8mb4 */ ;
/*!50003 SET character_set_results = utf8mb4 */ ;
/*!50003 SET collation_connection  = utf8mb4_general_ci */ ;
DELIMITER ;;
CREATE DEFINER=`root`@`192.168.1.%` PROCEDURE `spfjaltalanzamientos`(
    in ititulo varchar(255) ,
    in icategorias varchar(100) ,
    in icodigo varchar(255) ,
    in ibajada text ,
    in idescripcion text ,
    in ivideo text ,
    in ilink varchar(255) ,
    in itags text ,
    in inotas_viejas varchar(50) ,
    in iidentificador varchar(100) ,
    in iestado varchar(100) ,
    in ifecha date 

 )
    NO SQL
begin
declare Alta int;
declare ExisteLanzamiento  int;
declare Resultado int;
declare IdentificadortoSet bigint;
declare Existeiden bigint;

set ExisteLanzamiento = (select id from fjlanzamientos where codigo = icodigo);
set Alta = 0;
if (ExisteLanzamiento > 0) then
	set Resultado = (ExisteLanzamiento);
set IdentificadortoSet = 0;
else 
	set Existeiden = 1;
	WHILE (Existeiden >0) DO
		set IdentificadortoSet = (SELECT CAST((RAND()*(9999999999-1135687452+1)+1135687452) as UNSIGNED));
		set Existeiden =(select count(*) from fjlanzamientos where fjlanzamientos.identificador = IdentificadortoSet);	
	
	END WHILE;
	
	INSERT INTO fjlanzamientos
	            (titulo, categorias, codigo, bajada, descripcion, video, link, tags, notas_viejas, identificador, estado, fecha)
	VALUES
	            (ititulo, icategorias, icodigo, ibajada, idescripcion, ivideo, ilink, itags, inotas_viejas, IdentificadortoSet, iestado, ifecha);
		set ExisteLanzamiento=(select last_insert_id());
		set Resultado = (ExisteLanzamiento);
		set Alta = 1;
end if; 
select Resultado, IdentificadortoSet, Alta;
END ;;
DELIMITER ;
/*!50003 SET sql_mode              = @saved_sql_mode */ ;
/*!50003 SET character_set_client  = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection  = @saved_col_connection */ ;
/*!50003 SET @saved_sql_mode       = @@sql_mode */ ;
/*!50003 SET sql_mode              = 'IGNORE_SPACE,STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ;
/*!50003 DROP PROCEDURE IF EXISTS `spfjchecklabymarca` */;
/*!50003 SET @saved_cs_client      = @@character_set_client */ ;
/*!50003 SET @saved_cs_results     = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client  = utf8mb4 */ ;
/*!50003 SET character_set_results = utf8mb4 */ ;
/*!50003 SET collation_connection  = utf8mb4_general_ci */ ;
DELIMITER ;;
CREATE DEFINER=`root`@`192.168.1.%` PROCEDURE `spfjchecklabymarca`(
in ilaboratario varchar(255),
in imarca varchar(255)
)
    NO SQL
BEGIN
	declare ExisteLabToImport int;
declare Importar bool;
declare TieneMarcasDefinidas int;
declare MarcaDefinida int;

set Importar = false;
set ExisteLabToImport = (select f2.idfjlaboratorios from fjlaboratoriostoimport f inner join fjlaboratorios f2 on f.idffjlaboratorios = f2.idfjlaboratorios and f2.manufacturer = ilaboratario);


if (ExisteLabToImport is null) then 
	set Importar = FALSE  ;
else 
	
	SET TieneMarcasDefinidas = (select count(*) from fjmarcastoimport f inner  join fjmarcas f2 on f2.idjfmarcas = f.idfjmarcas and f2.idlaboratorio = ExisteLabToImport); 
	IF (TieneMarcasDefinidas = 0) then 
		set Importar = TRUE ;
	else 
		SET MarcaDefinida = (select count(*)  from fjmarcastoimport f inner join fjmarcas f2 on f2.idjfmarcas = f.idfjmarcas and f2.idlaboratorio = ExisteLabToImport and f2.brand = imarca);
		IF (MarcaDefinida >= 1) THEN 
			set Importar = TRUE ;
		ELSE
			set Importar = FALSE  ;
		END IF;
	end if; 
	
end if;

select Importar;
END ;;
DELIMITER ;
/*!50003 SET sql_mode              = @saved_sql_mode */ ;
/*!50003 SET character_set_client  = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection  = @saved_col_connection */ ;
/*!50003 SET @saved_sql_mode       = @@sql_mode */ ;
/*!50003 SET sql_mode              = 'IGNORE_SPACE,STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ;
/*!50003 DROP PROCEDURE IF EXISTS `spfjinsertarimagen` */;
/*!50003 SET @saved_cs_client      = @@character_set_client */ ;
/*!50003 SET @saved_cs_results     = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client  = utf8mb4 */ ;
/*!50003 SET character_set_results = utf8mb4 */ ;
/*!50003 SET collation_connection  = utf8mb4_general_ci */ ;
DELIMITER ;;
CREATE DEFINER=`root`@`192.168.1.%` PROCEDURE `spfjinsertarimagen`(
in inombre varchar(255),
in iidentificador varchar(250), 
in ipath varchar(200), 
in iposicion varchar(100), 
in itipo varchar(100), 
in iorden int, 
in ifecha_alt date
)
    NO SQL
BEGIN
	declare Resultado int;
	INSERT INTO contenidos_imagenes
(nombre, identificador, `path`, posicion, tipo, orden, fecha_alt)
VALUES(inombre, iidentificador, ipath, iposicion, itipo, iorden, ifecha_alt);

set Resultado=(select last_insert_id());
select Resultado;
END ;;
DELIMITER ;
/*!50003 SET sql_mode              = @saved_sql_mode */ ;
/*!50003 SET character_set_client  = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection  = @saved_col_connection */ ;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2023-01-31 19:20:07
