--
-- Host: 192.168.1.254    Database: iquartil_db
-- ------------------------------------------------------


--
-- Current Database: `iquartil_db`
--

CREATE DATABASE /*!32312 IF NOT EXISTS*/ `iquartil_db` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci */ /*!80016 DEFAULT ENCRYPTION='N' */;

USE `iquartil_db`;

--
-- Table structure for table `encuestadores_proyectos`
--

CREATE TABLE `encuestadores_proyectos` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `proyecto_id` int NOT NULL,
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`),
  KEY `proyecto_id` (`proyecto_id`),
  CONSTRAINT `encuestadores_proyectos_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
  CONSTRAINT `encuestadores_proyectos_ibfk_2` FOREIGN KEY (`proyecto_id`) REFERENCES `proyectos` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=44 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `encuestadores_proyectos`
--

INSERT INTO `encuestadores_proyectos` VALUES (43,61,1);

--
-- Table structure for table `fechas_cumpleanos`
--

CREATE TABLE `fechas_cumpleanos` (
  `id` int NOT NULL AUTO_INCREMENT,
  `mes` varchar(20) NOT NULL,
  `dia` int NOT NULL,
  `nombre` varchar(100) DEFAULT NULL,
  `ingreso` date DEFAULT NULL,
  `foto` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `fechas_cumpleanos`
--

INSERT INTO `fechas_cumpleanos` VALUES (1,'Enero',20,'IQuestioners','2025-03-18','path/to/photo.jpg'),(2,'Enero',20,'IQuestioners','2025-03-18',NULL),(3,'Enero',20,'IQuestioners','2025-03-18',NULL),(4,'Enero',20,'IQuestioners','2025-03-18',NULL),(5,'Enero',20,'IQuestioners','2025-03-18',NULL),(6,'Enero',20,'IQuestioners','2025-03-18',NULL),(7,'Febrero',20,'cOLOMBIA','2025-03-04',NULL),(8,'Febrero',20,'cOLOMBIA','2025-03-04',NULL),(9,'Abril',25,'Ejemplo 33','2025-03-02',NULL),(10,'Septiembre',12,'samuyel','2025-03-04',NULL),(11,'Julio',22,'CHUPELOOO','2025-03-04',NULL),(12,'Marzo',15,'Nuevo Cumpleaños','2025-03-25','path/to/photo2.jpg'),(13,'Marzo',15,'Nuevo Cumpleaños','2025-03-25','path/to/photo2.jpg'),(14,'Junio',8,'Samuel Bustos','2025-03-14','/var/www/html/iquartil/Base_Conocimiento /Foto corporativa_Alejandro_Fransiaca (1).png'),(15,'Junio',8,'Samuel Bustos','2025-03-14','/var/www/html/iquartil/Base_Conocimiento/Foto corporativa_Alejandro_Fransiaca (1).png'),(16,'Junio',8,'Samuel Bustos','2025-03-14','/var/www/html/iquartil/Base_Conocimiento/Foto.png'),(17,'Junio',10,'Samuel Bustos','2025-03-14','/var/www/html/iquartil/Base_Conocimiento/Foto.png');

--
-- Table structure for table `llamadas_agendadas`
--

CREATE TABLE `llamadas_agendadas` (
  `id` int NOT NULL AUTO_INCREMENT,
  `usuario_id` int DEFAULT NULL,
  `titulo` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL,
  `descripcion` text COLLATE utf8mb4_general_ci,
  `fecha_hora_agendada` datetime DEFAULT NULL,
  `notificado` tinyint DEFAULT '0',
  `recordatorio_enviado` tinyint DEFAULT '0',
  `creado_en` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `llamadas_agendadas`
--


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

CREATE TABLE `permisos` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `nombre_empleado` varchar(255) NOT NULL,
  `fecha_inicio` date NOT NULL,
  `fecha_fin` date NOT NULL,
  `tipo_permiso` varchar(50) NOT NULL,
  `motivo` text NOT NULL,
  `archivo_adjunto` varchar(255) DEFAULT NULL,
  `estado` varchar(20) NOT NULL,
  `observacion` text,
  `fecha_creacion` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `permisos`
--


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

CREATE TABLE `proyectos` (
  `id` int NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) COLLATE utf8mb4_general_ci NOT NULL,
  `descripcion` text COLLATE utf8mb4_general_ci,
  `fecha_inicio` date DEFAULT NULL,
  `fecha_fin` date DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

INSERT INTO `proyectos` VALUES (1,'Proyecto Ejemplo','Descripción del Proyecto Ejemplo','2024-08-01','2024-08-31'),(2,'IQuestioners','iii','2024-09-10','2024-09-10'),(3,'IQuestioners','iii','2024-09-10','2024-09-10'),(4,'IQuestioners','iii','2024-09-10','2024-09-10'),(5,'IQuestionersss','aaa','2024-08-29','2024-10-11'),(6,'LLamadas','drrd','2024-09-14','2024-10-18'),(7,'Proteccion','d','2024-09-12','2024-10-18'),(8,'Ejemplo 33','556451641','2024-09-25','2024-10-25'),(9,'IQuestioners','jjj','2024-09-18','2024-09-20'),(10,'cOLOMBIA','AAAA','2024-09-18','2024-09-29'),(11,'Banco Occidente','dddd','2024-09-24','2024-10-12'),(12,'Encuestas los Andes','cccc','2024-09-24','2024-10-10'),(13,'IQencuestas','sssssss','2024-09-25','2024-10-10'),(14,'ffffff','ffffff','2024-09-24','2024-10-03'),(15,'aaaaaaaaaaaaaaaaaaaaa','asdada','2025-02-27','2025-02-28');

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

CREATE TABLE `roles` (
  `id` int NOT NULL AUTO_INCREMENT,
  `rol_name` varchar(50) COLLATE utf8mb4_general_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

INSERT INTO `roles` VALUES (1,'admin_global'),(2,'admin_encuestas'),(3,'admin_tickets'),(4,'encuestador'),(5,'usuario'),(6,'cliente');

--
-- Table structure for table `solicitudes_permisos`
--

CREATE TABLE `solicitudes_permisos` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `nombre_empleado` varchar(255) NOT NULL,
  `fecha_inicio` date NOT NULL,
  `fecha_fin` date NOT NULL,
  `tipo_permiso` varchar(50) NOT NULL,
  `motivo` text NOT NULL,
  `archivo_adjunto` varchar(255) DEFAULT NULL,
  `jefe_inmediato` varchar(255) NOT NULL,
  `socio` varchar(255) DEFAULT NULL,
  `estado` varchar(20) DEFAULT 'pendiente',
  `observaciones` text,
  `fecha_creacion` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `solicitudes_permisos`
--


--
-- Table structure for table `sujetos`
--

CREATE TABLE `sujetos` (
  `id` int NOT NULL AUTO_INCREMENT,
  `proyecto_id` int DEFAULT NULL,
  `nombre` varchar(255) COLLATE utf8mb4_general_ci NOT NULL,
  `tipo_documento` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,
  `numero_documento` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,
  `celular1` varchar(20) COLLATE utf8mb4_general_ci DEFAULT NULL,
  `celular2` varchar(20) COLLATE utf8mb4_general_ci DEFAULT NULL,
  `celular3` varchar(20) COLLATE utf8mb4_general_ci DEFAULT NULL,
  `correo` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL,
  `observaciones` text COLLATE utf8mb4_general_ci,
  `estado` enum('Sin Contactar','Agendado','Efectiva','Llamar Más Tarde','Sin Agendar') COLLATE utf8mb4_general_ci DEFAULT 'Sin Contactar',
  `intentos_llamada` text COLLATE utf8mb4_general_ci,
  `fecha_ultimo_intento` datetime DEFAULT NULL,
  `ultimo_intento` datetime DEFAULT NULL,
  `numero_intentos` int DEFAULT '0',
  `intentos_previos` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin,
  `nuevo_celular` varchar(20) COLLATE utf8mb4_general_ci DEFAULT NULL,
  `nuevo_correo` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL,
  `llamadas_agendadas` datetime DEFAULT NULL,
  `fecha_agendar` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `proyecto_id` (`proyecto_id`),
  CONSTRAINT `sujetos_ibfk_1` FOREIGN KEY (`proyecto_id`) REFERENCES `proyectos` (`id`),
  CONSTRAINT `sujetos_chk_1` CHECK (json_valid(`intentos_previos`))
) ENGINE=InnoDB AUTO_INCREMENT=123 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `sujetos`
--

INSERT INTO `sujetos` VALUES (1,1,'Juan Pérez','CC','1234567890','3001234567','3012345678','3023456789','juan.perez@example.com','','Agendado',NULL,NULL,'2024-09-09 12:39:59',3,NULL,NULL,NULL,NULL,NULL),(2,1,'Ana Gómez','CC','1234567891','3001234568','3012345679','3023456790','ana.gomez@example.com','ss2vvv','Efectiva',NULL,'2024-09-09 11:17:30','2024-09-09 12:25:31',3,NULL,NULL,NULL,NULL,NULL),(3,1,'Carlos López','CC','1234567892','3001234569','3012345680','3023456791','carlos.lopez@example.com','yyyyy','Efectiva',NULL,NULL,'2024-09-09 12:33:33',3,NULL,NULL,NULL,NULL,NULL),(4,1,'Laura Martínez','CC','1234567893','3001234570','3012345681','3023456792','laura.martinez@example.com','jj','Efectiva',NULL,NULL,'2024-09-09 12:39:36',3,NULL,NULL,NULL,NULL,NULL),(5,1,'Pedro Rodríguez','CC','1234567894','3001234571','3012345682','3023456793','pedro.rodriguez@example.com','kkkk','Sin Agendar',NULL,NULL,'2024-09-09 13:20:26',2,NULL,NULL,NULL,NULL,NULL),(6,1,'María Fernández','CC','1234567895','3001234572','3012345683','3023456794','maria.fernandez@example.com','Nota KKJ6','',NULL,NULL,'2025-01-30 14:09:45',2,'[\"2025-01-30 14:09:45\"]','','','2025-01-30 14:11:00','0000-00-00 00:00:00'),(7,1,'Jorge Sánchez','CC','1234567896','3001234573','3012345684','3023456795','jorge.sanchez@example.com','Nota 7','Agendado',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(8,1,'Paola Jiménez','CC','1234567897','3001234574','3012345685','3023456796','paola.jimenez@example.com','9.00','Agendado',NULL,NULL,'2024-09-09 12:26:10',3,NULL,NULL,NULL,NULL,NULL),(9,1,'Andrés Romero','CC','1234567898','3001234575','3012345686','3023456797','andres.romero@example.com','dcccdd','Sin Contactar',NULL,'2024-09-09 11:17:06','2024-09-09 11:08:52',3,NULL,NULL,NULL,NULL,NULL),(10,1,'Sofia Castro','CC','1234567899','3001234576','3012345687','3023456798','sofia.castro@example.com','piiiiii','Efectiva',NULL,NULL,'2024-09-10 09:00:23',2,NULL,'iiii','iiii',NULL,NULL),(11,NULL,'Juan Pérez','DNI','12345678A','600123456','601234567','602345678','juan.perez@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(12,NULL,'María López','NIE','X1234567Y','603456789','604567890','605678901','maria.lopez@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(13,NULL,'Carlos Ruiz','DNI','23456789B','606789012','607890123','608901234','carlos.ruiz@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(14,NULL,'Ana Gómez','NIE','Y2345678Z','609012345','610123456','611234567','ana.gomez@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(15,NULL,'Luis Martínez','DNI','34567890C','612345678','613456789','614567890','luis.martinez@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(16,NULL,'Laura Fernández','NIE','Z3456789A','615678901','616789012','617890123','laura.fernandez@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(17,NULL,'Pedro Sánchez','DNI','45678901D','618901234','619012345','620123456','pedro.sanchez@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(18,NULL,'Carmen Díaz','NIE','A4567890B','621234567','622345678','623456789','carmen.diaz@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(19,NULL,'Javier Morales','DNI','56789012E','624567890','625678901','626789012','javier.morales@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(20,NULL,'Isabel Ruiz','NIE','B5678901C','627890123','628901234','629012345','isabel.ruiz@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(21,NULL,'Juan Pérez','DNI','12345678A','600123456','601234567','602345678','juan.perez@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(22,NULL,'María López','NIE','X1234567Y','603456789','604567890','605678901','maria.lopez@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(23,NULL,'Carlos Ruiz','DNI','23456789B','606789012','607890123','608901234','carlos.ruiz@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(24,NULL,'Ana Gómez','NIE','Y2345678Z','609012345','610123456','611234567','ana.gomez@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(25,NULL,'Luis Martínez','DNI','34567890C','612345678','613456789','614567890','luis.martinez@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(26,NULL,'Laura Fernández','NIE','Z3456789A','615678901','616789012','617890123','laura.fernandez@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(27,NULL,'Pedro Sánchez','DNI','45678901D','618901234','619012345','620123456','pedro.sanchez@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(28,NULL,'Carmen Díaz','NIE','A4567890B','621234567','622345678','623456789','carmen.diaz@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(29,NULL,'Javier Morales','DNI','56789012E','624567890','625678901','626789012','javier.morales@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(30,NULL,'Isabel Ruiz','NIE','B5678901C','627890123','628901234','629012345','isabel.ruiz@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(33,6,'Juan Pérez','DNI','12345678A','600123456','601234567','602345678','juan.perez@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(34,6,'María López','NIE','X1234567Y','603456789','604567890','605678901','maria.lopez@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(35,6,'Carlos Ruiz','DNI','23456789B','606789012','607890123','608901234','carlos.ruiz@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(36,6,'Ana Gómez','NIE','Y2345678Z','609012345','610123456','611234567','ana.gomez@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(37,6,'Luis Martínez','DNI','34567890C','612345678','613456789','614567890','luis.martinez@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(38,6,'Laura Fernández','NIE','Z3456789A','615678901','616789012','617890123','laura.fernandez@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(39,6,'Pedro Sánchez','DNI','45678901D','618901234','619012345','620123456','pedro.sanchez@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(40,6,'Carmen Díaz','NIE','A4567890B','621234567','622345678','623456789','carmen.diaz@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(41,6,'Javier Morales','DNI','56789012E','624567890','625678901','626789012','javier.morales@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(42,6,'Isabel Ruiz','NIE','B5678901C','627890123','628901234','629012345','isabel.ruiz@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(43,7,'Juan Pérez','DNI','12345678A','600123456','601234567','602345678','juan.perez@example.com','Nota dd1','Sin Contactar',NULL,NULL,'2024-09-12 10:08:28',3,NULL,'','',NULL,NULL),(44,7,'María López','NIE','X1234567Y','603456789','604567890','605678901','maria.lopez@example.com','',NULL,NULL,NULL,'2024-09-17 12:21:32',3,NULL,'','','0000-00-00 00:00:00','0000-00-00 00:00:00'),(45,7,'Carlos Ruiz','DNI','23456789B','606789012','607890123','608901234','carlos.ruiz@example.com','',NULL,NULL,NULL,'2024-09-17 11:54:31',3,NULL,'','','2024-09-17 11:02:00','0000-00-00 00:00:00'),(46,7,'Ana Gómez','NIE','Y2345678Z','609012345','610123456','611234567','ana.gomez@example.com','',NULL,NULL,NULL,'2024-09-17 12:19:33',3,NULL,'33088908','','2024-09-17 12:22:00','0000-00-00 00:00:00'),(47,7,'Luis Martínez','DNI','34567890C','612345678','613456789','614567890','luis.martinez@example.com',NULL,'Sin Contactar',NULL,NULL,'2024-09-17 10:15:56',3,NULL,'','',NULL,NULL),(48,7,'Laura Fernández','NIE','Z3456789A','615678901','616789012','617890123','laura.fernandez@example.com','','Sin Contactar',NULL,NULL,'2024-09-17 11:45:11',3,NULL,'','','2024-09-18 15:49:00','0000-00-00 00:00:00'),(49,7,'Pedro Sánchez','DNI','45678901D','618901234','619012345','620123456','pedro.sanchez@example.com','',NULL,NULL,NULL,'2024-09-17 11:53:46',3,NULL,'','','0000-00-00 00:00:00','0000-00-00 00:00:00'),(50,7,'Carmen Díaz','NIE','A4567890B','621234567','622345678','623456789','carmen.diaz@example.com','',NULL,NULL,NULL,'2024-09-17 12:05:30',3,NULL,'iiii','','0000-00-00 00:00:00','0000-00-00 00:00:00'),(51,7,'Javier Morales','DNI','56789012E','624567890','625678901','626789012','javier.morales@example.com','',NULL,NULL,NULL,'2024-09-17 12:07:01',3,NULL,'','','0000-00-00 00:00:00','0000-00-00 00:00:00'),(52,7,'Isabel Ruiz','NIE','B5678901C','627890123','628901234','629012345','isabel.ruiz@example.com','',NULL,NULL,NULL,'2024-09-17 12:12:46',3,NULL,'','','2024-09-17 12:15:00','0000-00-00 00:00:00'),(53,8,'Juan Pérez','DNI','12345678A','600123456','601234567','602345678','juan.perez@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(54,8,'María López','NIE','X1234567Y','603456789','604567890','605678901','maria.lopez@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(55,8,'Carlos Ruiz','DNI','23456789B','606789012','607890123','608901234','carlos.ruiz@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(56,8,'Ana Gómez','NIE','Y2345678Z','609012345','610123456','611234567','ana.gomez@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(57,8,'Luis Martínez','DNI','34567890C','612345678','613456789','614567890','luis.martinez@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(58,8,'Laura Fernández','NIE','Z3456789A','615678901','616789012','617890123','laura.fernandez@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(59,8,'Pedro Sánchez','DNI','45678901D','618901234','619012345','620123456','pedro.sanchez@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(60,8,'Carmen Díaz','NIE','A4567890B','621234567','622345678','623456789','carmen.diaz@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(61,8,'Javier Morales','DNI','56789012E','624567890','625678901','626789012','javier.morales@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(62,8,'Isabel Ruiz','NIE','B5678901C','627890123','628901234','629012345','isabel.ruiz@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(63,9,'Juan Pérez','DNI','12345678A','600123456','601234567','602345678','juan.perez@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(64,9,'María López','NIE','X1234567Y','603456789','604567890','605678901','maria.lopez@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(65,9,'Carlos Ruiz','DNI','23456789B','606789012','607890123','608901234','carlos.ruiz@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(66,9,'Ana Gómez','NIE','Y2345678Z','609012345','610123456','611234567','ana.gomez@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(67,9,'Luis Martínez','DNI','34567890C','612345678','613456789','614567890','luis.martinez@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(68,9,'Laura Fernández','NIE','Z3456789A','615678901','616789012','617890123','laura.fernandez@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(69,9,'Pedro Sánchez','DNI','45678901D','618901234','619012345','620123456','pedro.sanchez@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(70,9,'Carmen Díaz','NIE','A4567890B','621234567','622345678','623456789','carmen.diaz@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(71,9,'Javier Morales','DNI','56789012E','624567890','625678901','626789012','javier.morales@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(72,9,'Isabel Ruiz','NIE','B5678901C','627890123','628901234','629012345','isabel.ruiz@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(73,10,'Juan Pérez','DNI','12345678A','600123456','601234567','602345678','juan.perez@example.com','',NULL,NULL,NULL,'2024-09-17 15:00:11',3,'[\"2024-09-17 14:12:31\",\"2024-09-17 14:43:30\",\"2024-09-17 15:00:11\"]','','','2024-09-17 15:04:00','0000-00-00 00:00:00'),(74,10,'María López','NIE','X1234567Y','603456789','604567890','605678901','maria.lopez@example.com','','Llamar Más Tarde',NULL,NULL,'2024-09-18 10:58:36',3,'[\"2024-09-17 14:20:32\",\"2024-09-17 14:43:41\",\"2024-09-18 10:58:36\"]','','','2024-09-18 11:00:00','0000-00-00 00:00:00'),(75,10,'Carlos Ruiz','DNI','23456789B','606789012','607890123','608901234','carlos.ruiz@example.com','',NULL,NULL,NULL,'2024-09-17 15:15:43',3,'[\"2024-09-17 14:31:29\",\"2024-09-17 14:59:55\",\"2024-09-17 15:15:43\"]','','','2024-09-17 15:18:00','0000-00-00 00:00:00'),(76,10,'Ana Gómez','NIE','Y2345678Z','609012345','610123456','611234567','ana.gomez@example.com','','Agendado',NULL,NULL,'2024-09-24 16:21:25',3,'[\"2024-09-17 14:35:08\",\"2024-09-18 11:43:49\",\"2024-09-24 16:21:25\"]','','','2024-09-24 16:25:00','0000-00-00 00:00:00'),(77,10,'Luis Martínez','DNI','34567890C','612345678','613456789','614567890','luis.martinez@example.com','','Sin Contactar',NULL,NULL,'2024-09-24 16:19:59',3,'[\"2024-09-17 14:35:22\",\"2024-09-17 14:43:49\",\"2024-09-24 16:19:59\"]','33088908','','2024-09-24 16:21:00','0000-00-00 00:00:00'),(78,10,'Laura Fernández','NIE','Z3456789A','615678901','616789012','617890123','laura.fernandez@example.com','','Sin Contactar',NULL,NULL,'2024-09-24 16:31:15',3,'[\"2024-09-17 14:34:44\",\"2024-09-18 11:46:26\",\"2024-09-24 16:31:15\"]','','','2024-09-24 16:34:00','0000-00-00 00:00:00'),(79,10,'Pedro Sánchez','DNI','45678901D','618901234','619012345','620123456','pedro.sanchez@example.com','','Agendado',NULL,NULL,'2024-09-18 11:57:51',3,'[\"2024-09-17 14:35:42\",\"2024-09-17 15:15:56\",\"2024-09-18 11:57:51\"]','iiii','','2024-09-18 12:00:00','0000-00-00 00:00:00'),(80,10,'Carmen Díaz','NIE','A4567890B','621234567','622345678','623456789','carmen.diaz@example.com','','Sin Contactar',NULL,NULL,'2024-09-18 12:01:03',3,'[\"2024-09-17 14:37:24\",\"2024-09-18 11:52:04\",\"2024-09-18 12:01:03\"]','','','2024-09-18 12:02:00','0000-00-00 00:00:00'),(81,10,'Javier Morales','DNI','56789012E','624567890','625678901','626789012','javier.morales@example.com','',NULL,NULL,NULL,'2024-09-18 12:09:47',3,'[\"2024-09-17 14:24:47\",\"2024-09-18 12:06:15\",\"2024-09-18 12:09:47\"]','','','2024-09-18 12:12:00','0000-00-00 00:00:00'),(82,10,'Isabel Ruiz','NIE','B5678901C','627890123','628901234','629012345','isabel.ruiz@example.com','','Sin Contactar',NULL,NULL,'2024-09-24 16:23:28',3,'[\"2024-09-17 14:42:07\",\"2024-09-17 16:57:07\",\"2024-09-24 16:23:28\"]','','','2024-09-24 16:25:00','0000-00-00 00:00:00'),(83,11,'Juan PÃ©rez','DNI','12345678A','600123456','601234567','602345678','juan.perez@example.com','','Agendado',NULL,NULL,'2024-09-24 15:27:52',1,'[\"2024-09-24 15:27:52\"]','','','2024-09-24 15:30:00','0000-00-00 00:00:00'),(84,11,'MarÃ­a LÃ³pez','NIE','X1234567Y','603456789','604567890','605678901','maria.lopez@example.com','','Sin Contactar',NULL,NULL,'2024-09-24 16:41:57',1,'[\"2024-09-24 16:41:57\"]','','','2024-09-24 16:43:00','0000-00-00 00:00:00'),(85,11,'Carlos Ruiz','DNI','23456789B','606789012','607890123','608901234','carlos.ruiz@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(86,11,'Ana GÃ³mez','NIE','Y2345678Z','609012345','610123456','611234567','ana.gomez@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(87,11,'Luis MartÃ­nez','DNI','34567890C','612345678','613456789','614567890','luis.martinez@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(88,11,'Laura FernÃ¡ndez','NIE','Z3456789A','615678901','616789012','617890123','laura.fernandez@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(89,11,'Pedro SÃ¡nchez','DNI','45678901D','618901234','619012345','620123456','pedro.sanchez@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(90,11,'Carmen DÃ­az','NIE','A4567890B','621234567','622345678','623456789','carmen.diaz@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(91,11,'Javier Morales','DNI','56789012E','624567890','625678901','626789012','javier.morales@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(92,11,'Isabel Ruiz','NIE','B5678901C','627890123','628901234','629012345','isabel.ruiz@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(93,12,'Juan PÃ©rez','DNI','12345678A','600123456','601234567','602345678','juan.perez@example.com','rrrff','',NULL,NULL,'2025-01-30 11:48:51',1,'[\"2025-01-30 11:48:51\"]','','','0000-00-00 00:00:00','0000-00-00 00:00:00'),(94,12,'MarÃ­a LÃ³pez','NIE','X1234567Y','603456789','604567890','605678901','maria.lopez@example.com','','',NULL,NULL,'2025-01-30 11:49:20',1,'[\"2025-01-30 11:49:20\"]','','','2025-01-30 11:51:00','0000-00-00 00:00:00'),(95,12,'Carlos Ruiz','DNI','23456789B','606789012','607890123','608901234','carlos.ruiz@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(96,12,'Ana GÃ³mez','NIE','Y2345678Z','609012345','610123456','611234567','ana.gomez@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(97,12,'Luis MartÃ­nez','DNI','34567890C','612345678','613456789','614567890','luis.martinez@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(98,12,'Laura FernÃ¡ndez','NIE','Z3456789A','615678901','616789012','617890123','laura.fernandez@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(99,12,'Pedro SÃ¡nchez','DNI','45678901D','618901234','619012345','620123456','pedro.sanchez@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(100,12,'Carmen DÃ­az','NIE','A4567890B','621234567','622345678','623456789','carmen.diaz@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(101,12,'Javier Morales','DNI','56789012E','624567890','625678901','626789012','javier.morales@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(102,12,'Isabel Ruiz','NIE','B5678901C','627890123','628901234','629012345','isabel.ruiz@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(103,13,'Juan PÃ©rez','DNI','12345678A','600123456','601234567','602345678','juan.perez@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(104,13,'MarÃ­a LÃ³pez','NIE','X1234567Y','603456789','604567890','605678901','maria.lopez@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(105,13,'Carlos Ruiz','DNI','23456789B','606789012','607890123','608901234','carlos.ruiz@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(106,13,'Ana GÃ³mez','NIE','Y2345678Z','609012345','610123456','611234567','ana.gomez@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(107,13,'Luis MartÃ­nez','DNI','34567890C','612345678','613456789','614567890','luis.martinez@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(108,13,'Laura FernÃ¡ndez','NIE','Z3456789A','615678901','616789012','617890123','laura.fernandez@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(109,13,'Pedro SÃ¡nchez','DNI','45678901D','618901234','619012345','620123456','pedro.sanchez@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(110,13,'Carmen DÃ­az','NIE','A4567890B','621234567','622345678','623456789','carmen.diaz@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(111,13,'Javier Morales','DNI','56789012E','624567890','625678901','626789012','javier.morales@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(112,13,'Isabel Ruiz','NIE','B5678901C','627890123','628901234','629012345','isabel.ruiz@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(113,14,'Juan PÃ©rez','DNI','12345678A','600123456','601234567','602345678','juan.perez@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(114,14,'MarÃ­a LÃ³pez','NIE','X1234567Y','603456789','604567890','605678901','maria.lopez@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(115,14,'Carlos Ruiz','DNI','23456789B','606789012','607890123','608901234','carlos.ruiz@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(116,14,'Ana GÃ³mez','NIE','Y2345678Z','609012345','610123456','611234567','ana.gomez@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(117,14,'Luis MartÃ­nez','DNI','34567890C','612345678','613456789','614567890','luis.martinez@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(118,14,'Laura FernÃ¡ndez','NIE','Z3456789A','615678901','616789012','617890123','laura.fernandez@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(119,14,'Pedro SÃ¡nchez','DNI','45678901D','618901234','619012345','620123456','pedro.sanchez@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(120,14,'Carmen DÃ­az','NIE','A4567890B','621234567','622345678','623456789','carmen.diaz@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(121,14,'Javier Morales','DNI','56789012E','624567890','625678901','626789012','javier.morales@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL),(122,14,'Isabel Ruiz','NIE','B5678901C','627890123','628901234','629012345','isabel.ruiz@example.com',NULL,'Sin Contactar',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL);

--
-- Table structure for table `ticket_responses`
--

CREATE TABLE `ticket_responses` (
  `id` int NOT NULL AUTO_INCREMENT,
  `ticket_id` int DEFAULT NULL,
  `response_message` text COLLATE utf8mb4_general_ci,
  `file_name` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL,
  `user_type` enum('client','support') COLLATE utf8mb4_general_ci DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `ticket_id` (`ticket_id`),
  CONSTRAINT `ticket_responses_ibfk_1` FOREIGN KEY (`ticket_id`) REFERENCES `tickets` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `ticket_responses`
--


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

CREATE TABLE `tickets` (
  `id` int NOT NULL AUTO_INCREMENT,
  `description` text COLLATE utf8mb4_general_ci NOT NULL,
  `Estado` enum('En progreso','Abierto','Cerrado','Escalado') COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'Abierto',
  `user_id` int DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `file_name` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL,
  `asunto` varchar(255) COLLATE utf8mb4_general_ci NOT NULL,
  `prioridad` enum('baja','media','alta') COLLATE utf8mb4_general_ci NOT NULL,
  `producto` enum('knime_server','knime_hub','knime_desktop','soporte_interno','analitica') COLLATE utf8mb4_general_ci NOT NULL,
  `version` varchar(50) COLLATE utf8mb4_general_ci NOT NULL,
  `departamento` enum('desarrollo','tecnologia','analitica') COLLATE utf8mb4_general_ci NOT NULL,
  `admin_id` int DEFAULT NULL,
  `response` text COLLATE utf8mb4_general_ci,
  `responded_at` datetime DEFAULT NULL,
  `client_file_name` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL,
  `support_file_name` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`),
  CONSTRAINT `tickets_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=29 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

INSERT INTO `tickets` VALUES (27,'TEST','Abierto',36,'2025-04-01 15:29:14','2025-04-01 15:29:14','requirements.txt','TEST','baja','knime_server','1.0','tecnologia',NULL,NULL,NULL,NULL,NULL),(28,'frr','Abierto',57,'2025-04-01 15:46:33','2025-04-01 15:46:33','Imagen de WhatsApp 2025-03-27 a las 22.14.28_254279a2.jpg','Camara','baja','knime_server','fff','desarrollo',NULL,NULL,NULL,NULL,NULL);


