--
-- Host: localhost    Database: base_local
-- ------------------------------------------------------


--
-- Table structure for table `acciones`
--

CREATE TABLE `acciones` (
  `numero_aaff` int(11) NOT NULL,
  `denominacion` varchar(255) DEFAULT NULL,
  `modalidad` varchar(2) DEFAULT NULL,
  `prioridad` varchar(20) DEFAULT NULL,
  `tipo_programa` varchar(50) DEFAULT NULL,
  `horas_totales` int(11) DEFAULT NULL,
  `horas_p` int(11) DEFAULT NULL,
  `costo_por_hora_por_participante` decimal(10,2) DEFAULT NULL,
  `participantes_en_centros` int(11) DEFAULT NULL,
  `costo_centro_af` decimal(10,2) DEFAULT NULL,
  `profesor` int(11) DEFAULT NULL,
  `licencia` decimal(10,2) DEFAULT NULL,
  `total` decimal(10,2) DEFAULT NULL,
  PRIMARY KEY (`numero_aaff`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `acciones`
--


--
-- Table structure for table `actividad`
--

CREATE TABLE `actividad` (
  `id_actividad` int(11) NOT NULL AUTO_INCREMENT,
  `actividad` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `ip` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `user_id` int(11) NOT NULL,
  `fecha` datetime NOT NULL,
  PRIMARY KEY (`id_actividad`),
  KEY `actividad` (`actividad`),
  KEY `user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `actividad`
--


--
-- Table structure for table `administraciones`
--

CREATE TABLE `administraciones` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `codigo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `nombre` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `direccion` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `cp` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `ciudad` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `provincia` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `tramitador` tinyint(4) DEFAULT 0,
  `contable` tinyint(4) DEFAULT 0,
  `gestor` tinyint(4) DEFAULT 0,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `administraciones`
--


--
-- Table structure for table `albaranes`
--

CREATE TABLE `albaranes` (
  `id_albaran` int(11) NOT NULL AUTO_INCREMENT,
  `titulo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `id_cliente` int(11) NOT NULL,
  `fecha` datetime NOT NULL,
  `numero` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `condiciones` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `tipo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `estado` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `detallado` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `importe` decimal(9,2) NOT NULL,
  `id_fase` int(11) DEFAULT NULL,
  `id_sector` int(11) DEFAULT NULL,
  `id_obra` int(11) DEFAULT NULL,
  `cif` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `domicilio` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `cp` int(11) DEFAULT NULL,
  `telefono` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `id_usuario` int(11) NOT NULL,
  `importe_final` decimal(9,2) NOT NULL,
  `irpf` decimal(7,2) DEFAULT NULL,
  `nota_interna` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `nota_externa` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `imagen` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `programado` datetime DEFAULT NULL,
  `lugar` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `fechas` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  PRIMARY KEY (`id_albaran`),
  KEY `FK_client_id` (`id_cliente`),
  KEY `FK_fase_id` (`id_fase`),
  KEY `FK_sector_id` (`id_sector`),
  KEY `FK_obra_id` (`id_obra`),
  KEY `FK_user_id` (`id_usuario`),
  CONSTRAINT `albaranes_ibfk_1` FOREIGN KEY (`id_cliente`) REFERENCES `clientes` (`client_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `albaranes_ibfk_2` FOREIGN KEY (`id_usuario`) REFERENCES `users` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `albaranes_ibfk_3` FOREIGN KEY (`id_fase`) REFERENCES `fases` (`id_fase`) ON DELETE SET NULL ON UPDATE SET NULL,
  CONSTRAINT `albaranes_ibfk_4` FOREIGN KEY (`id_obra`) REFERENCES `obras` (`id_obra`) ON DELETE SET NULL ON UPDATE SET NULL,
  CONSTRAINT `albaranes_ibfk_5` FOREIGN KEY (`id_sector`) REFERENCES `sectores` (`id_sector`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `albaranes`
--

INSERT INTO `albaranes` VALUES (1,'sdfae',9,'2025-04-02 18:13:18','2023/A2',NULL,'Particular','No enviado','[{\"codigo\":\"SKU-400\",\"cantidad\":\"20 \",\"descripcion\":\"CERAMICA NUEVA BARATA \",\"precio_unitario\":\"0.00\",\"titulo\":null,\"igic\":\"0.00\"}]',0.00,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'f@23123123',13,0.00,NULL,NULL,NULL,'https://panelprincipal.platformkitdigital.com/image.php?id=CeD4ahiDU2QgDyWgNWYeh69k2',NULL,'qwer','qwer'),(2,'dfgdg',1,'2025-04-02 18:14:35','2023/A3',NULL,'Particular','Pendiente','[{\"codigo\":\"SKU-400\",\"cantidad\":\"20 \",\"descripcion\":\"CERAMICA NUEVA BARATA \",\"precio_unitario\":\"0.00\",\"titulo\":null,\"igic\":\"0.00\"}]',0.00,NULL,NULL,NULL,'37847226',NULL,NULL,NULL,'fede.gundel@gmail.com',13,0.00,NULL,NULL,NULL,'https://panelprincipal.platformkitdigital.com/image.php?id=CeD4ahiDU2QgDyWgNWYeh69k2',NULL,'wert','edrgwer'),(3,'sdfgwstwe',2,'2025-04-02 18:15:10','2023/A4',NULL,'Particular','No enviado','[{\"codigo\":\"SKU-400\",\"cantidad\":\"20 \",\"descripcion\":\"CERAMICA NUEVA BARATA \",\"precio_unitario\":\"10.00\",\"titulo\":null,\"igic\":\"0.00\"},{\"codigo\":\"1112\",\"cantidad\":\"1 dfgh\",\"descripcion\":\"Esto es una prueba\",\"precio_unitario\":\"200.00\",\"titulo\":\"Pared\",\"igic\":\"7.00\"},{\"codigo\":\"sku34\",\"cantidad\":\"1 dfgh\",\"descripcion\":\"Transportegwyilielbef\",\"precio_unitario\":\"0.00\",\"titulo\":\"TRANSPORTE 1 HORA \",\"igic\":\"7.00\"}]',400.00,NULL,NULL,NULL,'6767333L','Calle 9 letra b n6 24 entre 72C y 72E',NULL,NULL,'infopierre14@gmail.com',13,414.00,NULL,NULL,NULL,'https://panelprincipal.platformkitdigital.com/image.php?id=CeD4ahiDU2QgDyWgNWYeh69k2',NULL,NULL,NULL);

--
-- Table structure for table `alergeno_alumno`
--

CREATE TABLE `alergeno_alumno` (
  `id_alergeno_alumno` int(11) NOT NULL AUTO_INCREMENT,
  `id_alergeno` int(11) NOT NULL,
  `id_alumno` int(11) NOT NULL,
  PRIMARY KEY (`id_alergeno_alumno`),
  KEY `id_alergeno` (`id_alergeno`),
  CONSTRAINT `alergeno_alumno_ibfk_1` FOREIGN KEY (`id_alergeno`) REFERENCES `alergenos` (`id_alergeno`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `alergeno_alumno`
--


--
-- Table structure for table `alergenos`
--

CREATE TABLE `alergenos` (
  `id_alergeno` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `icono` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  PRIMARY KEY (`id_alergeno`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `alergenos`
--


--
-- Table structure for table `almacenes`
--

CREATE TABLE `almacenes` (
  `id_almacen` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  PRIMARY KEY (`id_almacen`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `almacenes`
--


--
-- Table structure for table `alumno_curso`
--

CREATE TABLE `alumno_curso` (
  `id_alumno_curso` int(11) NOT NULL AUTO_INCREMENT,
  `id_alumno` int(11) NOT NULL,
  `id_curso` int(11) NOT NULL,
  `estado` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT 'Interesado',
  PRIMARY KEY (`id_alumno_curso`),
  KEY `id_alumno` (`id_alumno`),
  KEY `id_curso` (`id_curso`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `alumno_curso`
--


--
-- Table structure for table `alumnos`
--

CREATE TABLE `alumnos` (
  `id_alumno` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `nif` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `niss` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `nombre` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `apellidos` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `fecha_nacimiento` date DEFAULT NULL,
  `domicilio` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `codigo_postal` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `municipio` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `discapacitado` tinyint(1) DEFAULT NULL,
  `sexo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `estudios` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `telefono` varchar(15) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `fecha_incorporacion` date DEFAULT NULL,
  `iban` varchar(34) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `colectivo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `categoria` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `area_funcional` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `entidad_trabajo_actual` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `es_pyme` tinyint(1) DEFAULT NULL,
  `sector_convenio` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `razon_social` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `cif_empresa` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `num_inscripcion_seguridad_social` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `datos_centro_trabajo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `domicilio_trabajo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `codigo_postal_trabajo` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `municipio_trabajo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `situacion_laboral` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `programa_prepara` tinyint(1) DEFAULT NULL,
  `programa_activacion` tinyint(1) DEFAULT NULL,
  `oficina_empleo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `fecha_demanda` date DEFAULT NULL,
  PRIMARY KEY (`id_alumno`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `alumnos`
--


--
-- Table structure for table `anomalia`
--

CREATE TABLE `anomalia` (
  `id_fichaje` int(11) DEFAULT NULL,
  `anomalia` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `id_miembro` int(11) NOT NULL,
  `id_anomalia` int(11) NOT NULL AUTO_INCREMENT,
  `fecha` datetime NOT NULL,
  `justificacion` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_danish_ci DEFAULT NULL,
  PRIMARY KEY (`id_anomalia`),
  KEY `id_miembro` (`id_miembro`),
  KEY `anomalia_ibfk_1` (`id_fichaje`)
) ENGINE=InnoDB AUTO_INCREMENT=155 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `anomalia`
--


--
-- Table structure for table `apartado_factura_manual`
--

CREATE TABLE `apartado_factura_manual` (
  `id_apartado_factura_manual` int(11) NOT NULL AUTO_INCREMENT,
  `cantidad` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `titulo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `descripcion` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `precio_unitario` decimal(9,2) NOT NULL,
  `id_factura_manual` int(11) NOT NULL,
  `id_medida` int(11) NOT NULL,
  `codigo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `igic` decimal(10,2) DEFAULT NULL,
  `id_albaran` int(11) DEFAULT NULL,
  PRIMARY KEY (`id_apartado_factura_manual`),
  KEY `id_factura_manual` (`id_factura_manual`),
  KEY `id_medida` (`id_medida`),
  KEY `id_albaran` (`id_albaran`),
  CONSTRAINT `apartado_factura_manual_ibfk_1` FOREIGN KEY (`id_factura_manual`) REFERENCES `factura_manual` (`id_factura_manual`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `apartado_factura_manual_ibfk_2` FOREIGN KEY (`id_albaran`) REFERENCES `albaranes` (`id_albaran`) ON DELETE SET NULL ON UPDATE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=58 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `apartado_factura_manual`
--

INSERT INTO `apartado_factura_manual` VALUES (52,'1 ',NULL,'Habitación con baño y yacuzzi.',100.00,45,0,'1',7.00,NULL),(53,'1 ',NULL,'Esto es una prueba',200.00,45,0,'1112',7.00,NULL),(54,'20 ',NULL,'CERAMICA NUEVA BARATA ',10.00,46,0,'SKU-400',0.00,3),(55,'1 dfgh','Pared','Esto es una prueba',200.00,46,0,'1112',7.00,3),(56,'1 dfgh','TRANSPORTE 1 HORA ','Transportegwyilielbef',0.00,46,0,'sku34',7.00,3),(57,'1 ',NULL,'Habitación con baño y yacuzzi.',100.00,46,0,'1',7.00,NULL);

--
-- Table structure for table `apartado_factura_rectificada`
--

CREATE TABLE `apartado_factura_rectificada` (
  `id_apartado_factura_rectificada` int(11) NOT NULL AUTO_INCREMENT,
  `cantidad` varchar(255) DEFAULT NULL,
  `titulo` varchar(255) DEFAULT NULL,
  `descripcion` varchar(10000) DEFAULT NULL,
  `precio_unitario` decimal(9,2) DEFAULT NULL,
  `igic` decimal(9,2) DEFAULT NULL,
  `id_factura_rectificada` int(11) DEFAULT NULL,
  `id_apartado_factura_manual` int(11) NOT NULL,
  PRIMARY KEY (`id_apartado_factura_rectificada`),
  KEY `apartado_factura_rectificada_ibfk_1` (`id_factura_rectificada`),
  KEY `id_apartado_factura_manual` (`id_apartado_factura_manual`),
  CONSTRAINT `apartado_factura_rectificada_ibfk_1` FOREIGN KEY (`id_factura_rectificada`) REFERENCES `facturas_rectificadas` (`id_factura_rectificada`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `apartado_factura_rectificada_ibfk_2` FOREIGN KEY (`id_apartado_factura_manual`) REFERENCES `apartado_factura_manual` (`id_apartado_factura_manual`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;

--
-- Dumping data for table `apartado_factura_rectificada`
--


--
-- Table structure for table `apartados`
--

CREATE TABLE `apartados` (
  `apartado_id` int(11) NOT NULL AUTO_INCREMENT,
  `titulo` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL,
  `descripcion` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `cantidad` int(11) NOT NULL,
  `precio_unitario` decimal(9,2) NOT NULL,
  `fecha` date NOT NULL DEFAULT current_timestamp(),
  `id_medida` int(11) DEFAULT NULL,
  `codigo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `precio_coste` double(10,2) DEFAULT NULL,
  `id_ubicacion` int(11) DEFAULT NULL,
  `ean` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `id_familia` int(11) DEFAULT NULL,
  `id_subfamilia` int(11) DEFAULT NULL,
  `id_igic` int(11) DEFAULT NULL,
  `fecha_caducidad` date DEFAULT NULL,
  `numero_lote` varchar(15) DEFAULT NULL,
  `stock` int(255) NOT NULL DEFAULT 0,
  PRIMARY KEY (`apartado_id`),
  UNIQUE KEY `codigo_unico` (`codigo`),
  KEY `id_medida` (`id_medida`),
  KEY `fk_apartados_ubicaciones` (`id_ubicacion`),
  KEY `fk_apartados_familias` (`id_familia`),
  KEY `fk_apartados_subfamilias` (`id_subfamilia`),
  KEY `id_igic` (`id_igic`),
  CONSTRAINT `apartados_ibfk_1` FOREIGN KEY (`id_medida`) REFERENCES `medidas` (`id_medida`) ON DELETE SET NULL ON UPDATE SET NULL,
  CONSTRAINT `apartados_ibfk_2` FOREIGN KEY (`id_igic`) REFERENCES `igic` (`id_igic`) ON DELETE SET NULL ON UPDATE SET NULL,
  CONSTRAINT `fk_apartados_familias` FOREIGN KEY (`id_familia`) REFERENCES `familias` (`id_familia`) ON DELETE SET NULL ON UPDATE SET NULL,
  CONSTRAINT `fk_apartados_subfamilias` FOREIGN KEY (`id_subfamilia`) REFERENCES `subfamilias` (`id_subfamilia`) ON DELETE SET NULL ON UPDATE SET NULL,
  CONSTRAINT `fk_apartados_ubicaciones` FOREIGN KEY (`id_ubicacion`) REFERENCES `ubicaciones` (`id_ubicacion`) ON DELETE SET NULL ON UPDATE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `apartados`
--

INSERT INTO `apartados` VALUES (6,'Pared','Esto es una prueba',1,200.00,'2024-10-16',NULL,'1112',200.00,NULL,'1112',NULL,NULL,1,'2024-10-16','1112',10),(7,'TRANSPORTE 1 HORA ','Transportegwyilielbef',1,0.00,'2024-11-05',NULL,'sku34',100.00,NULL,NULL,NULL,NULL,1,NULL,NULL,2147483647),(8,'Tejas de cerámica','CERAMICA NUEVA BARATA ',20,0.00,'2024-11-14',NULL,'SKU-400',22.00,NULL,NULL,NULL,NULL,NULL,NULL,NULL,5000000),(9,'Habitacion 305','Habitación con baño y yacuzzi.',1,100.00,'2025-01-09',NULL,'1',100.00,NULL,'11',NULL,NULL,1,'2025-01-30','3',3);

--
-- Table structure for table `archivos`
--

CREATE TABLE `archivos` (
  `id_archivo` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `url` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL,
  `fecha` timestamp NOT NULL DEFAULT current_timestamp(),
  `tipo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `carpeta_id` int(11) DEFAULT NULL,
  `extension` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  PRIMARY KEY (`id_archivo`),
  KEY `id_carpeta` (`carpeta_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `archivos`
--


--
-- Table structure for table `articulos`
--

CREATE TABLE `articulos` (
  `id_articulo` int(11) NOT NULL AUTO_INCREMENT,
  `titulo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `descripcion` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `precio_unitario` decimal(10,2) DEFAULT NULL,
  `activo` tinyint(1) NOT NULL DEFAULT 1,
  `descuento` decimal(10,2) DEFAULT NULL,
  `stock` int(11) DEFAULT NULL,
  `ean` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `codigo_proveedor` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `precio_coste` decimal(10,2) DEFAULT NULL,
  `id_marca` int(11) DEFAULT NULL,
  `id_familia` int(11) DEFAULT NULL,
  `id_subfamilia` int(11) DEFAULT NULL,
  `uds_caja` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `campo_1` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `campo_2` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `campo_3` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `campo_4` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `igic` decimal(9,2) DEFAULT NULL,
  `codigo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `id_ubicacion` int(11) DEFAULT NULL,
  PRIMARY KEY (`id_articulo`),
  KEY `articulos_ibfk_1` (`id_marca`),
  KEY `articulos_ibfk_2` (`id_familia`),
  KEY `articulos_ibfk_3` (`id_subfamilia`),
  KEY `fk_ubicacion` (`id_ubicacion`),
  CONSTRAINT `articulos_ibfk_1` FOREIGN KEY (`id_marca`) REFERENCES `marcas` (`id_marca`) ON DELETE SET NULL ON UPDATE SET NULL,
  CONSTRAINT `articulos_ibfk_2` FOREIGN KEY (`id_familia`) REFERENCES `familias` (`id_familia`) ON DELETE SET NULL ON UPDATE SET NULL,
  CONSTRAINT `articulos_ibfk_3` FOREIGN KEY (`id_subfamilia`) REFERENCES `subfamilias` (`id_subfamilia`) ON DELETE SET NULL ON UPDATE SET NULL,
  CONSTRAINT `fk_ubicacion` FOREIGN KEY (`id_ubicacion`) REFERENCES `ubicaciones` (`id_ubicacion`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `articulos`
--


--
-- Table structure for table `backups`
--

CREATE TABLE `backups` (
  `id_backup` int(11) NOT NULL AUTO_INCREMENT,
  `fecha` date NOT NULL,
  PRIMARY KEY (`id_backup`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;

--
-- Dumping data for table `backups`
--


--
-- Table structure for table `baldas`
--

CREATE TABLE `baldas` (
  `id_balda` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  PRIMARY KEY (`id_balda`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `baldas`
--


--
-- Table structure for table `bancos`
--

CREATE TABLE `bancos` (
  `id_banco` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `direccion` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `iban` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `beneficiario` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `divisa` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `swift` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  PRIMARY KEY (`id_banco`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `bancos`
--

INSERT INTO `bancos` VALUES (4,'BBVA','Alcalde Jose Ramirez Bethencourt n13','ES6801820769920201671575','1','(€) Euro','BBVAXXXXX'),(5,'SANTANDER',NULL,NULL,NULL,'(€) Euro',NULL);

--
-- Table structure for table `carpetas`
--

CREATE TABLE `carpetas` (
  `id_carpeta` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `carpeta_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id_carpeta`),
  KEY `carpeta_id` (`carpeta_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `carpetas`
--


--
-- Table structure for table `categoria`
--

CREATE TABLE `categoria` (
  `id_categoria` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  PRIMARY KEY (`id_categoria`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `categoria`
--

INSERT INTO `categoria` VALUES (1,'Fiestas');

--
-- Table structure for table `cliente_subvencion`
--

CREATE TABLE `cliente_subvencion` (
  `id_cliente_subvencion` int(11) NOT NULL AUTO_INCREMENT,
  `id_cliente` int(11) NOT NULL,
  `id_subvencion` int(11) NOT NULL,
  `fecha_envio` datetime DEFAULT NULL,
  `email` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL,
  `estado` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL,
  `email_marketing` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL,
  `id_estado_subvencion` int(11) DEFAULT NULL,
  `tag` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
  `url_portada` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `condiciones` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  PRIMARY KEY (`id_cliente_subvencion`),
  KEY `id_cliente` (`id_cliente`),
  KEY `id_subvencion` (`id_subvencion`),
  KEY `id_estado_subvencion` (`id_estado_subvencion`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `cliente_subvencion`
--


--
-- Table structure for table `clientes`
--

CREATE TABLE `clientes` (
  `client_id` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `direccion` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `cp` int(11) DEFAULT NULL,
  `email` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
  `telefono` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `cif` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `fecha` date DEFAULT NULL,
  `user_id` int(11) NOT NULL,
  `estado` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT 'Potencial',
  `imagen` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT 'assets/images/clientes/user-default.png',
  `email_marketing` tinyint(1) NOT NULL DEFAULT 0,
  `subvencionado` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT 'No',
  `fecha_nacimiento` date DEFAULT NULL,
  `sms_habilitado` tinyint(1) NOT NULL DEFAULT 0,
  `felicitado` tinyint(1) NOT NULL DEFAULT 0,
  `peluqueria` varchar(255) NOT NULL DEFAULT 'No',
  `tipo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT 'Particular',
  `sexo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT 'Otro',
  `emails` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `descuento` decimal(10,2) DEFAULT 0.00,
  `codigo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT 'CI78S',
  `id_sector` int(11) DEFAULT NULL,
  `linkedin` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `instagram` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tiktok` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `x` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `facebook` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `forma_juridica` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `nombre_juridico` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `cif_juridico` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `domicilio_fiscal` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `activo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT 'Activo',
  `codigo_tramitador` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `codigo_gestor` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `codigo_contable` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `web` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `terminos` tinyint(1) NOT NULL DEFAULT 0,
  `movil` varchar(20) DEFAULT NULL,
  `id_poblacion` int(11) DEFAULT NULL,
  PRIMARY KEY (`client_id`),
  KEY `FK_user_id` (`user_id`) USING BTREE,
  KEY `id_poblacion` (`id_poblacion`),
  CONSTRAINT `clientes_ibfk_1` FOREIGN KEY (`id_poblacion`) REFERENCES `poblaciones` (`id`) ON DELETE SET NULL ON UPDATE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `clientes`
--

INSERT INTO `clientes` VALUES (1,'Federico',NULL,NULL,'fede.gundel@gmail.com',NULL,'37847226','2024-09-02',14,'Potencial','assets/images/clientes/user-default.png',1,'No',NULL,0,0,'No','Particular','Hombre',NULL,0.00,'1',NULL,NULL,NULL,NULL,NULL,NULL,'Autónomo',NULL,NULL,NULL,'Activo',NULL,NULL,NULL,NULL,0,NULL,NULL),(2,'Juan','Calle 9 letra b n6 24 entre 72C y 72E',NULL,'infopierre14@gmail.com',NULL,'6767333L','2024-12-02',14,'Potencial','assets/images/clientes/user-default.png',1,'No','2000-02-02',0,0,'No','Particular','Hombre',NULL,0.00,'111',NULL,NULL,NULL,NULL,NULL,NULL,'Autónomo',NULL,NULL,NULL,'Activo',NULL,NULL,NULL,NULL,0,NULL,1),(3,'Pepito','Alcalde Jose Ramirez Bethencourt n13',35008,'fabiolacn77@hotmail.com','23232323','77777','2024-10-08',13,'Potencial','assets/images/clientes/user-default.png',1,'No','2024-10-09',0,0,'No','Particular','Mujer',NULL,0.00,'232',NULL,NULL,NULL,NULL,NULL,NULL,'Autónomo',NULL,NULL,NULL,'Inactivo',NULL,NULL,NULL,NULL,0,NULL,NULL),(4,'Gabriel','Alcalde Jose Ramirez Bethencourt n13',32323,'yosoyrubens@gmail.com','661033031','y12666311','2024-10-14',13,'Potencial','assets/images/clientes/user-default.png',0,'No','2024-10-14',0,0,'No','Particular','Hombre',NULL,0.00,'22',NULL,NULL,NULL,NULL,NULL,NULL,'Autónomo',NULL,NULL,NULL,'Activo',NULL,NULL,NULL,NULL,0,NULL,NULL),(5,'Javier García López ','CARRER CARME NUM 77 Planta 2',NULL,'Beledin.ads@gmail.com',NULL,'45123456A','2024-11-05',13,'Potencial','assets/images/clientes/user-default.png',0,'No','2024-10-31',0,0,'No','Particular','Hombre','Beledin.ads@gmail.com',0.00,'25100',NULL,NULL,NULL,NULL,NULL,NULL,'Autónomo',NULL,NULL,NULL,'Activo',NULL,NULL,NULL,NULL,0,NULL,NULL),(6,'Laura Rodríguez','Calle Alfonso VIII 5 2c',NULL,'liberrimostyle@gmail.com',NULL,'A12345678','2024-11-14',13,'Potencial','assets/images/clientes/user-default.png',0,'No',NULL,1,0,'No','Autónomo','Hombre','liberrimostyle@gmail.com',0.00,'34002',NULL,NULL,NULL,NULL,NULL,NULL,'Autónomo',NULL,NULL,NULL,'Activo',NULL,NULL,NULL,NULL,0,NULL,NULL),(7,'Cliente Javi',NULL,NULL,'javiervs9797@gmail.com',NULL,'45394193J','2025-03-30',6707,'Potencial','assets/images/clientes/user-default.png',1,'No',NULL,0,0,'No','Particular','Hombre',NULL,0.00,'34003',2,NULL,NULL,NULL,NULL,NULL,'Autónomo',NULL,NULL,NULL,'Activo',NULL,NULL,NULL,NULL,0,NULL,6),(8,'werfqwer',NULL,NULL,'infopierrefghfg14@gmail.com','666777888','234123','2024-12-02',14,'Potencial','assets/images/clientes/user-default.png',1,'No','1997-10-31',0,0,'No','Particular','Hombre',NULL,0.00,'2134',NULL,'7','8','9','10','11','Autónomo','Limidata','CIFLM','DFLMD','Activo',NULL,NULL,NULL,NULL,1,'sdfawefqw',1),(9,'fedefef',NULL,NULL,'f@23123123',NULL,NULL,'2024-12-02',14,'Potencial','assets/images/clientes/user-default.png',1,'No',NULL,0,0,'No','Particular','Hombre',NULL,0.00,'231',NULL,'1','2','3',NULL,'5','Autónomo',NULL,NULL,NULL,'Activo',NULL,NULL,NULL,'website',1,NULL,3),(10,'Pepe Gonzalez','consejal garcia feo nº 24',35012,'bdai_1203@hotmail.es','661033031','111111111','2025-01-09',13,'Potencial','assets/images/clientes/user-default.png',0,'No','2025-01-01',0,0,'No','Particular','Hombre',NULL,0.00,'2',NULL,NULL,NULL,NULL,NULL,NULL,'Autónomo',NULL,NULL,NULL,'Activo',NULL,NULL,NULL,NULL,1,'60999999',6),(11,'fwefedfef','Pellegrino 2045',NULL,NULL,'22846121397','44321248H','2025-03-30',6707,'Potencial','assets/images/clientes/user-default.png',0,'No',NULL,0,0,'No','Particular','Hombre',NULL,0.00,'7400',NULL,NULL,NULL,NULL,NULL,NULL,'Autónomo',NULL,NULL,NULL,'Activo',NULL,NULL,NULL,NULL,1,NULL,7),(13,'ertwert',NULL,NULL,NULL,NULL,NULL,'2025-03-30',6707,'Potencial','assets/images/clientes/user-default.png',0,'No',NULL,0,0,'No','Particular','Hombre',NULL,0.00,'7401',NULL,NULL,NULL,NULL,NULL,NULL,'Autónomo',NULL,NULL,NULL,'Activo',NULL,NULL,NULL,NULL,1,NULL,NULL),(14,'vb bcn',NULL,NULL,NULL,NULL,NULL,'2025-03-30',6707,'Potencial','assets/images/clientes/user-default.png',0,'No',NULL,0,0,'No','Particular','Hombre',NULL,0.00,'123',NULL,NULL,NULL,NULL,NULL,NULL,'Autónomo',NULL,NULL,NULL,'Activo',NULL,NULL,NULL,NULL,1,NULL,NULL),(15,'Ruben 2',NULL,NULL,NULL,NULL,NULL,'2025-04-03',6707,'Potencial','assets/images/clientes/user-default.png',0,'No',NULL,0,0,'No','Particular','Hombre',NULL,0.00,'7402',NULL,NULL,NULL,NULL,NULL,NULL,'Autónomo',NULL,NULL,NULL,'Activo',NULL,NULL,NULL,NULL,1,NULL,NULL);
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `before_insert_clientes` BEFORE INSERT ON `clientes` FOR EACH ROW BEGIN

    IF NEW.codigo IS NULL THEN

        SET NEW.codigo = (SELECT COALESCE(MAX(codigo), 0) + 1 FROM clientes);

    END IF;

END */;;
DELIMITER ;

--
-- Table structure for table `cnae`
--

CREATE TABLE `cnae` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `code` varchar(20) DEFAULT NULL,
  `description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `code` (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `cnae`
--


--
-- Table structure for table `columnas`
--

CREATE TABLE `columnas` (
  `id_columna` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  PRIMARY KEY (`id_columna`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `columnas`
--


--
-- Table structure for table `combustibles`
--

CREATE TABLE `combustibles` (
  `id_combustible` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  PRIMARY KEY (`id_combustible`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `combustibles`
--


--
-- Table structure for table `compras`
--

CREATE TABLE `compras` (
  `id_compra` int(11) NOT NULL AUTO_INCREMENT,
  `client_id` int(11) DEFAULT NULL,
  `detallado` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`detallado`)),
  `igic` decimal(7,2) NOT NULL,
  `importe` decimal(9,2) NOT NULL,
  `tipo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `importe_final` decimal(9,2) NOT NULL,
  `fecha` datetime NOT NULL,
  `user_id` int(11) DEFAULT NULL,
  `invoice_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id_compra`),
  KEY `client_id` (`client_id`),
  KEY `user_id` (`user_id`),
  CONSTRAINT `compras_ibfk_1` FOREIGN KEY (`client_id`) REFERENCES `clientes` (`client_id`) ON DELETE SET NULL ON UPDATE SET NULL,
  CONSTRAINT `compras_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ON DELETE SET NULL ON UPDATE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `compras`
--

INSERT INTO `compras` VALUES (1,NULL,'[{\"tipo\":\"Producto\",\"nombre\":\"Chupachup\",\"cantidad\":\"1\",\"precio_unitario\":\"6.00\",\"total\":\"6.00\"}]',0.07,6.00,'Efectivo',6.42,'2024-09-07 12:07:47',13,32),(3,NULL,'[{\"tipo\":\"Producto\",\"nombre\":\"Laser\",\"cantidad\":\"1\",\"precio_unitario\":\"3.00\",\"total\":\"3.00\"}]',0.07,3.00,'Efectivo',3.21,'2024-11-02 13:56:33',13,32),(8,7,'[{\"tipo\":\"Producto\",\"nombre\":\"pEPE\",\"cantidad\":\"1\",\"precio_unitario\":\"32.00\",\"total\":\"32.00\"}]',0.07,32.00,'Efectivo',34.24,'2025-01-07 07:47:23',13,32);

--
-- Table structure for table `condiciones`
--

CREATE TABLE `condiciones` (
  `id_condicion` int(11) NOT NULL AUTO_INCREMENT,
  `condicion` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `titulo` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL,
  PRIMARY KEY (`id_condicion`)
) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `condiciones`
--

INSERT INTO `condiciones` VALUES (3,'DESDE NUESTRAUHDWQDQDVWF','NO NOS HACEMOS CARGO '),(4,'NUESTRA EMPRES ANO SEIOEÑ','AVISO LEGAL ');

--
-- Table structure for table `contratos`
--

CREATE TABLE `contratos` (
  `id_contrato` int(11) NOT NULL AUTO_INCREMENT,
  `id_empleado` int(11) DEFAULT NULL,
  `tipo_contrato` varchar(25) DEFAULT NULL,
  `fecha_inicio` date DEFAULT NULL,
  `fecha_fin` date DEFAULT NULL,
  `salario_base` decimal(10,2) DEFAULT NULL,
  `horas_semanales` int(11) DEFAULT NULL,
  `dias_laborales` varchar(20) DEFAULT NULL,
  `horario_entrada` time DEFAULT NULL,
  `horario_salida` time DEFAULT NULL,
  `estado` varchar(20) DEFAULT NULL,
  PRIMARY KEY (`id_contrato`),
  KEY `id_empleado` (`id_empleado`),
  CONSTRAINT `contratos_ibfk_1` FOREIGN KEY (`id_empleado`) REFERENCES `empleado` (`id_empleado`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `contratos`
--


--
-- Table structure for table `convenios`
--

CREATE TABLE `convenios` (
  `id_convenio` int(20) NOT NULL AUTO_INCREMENT,
  `id_sector` int(11) DEFAULT NULL,
  `denominacion` varchar(255) DEFAULT NULL,
  `ambito` varchar(255) DEFAULT NULL,
  `codigo` bigint(255) NOT NULL,
  PRIMARY KEY (`id_convenio`),
  KEY `id_sector` (`id_sector`),
  CONSTRAINT `convenios_ibfk_1` FOREIGN KEY (`id_sector`) REFERENCES `sectors` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `convenios`
--


--
-- Table structure for table `copia_seguridad`
--

CREATE TABLE `copia_seguridad` (
  `id_copia_seguridad` int(11) NOT NULL AUTO_INCREMENT,
  `fecha` datetime NOT NULL,
  PRIMARY KEY (`id_copia_seguridad`)
) ENGINE=InnoDB AUTO_INCREMENT=90 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `copia_seguridad`
--

INSERT INTO `copia_seguridad` VALUES (1,'2025-01-15 00:00:00'),(2,'2025-01-15 00:00:00'),(3,'2025-01-15 00:00:00'),(4,'2025-01-16 11:35:00'),(5,'2025-01-16 11:36:00'),(6,'2025-01-16 11:37:00'),(7,'2025-01-19 12:30:00'),(8,'2025-01-16 11:41:00'),(9,'2025-01-16 11:42:00'),(10,'2025-01-16 11:43:00'),(11,'2025-01-16 11:44:00'),(12,'2025-01-16 11:45:00'),(13,'2025-01-16 11:45:00'),(14,'2025-01-16 11:46:00'),(15,'2025-01-16 11:47:00'),(16,'2025-01-16 11:48:00'),(17,'2025-01-16 11:49:00'),(18,'2025-01-16 11:50:00'),(19,'2025-01-16 11:51:00'),(20,'2025-01-16 11:52:00'),(21,'2025-01-16 11:53:00'),(22,'2025-01-16 11:54:00'),(23,'2025-01-16 11:55:00'),(24,'2025-01-16 11:56:00'),(25,'2025-01-16 11:57:00'),(26,'2025-01-16 11:58:00'),(27,'2025-01-16 11:59:00'),(28,'2025-01-16 12:00:00'),(29,'2025-01-16 12:01:00'),(30,'2025-01-16 12:02:00'),(31,'2025-01-16 12:03:00'),(32,'2025-01-16 12:04:00'),(33,'2025-01-16 12:05:00'),(34,'2025-01-16 12:06:00'),(35,'2025-01-16 12:07:00'),(36,'2025-01-16 12:08:00'),(37,'2025-01-16 12:09:00'),(38,'2025-01-16 12:10:00'),(39,'2025-01-16 12:11:00'),(40,'2025-01-16 12:12:00'),(41,'2025-01-16 12:13:00'),(42,'2025-01-16 12:14:00'),(43,'2025-01-16 12:15:00'),(44,'2025-01-16 12:16:00'),(45,'2025-01-16 12:17:00'),(46,'2025-01-16 12:18:00'),(47,'2025-01-16 12:19:00'),(48,'2025-01-16 12:20:00'),(49,'2025-01-16 12:21:00'),(50,'2025-01-16 12:22:00'),(51,'2025-01-16 12:23:00'),(52,'2025-01-16 12:24:00'),(53,'2025-01-16 12:25:00'),(54,'2025-01-16 12:26:00'),(55,'2025-01-16 12:27:00'),(56,'2025-01-16 12:28:00'),(57,'2025-01-16 12:29:00'),(58,'2025-01-16 12:30:00'),(59,'2025-01-16 12:31:00'),(60,'2025-01-16 12:32:00'),(61,'2025-01-16 12:33:00'),(62,'2025-01-16 12:34:00'),(63,'2025-01-16 12:35:00'),(64,'2025-01-16 12:36:00'),(65,'2025-01-16 12:37:00'),(66,'2025-01-16 12:38:00'),(67,'2025-01-16 12:39:00'),(68,'2025-01-16 12:40:00'),(69,'2025-01-16 12:41:00'),(70,'2025-01-16 12:42:00'),(71,'2025-01-16 12:43:00'),(72,'2025-01-16 12:44:00'),(73,'2025-01-16 12:45:00'),(74,'2025-01-16 12:46:00'),(75,'2025-01-16 12:47:00'),(76,'2025-01-16 12:48:00'),(77,'2025-01-16 12:49:00'),(78,'2025-01-16 12:50:00'),(79,'2025-01-16 12:51:00'),(80,'2025-01-16 12:52:00'),(81,'2025-01-16 12:53:00'),(82,'2025-01-16 12:54:00'),(83,'2025-01-16 12:55:00'),(84,'2025-01-16 12:56:00'),(85,'2025-01-16 12:57:00'),(86,'2025-01-16 12:58:00'),(87,'2025-01-16 12:59:00'),(88,'2025-01-16 13:00:00'),(89,'2025-01-16 13:01:00');

--
-- Table structure for table `coverpage`
--

CREATE TABLE `coverpage` (
  `coverpage_id` int(11) NOT NULL AUTO_INCREMENT,
  `coverpage_name` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `coverpage_url` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  PRIMARY KEY (`coverpage_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `coverpage`
--


--
-- Table structure for table `cursos`
--

CREATE TABLE `cursos` (
  `id_curso` int(11) NOT NULL AUTO_INCREMENT,
  `numero_aaff` int(11) NOT NULL,
  `numero_grupo` int(11) DEFAULT NULL,
  `numero_plaza` int(11) DEFAULT NULL,
  `certificado` tinyint(1) DEFAULT NULL,
  `instalacion` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `sede` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `modalidad` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `fecha_i` date DEFAULT NULL,
  `fecha_f` date DEFAULT NULL,
  `horario` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `estado` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `id_plan` int(11) DEFAULT NULL,
  `nivel_estudios` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `id_docente` int(11) DEFAULT NULL,
  `nombre_curso` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  PRIMARY KEY (`id_curso`),
  KEY `id_plan` (`id_plan`),
  KEY `id_docente` (`id_docente`),
  KEY `numero_aaff` (`numero_aaff`),
  CONSTRAINT `cursos_ibfk_2` FOREIGN KEY (`id_plan`) REFERENCES `planes` (`id_plan`) ON DELETE SET NULL ON UPDATE SET NULL,
  CONSTRAINT `cursos_ibfk_3` FOREIGN KEY (`id_docente`) REFERENCES `docentes` (`id_docente`) ON DELETE SET NULL ON UPDATE SET NULL,
  CONSTRAINT `cursos_ibfk_4` FOREIGN KEY (`numero_aaff`) REFERENCES `acciones` (`numero_aaff`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `cursos`
--


--
-- Table structure for table `datos_cliente`
--

CREATE TABLE `datos_cliente` (
  `cp` int(11) NOT NULL,
  `telefono` int(11) NOT NULL,
  `email` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL,
  `nombre_comercial` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL,
  `id_sector` int(11) DEFAULT NULL,
  `id_fase` int(11) DEFAULT NULL,
  `id_zona` int(11) DEFAULT NULL,
  `tipo` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL,
  `numero_empleados` int(11) NOT NULL,
  `importe` int(11) NOT NULL,
  `tipo_enlace` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL,
  `user_id` int(11) NOT NULL,
  `id_cliente_subvencion` int(11) NOT NULL,
  `cif` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL,
  `id_datos_cliente` int(11) NOT NULL AUTO_INCREMENT,
  `domicilio` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL,
  `titulo` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL,
  PRIMARY KEY (`id_datos_cliente`),
  KEY `id_sector` (`id_sector`),
  KEY `id_fase` (`id_fase`),
  KEY `id_zona` (`id_zona`),
  KEY `user_id` (`user_id`),
  KEY `id_cliente_subvencion` (`id_cliente_subvencion`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `datos_cliente`
--


--
-- Table structure for table `datos_cliente_peluqueria`
--

CREATE TABLE `datos_cliente_peluqueria` (
  `id_datos_cliente_peluqueria` int(11) NOT NULL AUTO_INCREMENT,
  `client_id` int(11) NOT NULL,
  `id_sector` int(11) DEFAULT NULL,
  `id_tipo_pelo` int(11) DEFAULT NULL,
  `id_fase` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `fotos` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  PRIMARY KEY (`id_datos_cliente_peluqueria`),
  KEY `client_id` (`client_id`),
  KEY `id_sector` (`id_sector`),
  KEY `id_tipo_pelo` (`id_tipo_pelo`),
  KEY `id_fase` (`id_fase`),
  KEY `user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `datos_cliente_peluqueria`
--


--
-- Table structure for table `docentes`
--

CREATE TABLE `docentes` (
  `id_docente` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `dni` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `fecha_alta` date DEFAULT NULL,
  `fecha_baja` date DEFAULT NULL,
  PRIMARY KEY (`id_docente`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `docentes`
--


--
-- Table structure for table `empleado`
--

CREATE TABLE `empleado` (
  `id_empleado` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `apellidos` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `nif` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `direccion` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `telefono` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `email` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `fecha_contratacion` date DEFAULT NULL,
  `fecha_nacimiento` date DEFAULT NULL,
  `estado` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `numero_seguridad_social` varchar(20) DEFAULT NULL,
  PRIMARY KEY (`id_empleado`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `empleado`
--


--
-- Table structure for table `empleado_grupo2`
--

CREATE TABLE `empleado_grupo2` (
  `id_empleado_grupo2` int(11) NOT NULL AUTO_INCREMENT,
  `id_grupo2` int(11) NOT NULL,
  `id_empleado` int(11) NOT NULL,
  PRIMARY KEY (`id_empleado_grupo2`),
  KEY `id_grupo2` (`id_grupo2`),
  KEY `id_empleado` (`id_empleado`),
  CONSTRAINT `empleado_grupo2_ibfk_1` FOREIGN KEY (`id_empleado`) REFERENCES `empleados` (`id_empleado`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `empleado_grupo2_ibfk_2` FOREIGN KEY (`id_grupo2`) REFERENCES `grupos2` (`id_grupo2`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `empleado_grupo2`
--


--
-- Table structure for table `empleados`
--

CREATE TABLE `empleados` (
  `id_empleado` int(11) NOT NULL AUTO_INCREMENT,
  `dni` varchar(255) DEFAULT NULL,
  `telefono` varchar(255) DEFAULT NULL,
  `direccion` varchar(255) DEFAULT NULL,
  `nombre` varchar(255) DEFAULT NULL,
  `precio_hora` decimal(9,2) DEFAULT NULL,
  `numero` varchar(15) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `nif` varchar(20) DEFAULT NULL,
  `precio_hora_extra` decimal(10,2) DEFAULT NULL,
  `id_usuario` int(11) DEFAULT NULL,
  PRIMARY KEY (`id_empleado`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;

--
-- Dumping data for table `empleados`
--

INSERT INTO `empleados` VALUES (1,'2323','2323','232','Pepe',2.00,'33333333333','fede.gundel@gmail.com','123123',23.00,NULL),(2,'martin','12345678','calle poeta','juan carlods',22.00,'12122222','fede.gundel@gmail.com','2121',12.00,NULL),(3,'2222','2222','1','Pepe',30.00,'987123',NULL,NULL,NULL,NULL),(4,'ii','ii','ii','k',12.00,'212121212','fede.gundel@gmail.com','1232',12312.00,NULL),(5,'000000','6666666','calle 3','Ramiro',8.00,'7','yosoyrubens@gmail.com','88723',99.00,NULL),(6,'2222','2222','Alcalde Jose Ramirez Bethencourt','Javi Pepito',3.00,'312222','javiervs9797@gmail.com','3',3.00,6690),(7,'2','3','4','Empleado Limixer',5.00,'6','77','8',9.00,6697),(10,'3213213123213123','31312','1232132132','Empleado Rubben',213.00,'21321','3123213','21321',99999999.99,13),(11,'qewqe','wqe','wqewqe','ewqe',321312.00,'3213','213','213213',99999999.99,6684);

--
-- Table structure for table `envios_itv`
--

CREATE TABLE `envios_itv` (
  `id_envio_itv` int(11) NOT NULL AUTO_INCREMENT,
  `tipo` varchar(25) DEFAULT NULL,
  `id_vehiculo` int(11) DEFAULT NULL,
  `fecha` date DEFAULT NULL,
  `numero_email` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `motivo` varchar(20) NOT NULL,
  PRIMARY KEY (`id_envio_itv`),
  KEY `fk_vehiculo` (`id_vehiculo`),
  CONSTRAINT `fk_vehiculo` FOREIGN KEY (`id_vehiculo`) REFERENCES `vehiculos` (`id_vehiculo`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `envios_itv`
--


--
-- Table structure for table `estado_archivo`
--

CREATE TABLE `estado_archivo` (
  `id_estado_archivo` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `color` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  PRIMARY KEY (`id_estado_archivo`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `estado_archivo`
--

INSERT INTO `estado_archivo` VALUES (1,'Cancelado','#bc5063'),(2,'PASO 2','#3dba1e'),(3,'Activo','#ef7afa'),(4,'TODO OK','#33fd00'),(5,'TODO PERFECTO','#ff0080');

--
-- Table structure for table `estado_subvencion`
--

CREATE TABLE `estado_subvencion` (
  `nombre` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL,
  `id_estado_subvencion` int(11) NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (`id_estado_subvencion`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `estado_subvencion`
--


--
-- Table structure for table `estados`
--

CREATE TABLE `estados` (
  `id_estado` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL,
  PRIMARY KEY (`id_estado`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `estados`
--

INSERT INTO `estados` VALUES (1,'Nuevas'),(2,'A estrenaer');

--
-- Table structure for table `eventos`
--

CREATE TABLE `eventos` (
  `id_evento` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `fecha_inicio` datetime NOT NULL,
  `descripcion` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `id_categoria` int(11) DEFAULT NULL,
  `fecha_final` datetime NOT NULL,
  `cancelado` tinyint(1) NOT NULL DEFAULT 0,
  `horario` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '../horarios/default.pdf',
  PRIMARY KEY (`id_evento`),
  KEY `id_categoria` (`id_categoria`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `eventos`
--

INSERT INTO `eventos` VALUES (1,'Fiesta de la primavera','2024-09-01 04:42:00','dfgsdfgdfg',1,'2024-09-24 04:42:00',0,'../horarios/default.pdf'),(2,'nuevo','2024-09-08 12:02:00','rdtgwet',NULL,'2024-10-03 12:02:00',0,'../horarios/default.pdf');

--
-- Table structure for table `factura_empleado`
--

CREATE TABLE `factura_empleado` (
  `id_factura_empleado` int(11) NOT NULL AUTO_INCREMENT,
  `id_empleado` int(11) NOT NULL,
  `fecha_i` date NOT NULL,
  `horas` int(11) NOT NULL,
  `horas_extra` int(11) NOT NULL,
  `importe` decimal(10,2) NOT NULL,
  `precio_hora` decimal(10,2) NOT NULL,
  `precio_horas_extra` decimal(10,2) NOT NULL,
  `fecha_f` date NOT NULL,
  `base` decimal(10,2) DEFAULT NULL,
  `bonus` decimal(10,2) DEFAULT NULL,
  `hora_extra` decimal(10,2) DEFAULT NULL,
  `otros_ingresos` decimal(10,2) DEFAULT NULL,
  `irpf` decimal(10,2) DEFAULT NULL,
  `total_ingresos` decimal(10,2) DEFAULT NULL,
  `total_deducciones` decimal(10,2) DEFAULT NULL,
  `firma` tinyint(1) DEFAULT 0,
  `csrf_token` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id_factura_empleado`),
  KEY `id_empleado` (`id_empleado`),
  CONSTRAINT `factura_empleado_ibfk_1` FOREIGN KEY (`id_empleado`) REFERENCES `empleados` (`id_empleado`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=63 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;

--
-- Dumping data for table `factura_empleado`
--

INSERT INTO `factura_empleado` VALUES (61,1,'2024-12-30',70,70,1750.00,2.00,23.00,'2025-01-07',NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,'MTczMzcxNDk4N0YyQUpRbmoxTVAzR0tCbE5wVEw2T0F0QlN5MTFPV3hQ'),(62,1,'2024-12-24',99,990,922878.00,92.00,923.00,'2025-01-07',NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,'MTczMzcxNTE0OVZhZGxzNUgxY1lhWTVnbHgzMENIejl0Y2VIaHpYZDVi');

--
-- Table structure for table `factura_manual`
--

CREATE TABLE `factura_manual` (
  `id_factura_manual` int(11) NOT NULL AUTO_INCREMENT,
  `numero` varchar(255) NOT NULL,
  `fecha` date NOT NULL,
  `direccion` varchar(255) DEFAULT NULL,
  `importe` decimal(9,2) NOT NULL,
  `estado` varchar(255) NOT NULL,
  `email` varchar(255) NOT NULL,
  `imagen` varchar(255) NOT NULL,
  `fecha_vencimiento` date DEFAULT NULL,
  `nombre` varchar(255) NOT NULL,
  `cif` varchar(255) DEFAULT NULL,
  `cp` varchar(255) DEFAULT NULL,
  `telefono` varchar(255) DEFAULT NULL,
  `irpf` decimal(7,2) DEFAULT NULL,
  `client_id` int(11) NOT NULL,
  `fecha_envio` datetime DEFAULT NULL,
  `titulo` varchar(255) DEFAULT NULL,
  `tipo` varchar(255) NOT NULL DEFAULT 'Empresa',
  `programado` date DEFAULT NULL,
  `id_banco` int(11) DEFAULT NULL,
  `id_banco_2` int(11) DEFAULT NULL,
  `id_banco_3` int(11) DEFAULT NULL,
  `condiciones` longtext DEFAULT NULL,
  `impuesto` longtext DEFAULT NULL,
  `fechas` varchar(255) DEFAULT NULL,
  `lugar` varchar(255) DEFAULT NULL,
  `id_proyecto` int(11) DEFAULT NULL,
  PRIMARY KEY (`id_factura_manual`),
  KEY `client_id` (`client_id`),
  KEY `id_banco` (`id_banco`),
  KEY `id_banco_3` (`id_banco_3`),
  KEY `id_proyecto` (`id_proyecto`),
  KEY `id_banco_2` (`id_banco_2`),
  CONSTRAINT `factura_manual_ibfk_1` FOREIGN KEY (`id_banco`) REFERENCES `bancos` (`id_banco`) ON DELETE SET NULL ON UPDATE SET NULL,
  CONSTRAINT `factura_manual_ibfk_2` FOREIGN KEY (`id_proyecto`) REFERENCES `proyectos` (`id_proyecto`) ON DELETE SET NULL ON UPDATE SET NULL,
  CONSTRAINT `factura_manual_ibfk_3` FOREIGN KEY (`id_banco_2`) REFERENCES `bancos` (`id_banco`) ON DELETE SET NULL ON UPDATE SET NULL,
  CONSTRAINT `factura_manual_ibfk_4` FOREIGN KEY (`client_id`) REFERENCES `clientes` (`client_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=47 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;

--
-- Dumping data for table `factura_manual`
--

INSERT INTO `factura_manual` VALUES (45,'2025/A30','2025-04-08',NULL,300.00,'Enviada','fede.gundel@gmail.com','https://localhost/image.php?id=ix7XQcvhzdaaoqIPXeSEtgIO7',NULL,'Federico','37847226',NULL,NULL,NULL,1,'2025-04-03 01:26:53','Factura','Particular',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(46,'2025/A31','2025-04-03',NULL,500.00,'Enviada','fede.gundel@gmail.com','https://localhost/image.php?id=ix7XQcvhzdaaoqIPXeSEtgIO7',NULL,'Federico','37847226',NULL,NULL,NULL,1,'2025-04-03 05:25:05','Factura','Particular',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);

--
-- Table structure for table `factura_proveedor`
--

CREATE TABLE `factura_proveedor` (
  `id_factura_proveedor` int(11) NOT NULL AUTO_INCREMENT,
  `importe` decimal(7,2) NOT NULL,
  `id_proveedor` int(11) DEFAULT NULL,
  `fecha_vencimiento` datetime DEFAULT NULL,
  `numero` varchar(255) DEFAULT NULL,
  `fecha` datetime NOT NULL,
  PRIMARY KEY (`id_factura_proveedor`),
  KEY `id_proveedor` (`id_proveedor`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;

--
-- Dumping data for table `factura_proveedor`
--

INSERT INTO `factura_proveedor` VALUES (4,800.00,1,'2024-11-04 13:37:00','8888','2024-11-04 13:37:00'),(5,1400.00,1,'2024-11-14 12:34:00','112','2024-11-14 12:34:00'),(9,500.00,2,'2024-12-30 14:05:00','LMD/01','2024-12-30 14:05:00');

--
-- Table structure for table `facturas`
--

CREATE TABLE `facturas` (
  `id_factura` int(11) NOT NULL AUTO_INCREMENT,
  `numero` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `fecha` datetime NOT NULL,
  `domicilio` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL,
  `importe` decimal(9,2) NOT NULL,
  `estado` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL,
  `id_presupuesto` int(11) NOT NULL,
  `email` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL,
  `importe_restante` decimal(9,2) NOT NULL,
  `fecha_envio` datetime DEFAULT NULL,
  `metodo_pago` int(11) DEFAULT NULL,
  `pagos` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `importe_s` decimal(9,2) NOT NULL,
  `fecha_vencimiento` datetime NOT NULL,
  `dias_vencimiento` int(11) NOT NULL DEFAULT 7,
  `emails_vencimiento` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '',
  `imagen` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `programado` datetime DEFAULT NULL,
  PRIMARY KEY (`id_factura`),
  KEY `FK_presupuesto_id` (`id_presupuesto`),
  KEY `metodo_pago` (`metodo_pago`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `facturas`
--


--
-- Table structure for table `facturas_rectificadas`
--

CREATE TABLE `facturas_rectificadas` (
  `id_factura_rectificada` int(11) NOT NULL AUTO_INCREMENT,
  `id_factura_manual` int(11) NOT NULL,
  `numero` varchar(255) NOT NULL,
  `fecha` date NOT NULL,
  PRIMARY KEY (`id_factura_rectificada`),
  KEY `facturas_rectificadas_ibfk_1` (`id_factura_manual`),
  CONSTRAINT `facturas_rectificadas_ibfk_1` FOREIGN KEY (`id_factura_manual`) REFERENCES `factura_manual` (`id_factura_manual`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;

--
-- Dumping data for table `facturas_rectificadas`
--


--
-- Table structure for table `familias`
--

CREATE TABLE `familias` (
  `id_familia` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id_familia`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `familias`
--


--
-- Table structure for table `fases`
--

CREATE TABLE `fases` (
  `id_fase` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  PRIMARY KEY (`id_fase`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `fases`
--


--
-- Table structure for table `favorites`
--

CREATE TABLE `favorites` (
  `favorite_id` int(11) NOT NULL AUTO_INCREMENT,
  `favorite_user` int(11) NOT NULL,
  `favorite_type` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `favorite_type_id` int(11) NOT NULL,
  `favorite_data` int(11) NOT NULL,
  PRIMARY KEY (`favorite_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `favorites`
--


--
-- Table structure for table `featured`
--

CREATE TABLE `featured` (
  `featured_id` int(11) NOT NULL AUTO_INCREMENT,
  `featured_name` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `featured_url` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `featured_column` int(11) NOT NULL,
  PRIMARY KEY (`featured_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `featured`
--


--
-- Table structure for table `fichajes`
--

CREATE TABLE `fichajes` (
  `id_fichaje` int(11) NOT NULL AUTO_INCREMENT,
  `id_miembro` int(11) NOT NULL,
  `fecha_entrada` datetime NOT NULL,
  `fecha_salida` datetime DEFAULT NULL,
  `horas_descanso` int(11) DEFAULT NULL,
  `fecha` date NOT NULL,
  `ultima_entrada` datetime DEFAULT NULL,
  `ultima_salida` datetime DEFAULT NULL,
  `observaciones` varchar(1000) DEFAULT NULL,
  `estado` varchar(255) DEFAULT 'Pendiente',
  `csrf_token` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id_fichaje`),
  KEY `miembro` (`id_miembro`)
) ENGINE=InnoDB AUTO_INCREMENT=90 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `fichajes`
--

INSERT INTO `fichajes` VALUES (1,1,'2024-09-18 18:37:40','2024-09-18 18:38:08',3,'2024-09-18',NULL,NULL,NULL,'Pendiente',NULL),(2,1,'2024-09-18 18:39:58','2024-09-18 18:44:02',NULL,'2024-09-18',NULL,NULL,NULL,'Pendiente',NULL),(3,2,'2024-10-08 15:31:49','2024-10-08 15:32:35',NULL,'2024-10-08',NULL,NULL,NULL,'Pendiente',NULL),(4,2,'2024-10-16 20:39:43','2024-10-16 20:40:10',NULL,'2024-10-16',NULL,NULL,NULL,'Pendiente',NULL),(5,2,'2024-10-17 16:28:32','2024-10-17 16:29:18',4,'2024-10-17',NULL,NULL,NULL,'Pendiente',NULL),(6,2,'2024-11-02 13:50:12','2024-11-14 13:48:27',2086,'2024-11-02',NULL,NULL,NULL,'Pendiente',NULL),(7,2,'2024-11-14 13:48:35','2024-12-02 23:22:09',1252768,'2024-11-14',NULL,NULL,NULL,'Pendiente',NULL),(8,2,'2024-11-13 13:49:00','2024-11-29 13:49:00',3600,'2024-11-13',NULL,NULL,NULL,'Pendiente',NULL),(9,3,'2024-11-19 11:51:05','2024-11-19 11:51:38',NULL,'2024-11-19',NULL,NULL,NULL,'Pendiente',NULL),(10,3,'2024-11-19 11:53:48','2025-01-08 11:31:20',NULL,'2024-11-19',NULL,NULL,NULL,'Pendiente',NULL),(11,6,'2024-12-02 09:52:52','2024-12-02 09:54:32',NULL,'2024-12-02',NULL,NULL,NULL,'Pendiente',NULL),(12,1,'2024-12-04 15:46:00','2024-12-13 15:46:00',43200,'2024-12-04',NULL,NULL,NULL,'Pendiente',NULL),(13,1,'2024-12-11 07:54:00','2024-12-21 07:54:00',43200,'2024-12-11',NULL,NULL,'asdasdasd','Pendiente',NULL),(14,1,'2024-12-11 07:54:00','2024-12-21 07:54:00',43200,'2024-12-11',NULL,NULL,'asdasdasd','Pendiente',NULL),(15,1,'2024-12-11 07:54:00','2024-12-21 07:54:00',43200,'2024-12-11',NULL,NULL,'asdasdasd','Pendiente',NULL),(16,1,'2024-12-11 07:54:00','2024-12-21 07:54:00',43200,'2024-12-11',NULL,NULL,'asdasdasd','Pendiente',NULL),(17,1,'2024-12-11 07:54:00','2024-12-21 07:54:00',43200,'2024-12-11',NULL,NULL,'asdasdasd','Pendiente','MTczMzQ4MzQ4MVNNbDRPTXhNN0J2Z3l5TTlOelFIQXZNRnV5bUc0RTJY'),(18,1,'2024-12-11 07:54:00','2024-12-21 07:54:00',43200,'2024-12-11',NULL,NULL,'asdasdasd','Pendiente','MTczMzQ4MzcxN0luU0hxeUZtb29iY3NicmltYVhMMHdtMTdiUHdKOUpN'),(19,1,'2024-12-11 07:54:00','2024-12-21 07:54:00',43200,'2024-12-11',NULL,NULL,'asdasdasd','Pendiente','MTczMzQ4Mzc1NWJvWlFQR0ZxNHFaUHlpNGl3RXRTUXdpUllyY3RvbnFT'),(20,1,'2024-12-11 07:54:00','2024-12-21 07:54:00',43200,'2024-12-11',NULL,NULL,'asdasdasd','Pendiente','MTczMzQ4NDA4OVA1bW1lWm01cVpCYkYzdno1T29yR1pJb3A1MDJkRnJz'),(21,1,'2024-12-11 07:54:00','2024-12-21 07:54:00',43200,'2024-12-11',NULL,NULL,'asdasdasd','Pendiente','MTczMzQ4NDUxMTE4U3J1RmZPWE9TODFMZ1I3SzJsdDNocUNQMlZLaDg4'),(22,1,'2024-12-11 07:54:00','2024-12-21 07:54:00',43200,'2024-12-11',NULL,NULL,'asdasdasd','Pendiente','MTczMzQ4NDcyN3RISmhDNU1pRm9xUTVGYlZyUDBvemZqeVc2cHE1dTZi'),(23,1,'2024-12-11 07:54:00','2024-12-21 07:54:00',43200,'2024-12-11',NULL,NULL,'asdasdasd','Pendiente','MTczMzQ4NDg2MEpiMHF4M01USTBQeDNOU29nZHN5UU8xTHBoOGNCM0xs'),(24,1,'2024-12-11 07:54:00','2024-12-21 07:54:00',43200,'2024-12-11',NULL,NULL,'asdasdasd','Pendiente','MTczMzQ4NDg5N3FSdGhHWW5pNnQ1bHp3cG1xeGVvYVdnV1d2RXBkV3Fn'),(25,1,'2024-12-11 07:54:00','2024-12-21 07:54:00',43200,'2024-12-11',NULL,NULL,'asdasdasd','Aceptado',NULL),(26,1,'2024-12-14 08:49:00','2024-12-21 08:49:00',10800,'2024-12-14',NULL,NULL,'SDDDDDDDDDDDDDDDDD','Aceptado',NULL),(27,1,'2024-12-14 08:49:00','2024-12-21 08:49:00',10800,'2024-12-14',NULL,NULL,'SDDDDDDDDDDDDDDDDD','Aceptado',NULL),(28,1,'2024-12-14 08:49:00','2024-12-21 08:49:00',10800,'2024-12-14',NULL,NULL,'SDDDDDDDDDDDDDDDDD','Aceptado',NULL),(29,1,'2024-12-14 08:49:00','2024-12-21 08:49:00',10800,'2024-12-14',NULL,NULL,'SDDDDDDDDDDDDDDDDD','Aceptado',NULL),(30,1,'2024-12-14 08:49:00','2024-12-21 08:49:00',10800,'2024-12-14',NULL,NULL,'SDDDDDDDDDDDDDDDDD','Aceptado',NULL),(31,1,'2024-12-14 08:49:00','2024-12-21 08:49:00',10800,'2024-12-14',NULL,NULL,'SDDDDDDDDDDDDDDDDD','Aceptado',NULL),(32,1,'2024-12-14 08:49:00','2024-12-21 08:49:00',10800,'2024-12-14',NULL,NULL,'SDDDDDDDDDDDDDDDDD','Aceptado',NULL),(33,1,'2024-12-14 08:49:00','2024-12-21 08:49:00',10800,'2024-12-14',NULL,NULL,'SDDDDDDDDDDDDDDDDD','Aceptado',NULL),(34,1,'2024-12-14 08:49:00','2024-12-21 08:49:00',10800,'2024-12-14',NULL,NULL,'SDDDDDDDDDDDDDDDDD','Aceptado',NULL),(35,1,'2024-12-14 08:49:00','2024-12-21 08:49:00',3600,'2024-12-14',NULL,NULL,'SDDDDDDDDDDDDDDDDD','Pendiente','MTczMzQ5OTAxN0R3b1l5d1JzdzliRmhMVGhBWHE1MUNhSm5KRXpadzJO'),(36,1,'2024-12-08 12:13:49','0000-00-00 00:00:00',0,'2024-12-08',NULL,NULL,'','Pendiente','MTczMzY3MDg0OVYzRHV4cE9hOFhzZ3p1RnBScGx4WEpmbVF4ZTBGT3pk'),(37,1,'2024-12-08 12:16:40','0000-00-00 00:00:00',0,'2024-12-08',NULL,NULL,'','Pendiente','MTczMzY3MTAyMHlTRUdVYkQ1b2dlMGNKUjdoUldhQjh1am9EdVFiZkVx'),(38,1,'2024-12-08 12:18:15','0000-00-00 00:00:00',0,'2024-12-08',NULL,NULL,'','Pendiente','MTczMzY3MTExNXM4Q0VMU2M1bVFlSHM1Q0VSMXZyTU4xd0lxZ3lOTm5H'),(39,1,'2024-12-08 12:25:11','0000-00-00 00:00:00',0,'2024-12-08',NULL,NULL,'','Pendiente','MTczMzY3MTUzMVRJOHd6Vjd4VjVpNEJPTUgxV002RVIyR3cxYW9Bbkkx'),(40,1,'2024-12-08 12:28:10','0000-00-00 00:00:00',0,'2024-12-08',NULL,NULL,'','Pendiente','MTczMzY3MTcxMTRGWThjMnJacUtPb1pxblZpaWhQZHF6UmpLVWR3SFVz'),(41,1,'2024-12-08 12:31:00','0000-00-00 00:00:00',0,'2024-12-08',NULL,NULL,'','Pendiente','MTczMzY3MTg4MXdBcG11WHFTM09KeHVjTWdVTkFxNVloaWZUN0d6UVRN'),(55,1,'2024-12-08 13:08:28','2024-12-08 13:27:53',184,'2024-12-08',NULL,NULL,'','Pendiente','MTczMzY3NDEyOEJlMmlxUXhOVU40Nng3YWgyMHpyV3hTRzJxeU5jdlJD'),(56,1,'2024-12-08 13:28:27','2024-12-08 13:28:43',0,'2024-12-08',NULL,NULL,'','Pendiente','MTczMzY3NTMyN1h3dnlPamp6dWR6WXI1dDBQMDFnNVo0TnE5WXRIaFhM'),(57,1,'2024-12-08 13:34:35','2024-12-08 14:12:04',737,'2024-12-08',NULL,NULL,'','Pendiente','MTczMzY3NTY5NVQ4ZVl0RHIzYlZQVGhXVHE1U3FwR1hoUzc5Wmo1SVBP'),(58,1,'2024-12-08 14:14:06','2024-12-08 14:15:15',0,'2024-12-08',NULL,NULL,'','Pendiente','MTczMzY3ODA2N29QNU1SNlBTMlRPUlBHdnViZzczakhQM3EzelVDV1M1'),(59,1,'2024-12-08 14:15:26','2024-12-08 14:19:24',1,'2024-12-08',NULL,NULL,'','Pendiente','MTczMzY3ODE0N3hlcXlXRkZwQ0FoVUZtQXBXdmdVdFF4c3pCaktQQ1g5'),(60,1,'2024-12-08 14:21:13','2024-12-08 14:21:16',0,'2024-12-08',NULL,NULL,'','Pendiente','MTczMzY3ODQ5Mzg1TUdaR0NRMmcxWWFmUDNESTZsQ2dIakhPNzFFVktv'),(61,1,'2024-12-08 14:21:18','2024-12-08 14:21:26',2,'2024-12-08',NULL,NULL,'','Pendiente','MTczMzY3ODQ5OHhKUGIyTkZZV08zajZxVlBJelNYU0d2REFnRndTajNI'),(62,1,'2024-12-08 14:26:16','2024-12-08 14:30:28',9,'2024-12-08',NULL,NULL,'','Pendiente','MTczMzY3ODc5NkpvOXJjTnVycnB0N3pocTd0WGM5RHU4VnZ3UmVMY25m'),(63,1,'2024-12-08 14:43:41','2024-12-08 14:45:56',3,'2024-12-08',NULL,NULL,'','Pendiente','MTczMzY3OTg0MUpjY2NnTnRORVVRNmkzRGo4Q29CQ2dEWWxHNWZ1UUUy'),(64,1,'2024-12-08 14:47:22','2024-12-08 14:47:33',0,'2024-12-08',NULL,NULL,'','Pendiente','MTczMzY4MDA2Mm1NUjU2NTVHY3J1TWNXUmxWMVdRRzRsbHFwbU1WRHJm'),(65,1,'2024-12-08 14:49:34','2024-12-08 14:51:08',2,'2024-12-08',NULL,NULL,'','Pendiente','MTczMzY4MDE5NVpUYU9kdE45VFNKTzRNN3BZc2RLR3pQZDU5R1NSNWxw'),(66,1,'2024-12-08 14:53:19','2024-12-08 14:53:21',0,'2024-12-08',NULL,NULL,'','Pendiente','MTczMzY4MDQxOXBEQU1CU3VhcXlWSE05YmVNSkRGVk5WOGpFczdXalZ4'),(67,1,'2024-12-08 14:53:56','2024-12-08 14:53:59',0,'2024-12-08',NULL,NULL,'','Pendiente','MTczMzY4MDQ1NkpwWjRaRkl2UlJpRFNXZjhHSkx3cldZcWFRaUxWUG1F'),(68,1,'2024-12-08 14:55:16','2024-12-08 14:55:23',0,'2024-12-08',NULL,NULL,'','Pendiente','MTczMzY4MDUzNnZHejIwSVd1M3gzZllYWG5BZlpYOUpicERjblpybGR2'),(69,1,'2024-12-08 15:00:55','2024-12-08 15:01:19',0,'2024-12-08',NULL,NULL,'','Aceptado','MTczMzY4MDg3NTh1VjJyd0hiZ2NpeFUzbEVPVHBYVGxuejhWcWFOSnVP'),(70,1,'2024-12-08 15:08:38','2024-12-08 15:09:17',0,'2024-12-08',NULL,NULL,'','Aceptado','MTczMzY4MTMzOFQ5Q29BeXdHbmdJdm9GTThBcXQ1M0VXeDdYWE81TDBH'),(71,1,'2024-12-08 15:49:43','2024-12-18 12:14:59',272,'2024-12-08',NULL,NULL,'','Aceptado','MTczMzY4MzgwM2FVbURTaTFNVk5Tc3pTd0owNnA5ek1QRHlqSXBOREtP'),(84,2,'2024-12-09 17:18:21','2024-12-13 17:39:39',0,'2024-12-09',NULL,'2024-12-13 17:39:40','','Aceptado','MTczMzc2NDcwMW1GS25vSkFaeG8xdkVRdXgxSzV0WHNaekRvUVpzWmVC'),(85,1,'2024-12-18 12:15:02',NULL,0,'2024-12-18',NULL,NULL,'','Aceptado','MTczNDUzNDk1MFBuTElJU09yNENOenp1SlJPZ0xSeUtRR0tJUEd1ZDRR'),(87,2,'2025-01-13 20:50:18','2025-01-29 13:56:46',1020379,'2025-01-13',NULL,NULL,'','Aceptado','MTczNjgwMTQxOGJTOUJ5SUc3dWNxaHpuWUQ1cEtIREZ1ZzJ2R1BQU3FJ'),(88,2,'2025-01-29 13:56:51','2025-01-29 14:01:08',0,'2025-01-29',NULL,NULL,'','Aceptado','MTczODE1OTAxM1pHRnpsT0dzMngzelZheVhNMEdDS1FtSHE5OFV1TVE0'),(89,2,'2025-01-29 14:01:15',NULL,0,'2025-01-29',NULL,NULL,'','Aceptado','MTczODE1OTI3NGJYMjZmaThFMGlUVW9Nb1ZpQnZTcVNDd2oyeWhZdjNn');

--
-- Table structure for table `files`
--

CREATE TABLE `files` (
  `file_id` int(11) NOT NULL AUTO_INCREMENT,
  `file_user` int(11) DEFAULT NULL,
  `file_name` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `file_extension` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `file_type` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `file_section` int(11) NOT NULL,
  `file_folder` int(11) NOT NULL,
  `file_address` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `file_tags` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `file_data` int(11) NOT NULL,
  `fecha` date NOT NULL,
  `id_estado_archivo` int(11) DEFAULT NULL,
  PRIMARY KEY (`file_id`),
  KEY `file_user` (`file_user`),
  KEY `id_estado_archivo` (`id_estado_archivo`),
  CONSTRAINT `files_ibfk_1` FOREIGN KEY (`id_estado_archivo`) REFERENCES `estado_archivo` (`id_estado_archivo`) ON DELETE SET NULL ON UPDATE SET NULL,
  CONSTRAINT `files_ibfk_2` FOREIGN KEY (`file_user`) REFERENCES `users` (`user_id`) ON DELETE SET NULL ON UPDATE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `files`
--

INSERT INTO `files` VALUES (8,13,'Fondo empresa','pdf','Archivo',0,22,'/22/','',1731587600,'2024-11-14',NULL);

--
-- Table structure for table `financieras`
--

CREATE TABLE `financieras` (
  `id_financiera` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) NOT NULL,
  `telefono` varchar(20) NOT NULL,
  `email` varchar(255) NOT NULL,
  PRIMARY KEY (`id_financiera`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `financieras`
--


--
-- Table structure for table `firmas`
--

CREATE TABLE `firmas` (
  `id_firma` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `dni` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  PRIMARY KEY (`id_firma`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `firmas`
--


--
-- Table structure for table `folders`
--

CREATE TABLE `folders` (
  `folder_id` int(11) NOT NULL AUTO_INCREMENT,
  `folder_name` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `folder_user` int(11) DEFAULT NULL,
  `folder_section` int(11) NOT NULL,
  `folder_folder` int(11) NOT NULL,
  `folder_type` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `folder_address` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `folder_tag` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `folder_data` int(11) NOT NULL,
  `id_estado_archivo` int(11) DEFAULT NULL,
  `id_extra_folder` int(11) DEFAULT NULL,
  PRIMARY KEY (`folder_id`),
  KEY `id_estado_archivo` (`id_estado_archivo`),
  KEY `folder_user` (`folder_user`),
  CONSTRAINT `folders_ibfk_1` FOREIGN KEY (`id_estado_archivo`) REFERENCES `estado_archivo` (`id_estado_archivo`) ON DELETE SET NULL ON UPDATE SET NULL,
  CONSTRAINT `folders_ibfk_2` FOREIGN KEY (`folder_user`) REFERENCES `users` (`user_id`) ON DELETE SET NULL ON UPDATE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=37 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `folders`
--

INSERT INTO `folders` VALUES (19,'JUAN MANUEL',13,0,0,NULL,'/','',1726574064,4,NULL),(22,'FACTURAS 2025 ',13,0,0,NULL,'/','',1731587567,NULL,NULL);

--
-- Table structure for table `formularios`
--

CREATE TABLE `formularios` (
  `id_formulario` int(11) NOT NULL AUTO_INCREMENT,
  `portada` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `info_1` varchar(2500) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `nombre` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `apellidos` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `dni` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `telefono` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `pais` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `ciudad` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `direccion` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `info_2` varchar(2500) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `info_3` varchar(2500) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `autorizacion` tinyint(1) DEFAULT NULL,
  `info_4` varchar(2500) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `texto_modal` varchar(2500) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `lottie_modal` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `nombre_formulario` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `estado` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT 'Activo',
  PRIMARY KEY (`id_formulario`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `formularios`
--


--
-- Table structure for table `gasto_proyecto`
--

CREATE TABLE `gasto_proyecto` (
  `id_gasto_proyecto` int(11) NOT NULL AUTO_INCREMENT,
  `concepto` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `importe` decimal(10,2) DEFAULT NULL,
  `observaciones` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `id_proyecto` int(11) NOT NULL,
  `fecha` date DEFAULT NULL,
  PRIMARY KEY (`id_gasto_proyecto`),
  KEY `fk_gasto_proyecto_proyectos` (`id_proyecto`),
  CONSTRAINT `fk_gasto_proyecto_proyectos` FOREIGN KEY (`id_proyecto`) REFERENCES `proyectos` (`id_proyecto`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `gasto_proyecto`
--

INSERT INTO `gasto_proyecto` VALUES (2,'Bloque de hormigon',3000.00,'bloque',4,'2025-01-30');

--
-- Table structure for table `google`
--

CREATE TABLE `google` (
  `client_id` varchar(100) DEFAULT NULL,
  `client_secret` varchar(100) DEFAULT NULL,
  `redirect_link` varchar(100) DEFAULT NULL,
  `id` int(11) NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `google`
--

INSERT INTO `google` VALUES ('313096051511-e31b1hp4csccccelp905up8rf4nvsorv.apps.googleusercontent.com','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','http://localhost/plataforma/login',1);

--
-- Table structure for table `grupo_cliente`
--

CREATE TABLE `grupo_cliente` (
  `id_grupo_cliente` int(11) NOT NULL AUTO_INCREMENT,
  `id_grupo` int(11) NOT NULL,
  `client_id` int(11) NOT NULL,
  PRIMARY KEY (`id_grupo_cliente`),
  KEY `id_grupo` (`id_grupo`),
  KEY `client_id` (`client_id`),
  CONSTRAINT `grupo_cliente_ibfk_1` FOREIGN KEY (`id_grupo`) REFERENCES `grupos` (`id_grupo`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `grupo_cliente_ibfk_2` FOREIGN KEY (`client_id`) REFERENCES `clientes` (`client_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `grupo_cliente`
--

INSERT INTO `grupo_cliente` VALUES (4,3,4),(5,3,8);

--
-- Table structure for table `grupos`
--

CREATE TABLE `grupos` (
  `id_grupo` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  PRIMARY KEY (`id_grupo`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `grupos`
--

INSERT INTO `grupos` VALUES (3,'LASER MICROBLADING'),(5,'Grupos jueves a las 3'),(6,'ss');

--
-- Table structure for table `grupos2`
--

CREATE TABLE `grupos2` (
  `id_grupo2` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  PRIMARY KEY (`id_grupo2`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `grupos2`
--

INSERT INTO `grupos2` VALUES (1,'ss');

--
-- Table structure for table `igic`
--

CREATE TABLE `igic` (
  `id_igic` int(11) NOT NULL AUTO_INCREMENT,
  `porcentaje` decimal(9,2) DEFAULT NULL,
  `nombre` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id_igic`),
  UNIQUE KEY `porcentaje` (`porcentaje`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `igic`
--

INSERT INTO `igic` VALUES (1,7.00,'IGIC 7%'),(3,21.00,'IVA 21%');

--
-- Table structure for table `impuestos`
--

CREATE TABLE `impuestos` (
  `id_impuesto` int(11) NOT NULL AUTO_INCREMENT,
  `titulo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `impuesto` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  PRIMARY KEY (`id_impuesto`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `impuestos`
--

INSERT INTO `impuestos` VALUES (1,'a1','a2');

--
-- Table structure for table `ingreso_plan`
--

CREATE TABLE `ingreso_plan` (
  `id_ingreso_plan` int(11) NOT NULL AUTO_INCREMENT,
  `monto` decimal(9,2) NOT NULL,
  `fecha` datetime NOT NULL,
  `observaciones` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `id_plan` int(11) NOT NULL,
  PRIMARY KEY (`id_ingreso_plan`),
  KEY `id_plan` (`id_plan`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `ingreso_plan`
--


--
-- Table structure for table `jornada_laboral`
--

CREATE TABLE `jornada_laboral` (
  `id_jornada` int(11) NOT NULL AUTO_INCREMENT,
  `id_miembro` int(11) NOT NULL,
  `lunes_e` time DEFAULT '08:00:00',
  `lunes_s` time DEFAULT '12:00:00',
  `martes_e` time DEFAULT '08:00:00',
  `martes_s` time DEFAULT '12:00:00',
  `miercoles_e` time DEFAULT '08:00:00',
  `miercoles_s` time DEFAULT '12:00:00',
  `jueves_e` time DEFAULT '08:00:00',
  `jueves_s` time DEFAULT '12:00:00',
  `viernes_e` time DEFAULT '08:00:00',
  `viernes_s` time DEFAULT '12:00:00',
  `sabado_e` time DEFAULT '08:00:00',
  `sabado_s` time DEFAULT '12:00:00',
  `lunes2_e` time DEFAULT '14:00:00',
  `lunes2_s` time DEFAULT '18:00:00',
  `martes2_e` time DEFAULT '14:00:00',
  `martes2_s` time DEFAULT '18:00:00',
  `miercoles2_e` time DEFAULT '14:00:00',
  `miercoles2_s` time DEFAULT '18:00:00',
  `jueves2_e` time DEFAULT '14:00:00',
  `jueves2_s` time DEFAULT '18:00:00',
  `viernes2_e` time DEFAULT '14:00:00',
  `viernes2_s` time DEFAULT '18:00:00',
  `sabado2_e` time DEFAULT '14:00:00',
  `sabado2_s` time DEFAULT '18:00:00',
  `domingo_e` time DEFAULT NULL,
  `domingo_s` time DEFAULT NULL,
  `domingo2_e` time DEFAULT NULL,
  `domingo2_s` time DEFAULT NULL,
  PRIMARY KEY (`id_jornada`),
  KEY `id_miembro` (`id_miembro`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `jornada_laboral`
--

INSERT INTO `jornada_laboral` VALUES (1,1,'08:00:00','12:00:00','08:00:00','12:00:00','08:00:00','12:00:00','08:00:00','12:00:00','08:00:00','12:00:00','08:00:00','12:00:00','14:00:00','20:00:00','14:00:00','20:00:00','14:00:00','20:00:00','14:00:00','20:00:00','14:00:00','20:00:00','14:00:00','20:00:00','08:00:00','12:00:00','14:00:00','20:00:00'),(2,2,'08:00:00','18:00:00','08:00:00','18:00:00','08:00:00','18:00:00','08:00:00','18:00:00','08:00:00','18:00:00','08:00:00','18:00:00',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'08:00:00','18:00:00',NULL,NULL),(3,3,'08:00:00','12:00:00','08:00:00','12:00:00','08:00:00','12:00:00','08:00:00','12:00:00','08:00:00','12:00:00','08:00:00','12:00:00','14:00:00','20:00:00','14:00:00','20:00:00','14:00:00','20:00:00','14:00:00','20:00:00','14:00:00','20:00:00','14:00:00','20:00:00','08:00:00','12:00:00','14:00:00','20:00:00'),(4,4,'08:00:00','12:00:00','08:00:00','12:00:00','08:00:00','12:00:00','08:00:00','12:00:00','08:00:00','12:00:00','08:00:00','12:00:00','14:00:00','20:00:00','14:00:00','20:00:00','14:00:00','20:00:00','14:00:00','20:00:00','14:00:00','20:00:00','14:00:00','20:00:00',NULL,NULL,NULL,NULL),(5,5,'08:00:00','12:00:00','08:00:00','12:00:00','08:00:00','12:00:00','08:00:00','12:00:00','08:00:00','12:00:00','08:00:00','12:00:00','14:00:00','20:00:00','14:00:00','20:00:00','14:00:00','20:00:00','14:00:00','20:00:00','14:00:00','20:00:00','14:00:00','20:00:00',NULL,NULL,NULL,NULL),(6,6,'08:00:00','12:00:00','08:00:00','12:00:00','08:00:00','12:00:00','08:00:00','12:00:00','08:00:00','12:00:00','08:00:00','12:00:00','14:00:00','20:00:00','14:00:00','20:00:00','14:00:00','20:00:00','14:00:00','20:00:00','14:00:00','20:00:00','14:00:00','20:00:00',NULL,NULL,NULL,NULL),(7,7,'08:00:00','12:00:00','08:00:00','12:00:00','08:00:00','12:00:00','08:00:00','12:00:00','08:00:00','12:00:00','08:00:00','12:00:00','14:00:00','20:00:00','14:00:00','20:00:00','14:00:00','20:00:00','14:00:00','20:00:00','14:00:00','20:00:00','14:00:00','20:00:00','08:00:00','12:00:00','14:00:00','20:00:00');

--
-- Table structure for table `kit_articulo`
--

CREATE TABLE `kit_articulo` (
  `id_kit_articulo` int(11) NOT NULL AUTO_INCREMENT,
  `id_articulo` int(11) NOT NULL,
  `id_kit` int(11) NOT NULL,
  `cantidad` int(11) NOT NULL,
  PRIMARY KEY (`id_kit_articulo`),
  KEY `fk_kit_articulo_id_articulo` (`id_articulo`),
  KEY `fk_kit_articulo_id_kit` (`id_kit`),
  CONSTRAINT `fk_kit_articulo_id_articulo` FOREIGN KEY (`id_articulo`) REFERENCES `articulos` (`id_articulo`) ON DELETE CASCADE,
  CONSTRAINT `fk_kit_articulo_id_kit` FOREIGN KEY (`id_kit`) REFERENCES `kits` (`id_kit`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `kit_articulo`
--


--
-- Table structure for table `kits`
--

CREATE TABLE `kits` (
  `id_kit` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `descuento` decimal(7,2) NOT NULL,
  PRIMARY KEY (`id_kit`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `kits`
--


--
-- Table structure for table `logins`
--

CREATE TABLE `logins` (
  `login_id` int(11) NOT NULL AUTO_INCREMENT,
  `login_user` int(11) DEFAULT NULL,
  `login_ip` text NOT NULL,
  `login_agent` text DEFAULT NULL,
  `login_success` tinyint(4) NOT NULL,
  `login_date` int(11) NOT NULL,
  PRIMARY KEY (`login_id`),
  KEY `fk_logins_users_idx` (`login_user`)
) ENGINE=InnoDB AUTO_INCREMENT=272 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `logins`
--

INSERT INTO `logins` VALUES (8,13,'77.231.124.90','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 OPR/112.0.0.0',1,1725289441),(9,13,'77.231.124.90','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 OPR/112.0.0.0',1,1725292413),(12,13,'77.231.124.90','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 OPR/112.0.0.0',1,1725301235),(17,13,'77.231.124.90','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 OPR/112.0.0.0',1,1725460669),(18,13,'77.231.124.90','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 OPR/112.0.0.0',1,1725461097),(20,13,'77.231.124.90','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 OPR/112.0.0.0',1,1725522947),(21,13,'77.231.124.90','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 OPR/112.0.0.0',1,1725619965),(24,13,'77.231.124.90','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 OPR/112.0.0.0',1,1725628090),(26,13,'85.51.18.14','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 OPR/112.0.0.0',1,1725707061),(27,13,'85.51.16.184','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 OPR/112.0.0.0',1,1725710322),(29,13,'85.51.57.178','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 OPR/112.0.0.0',1,1725822977),(31,13,'90.166.99.91','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 OPR/112.0.0.0',1,1725967262),(37,13,'85.51.57.178','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 OPR/112.0.0.0',1,1726120796),(38,13,'77.231.124.90','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 OPR/112.0.0.0',1,1726129244),(52,13,'85.51.18.3','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 OPR/112.0.0.0',1,1726574031),(68,13,'90.166.99.4','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 OPR/112.0.0.0',1,1727088088),(69,13,'85.51.17.73','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 OPR/112.0.0.0',1,1727094976),(74,13,'90.166.193.89','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 OPR/112.0.0.0',1,1727269230),(80,13,'83.59.19.36','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 OPR/112.0.0.0',1,1727544251),(84,13,'77.231.124.90','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36 OPR/113.0.0.0',1,1728322851),(85,13,'83.59.19.36','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36 OPR/113.0.0.0',1,1728396513),(86,13,'83.59.19.36','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36 OPR/113.0.0.0',1,1728593270),(87,13,'83.59.19.36','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36 OPR/113.0.0.0',1,1728668894),(88,13,'83.59.19.36','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36 OPR/113.0.0.0',1,1728919837),(92,13,'2.137.147.122','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36 OPR/113.0.0.0',1,1729106149),(93,13,'85.51.21.85','Mozilla/5.0 (iPhone; CPU iPhone OS 17_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/129.0.6668.69 Mobile/15E148 Safari/604.1',1,1729107580),(94,13,'85.51.57.178','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36 OPR/113.0.0.0',1,1729122995),(95,13,'81.61.230.94','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36 OPR/113.0.0.0',1,1729178640),(100,13,'212.230.233.53','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 OPR/114.0.0.0',1,1730143954),(103,13,'119.12.255.220','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 OPR/114.0.0.0',1,1730199294),(108,13,'79.116.36.84','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 OPR/114.0.0.0',1,1730289437),(109,13,'46.27.69.24','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 OPR/114.0.0.0',1,1730552143),(113,13,'90.166.98.221','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 OPR/114.0.0.0',1,1730727318),(115,13,'46.27.69.24','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 OPR/114.0.0.0',1,1730816028),(116,13,'87.125.238.24','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 OPR/114.0.0.0',1,1730885984),(118,13,'46.27.69.24','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 OPR/114.0.0.0',1,1731075807),(119,13,'213.96.27.35','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 OPR/114.0.0.0',1,1731320105),(121,13,'83.59.19.36','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 OPR/114.0.0.0',1,1731585581),(122,13,'83.59.19.36','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 OPR/114.0.0.0',1,1731586665),(124,13,'83.59.19.36','Mozilla/5.0 (iPhone; CPU iPhone OS 18_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/130.0.6723.90 Mobile/15E148 Safari/604.1',1,1731592079),(125,13,'46.27.69.24','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36',1,1731608316),(127,13,'46.27.69.24','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 OPR/114.0.0.0',1,1731928764),(128,13,'46.27.69.24','Mozilla/5.0 (iPhone; CPU iPhone OS 18_2_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/131.0.6778.73 Mobile/15E148 Safari/604.1',1,1732016727),(130,13,'46.27.69.24','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 OPR/114.0.0.0',1,1732016792),(137,13,'46.27.69.24','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 OPR/114.0.0.0',1,1732187769),(143,13,'46.27.69.24','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 OPR/114.0.0.0',1,1732275550),(147,13,'46.27.69.24','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 OPR/114.0.0.0',1,1732288086),(148,6692,'88.8.175.89','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36',0,1732538783),(155,13,'46.27.69.24','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 OPR/114.0.0.0',1,1732557970),(156,13,'46.27.69.24','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 OPR/114.0.0.0',1,1732558008),(157,13,'46.27.69.24','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 OPR/114.0.0.0',1,1732558301),(165,13,'85.48.184.171','Mozilla/5.0 (iPhone; CPU iPhone OS 18_2_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/131.0.6778.73 Mobile/15E148 Safari/604.1',1,1732866504),(169,6699,'176.80.93.26','Mozilla/5.0 (iPhone; CPU iPhone OS 17_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/131.0.6778.73 Mobile/15E148 Safari/604.1',0,1732874792),(174,13,'46.27.69.24','Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36',1,1733129056),(175,13,'206.204.131.46','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36',1,1733132841),(176,6701,'206.204.131.46','Mozilla/5.0 (iPhone; CPU iPhone OS 17_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.6 Mobile/15E148 Safari/604.1',0,1733132945),(177,6701,'206.204.131.46','Mozilla/5.0 (iPhone; CPU iPhone OS 17_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.6 Mobile/15E148 Safari/604.1',1,1733132965),(178,13,'176.80.93.104','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 OPR/114.0.0.0',1,1733133172),(184,13,'46.27.69.24','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 OPR/114.0.0.0',1,1733181550),(190,6702,'186.0.181.131','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36',0,1733488356),(192,6702,'186.0.181.131','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36',1,1733488466),(193,6702,'186.0.181.131','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36',1,1733495051),(202,13,'46.27.69.24','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 OPR/114.0.0.0',1,1733764407),(204,6703,'85.56.69.243','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36',0,1733827238),(209,13,'85.51.57.178','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36',1,1734111177),(210,6704,'83.52.81.110','Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36',0,1734113445),(211,6704,'83.52.81.110','Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36',1,1734113475),(212,13,'83.59.20.38','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 OPR/114.0.0.0',1,1734266363),(225,13,'46.27.69.24','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36 OPR/115.0.0.0',1,1735820069),(226,6705,'85.56.69.243','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36',0,1735821042),(227,6703,'85.56.69.243','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36',0,1735830723),(234,13,'46.27.69.24','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36',1,1736337821),(235,13,'46.27.69.24','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36',1,1736344295),(238,13,'83.59.9.4','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36',1,1736425921),(244,13,'83.59.9.4','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36 OPR/115.0.0.0',1,1736594704),(245,13,'79.117.162.10','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36 OPR/115.0.0.0',1,1736799163),(248,13,'46.27.69.24','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36 OPR/115.0.0.0',1,1736986160),(249,13,'46.27.69.24','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36 OPR/115.0.0.0',1,1737031169),(250,13,'46.27.69.24','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36 OPR/115.0.0.0',1,1737050002),(251,13,'83.59.9.4','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 OPR/114.0.0.0',1,1737137137),(252,13,'83.59.9.4','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36 OPR/115.0.0.0',1,1737969013),(254,13,'85.51.16.41','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36',1,1738008085),(255,13,'83.59.9.4','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 OPR/116.0.0.0',1,1738085923),(256,13,'85.51.16.169','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 OPR/116.0.0.0',1,1738158938),(257,13,'85.51.23.116','Mozilla/5.0 (iPhone; CPU iPhone OS 18_3_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/132.0.6834.100 Mobile/15E148 Safari/604.1',1,1738159205),(258,13,'46.27.69.24','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 OPR/116.0.0.0',1,1738171504),(259,13,'46.27.69.24','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36 OPR/115.0.0.0',1,1738172444),(261,13,'83.59.9.4','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 OPR/116.0.0.0',1,1738254557),(262,13,'46.27.69.24','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 OPR/116.0.0.0',1,1738580648),(263,13,'46.27.69.24','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 OPR/116.0.0.0',1,1738583900),(264,6706,'104.28.88.133','Mozilla/5.0 (iPhone; CPU iPhone OS 18_1_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.1.1 Mobile/15E148 Safari/604.1',0,1738586802),(265,6706,'104.28.88.133','Mozilla/5.0 (iPhone; CPU iPhone OS 18_1_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.1.1 Mobile/15E148 Safari/604.1',0,1738586807),(266,13,'46.27.69.24','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 OPR/116.0.0.0',1,1738602085),(267,13,'85.51.57.178','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 OPR/116.0.0.0',1,1738748375),(268,13,'46.27.69.24','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 OPR/116.0.0.0',1,1738756283),(269,6707,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36',0,1743331492),(270,6707,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36',1,1743333559),(271,6707,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36',1,1743459631);

--
-- Table structure for table `mailing`
--

CREATE TABLE `mailing` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `from_address` varchar(100) DEFAULT NULL,
  `to_address` varchar(100) DEFAULT NULL,
  `body` text DEFAULT NULL,
  `used` tinyint(1) DEFAULT NULL,
  `attachments` text DEFAULT NULL,
  `status` tinyint(1) DEFAULT NULL,
  `createdAt` datetime DEFAULT NULL,
  `title` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `mailing`
--

INSERT INTO `mailing` VALUES (7,'panelprincipal@platformkitdigital.com','fede.gundel@gmail.com','<p>Muy buenas, Tras lo hablado le enviamos el albaran, Cualquier tipo de duda o comentario por favor h&aacute;ganoslo saber, Un saludo.</p>',0,'',1,'2025-04-02 22:15:35','Albaran - Pendiente'),(8,'panelprincipal@platformkitdigital.com','fede.gundel@gmail.com','<p>Muy buenas, Tras lo hablado le enviamos el albaran, Cualquier tipo de duda o comentario por favor h&aacute;ganoslo saber, Un saludo.</p>',0,'',1,'2025-04-03 00:59:07','Albaran - Pendiente'),(9,'panelprincipal@platformkitdigital.com','fede.gundel@gmail.com','<p>Muy buenas, Tras lo hablado le enviamos la <strong>factura</strong>, Cualquier tipo de duda o comentario por favor h&aacute;ganoslo saber, Un saludo.</p>',0,'',1,'2025-04-03 01:26:48','Factura - Importante'),(10,'panelprincipal@platformkitdigital.com','fede.gundel@gmail.com','<p>Muy buenas, Tras lo hablado le enviamos la <strong>factura</strong>, Cualquier tipo de duda o comentario por favor h&aacute;ganoslo saber, Un saludo.</p>',0,'',1,'2025-04-03 05:25:00','Factura - Importante');

--
-- Table structure for table `marcas`
--

CREATE TABLE `marcas` (
  `id_marca` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id_marca`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `marcas`
--


--
-- Table structure for table `materiales`
--

CREATE TABLE `materiales` (
  `material_id` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `cantidad` int(11) NOT NULL,
  `id_estado` int(11) NOT NULL,
  `id_ubicacion` int(11) NOT NULL,
  PRIMARY KEY (`material_id`),
  KEY `FK_estado_id` (`id_estado`),
  KEY `FK_ubicacion_id` (`id_ubicacion`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `materiales`
--

INSERT INTO `materiales` VALUES (2,'Cajas',234,2,1),(3,'ROLLOS PAPEL ',500,1,1),(4,'Papel',300,1,2);

--
-- Table structure for table `medidas`
--

CREATE TABLE `medidas` (
  `id_medida` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  PRIMARY KEY (`id_medida`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `medidas`
--

INSERT INTO `medidas` VALUES (1,'dfgh');

--
-- Table structure for table `message`
--

CREATE TABLE `message` (
  `message_id` int(11) NOT NULL AUTO_INCREMENT,
  `message_user` int(11) NOT NULL,
  `message_ticket_id` int(11) NOT NULL,
  `message_date` int(11) NOT NULL,
  `message_text` varchar(5000) NOT NULL,
  PRIMARY KEY (`message_id`),
  KEY `fk_logins_users_idx` (`message_user`),
  KEY `fk_message_tikets1_idx` (`message_ticket_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `message`
--


--
-- Table structure for table `metodos_pago`
--

CREATE TABLE `metodos_pago` (
  `id_metodo` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  PRIMARY KEY (`id_metodo`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `metodos_pago`
--

INSERT INTO `metodos_pago` VALUES (1,'Efectivo'),(2,'Transferencia bancaria ');

--
-- Table structure for table `miembro_equipo`
--

CREATE TABLE `miembro_equipo` (
  `id_miembro` int(11) NOT NULL AUTO_INCREMENT,
  `dni` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `precio_hora` int(11) DEFAULT NULL,
  `user_id` int(11) NOT NULL,
  `precio_horas_extra` int(11) DEFAULT NULL,
  `direccion` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `kilometros_casa` int(11) DEFAULT 1,
  `kilometros_calle` int(11) DEFAULT 1,
  `calle` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT 'Avenida Escaleritas, Las Palmas de Gran Canaria, España',
  PRIMARY KEY (`id_miembro`),
  KEY `user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `miembro_equipo`
--

INSERT INTO `miembro_equipo` VALUES (1,'37847226',NULL,14,NULL,'Pelegrino 2045, Olavarría, Provincia de Buenos Aires, Argentina',1,1,'Ramón Rendon 540, Olavarría, Provincia de Buenos Aires, Argentina'),(2,'7777',4,13,5,'Av. Escaleritas, Las Palmas de Gran Canaria, España',1,1,'Av. Alcalde José Ramirez Bethencourt, Las Palmas de Gran Canaria, España'),(3,'44718159',10,6689,10,'Calle Alejandro Hidalgo, 3, Las Palmas de Gran Canaria, España',NULL,NULL,'Avenida del Barranco, El Tablero, España'),(5,'22222',2,6681,3,'Calle Ciudad Jardín, n8, Corralejo, Las Palmas, España',1,1,'Av. Escaleritas, Las Palmas de Gran Canaria, España'),(6,'222222',2,6701,4,'Calle Ciudad Jardín, Corralejo, Las Palmas, España',1,1,'Avenida Escaleritas, Las Palmas de Gran Canaria, España'),(7,'00000002',3,6698,33,'Las Palmas, n26, Tarifa, España',1,1,'Av. Escaleritas, n3, Las Palmas de Gran Canaria, España');

--
-- Table structure for table `modelos`
--

CREATE TABLE `modelos` (
  `id_modelo` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  PRIMARY KEY (`id_modelo`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `modelos`
--

INSERT INTO `modelos` VALUES (3,'qwe');

--
-- Table structure for table `navegadores`
--

CREATE TABLE `navegadores` (
  `id_navegador` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  PRIMARY KEY (`id_navegador`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `navegadores`
--


--
-- Table structure for table `nivel_estudios`
--

CREATE TABLE `nivel_estudios` (
  `id_nivel_estudios` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  PRIMARY KEY (`id_nivel_estudios`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `nivel_estudios`
--


--
-- Table structure for table `notas`
--

CREATE TABLE `notas` (
  `id_nota` int(11) NOT NULL AUTO_INCREMENT,
  `cuerpo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `id_cliente` int(11) NOT NULL,
  `fecha` datetime NOT NULL,
  PRIMARY KEY (`id_nota`),
  KEY `FK_client_id` (`id_cliente`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `notas`
--

INSERT INTO `notas` VALUES (1,'Cliente ideal',1,'2024-09-04 15:46:00'),(2,'Cliente contento',2,'2024-09-10 12:27:12'),(3,'Cliente problematico',2,'2024-09-23 11:56:31'),(4,'Clienta me llamo a las 7:00 am',3,'2024-10-08 15:21:40'),(5,'cLIENTE CONTENTO',4,'2024-10-14 16:43:16'),(6,'Cliente simpatico',10,'2025-01-09 12:39:21'),(7,'cl4l',1,'2025-01-17 18:31:56');

--
-- Table structure for table `obras`
--

CREATE TABLE `obras` (
  `id_obra` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  PRIMARY KEY (`id_obra`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `obras`
--


--
-- Table structure for table `observaciones`
--

CREATE TABLE `observaciones` (
  `id_observacion` int(11) NOT NULL AUTO_INCREMENT,
  `observacion` varchar(2255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `id_pedido` int(11) NOT NULL,
  PRIMARY KEY (`id_observacion`),
  KEY `id_pedido` (`id_pedido`),
  CONSTRAINT `observaciones_ibfk_1` FOREIGN KEY (`id_pedido`) REFERENCES `pedidos` (`id_pedido`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `observaciones`
--


--
-- Table structure for table `otras_carpetas`
--

CREATE TABLE `otras_carpetas` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `otras_carpetas`
--


--
-- Table structure for table `pago`
--

CREATE TABLE `pago` (
  `id_pago` int(11) NOT NULL AUTO_INCREMENT,
  `importe` decimal(7,2) NOT NULL,
  `estado` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `id_miembro` int(11) DEFAULT NULL,
  `fecha` date NOT NULL,
  `pagos` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `importe_restante` decimal(7,2) NOT NULL,
  `horas_extra` int(11) DEFAULT NULL,
  `precio_horas_extra` decimal(7,2) DEFAULT NULL,
  `id_proveedor` int(11) DEFAULT NULL,
  `numero_factura` int(11) DEFAULT NULL,
  `fecha_vencimiento` datetime DEFAULT NULL,
  PRIMARY KEY (`id_pago`),
  KEY `id_miembro` (`id_miembro`),
  KEY `id_proveedor` (`id_proveedor`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `pago`
--


--
-- Table structure for table `pago_empleado`
--

CREATE TABLE `pago_empleado` (
  `id_pago_empleado` int(11) NOT NULL AUTO_INCREMENT,
  `importe` decimal(7,2) DEFAULT NULL,
  `id_metodo` int(11) DEFAULT NULL,
  `id_banco` int(11) DEFAULT NULL,
  `fecha` datetime DEFAULT NULL,
  `id_factura_empleado` int(11) NOT NULL,
  PRIMARY KEY (`id_pago_empleado`),
  KEY `id_metodo` (`id_metodo`),
  KEY `id_banco` (`id_banco`),
  KEY `id_factura_empleado` (`id_factura_empleado`),
  CONSTRAINT `pago_empleado_ibfk_1` FOREIGN KEY (`id_banco`) REFERENCES `bancos` (`id_banco`) ON DELETE SET NULL ON UPDATE SET NULL,
  CONSTRAINT `pago_empleado_ibfk_2` FOREIGN KEY (`id_metodo`) REFERENCES `metodos_pago` (`id_metodo`) ON DELETE SET NULL ON UPDATE SET NULL,
  CONSTRAINT `pago_empleado_ibfk_3` FOREIGN KEY (`id_factura_empleado`) REFERENCES `factura_empleado` (`id_factura_empleado`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;

--
-- Dumping data for table `pago_empleado`
--


--
-- Table structure for table `pago_factura`
--

CREATE TABLE `pago_factura` (
  `id_pago_factura` int(11) NOT NULL AUTO_INCREMENT,
  `importe` decimal(9,2) NOT NULL,
  `id_metodo` int(11) DEFAULT NULL,
  `id_banco` int(11) DEFAULT NULL,
  `fecha` date NOT NULL,
  `id_factura_manual` int(11) NOT NULL,
  PRIMARY KEY (`id_pago_factura`),
  KEY `id_metodo` (`id_metodo`),
  KEY `id_banco` (`id_banco`),
  KEY `id_factura_manual` (`id_factura_manual`),
  CONSTRAINT `pago_factura_ibfk_1` FOREIGN KEY (`id_banco`) REFERENCES `bancos` (`id_banco`) ON DELETE SET NULL ON UPDATE SET NULL,
  CONSTRAINT `pago_factura_ibfk_2` FOREIGN KEY (`id_metodo`) REFERENCES `metodos_pago` (`id_metodo`) ON DELETE SET NULL ON UPDATE SET NULL,
  CONSTRAINT `pago_factura_ibfk_3` FOREIGN KEY (`id_factura_manual`) REFERENCES `factura_manual` (`id_factura_manual`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `pago_factura`
--


--
-- Table structure for table `pago_proveedor`
--

CREATE TABLE `pago_proveedor` (
  `id_pago_proveedor` int(11) NOT NULL AUTO_INCREMENT,
  `importe` decimal(9,2) NOT NULL,
  `id_metodo` int(11) DEFAULT NULL,
  `id_banco` int(11) DEFAULT NULL,
  `fecha` datetime NOT NULL,
  `id_factura_proveedor` int(11) NOT NULL,
  PRIMARY KEY (`id_pago_proveedor`),
  KEY `id_metodo` (`id_metodo`),
  KEY `id_banco` (`id_banco`),
  KEY `id_factura_proveedor` (`id_factura_proveedor`),
  CONSTRAINT `pago_proveedor_ibfk_1` FOREIGN KEY (`id_banco`) REFERENCES `bancos` (`id_banco`) ON DELETE SET NULL ON UPDATE SET NULL,
  CONSTRAINT `pago_proveedor_ibfk_2` FOREIGN KEY (`id_metodo`) REFERENCES `metodos_pago` (`id_metodo`) ON DELETE SET NULL ON UPDATE SET NULL,
  CONSTRAINT `pago_proveedor_ibfk_3` FOREIGN KEY (`id_factura_proveedor`) REFERENCES `factura_proveedor` (`id_factura_proveedor`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;

--
-- Dumping data for table `pago_proveedor`
--

INSERT INTO `pago_proveedor` VALUES (1,20.00,NULL,4,'2024-11-04 13:37:50',4),(2,780.00,1,NULL,'2024-11-04 13:38:00',4),(3,1400.00,1,4,'2024-11-14 12:34:00',5);

--
-- Table structure for table `pedidos`
--

CREATE TABLE `pedidos` (
  `id_pedido` int(11) NOT NULL AUTO_INCREMENT,
  `numero` varchar(255) DEFAULT NULL,
  `nombre` varchar(255) DEFAULT NULL,
  `domicilio` varchar(255) DEFAULT NULL,
  `dni` varchar(255) DEFAULT NULL,
  `telefono` varchar(255) DEFAULT NULL,
  `palets` varchar(255) DEFAULT NULL,
  `bultos` varchar(255) DEFAULT NULL,
  `tipo_entrega` varchar(255) DEFAULT NULL,
  `estado` varchar(255) DEFAULT '',
  `geolocalizacion` varchar(255) DEFAULT NULL,
  `id_transportista` int(11) DEFAULT NULL,
  `fecha_creacion` datetime DEFAULT current_timestamp(),
  `fecha_entrega` date DEFAULT NULL,
  `id_firma` int(11) DEFAULT NULL,
  `id_almacen` int(11) DEFAULT NULL,
  `id_balda` int(11) DEFAULT NULL,
  `id_columna` int(11) DEFAULT NULL,
  `fecha_almacen` date DEFAULT NULL,
  PRIMARY KEY (`id_pedido`),
  KEY `pedidos_transportistas_id` (`id_transportista`),
  KEY `id_firma` (`id_firma`),
  KEY `id_almacen` (`id_almacen`),
  KEY `id_balda` (`id_balda`),
  KEY `id_columna` (`id_columna`),
  CONSTRAINT `pedidos_ibfk_1` FOREIGN KEY (`id_transportista`) REFERENCES `transportistas` (`id_transportista`) ON DELETE SET NULL ON UPDATE SET NULL,
  CONSTRAINT `pedidos_ibfk_2` FOREIGN KEY (`id_firma`) REFERENCES `firmas` (`id_firma`) ON DELETE SET NULL ON UPDATE SET NULL,
  CONSTRAINT `pedidos_ibfk_3` FOREIGN KEY (`id_almacen`) REFERENCES `almacenes` (`id_almacen`) ON DELETE SET NULL ON UPDATE SET NULL,
  CONSTRAINT `pedidos_ibfk_4` FOREIGN KEY (`id_balda`) REFERENCES `baldas` (`id_balda`) ON DELETE SET NULL ON UPDATE SET NULL,
  CONSTRAINT `pedidos_ibfk_5` FOREIGN KEY (`id_columna`) REFERENCES `columnas` (`id_columna`) ON DELETE SET NULL ON UPDATE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;

--
-- Dumping data for table `pedidos`
--

INSERT INTO `pedidos` VALUES (1,'234234','341234','123412','12341234',NULL,'0','012341234','Directa','Entregado',NULL,NULL,'2024-09-25 17:20:15',NULL,NULL,NULL,NULL,NULL,NULL);

--
-- Table structure for table `pedidos_observaciones`
--

CREATE TABLE `pedidos_observaciones` (
  `id_pedido` int(11) NOT NULL,
  `observacion` varchar(500) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  KEY `pedidos_observaciones_id` (`id_pedido`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;

--
-- Dumping data for table `pedidos_observaciones`
--


--
-- Table structure for table `pedidos_transportistas`
--

CREATE TABLE `pedidos_transportistas` (
  `id_transportista` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) NOT NULL,
  `domicilio` varchar(255) NOT NULL,
  `dni` varchar(255) NOT NULL,
  `telefono` varchar(255) NOT NULL,
  PRIMARY KEY (`id_transportista`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;

--
-- Dumping data for table `pedidos_transportistas`
--


--
-- Table structure for table `periodo_vacaciones`
--

CREATE TABLE `periodo_vacaciones` (
  `id_periodo_vacaciones` int(11) NOT NULL AUTO_INCREMENT,
  `salida_periodo_1` date DEFAULT NULL,
  `incorporacion_periodo_1` date DEFAULT NULL,
  `salida_periodo_2` date DEFAULT NULL,
  `incorporacion_periodo_2` date DEFAULT NULL,
  `salida_periodo_3` date DEFAULT NULL,
  `incorporacion_periodo_3` date DEFAULT NULL,
  `id_empleado` int(11) NOT NULL,
  `observaciones` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `data` text DEFAULT NULL,
  PRIMARY KEY (`id_periodo_vacaciones`),
  KEY `id_empleado` (`id_empleado`)
) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `periodo_vacaciones`
--

INSERT INTO `periodo_vacaciones` VALUES (16,NULL,NULL,NULL,NULL,NULL,NULL,6,'turbodat','[{\\\"salida\\\":\\\"2025-02-05\\\",\\\"incorporacion\\\":\\\"2025-02-07\\\",\\\"dias\\\":2},{\\\"salida\\\":\\\"2025-02-10\\\",\\\"incorporacion\\\":\\\"2025-02-16\\\",\\\"dias\\\":6},{\\\"salida\\\":\\\"2025-02-27\\\",\\\"incorporacion\\\":\\\"2025-03-02\\\",\\\"dias\\\":3}]'),(18,NULL,NULL,NULL,NULL,NULL,NULL,7,'','[{\\\"salida\\\":\\\"2025-02-05\\\",\\\"incorporacion\\\":\\\"2025-02-27\\\",\\\"dias\\\":22}]'),(19,NULL,NULL,NULL,NULL,NULL,NULL,7,'ewqeqwe','[{\\\"salida\\\":\\\"2025-02-10\\\",\\\"incorporacion\\\":\\\"2025-02-17\\\",\\\"dias\\\":7}]');

--
-- Table structure for table `personalizacion`
--

CREATE TABLE `personalizacion` (
  `url_logo_portada` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `url_imagen_portada` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `url_facebook` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `url_linkedin` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `url_twitter` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `url_youtube` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `id_personalizacion` int(11) NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (`id_personalizacion`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `personalizacion`
--


--
-- Table structure for table `planes`
--

CREATE TABLE `planes` (
  `id_plan` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `id_sector` int(11) DEFAULT NULL,
  `importe` decimal(9,2) NOT NULL,
  `fecha` date NOT NULL,
  PRIMARY KEY (`id_plan`),
  KEY `id_sector` (`id_sector`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `planes`
--


--
-- Table structure for table `poblaciones`
--

CREATE TABLE `poblaciones` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `poblaciones`
--

INSERT INTO `poblaciones` VALUES (1,'Olavarria'),(3,'fgdfg'),(4,'sdfsfffffffff'),(5,'asd'),(6,'Las Palmas'),(7,'Olavarría'),(8,'Las palmas');

--
-- Table structure for table `presupuesto_programado`
--

CREATE TABLE `presupuesto_programado` (
  `id_presupuesto_programado` int(11) NOT NULL AUTO_INCREMENT,
  `fecha_envio` datetime NOT NULL,
  `id_presupuesto` int(11) NOT NULL,
  `estado` varchar(255) NOT NULL DEFAULT 'No enviado',
  PRIMARY KEY (`id_presupuesto_programado`),
  KEY `id_presupuesto` (`id_presupuesto`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `presupuesto_programado`
--


--
-- Table structure for table `presupuestos`
--

CREATE TABLE `presupuestos` (
  `id_presupuesto` int(11) NOT NULL AUTO_INCREMENT,
  `titulo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `id_cliente` int(11) NOT NULL,
  `fecha` datetime NOT NULL,
  `numero` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `condiciones` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `tipo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `estado` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `detallado` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `importe` decimal(9,2) NOT NULL,
  `id_fase` int(11) DEFAULT NULL,
  `id_sector` int(11) DEFAULT NULL,
  `id_obra` int(11) DEFAULT NULL,
  `cif` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `domicilio` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `cp` int(11) DEFAULT NULL,
  `telefono` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `id_usuario` int(11) NOT NULL,
  `importe_final` decimal(9,2) NOT NULL,
  `irpf` decimal(7,2) DEFAULT NULL,
  `nota_interna` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `nota_externa` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `imagen` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `programado` date DEFAULT NULL,
  `lugar` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `fechas` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `impuesto` decimal(7,2) DEFAULT NULL,
  PRIMARY KEY (`id_presupuesto`),
  KEY `FK_client_id` (`id_cliente`),
  KEY `FK_fase_id` (`id_fase`),
  KEY `FK_sector_id` (`id_sector`),
  KEY `FK_obra_id` (`id_obra`),
  KEY `FK_user_id` (`id_usuario`),
  CONSTRAINT `presupuestos_ibfk_1` FOREIGN KEY (`id_cliente`) REFERENCES `clientes` (`client_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `presupuestos_ibfk_2` FOREIGN KEY (`id_usuario`) REFERENCES `users` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `presupuestos_ibfk_3` FOREIGN KEY (`id_fase`) REFERENCES `fases` (`id_fase`) ON DELETE SET NULL ON UPDATE SET NULL,
  CONSTRAINT `presupuestos_ibfk_4` FOREIGN KEY (`id_obra`) REFERENCES `obras` (`id_obra`) ON DELETE SET NULL ON UPDATE SET NULL,
  CONSTRAINT `presupuestos_ibfk_5` FOREIGN KEY (`id_sector`) REFERENCES `sectores` (`id_sector`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `presupuestos`
--

INSERT INTO `presupuestos` VALUES (1,'rhrrt',1,'2024-09-01 23:29:59','2022/A5',NULL,'Particular','Aceptado','[]',0.00,NULL,NULL,NULL,'37847226',NULL,NULL,NULL,'fede.gundel@gmail.com',13,0.00,NULL,NULL,NULL,'https://panelprincipal.platformkitdigital.com/image.php?id=CeD4ahiDU2QgDyWgNWYeh69k2',NULL,NULL,NULL,NULL),(2,'Hola3333333333',1,'2024-10-07 18:42:59','2022/A6','Hola esta es una prueba','Particular','Aceptado','[{\"codigo\":\"993\",\"cantidad\":\"5 \",\"descripcion\":\"AA\",\"precio_unitario\":\"250.00\",\"titulo\":null,\"igic\":\"0.00\"}]',1250.00,NULL,NULL,NULL,'37847226',NULL,NULL,NULL,'fede.gundel@gmail.com',13,1250.00,NULL,NULL,NULL,'https://panelprincipal.platformkitdigital.com/image.php?id=CeD4ahiDU2QgDyWgNWYeh69k2',NULL,'Las Arenas','01/02/2024',NULL),(3,'Prueba 2024',3,'2024-10-08 15:23:11','2022/A7','Hola esto es una prueba de condiciones.','Particular','Aceptado','[{\"codigo\":\"67676\",\"cantidad\":\"20 \",\"descripcion\":\"Esto es una prueba\",\"precio_unitario\":\"1.00\",\"titulo\":\"Alfombrilla\",\"igic\":\"7.00\"}]',20.00,NULL,NULL,NULL,'77777','Alcalde Jose Ramirez Bethencourt n13',NULL,'23232323','fabiolacn77@hotmail.com',13,21.40,NULL,NULL,NULL,'https://panelprincipal.platformkitdigital.com/image.php?id=CeD4ahiDU2QgDyWgNWYeh69k2',NULL,NULL,NULL,NULL),(4,'Crear pared',4,'2024-10-16 20:19:12','2022/A8','aaaa','Particular','Aceptado','[{\"codigo\":\"1112\",\"cantidad\":\"1 \",\"descripcion\":\"Esto es una prueba\",\"precio_unitario\":\"200.00\",\"titulo\":\"Pared\",\"igic\":\"7.00\"}]',200.00,NULL,NULL,NULL,'y12666311','Alcalde Jose Ramirez Bethencourt n13',32323,'661033031','yosoyrubens@gmail.com',13,214.00,NULL,NULL,NULL,'https://panelprincipal.platformkitdigital.com/image.php?id=CeD4ahiDU2QgDyWgNWYeh69k2',NULL,'Las casas verdes','20 de enero de 2024',NULL),(5,'CLIENTE 45',5,'2024-11-05 14:15:06','2022/A9','DESDE NUESTRAUHDWQDQDVWF','Particular','Aceptado','[{\"codigo\":\"sku34\",\"cantidad\":\"1 \",\"descripcion\":\"Transportegwyilielbef\",\"precio_unitario\":\"0.00\",\"titulo\":null,\"igic\":\"7.00\"},{\"codigo\":\"sku34\",\"cantidad\":\"8 \",\"descripcion\":\"Transportegwyilielbef\",\"precio_unitario\":\"0.00\",\"titulo\":null,\"igic\":\"7.00\"}]',0.00,NULL,NULL,NULL,'45123456A','CARRER CARME NUM 77 Planta 2',NULL,NULL,'Beledin.ads@gmail.com',13,0.00,NULL,NULL,NULL,'https://panelprincipal.platformkitdigital.com/image.php?id=E7zSPeEC3ux6FzI7lvSvKPXe3',NULL,NULL,NULL,NULL),(6,'Cliente 43',6,'2024-11-14 12:22:58','2022/A10','DESDE NUESTRAUHDWQDQDVWF','Particular','Pendiente','[]',0.00,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,13,0.00,NULL,NULL,NULL,'https://panelprincipal.platformkitdigital.com/image.php?id=CeD4ahiDU2QgDyWgNWYeh69k2',NULL,NULL,NULL,NULL),(7,'6y7y',7,'2024-12-30 12:56:16','2022/A11',NULL,'Particular','No enviado','[{\"codigo\":\"1112\",\"cantidad\":\"1 \",\"descripcion\":\"Esto es una prueba\",\"precio_unitario\":\"200.00\",\"titulo\":null,\"igic\":\"7.00\"}]',200.00,NULL,NULL,NULL,'312313M',NULL,NULL,NULL,'limixerr@gmail.com',13,182.00,16.00,NULL,NULL,'https://panelprincipal.platformkitdigital.com/image.php?id=CeD4ahiDU2QgDyWgNWYeh69k2',NULL,NULL,'r',7.00),(8,'333',7,'2024-12-30 13:08:25','2022/A11','eso esss','Particular','Enviado','[{\"codigo\":\"1112\",\"cantidad\":\"1 \",\"descripcion\":\"Esto es una prueba\",\"precio_unitario\":\"200.00\",\"titulo\":null,\"igic\":\"7.00\"}]',200.00,NULL,NULL,NULL,'312313M',NULL,NULL,NULL,'limixerr@gmail.com',13,170.00,22.00,'internita','externtia','https://panelprincipal.platformkitdigital.com/image.php?id=CeD4ahiDU2QgDyWgNWYeh69k2','2025-01-15',NULL,NULL,7.00),(9,'Presupuesto de producción',7,'2025-01-15 11:13:47','2022/A12',NULL,'Particular','Enviado','[{\"codigo\":\"SKU-400\",\"cantidad\":\"5 \",\"descripcion\":\"CERAMICA NUEVA BARATA \",\"precio_unitario\":\"120.00\",\"titulo\":\"Tejas de cerámica\",\"igic\":\"21.00\"}]',600.00,NULL,NULL,NULL,'45394193J','Domicilio',35018,'123123123','javiervs9797@gmail.com',13,636.00,15.00,NULL,NULL,'https://panelprincipal.platformkitdigital.com/image.php?id=CeD4ahiDU2QgDyWgNWYeh69k2','2025-01-15','tt',NULL,21.00),(10,'Cliente 2',2,'2025-01-17 18:21:20','2022/A13','DESDE NUESTRAUHDWQDQDVWF\\nNUESTRA EMPRES ANO SEIOEÑ','Particular','No enviado','[{\"codigo\":\"1\",\"cantidad\":\"1 \",\"descripcion\":\"Habitación con baño y yacuzzi.\",\"precio_unitario\":\"100.00\",\"titulo\":null,\"igic\":\"7.00\"}]',100.00,NULL,NULL,NULL,'6767333L','Calle 9 letra b n6 24 entre 72C y 72E',NULL,NULL,'infopierre14@gmail.com',13,107.00,NULL,NULL,NULL,'https://panelprincipal.platformkitdigital.com/image.php?id=ix7XQcvhzdaaoqIPXeSEtgIO7',NULL,NULL,NULL,7.00),(11,'Cliente 2',2,'2025-01-17 18:21:20','2022/A13','DESDE NUESTRAUHDWQDQDVWF\\nNUESTRA EMPRES ANO SEIOEÑ','Particular','Aceptado','[{\"codigo\":\"1\",\"cantidad\":\"1 \",\"descripcion\":\"Habitación con baño y yacuzzi.\",\"precio_unitario\":\"100.00\",\"titulo\":null,\"igic\":\"7.00\"}]',100.00,NULL,NULL,NULL,'6767333L','Calle 9 letra b n6 24 entre 72C y 72E',NULL,NULL,'infopierre14@gmail.com',13,107.00,NULL,NULL,NULL,'https://panelprincipal.platformkitdigital.com/image.php?id=ix7XQcvhzdaaoqIPXeSEtgIO7',NULL,NULL,NULL,NULL),(12,'Cliente 2',6,'2025-01-16 19:43:27','2022/A15','DESDE NUESTRAUHDWQDQDVWF\\nNUESTRA EMPRES ANO SEIOEÑ','Particular','Aceptado','[{\"codigo\":\"1\",\"cantidad\":\"1 \",\"descripcion\":\"Habitación con baño y yacuzzi.\",\"precio_unitario\":\"100.00\",\"titulo\":null,\"igic\":\"7.00\"},{\"codigo\":\"1\",\"cantidad\":\"1 \",\"descripcion\":\"Habitación con baño y yacuzzi.\",\"precio_unitario\":\"100.00\",\"titulo\":null,\"igic\":\"7.00\"}]',200.00,NULL,NULL,NULL,'A12345678','Calle Alfonso VIII 5 2c',NULL,NULL,'liberrimostyle@gmail.com',13,214.00,NULL,NULL,NULL,'https://panelprincipal.platformkitdigital.com/image.php?id=ix7XQcvhzdaaoqIPXeSEtgIO7',NULL,NULL,NULL,7.00);

--
-- Table structure for table `producto`
--

CREATE TABLE `producto` (
  `id_producto` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `numero` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `precio` decimal(10,2) NOT NULL,
  `id_subcategoria` int(11) DEFAULT NULL,
  `descripcion` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  PRIMARY KEY (`id_producto`),
  KEY `id_subcategoria` (`id_subcategoria`),
  CONSTRAINT `producto_ibfk_1` FOREIGN KEY (`id_subcategoria`) REFERENCES `subcategorias` (`id_subcategoria`) ON DELETE SET NULL ON UPDATE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `producto`
--

INSERT INTO `producto` VALUES (3,'pEPE','1',32.00,NULL,'2222'),(4,'Laser','23',3.00,NULL,'11111');

--
-- Table structure for table `proveedores`
--

CREATE TABLE `proveedores` (
  `id_proveedor` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `cif` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `cp` int(11) DEFAULT NULL,
  `direccion` int(11) DEFAULT NULL,
  `email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `telefono` int(11) DEFAULT NULL,
  `tipo` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id_proveedor`)
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `proveedores`
--

INSERT INTO `proveedores` VALUES (1,'Quesos las palmas','iiii',0,0,'yosoyrubens@gmail.com',661033031,NULL);

--
-- Table structure for table `proyecto_empleado`
--

CREATE TABLE `proyecto_empleado` (
  `id_proyecto_empleado` int(11) NOT NULL AUTO_INCREMENT,
  `id_empleado` int(11) DEFAULT NULL,
  `id_proyecto` int(11) DEFAULT NULL,
  `fecha_i` datetime NOT NULL,
  `fecha_f` datetime NOT NULL,
  `id_grupo2` int(11) DEFAULT NULL,
  PRIMARY KEY (`id_proyecto_empleado`),
  KEY `id_empleado` (`id_empleado`),
  KEY `id_proyecto` (`id_proyecto`),
  KEY `id_grupo2` (`id_grupo2`),
  CONSTRAINT `proyecto_empleado_ibfk_1` FOREIGN KEY (`id_empleado`) REFERENCES `empleados` (`id_empleado`) ON DELETE SET NULL ON UPDATE SET NULL,
  CONSTRAINT `proyecto_empleado_ibfk_2` FOREIGN KEY (`id_grupo2`) REFERENCES `grupos2` (`id_grupo2`) ON DELETE SET NULL ON UPDATE SET NULL,
  CONSTRAINT `proyecto_empleado_ibfk_3` FOREIGN KEY (`id_proyecto`) REFERENCES `proyectos` (`id_proyecto`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `proyecto_empleado`
--

INSERT INTO `proyecto_empleado` VALUES (6,1,1,'2024-09-02 02:00:00','2024-09-02 06:00:00',NULL),(11,1,3,'2024-11-12 06:00:00','2024-11-12 18:00:00',NULL),(12,1,4,'2025-01-14 06:00:00','2025-01-14 18:00:00',NULL),(13,5,4,'2025-01-28 06:00:00','2025-01-28 18:00:00',NULL),(14,3,4,'2025-01-28 12:00:00','2025-01-29 00:00:00',NULL),(15,3,4,'2025-01-28 06:00:00','2025-01-28 18:00:00',NULL),(16,6,5,'2025-02-04 06:00:00','2025-02-04 18:00:00',NULL),(17,5,5,'2025-02-04 06:00:00','2025-02-04 18:00:00',NULL),(18,3,5,'2025-02-04 06:00:00','2025-02-04 18:00:00',NULL);

--
-- Table structure for table `proyecto_trabajador`
--

CREATE TABLE `proyecto_trabajador` (
  `id_proyecto_trabajador` int(11) NOT NULL AUTO_INCREMENT,
  `id_trabajador` int(11) NOT NULL,
  `id_proyecto` int(11) DEFAULT NULL,
  `fecha_i` datetime NOT NULL,
  `fecha_f` datetime NOT NULL,
  PRIMARY KEY (`id_proyecto_trabajador`),
  KEY `FK_t_id` (`id_trabajador`),
  KEY `FK_p_id` (`id_proyecto`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `proyecto_trabajador`
--


--
-- Table structure for table `proyectos`
--

CREATE TABLE `proyectos` (
  `id_proyecto` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `color` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `gastos_adicionales` decimal(10,2) DEFAULT NULL,
  `observaciones` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  PRIMARY KEY (`id_proyecto`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `proyectos`
--

INSERT INTO `proyectos` VALUES (1,'Proyecto de prueba','#d81089',10.00,'Es un proyecto de prueba'),(3,'TENERIFE SUR ','#b77afa',400.00,'DESDE EL DIA 9 DE NOVIEMBRE AL 28 DE NOVIEMBRE ESTARÁN LOS MATERIALES EN ESTA UBICACIÓN: \n'),(4,'Hospital negrin','#db1988',100.00,'Hospital negrin GC'),(5,'Boda Marbella 1','#16e525',0.00,'Boda');

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

CREATE TABLE `roles` (
  `id_rol` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `links` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  PRIMARY KEY (`id_rol`)
) ENGINE=InnoDB AUTO_INCREMENT=53 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `roles`
--

INSERT INTO `roles` VALUES (23,'Administrador','[\"calculonomina\",\"historialnominas\",\"empleadosnomina\",\"contratos\",\"inicio\",\"apartados\",\"condiciones\",\"crearpresupuesto\",\"historialpresupuestos\",\"presupuestosprogramados\",\"crearfacturamanual\",\"historialfacturasmanuales\",\"historialfacturasrectificadas\",\"bancos\",\"copias_seguridad\",\"facturasprogramadas\",\"cobrospendientes\",\"clientestotales\",\"potencialcliente\",\"emailmarketing\",\"vehiculos\",\"financiacion\",\"historialventas\",\"itv\",\"historialenviositv\",\"alumnos\",\"alumnospotenciales\",\"planes\",\"cursos\",\"docentes\",\"equipo\",\"fichajes\",\"fichaje\",\"alerta\",\"controldevacaciones\",\"ventasmanuales\",\"agregarproductosyservicios\",\"calendariocitas\",\"historialcompras\",\"ofertacumpleanos\",\"enviomasivo\",\"subirrecursos\",\"marketing\",\"crearcarpeta\",\"finanzas\",\"legal\",\"presupuestos_c\",\"otrosrecursos\",\"proveedores\",\"pagoaproveedores\",\"controldesueldos\",\"inventario\",\"empleados\",\"controldepersonal\",\"historialactividades\",\"backups\",\"miembros_eventos\",\"historialeventos\",\"historialeventosprueba\",\"historialeventosusuario\",\"miembros\",\"logistica_crear_pedido\",\"logistica_estadisticas\",\"logistica_en_ruta\",\"logistica_pedidos_pendientes\",\"logistica_pedidos_entregados\",\"logistica_no_entregado\",\"logistica_historial\",\"logistica_observaciones_carga\",\"logistica_transportistas\",\"logistica_scanner\",\"misformularios\",\"crearformulario\",\"sistemaarchivos\",\"condiciones\",\"crearalbaran\",\"historialalbaranes\"]'),(40,'Admin1','[\"inicio\",\"clientestotales\",\"potencialcliente\",\"emailmarketing\"]'),(43,'FEBRERO','[\"miembros\",\"crearpresupuesto\",\"historialpresupuestos\",\"crearfacturamanual\",\"historialfacturasmanuales\",\"facturasprogramadas\"]'),(46,'Nuevo','[\"inicio\",\"financiacion\",\"historialventas\",\"alumnospotenciales\",\"cursos\"]'),(47,'Unico','[\"apartados\",\"miembros\"]'),(48,'Trabajador','[\"fichaje\"]'),(51,'De prueba','[\"apartados\",\"miembros\"]'),(52,'Contratos','[\"inicio\",\"contratos\"]');

--
-- Table structure for table `sector_cnae`
--

CREATE TABLE `sector_cnae` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `sector_id` int(11) DEFAULT NULL,
  `cnae_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_sector_cnae` (`sector_id`,`cnae_id`),
  KEY `cnae_id` (`cnae_id`),
  CONSTRAINT `sector_cnae_ibfk_1` FOREIGN KEY (`sector_id`) REFERENCES `sectors` (`id`),
  CONSTRAINT `sector_cnae_ibfk_2` FOREIGN KEY (`cnae_id`) REFERENCES `cnae` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `sector_cnae`
--


--
-- Table structure for table `sectores`
--

CREATE TABLE `sectores` (
  `id_sector` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `id_cliente` int(11) NOT NULL,
  PRIMARY KEY (`id_sector`),
  KEY `FK_sector_client_id` (`id_cliente`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `sectores`
--

INSERT INTO `sectores` VALUES (1,'1',0),(2,'Autónomo',0),(3,'dfdf',0);

--
-- Table structure for table `sectors`
--

CREATE TABLE `sectors` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `sector_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `sectors`
--


--
-- Table structure for table `servicio`
--

CREATE TABLE `servicio` (
  `id_servicio` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `descripcion` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `precio` decimal(7,2) NOT NULL,
  `id_subcategoria` int(11) DEFAULT NULL,
  PRIMARY KEY (`id_servicio`),
  KEY `id_subcategoria` (`id_subcategoria`),
  CONSTRAINT `servicio_ibfk_1` FOREIGN KEY (`id_subcategoria`) REFERENCES `subcategorias` (`id_subcategoria`) ON DELETE SET NULL ON UPDATE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `servicio`
--


--
-- Table structure for table `servicio_calendario`
--

CREATE TABLE `servicio_calendario` (
  `id_servicio_calendario` int(11) NOT NULL AUTO_INCREMENT,
  `id_servicio` int(11) NOT NULL,
  `color` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  PRIMARY KEY (`id_servicio_calendario`),
  KEY `id_servicio` (`id_servicio`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `servicio_calendario`
--


--
-- Table structure for table `servicio_trabajador`
--

CREATE TABLE `servicio_trabajador` (
  `id_servicio_trabajador` int(11) NOT NULL AUTO_INCREMENT,
  `client_id` int(11) DEFAULT NULL,
  `id_servicio_calendario` int(11) DEFAULT NULL,
  `user_id` int(11) NOT NULL,
  `fecha_i` datetime NOT NULL,
  `fecha_f` datetime NOT NULL,
  PRIMARY KEY (`id_servicio_trabajador`),
  KEY `client_id` (`client_id`),
  KEY `id_servicio_calendario` (`id_servicio_calendario`),
  KEY `user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `servicio_trabajador`
--


--
-- Table structure for table `slider`
--

CREATE TABLE `slider` (
  `slider_id` int(11) NOT NULL AUTO_INCREMENT,
  `slider_title` varchar(150) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `slider_subtitle` varchar(200) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `slider_url` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `slider_btn` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `slider_image` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `slider_data` int(11) NOT NULL,
  PRIMARY KEY (`slider_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `slider`
--


--
-- Table structure for table `sms`
--

CREATE TABLE `sms` (
  `id_sms` int(11) NOT NULL AUTO_INCREMENT,
  `fecha_envio` datetime DEFAULT NULL,
  `client_id` int(11) NOT NULL,
  `estado` varchar(255) NOT NULL DEFAULT '',
  `cuerpo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `fecha_programado` datetime DEFAULT NULL,
  `id_tag` int(11) DEFAULT NULL,
  PRIMARY KEY (`id_sms`),
  KEY `vwer` (`client_id`),
  KEY `tag` (`id_tag`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `sms`
--


--
-- Table structure for table `subcategorias`
--

CREATE TABLE `subcategorias` (
  `id_subcategoria` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  PRIMARY KEY (`id_subcategoria`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `subcategorias`
--

INSERT INTO `subcategorias` VALUES (1,'Test'),(2,'Test'),(3,'Test');

--
-- Table structure for table `subfamilias`
--

CREATE TABLE `subfamilias` (
  `id_subfamilia` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `id_familia` int(11) DEFAULT NULL,
  PRIMARY KEY (`id_subfamilia`),
  KEY `id_familia` (`id_familia`),
  CONSTRAINT `subfamilias_ibfk_1` FOREIGN KEY (`id_familia`) REFERENCES `familias` (`id_familia`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `subfamilias`
--


--
-- Table structure for table `subvenciones`
--

CREATE TABLE `subvenciones` (
  `id_subvencion` int(11) NOT NULL AUTO_INCREMENT,
  `titulo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `estado` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `url_generico` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `email_marketing` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `url_autonomo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `url_sociedad` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `descripcion` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `fecha` datetime NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id_subvencion`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `subvenciones`
--


--
-- Table structure for table `tag`
--

CREATE TABLE `tag` (
  `id_tag` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  PRIMARY KEY (`id_tag`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `tag`
--

INSERT INTO `tag` VALUES (1,'gf');

--
-- Table structure for table `tag_cliente`
--

CREATE TABLE `tag_cliente` (
  `id_tag` int(11) NOT NULL,
  `client_id` int(11) NOT NULL,
  `id_tag_cliente` int(11) NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (`id_tag_cliente`),
  KEY `id_tag` (`id_tag`),
  KEY `client_id` (`client_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `tag_cliente`
--


--
-- Table structure for table `tickets`
--

CREATE TABLE `tickets` (
  `ticket_id` int(11) NOT NULL AUTO_INCREMENT,
  `ticket_user` int(11) NOT NULL,
  `ticket_assistant` int(11) DEFAULT NULL,
  `ticket_title` tinytext NOT NULL,
  `ticket_status` tinytext NOT NULL,
  `ticket_response_date` int(11) DEFAULT NULL,
  `ticket_date` int(11) NOT NULL,
  PRIMARY KEY (`ticket_id`),
  KEY `fk_logins_users_idx` (`ticket_user`),
  KEY `fk_tickets_users1_idx` (`ticket_assistant`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `tickets`
--


--
-- Table structure for table `tipo_pelo`
--

CREATE TABLE `tipo_pelo` (
  `id_tipo_pelo` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  PRIMARY KEY (`id_tipo_pelo`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `tipo_pelo`
--


--
-- Table structure for table `tools`
--

CREATE TABLE `tools` (
  `tool_id` int(11) NOT NULL AUTO_INCREMENT,
  `tool_name` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `tool_url` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `tool_image` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `tool_discard` int(11) DEFAULT NULL,
  PRIMARY KEY (`tool_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `tools`
--


--
-- Table structure for table `trabajadores`
--

CREATE TABLE `trabajadores` (
  `id_trabajador` int(11) NOT NULL AUTO_INCREMENT,
  `cif` varchar(255) NOT NULL,
  `precio_hora` int(11) NOT NULL,
  `horas_totales` int(11) NOT NULL,
  `nombre` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `precio_horas_extra` int(11) NOT NULL,
  `telefono` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  PRIMARY KEY (`id_trabajador`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `trabajadores`
--


--
-- Table structure for table `transportistas`
--

CREATE TABLE `transportistas` (
  `id_transportista` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `dni` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id_transportista`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `transportistas`
--


--
-- Table structure for table `tutores`
--

CREATE TABLE `tutores` (
  `id_tutor` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `apellidos` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `telefono` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `parentesco` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `habilitado` tinyint(1) NOT NULL,
  `id_alumno` int(11) NOT NULL,
  PRIMARY KEY (`id_tutor`),
  KEY `id_alumno` (`id_alumno`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `tutores`
--


--
-- Table structure for table `ubicaciones`
--

CREATE TABLE `ubicaciones` (
  `id_ubicacion` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  PRIMARY KEY (`id_ubicacion`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `ubicaciones`
--

INSERT INTO `ubicaciones` VALUES (1,'Almacen 4'),(2,'Almacen 5');

--
-- Table structure for table `uploads`
--

CREATE TABLE `uploads` (
  `upload_id` int(11) NOT NULL AUTO_INCREMENT,
  `upload_name` varchar(100) NOT NULL,
  `upload_original_name` tinytext NOT NULL,
  `upload_mime_type` tinytext NOT NULL,
  `upload_size` int(11) NOT NULL,
  `upload_password` tinytext NOT NULL,
  `upload_date` int(11) NOT NULL,
  PRIMARY KEY (`upload_id`)
) ENGINE=InnoDB AUTO_INCREMENT=414 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `uploads`
--

INSERT INTO `uploads` VALUES (365,'JqQtMpGKrMOC9EpYGL92Z8q73','caxfdh.png','image/png',8833,'zfvnGL5jMmwSqzcn4KfwGuQoEHxOpTL9tQZ5KqYS+Qo=',1683294725),(366,'ix7XQcvhzdaaoqIPXeSEtgIO7','image.png','image/png',12697,'ERGj8xcgbslU3szPojVcxt3QD+M+sfSTtuyOcrqbVrM=',1683294774),(382,'TjztTZkaBHyhn9hxLQYNGgoKr','image (1).jpg','image/jpeg',188606,'4X1et1oq47DZc+YBKUiGKUpBBEu4TMs0uFekrcNoRPg=',1687948406),(389,'IqIY6yoXv9DVSpAfCBhLQyfgn','image.png','image/png',75768,'J4iZW/CHQQJ8LUyw72+30zYeDYpynoo6DZgzRQ+5e3g=',1689663082),(390,'Ws9DF5UMOiRh4sZhJwV8asGWI','image (2).png','image/png',26120,'ugIh0KWba0mMyz+GNwGfe7YoidGwpRW8J/xmDKCk3YM=',1689663089),(391,'8d4gbFY5aY3AkU1SZnnN4eGvb','logo_white_1.png','image/png',73698,'JrLujh6L6UYpnu4bIK6VfN0nC1ImjBdAo4LdD0dZ9b4=',1690253261),(392,'CeD4ahiDU2QgDyWgNWYeh69k2','logo_1.png','image/png',107853,'tDzw4bjT/3P35bsbJG83/ny6eR7HcewZ4DBjtkX0P3Q=',1690253491),(413,'5LT7VM4o6jokGm9Qex5pFtR6q','1111111111111.png','image/png',100197,'n06eauS5GwCMySohCSvaDPrURSzdcvwrOgQE2awttC0=',1743617544);

--
-- Table structure for table `user_copia`
--

CREATE TABLE `user_copia` (
  `id_user_copia` int(11) NOT NULL AUTO_INCREMENT,
  `id_copia_seguridad` int(11) NOT NULL,
  `email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  PRIMARY KEY (`id_user_copia`),
  KEY `id_copia_seguridad` (`id_copia_seguridad`)
) ENGINE=InnoDB AUTO_INCREMENT=88 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `user_copia`
--

INSERT INTO `user_copia` VALUES (1,3,'javiervs9797@gmail.com'),(2,4,'javiervs9797@gmail.com'),(3,5,'javiervs9797@gmail.com'),(4,6,'javiervs9797@gmail.com'),(5,7,'javiervs9797@gmail.com'),(6,8,'javiervs9797@gmail.com'),(7,9,'javiervs9797@gmail.com'),(8,10,'javiervs9797@gmail.com'),(9,11,'javiervs9797@gmail.com'),(10,12,'javiervs9797@gmail.com'),(11,13,'limixerr@gmail.com'),(12,14,'limixerr@gmail.com'),(13,15,'limixerr@gmail.com'),(14,16,'limixerr@gmail.com'),(15,17,'limixerr@gmail.com'),(16,18,'limixerr@gmail.com'),(17,19,'limixerr@gmail.com'),(18,20,'limixerr@gmail.com'),(19,21,'limixerr@gmail.com'),(20,22,'limixerr@gmail.com'),(21,23,'limixerr@gmail.com'),(22,24,'limixerr@gmail.com'),(23,25,'limixerr@gmail.com'),(24,26,'limixerr@gmail.com'),(25,27,'limixerr@gmail.com'),(26,28,'limixerr@gmail.com'),(27,29,'limixerr@gmail.com'),(28,30,'limixerr@gmail.com'),(29,31,'limixerr@gmail.com'),(30,32,'limixerr@gmail.com'),(31,33,'limixerr@gmail.com'),(32,34,'limixerr@gmail.com'),(33,35,'limixerr@gmail.com'),(34,36,'limixerr@gmail.com'),(35,37,'limixerr@gmail.com'),(36,38,'limixerr@gmail.com'),(37,39,'limixerr@gmail.com'),(38,40,'limixerr@gmail.com'),(39,41,'limixerr@gmail.com'),(40,42,'limixerr@gmail.com'),(41,43,'limixerr@gmail.com'),(42,44,'limixerr@gmail.com'),(43,45,'limixerr@gmail.com'),(44,46,'limixerr@gmail.com'),(45,47,'limixerr@gmail.com'),(46,48,'limixerr@gmail.com'),(47,49,'limixerr@gmail.com'),(48,50,'limixerr@gmail.com'),(49,51,'limixerr@gmail.com'),(50,52,'limixerr@gmail.com'),(51,53,'limixerr@gmail.com'),(52,54,'limixerr@gmail.com'),(53,55,'limixerr@gmail.com'),(54,56,'limixerr@gmail.com'),(55,57,'limixerr@gmail.com'),(56,58,'limixerr@gmail.com'),(57,59,'limixerr@gmail.com'),(58,60,'limixerr@gmail.com'),(59,61,'limixerr@gmail.com'),(60,62,'limixerr@gmail.com'),(61,63,'limixerr@gmail.com'),(62,64,'limixerr@gmail.com'),(63,65,'limixerr@gmail.com'),(64,66,'limixerr@gmail.com'),(65,67,'limixerr@gmail.com'),(66,68,'limixerr@gmail.com'),(67,69,'limixerr@gmail.com'),(68,70,'limixerr@gmail.com'),(69,71,'limixerr@gmail.com'),(70,72,'limixerr@gmail.com'),(71,73,'limixerr@gmail.com'),(72,74,'limixerr@gmail.com'),(73,75,'limixerr@gmail.com'),(74,76,'limixerr@gmail.com'),(75,77,'limixerr@gmail.com'),(76,78,'limixerr@gmail.com'),(77,79,'limixerr@gmail.com'),(78,80,'limixerr@gmail.com'),(79,81,'limixerr@gmail.com'),(80,82,'limixerr@gmail.com'),(81,83,'limixerr@gmail.com'),(82,84,'limixerr@gmail.com'),(83,85,'limixerr@gmail.com'),(84,86,'limixerr@gmail.com'),(85,87,'limixerr@gmail.com'),(86,88,'limixerr@gmail.com'),(87,89,'limixerr@gmail.com');

--
-- Table structure for table `user_evento`
--

CREATE TABLE `user_evento` (
  `id_user_evento` int(11) NOT NULL AUTO_INCREMENT,
  `id_evento` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `contrato` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `nif` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `contrato_lleno` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `horario_lleno` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `direccion` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `cp` int(11) DEFAULT NULL,
  `email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `telefono` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `uniforme` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT 'No entregado',
  PRIMARY KEY (`id_user_evento`),
  KEY `user_id` (`user_id`),
  KEY `id_evento` (`id_evento`),
  CONSTRAINT `user_evento_ibfk_1` FOREIGN KEY (`id_evento`) REFERENCES `eventos` (`id_evento`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `user_evento`
--

INSERT INTO `user_evento` VALUES (1,1,13,'../contratos/1/13/contrato_vacio.pdf','ewteer','../contratos/1/13/contrato_lleno.pdf','../horarios/1/13/horario_lleno.pdf','Pellegrino 2045',7400,'fede.gundel@gmail.com','+34 22846121397','No entregado'),(2,2,14,'../contratos/2/14/contrato_vacio.pdf','2134234',NULL,'../horarios/2/14/horario_lleno.pdf','12342',34123,'fede.gundel@gmail.com',NULL,'No entregado'),(3,2,6680,'../contratos/2/6680/contrato_vacio.pdf','2134234',NULL,NULL,'12342',34123,'32123',NULL,'No entregado');

--
-- Table structure for table `user_permiso`
--

CREATE TABLE `user_permiso` (
  `id_user_permiso` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `folder_id` int(11) NOT NULL,
  PRIMARY KEY (`id_user_permiso`),
  KEY `user_id` (`user_id`),
  KEY `folder_id` (`folder_id`),
  CONSTRAINT `user_permiso_ibfk_1` FOREIGN KEY (`folder_id`) REFERENCES `folders` (`folder_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `user_permiso_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=142 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `user_permiso`
--

INSERT INTO `user_permiso` VALUES (84,6680,17),(85,6680,19),(86,14,19);

--
-- Table structure for table `users`
--

CREATE TABLE `users` (
  `user_id` int(11) NOT NULL AUTO_INCREMENT,
  `user_role` tinyint(4) NOT NULL DEFAULT 0,
  `user_origin` tinyint(4) NOT NULL DEFAULT 0,
  `user_supervisor` int(11) DEFAULT NULL,
  `user_email` tinytext NOT NULL,
  `user_password` varchar(256) DEFAULT NULL,
  `user_full_name` text NOT NULL,
  `user_avatar` text DEFAULT NULL,
  `user_code` varchar(45) NOT NULL,
  `user_verification_status` tinyint(4) NOT NULL DEFAULT 0,
  `user_language` varchar(30) NOT NULL,
  `user_last_seen` int(11) DEFAULT NULL,
  `modal_configuration` int(11) DEFAULT NULL,
  `user_first_seen` int(11) DEFAULT NULL,
  `id_rol` int(11) DEFAULT NULL,
  `notificado` tinyint(1) NOT NULL DEFAULT 0,
  `trabajador_peluqueria` tinyint(1) NOT NULL DEFAULT 0,
  `fondo_portada` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT './assets/img/fondo_default.jpg',
  `emails` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`emails`)),
  PRIMARY KEY (`user_id`),
  KEY `fk_users_users1_idx` (`user_supervisor`),
  KEY `user_ROL` (`id_rol`)
) ENGINE=InnoDB AUTO_INCREMENT=6708 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `users`
--

INSERT INTO `users` VALUES (13,7,2,NULL,'yosoyrubens@gmail.com','$2y$12$Pzn4ncCWSeUUjrvZ9iyBZedKtP7lLS.C1hZbQZNBCvDdg2SXI5MzK','Ruben Gracida Mena','./image.php?id=JqQtMpGKrMOC9EpYGL92Z8q73','nGM7dh9XNst9QCBDhDZntyT2xS94ZCRcTu7ZhmjzeJPwg',1,'',1738774568,NULL,1663334351,23,0,1,'https://panelprincipal.platformkitdigital.com/image.php?id=TjztTZkaBHyhn9hxLQYNGgoKr','[]'),(6699,7,2,NULL,'adrialmn309@gmail.com','','adrian aleman','https://lh3.googleusercontent.com/a/ACg8ocKBTDGnytX0iWDcVlDscpkqNdgITNeiCZQiL1BogAjys_ONaI4=s96-c','s8WPhWgFWmVPHUPtTGCzfcSaJ1CtcgP8GRJ6dPPNsXYTw',0,'',0,NULL,1732874792,23,0,0,'./assets/img/fondo_default.jpg',NULL),(6700,7,3,NULL,'liberrimostyle2@gmail.com','$2y$12$R7GNf/AW5.dwWN8NYJW1x.qWYbca5yLtekAbSgiSqLFxq2aExzx6y','Pepito','/assets/images/profile.png','62665473423',0,'',0,NULL,1733132726,23,0,0,'./assets/img/fondo_default.jpg',NULL),(6701,7,2,13,'gfhlaspalmas5@gmail.com','','Guzmán Falcón Hernández','https://lh3.googleusercontent.com/a/ACg8ocLyrE3ysXUGGHupb3GRPfvGlf057KlGx6kKzqUs1nZEMSMdYJQt=s96-c','4ANPymngcYEYm5crF9a27dcrCsanu1vt81US9UufZKgau',1,'',0,NULL,1733132945,48,0,0,'./assets/img/fondo_default.jpg',NULL),(6702,7,2,NULL,'gundelfederico@gmail.com','','Federico Gundel','https://lh3.googleusercontent.com/a/ACg8ocJPqEQdT5e26glSormP3xAPTmeNnqNOnYq_J_JRzqrobC5-ow=s96-c','CRx9PjJ8aSCbmvjjVYqQCzdWY2vYG9Q2KzaYqhZQpCGUG',1,'',0,NULL,1733488356,23,0,0,'./assets/img/fondo_default.jpg',NULL),(6703,7,2,NULL,'pinturasmonte@gmail.com','','MONTELONGO ','https://lh3.googleusercontent.com/a/ACg8ocJLNC3KuUeMiZtaujZJxCg2QSSq8jzxb07z9ajbCJ2eg5IzpGo=s96-c','pzLpGVDKNen4GF7pDbakdCVmxfMk34dZPM9cZuW91AfB3',0,'',0,NULL,1733827238,48,0,0,'./assets/img/fondo_default.jpg',NULL),(6704,7,2,13,'david@opa.agency','','David Barredo','https://lh3.googleusercontent.com/a/ACg8ocI4SAkpkXJlzELnG1j37kiTZlgf4aZ2_uYAYx5E_7lon6A-Pg=s96-c','NHAvfzcCaVETZQkDgwfdus7zjw8ttUZBVCbAmw65tjSrY',1,'',0,NULL,1734113445,23,0,0,'./assets/img/fondo_default.jpg',NULL),(6705,7,2,NULL,'pinturasmonte2@gmail.com','','Pinturas y Reformas Montelongo, S.L. ','https://lh3.googleusercontent.com/a/ACg8ocIUWE6fli1GwH_lwHJIfsiCV5jQ8XJswfhY4akPiqp-UE8NgH8=s96-c','3YbLExN8esHkNHDHa6JahRxDNJrASVXJMR6kXhrYj7wGq',0,'',0,NULL,1735821042,48,0,0,'./assets/img/fondo_default.jpg',NULL),(6706,7,2,NULL,'dani.glezz.89@gmail.com','','Daniel Gonzalez Arencibia','https://lh3.googleusercontent.com/a-/ALV-UjWVmlLobw5cxkcQYqOJoqffQmH1TsN-EpU3r19y1mhk7Jt28yzkfCqXdNNys826bAtay2wBZcR0schyiwYxEx-VGiFVh3_tZ22_fldiJWi8iFEWNupegWhzwGeuvSvSPZY-EqWkxGOhMiLbRVKmpe9PXeXnqkdAbHIb9Y-fmgmiYcBK80d6iYJ3TewlZZmqp6_XQ6VTNHkQEyFyQRjyNYJ9OQFCLG6dp2T3RzEUTsXhKDu7_4i8L6sQTQwY0BL_9_1mnTrlIh_sLvBYzEN8wGHYs3w2Af7sX0k1MBS6wPPltCXfnJaAsYi34KVJifMtaVL5i2ETPR-zBGjjVGiPt8wuaIGs6PJ_8O6M9hVekykaDywMDe0PIa-1MHdJR4T19aHtDq9hRrJB6En4Y0XzkRGKvj3QsI8tUnB5QacJMDV8c0vWEbomNYu1Gm-ctoj5EUyQSKbln-ROUlM7CReb60zzyrxqxHajPXMNuQW_LIOzjcvunXDRl19Ptz1GiqyJm9DoWVWr1nCeIwVSkE4t2ObSHFf1Pwq2QK6ZeldBETKnv0s4qr9SHLvIVx_sztmUFI2rfhJZdmPupdyZgU35u_9Yd8AVgAmFgOoFHKDxMATRofrol2mSgrJAFWwUPmAJrhUKj-kB2Xd65i-vz0fL8X_smQ93YhNr99L0eKMvuZTL23L8FOLVUGH36gw54G1pXi0ERQW2B8JkICMZWkTIg5vcxJLJ7glPKigc3ITbu-VDfncR2tKL31wgAIcgv69cFrb9Mapm6Nz7qRDAV4tP5Ck43gWUTvOKIibwpA7eMInrvfzrNZHSLVJ5LsWNQHTt_KfjwuTWjSDJgxEjOrZqXNIRKtGALToCmBM87CbIAjw78FQb7QJmaqBHvT5S4Zdty2HHTGybYAu69HTGOfJR0jq007onq3pmgufCRv4H_Nc0XsFrJxTrqZ9Fkmb8-nt18u_cbzauqPZWwBraR5ZmQaYotcSE=s96-c','Jth4EztFbG2Pwq6e6zxPbE9b2ubxaY8PNbcS33kDMaXqy',0,'',0,NULL,1738586802,48,0,0,'./assets/img/fondo_default.jpg',NULL),(6707,7,2,NULL,'fede.gundel@gmail.com','','Federico Gundel','https://lh3.googleusercontent.com/a/ACg8ocJrP5ItNgjLKQYshGOxFu8PY5vbki8AjKJsY111_kftd0RS6tXy=s96-c','uYFekxA1QHdKXkPeyr7qa766h4dgVUwKTCaB6Z4rAaxUv',1,'',0,NULL,1743331491,23,0,0,'./assets/img/fondo_default.jpg',NULL);

--
-- Table structure for table `vehiculos`
--

CREATE TABLE `vehiculos` (
  `id_vehiculo` int(11) NOT NULL AUTO_INCREMENT,
  `exposicion` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `id_modelo` int(11) DEFAULT NULL,
  `id_marca` int(11) DEFAULT NULL,
  `fecha_matriculacion` date DEFAULT NULL,
  `proxima_itv` date NOT NULL,
  `id_combustible` int(11) DEFAULT NULL,
  `kilometros` decimal(10,2) NOT NULL,
  `matricula` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `envio_vencimiento` tinyint(1) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id_vehiculo`),
  UNIQUE KEY `matricula` (`matricula`),
  KEY `fk_modelo` (`id_modelo`),
  KEY `fk_combustible` (`id_combustible`),
  KEY `fk_marca` (`id_marca`),
  CONSTRAINT `fk_combustible` FOREIGN KEY (`id_combustible`) REFERENCES `combustibles` (`id_combustible`) ON DELETE SET NULL ON UPDATE SET NULL,
  CONSTRAINT `fk_marca` FOREIGN KEY (`id_marca`) REFERENCES `marcas` (`id_marca`) ON DELETE SET NULL ON UPDATE SET NULL,
  CONSTRAINT `fk_modelo` FOREIGN KEY (`id_modelo`) REFERENCES `modelos` (`id_modelo`) ON DELETE SET NULL ON UPDATE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `vehiculos`
--


--
-- Table structure for table `ventas`
--

CREATE TABLE `ventas` (
  `id_venta` int(11) NOT NULL AUTO_INCREMENT,
  `client_id` int(11) DEFAULT NULL,
  `id_vehiculo` int(11) DEFAULT NULL,
  `id_financiera` int(11) DEFAULT NULL,
  `plazo` int(11) DEFAULT NULL,
  `id_metodo` int(11) DEFAULT NULL,
  `fecha` date DEFAULT NULL,
  PRIMARY KEY (`id_venta`),
  UNIQUE KEY `unique_id_vehiculo` (`id_vehiculo`),
  KEY `fk_financieras` (`id_financiera`),
  KEY `fk_metodos_pago` (`id_metodo`),
  CONSTRAINT `fk_financieras` FOREIGN KEY (`id_financiera`) REFERENCES `financieras` (`id_financiera`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `fk_metodos_pago` FOREIGN KEY (`id_metodo`) REFERENCES `metodos_pago` (`id_metodo`) ON DELETE SET NULL ON UPDATE SET NULL,
  CONSTRAINT `fk_vehiculos` FOREIGN KEY (`id_vehiculo`) REFERENCES `vehiculos` (`id_vehiculo`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `ventas`
--


--
-- Temporary table structure for view `vista_clientes`
--

/*!50001 DROP VIEW IF EXISTS `vista_clientes`*/;
/*!50001 CREATE VIEW `vista_clientes` AS SELECT
 1 AS `movil`,
  1 AS `client_id`,
  1 AS `nombre`,
  1 AS `direccion`,
  1 AS `cp`,
  1 AS `email`,
  1 AS `telefono`,
  1 AS `cif`,
  1 AS `fecha`,
  1 AS `user_id`,
  1 AS `estado`,
  1 AS `imagen`,
  1 AS `terminos`,
  1 AS `email_marketing`,
  1 AS `subvencionado`,
  1 AS `fecha_nacimiento`,
  1 AS `sms_habilitado`,
  1 AS `felicitado`,
  1 AS `peluqueria`,
  1 AS `tipo`,
  1 AS `sexo`,
  1 AS `emails`,
  1 AS `descuento`,
  1 AS `codigo`,
  1 AS `id_sector`,
  1 AS `linkedin`,
  1 AS `instagram`,
  1 AS `tiktok`,
  1 AS `x`,
  1 AS `facebook`,
  1 AS `forma_juridica`,
  1 AS `nombre_juridico`,
  1 AS `cif_juridico`,
  1 AS `domicilio_fiscal`,
  1 AS `activo`,
  1 AS `codigo_tramitador`,
  1 AS `id_poblacion`,
  1 AS `codigo_gestor`,
  1 AS `codigo_contable`,
  1 AS `web`,
  1 AS `grupos`,
  1 AS `sms_enviados` */;

--
-- Table structure for table `zonas`
--

CREATE TABLE `zonas` (
  `id_zona` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `id_cliente` int(11) NOT NULL,
  PRIMARY KEY (`id_zona`),
  KEY `id_cliente` (`id_cliente`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `zonas`
--


--
-- Final view structure for view `vista_clientes`
--

/*!50001 DROP VIEW IF EXISTS `vista_clientes`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `vista_clientes` AS select `c`.`movil` AS `movil`,`c`.`client_id` AS `client_id`,`c`.`nombre` AS `nombre`,`c`.`direccion` AS `direccion`,`c`.`cp` AS `cp`,`c`.`email` AS `email`,`c`.`telefono` AS `telefono`,`c`.`cif` AS `cif`,`c`.`fecha` AS `fecha`,`c`.`user_id` AS `user_id`,`c`.`estado` AS `estado`,`c`.`imagen` AS `imagen`,`c`.`terminos` AS `terminos`,`c`.`email_marketing` AS `email_marketing`,`c`.`subvencionado` AS `subvencionado`,`c`.`fecha_nacimiento` AS `fecha_nacimiento`,`c`.`sms_habilitado` AS `sms_habilitado`,`c`.`felicitado` AS `felicitado`,`c`.`peluqueria` AS `peluqueria`,`c`.`tipo` AS `tipo`,`c`.`sexo` AS `sexo`,`c`.`emails` AS `emails`,`c`.`descuento` AS `descuento`,`c`.`codigo` AS `codigo`,`c`.`id_sector` AS `id_sector`,`c`.`linkedin` AS `linkedin`,`c`.`instagram` AS `instagram`,`c`.`tiktok` AS `tiktok`,`c`.`x` AS `x`,`c`.`facebook` AS `facebook`,`c`.`forma_juridica` AS `forma_juridica`,`c`.`nombre_juridico` AS `nombre_juridico`,`c`.`cif_juridico` AS `cif_juridico`,`c`.`domicilio_fiscal` AS `domicilio_fiscal`,`c`.`activo` AS `activo`,`c`.`codigo_tramitador` AS `codigo_tramitador`,`c`.`id_poblacion` AS `id_poblacion`,`c`.`codigo_gestor` AS `codigo_gestor`,`c`.`codigo_contable` AS `codigo_contable`,`c`.`web` AS `web`,nullif(json_arrayagg(if(`g`.`id_grupo` is not null,json_object('id_grupo',`g`.`id_grupo`,'nombre',`g`.`nombre`),NULL)),'[null]') AS `grupos`,nullif(json_arrayagg(if(`s`.`id_sms` is not null,json_object('id_sms',`s`.`id_sms`,'fecha_envio',`s`.`fecha_envio`,'estado',`s`.`estado`,'cuerpo',`s`.`cuerpo`,'fecha_programado',`s`.`fecha_programado`,'id_tag',`s`.`id_tag`,'tag_nombre',`t`.`nombre`),NULL)),'[null]') AS `sms_enviados` from ((((`clientes` `c` left join `grupo_cliente` `gc` on(`c`.`client_id` = `gc`.`client_id`)) left join `grupos` `g` on(`gc`.`id_grupo` = `g`.`id_grupo`)) left join `sms` `s` on(`c`.`client_id` = `s`.`client_id`)) left join `tag` `t` on(`s`.`id_tag` = `t`.`id_tag`)) group by `c`.`client_id` */;


