diff --git a/sql/.DS_Store b/sql/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/sql/.DS_Store differ diff --git a/sql/diplomaster.sql b/sql/diplomaster.sql index 8202a0e..45fbdb9 100644 --- a/sql/diplomaster.sql +++ b/sql/diplomaster.sql @@ -1,11 +1,11 @@ -- phpMyAdmin SQL Dump --- version 5.2.1 +-- version 5.2.0 -- https://www.phpmyadmin.net/ -- --- Servidor: 127.0.0.1 --- Tiempo de generación: 26-05-2025 a las 06:38:37 --- Versión del servidor: 10.4.32-MariaDB --- Versión de PHP: 8.2.12 +-- Servidor: localhost:8889 +-- Tiempo de generación: 17-06-2025 a las 17:53:11 +-- Versión del servidor: 5.7.39 +-- Versión de PHP: 8.2.0 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; @@ -32,18 +32,22 @@ CREATE TABLE `alumnos` ( `nombre` varchar(100) NOT NULL, `email` varchar(100) NOT NULL, `telefono` varchar(15) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Volcado de datos para la tabla `alumnos` -- INSERT INTO `alumnos` (`id`, `nombre`, `email`, `telefono`) VALUES -(1, 'Alumno Uno', 'alumno1@demo.com', '123456789'), -(2, 'Alumno Dos', 'alumno2@demo.com', '987654321'), -(3, 'Arnorl', 'chris1203aless@gmail.com', '132456'), -(5, 'Jane', 'vipof86244@yosfer.com', 'wert'), -(6, 'john', 'profesor@demo.com', '132456'); +(14, 'trata', 'trata@mail.com', '234223423'), +(15, 'tratita', 'tratita@mail.com', '23423423423'), +(16, 'inyec', 'inyec@mail.com', '234234234'), +(17, 'pild', 'pild@mail.com', '23423423'), +(18, 'tratammm', 'tratam@mail.com', '253453453'), +(20, 'Carlos Raul Bonilla Palomino', 'car2002boni@gmail.com', '2284078692'), +(21, 'Alexis Aarón Palestina Villaa', 'aaronpalestinav@gmail.com', '2282844275'), +(22, 'Marlon Garett González Ortíz', 'marlon39257@gmail.com', '2281004994'), +(23, 'Ángel Alexander Alducin Díaz', 'alducindz03@gmail.com', '2282547725'); -- -------------------------------------------------------- @@ -56,16 +60,22 @@ CREATE TABLE `alumnos_cursos` ( `alumno_id` int(11) NOT NULL, `curso_id` int(11) NOT NULL, `estado` enum('cursando','aprobado','reprobado') NOT NULL DEFAULT 'cursando' -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Volcado de datos para la tabla `alumnos_cursos` -- INSERT INTO `alumnos_cursos` (`id`, `alumno_id`, `curso_id`, `estado`) VALUES -(1, 1, 1, 'aprobado'), -(2, 2, 1, 'cursando'), -(3, 1, 2, 'cursando'); +(16, 14, 7, 'cursando'), +(17, 15, 7, 'cursando'), +(18, 16, 18, 'cursando'), +(19, 17, 6, 'cursando'), +(20, 18, 19, 'cursando'), +(22, 20, 21, 'cursando'), +(23, 21, 22, 'cursando'), +(24, 22, 23, 'cursando'), +(25, 23, 23, 'cursando'); -- -------------------------------------------------------- @@ -79,17 +89,25 @@ CREATE TABLE `cursos` ( `descripcion` varchar(250) DEFAULT NULL, `estado` enum('activo','completado','archivado') NOT NULL DEFAULT 'activo', `tipo` enum('inyeccion','pildora','tratamiento') NOT NULL, - `competencias` text DEFAULT NULL, + `competencias` text, + `docente` varchar(100) DEFAULT NULL, + `horas_trabajadas` int(11) DEFAULT NULL, `profesor_id` int(11) NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Volcado de datos para la tabla `cursos` -- -INSERT INTO `cursos` (`id`, `nombre`, `descripcion`, `estado`, `tipo`, `competencias`, `profesor_id`) VALUES -(1, 'Curso Básic', 'Curso introductorio', 'activo', 'pildora', '', 1), -(2, 'Curso Avanzado', 'Para alumnos avanzados', 'activo', 'pildora', NULL, 1); +INSERT INTO `cursos` (`id`, `nombre`, `descripcion`, `estado`, `tipo`, `competencias`, `docente`, `horas_trabajadas`, `profesor_id`) VALUES +(6, 'Curso Experto', 'Para expertos', 'completado', 'pildora', '', NULL, 15, 1), +(7, 'Curso Tratamiento', 'curso tratamiento', 'activo', 'tratamiento', 'Hola, soy una competencia\nHola, soy la segunda Competencia', NULL, NULL, 1), +(18, 'Curso inyeccion', 'dfsfsdfsd', 'completado', 'inyeccion', '', NULL, NULL, 1), +(19, 'tratammmm', 'dfdsfsdfs', 'completado', 'tratamiento', 'Resistir \nExpresion\nDolor', NULL, NULL, 1), +(20, 'p aaron', 'sdfsdfds', 'completado', 'inyeccion', '', NULL, NULL, 1), +(21, 'Bonilla', 'idjfsidjsd', 'completado', 'inyeccion', '', NULL, NULL, 1), +(22, 'Curso Avanzado de Python', 'Curso avanzado para aprender Python', 'completado', 'inyeccion', '', NULL, NULL, 1), +(23, 'Desarrollo en WPF', 'Curso para aprender WPF', 'completado', 'tratamiento', 'Ángel\nAdán\nBonilla', NULL, 20, 1); -- -------------------------------------------------------- @@ -101,15 +119,23 @@ CREATE TABLE `diplomas` ( `id` int(11) NOT NULL, `alumno_curso_id` int(11) NOT NULL, `codigo_unico` varchar(20) NOT NULL, - `fecha_emision` timestamp NOT NULL DEFAULT current_timestamp() -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; + `fecha_emision` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Volcado de datos para la tabla `diplomas` -- INSERT INTO `diplomas` (`id`, `alumno_curso_id`, `codigo_unico`, `fecha_emision`) VALUES -(1, 1, 'DIPL-000001', '2025-05-19 13:58:37'); +(13, 16, 'F1198F', '2025-06-16 06:00:00'), +(14, 18, 'EDCF2F', '2025-06-16 06:00:00'), +(15, 19, 'E4874D', '2025-06-16 06:00:00'), +(16, 17, '226829', '2025-06-16 06:00:00'), +(17, 20, '78CA0A', '2025-06-16 06:00:00'), +(19, 22, 'CEEC4D', '2025-06-16 06:00:00'), +(20, 23, '73721F', '2025-06-16 06:00:00'), +(21, 24, 'EEE6BA', '2025-06-17 06:00:00'), +(22, 25, '5A4F96', '2025-06-17 06:00:00'); -- -------------------------------------------------------- @@ -122,15 +148,15 @@ CREATE TABLE `usuarios` ( `nombre` varchar(100) NOT NULL, `email` varchar(100) NOT NULL, `password` varchar(255) NOT NULL, - `aprobado` tinyint(1) NOT NULL DEFAULT 1 -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; + `aprobado` tinyint(1) NOT NULL DEFAULT '1' +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Volcado de datos para la tabla `usuarios` -- INSERT INTO `usuarios` (`id`, `nombre`, `email`, `password`, `aprobado`) VALUES -(1, 'Profesor Demo', 'profesor@demo.com', '$2y$10$SvHICbXFDFe/8nmrCMZJr.zDIcPIfGEFW/oOx/Dz1hYjdIF.xerg6', 1); +(1, 'Profesor Demo', 'profesor@demo.com', '$2y$10$RTZ3rPzA0hHMa7rY/9VuKuIY0NwlibHuWldoJ14sbIdgq1LCaRqom', 1); -- -- Índices para tablas volcadas @@ -141,7 +167,8 @@ INSERT INTO `usuarios` (`id`, `nombre`, `email`, `password`, `aprobado`) VALUES -- ALTER TABLE `alumnos` ADD PRIMARY KEY (`id`), - ADD UNIQUE KEY `email` (`email`); + ADD UNIQUE KEY `email` (`email`), + ADD UNIQUE KEY `telefono` (`telefono`); -- -- Indices de la tabla `alumnos_cursos` @@ -181,25 +208,25 @@ ALTER TABLE `usuarios` -- AUTO_INCREMENT de la tabla `alumnos` -- ALTER TABLE `alumnos` - MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7; + MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=24; -- -- AUTO_INCREMENT de la tabla `alumnos_cursos` -- ALTER TABLE `alumnos_cursos` - MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; + MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=26; -- -- AUTO_INCREMENT de la tabla `cursos` -- ALTER TABLE `cursos` - MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14; + MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=24; -- -- AUTO_INCREMENT de la tabla `diplomas` -- ALTER TABLE `diplomas` - MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; + MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=23; -- -- AUTO_INCREMENT de la tabla `usuarios`