-
-
-
Bienvenido = htmlspecialchars($profesor['nombre']) ?>
-
Este es tu panel de gestión de DiploMaster
-
-
Resumen:
-
• 0 cursos activos
-
• 0 alumnos registrados
-
• 0 diplomas emitidos
+
+
+
+
+
Panel de Administración
+
Bienvenido al sistema de gestión de DiploMaster
+
+
Estadísticas:
+
• 0 cursos activos
+
• 0 estudiantes registrados
+
• 0 diplomas emitidos
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
Bienvenido = htmlspecialchars($user['nombre']) ?>
+
Este es tu panel de control en DiploMaster
+
+
Resumen:
+
• 0 cursos registrados
+
• 0 diplomas disponibles
+
+
+
+
+
Mis Cursos Recientes
+
+
+
+
+
+
+
+
+ Nombre |
+ Fecha Inicio |
+ Fecha Fin |
+ Acciones |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
diff --git a/includes/config.php b/includes/config.php
index 0ab85c9..930bb62 100644
--- a/includes/config.php
+++ b/includes/config.php
@@ -21,7 +21,7 @@ try {
}
function is_logged_in() {
- return isset($_SESSION['profesor']);
+ return isset($_SESSION['user']);
}
function redirect_if_not_logged_in() {
diff --git a/index.php b/index.php
index cda4885..73ec632 100644
--- a/index.php
+++ b/index.php
@@ -17,14 +17,14 @@
DiploMaster
-
Sistema de gestión de diplomas para profesores
+
Bienvenido al sistema de diplomas
diff --git a/sql/diplomaster (1).sql b/sql/diplomaster (1).sql
index a1a759c..89c3975 100644
--- a/sql/diplomaster (1).sql
+++ b/sql/diplomaster (1).sql
@@ -1,57 +1,157 @@
--- Crear la base de datos
-CREATE DATABASE IF NOT EXISTS diplomaster;
-USE diplomaster;
+-- phpMyAdmin SQL Dump
+-- version 5.2.1
+-- https://www.phpmyadmin.net/
+--
+-- Servidor: 127.0.0.1
+-- Tiempo de generación: 05-05-2025 a las 04:15:28
+-- Versión del servidor: 10.4.32-MariaDB
+-- Versión de PHP: 8.2.12
--- Tabla de usuarios (profesores)
-CREATE TABLE `usuarios` (
- `id` INT(11) NOT NULL AUTO_INCREMENT,
- `nombre` VARCHAR(100) NOT NULL,
- `email` VARCHAR(100) UNIQUE NOT NULL,
- `password` VARCHAR(255) NOT NULL,
- `aprobado` BOOLEAN NOT NULL DEFAULT 0,
- PRIMARY KEY (`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
+SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
+START TRANSACTION;
+SET time_zone = "+00:00";
+
+
+/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
+/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
+/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
+/*!40101 SET NAMES utf8mb4 */;
+
+--
+-- Base de datos: `diplomaster`
+--
+
+-- --------------------------------------------------------
+
+--
+-- Estructura de tabla para la tabla `cursos`
+--
--- Tabla de cursos (cada profesor crea sus cursos)
CREATE TABLE `cursos` (
- `id` INT(11) NOT NULL AUTO_INCREMENT,
- `nombre` VARCHAR(100) NOT NULL,
- `descripcion` VARCHAR(250) DEFAULT NULL,
- `estado` ENUM('activo', 'completado', 'archivado') NOT NULL DEFAULT 'activo',
- `tipo` ENUM('inyeccion', 'pildora', 'tratamiento') NOT NULL,
- `profesor_id` INT(11) NOT NULL,
- FOREIGN KEY (`profesor_id`) REFERENCES `usuarios`(`id`) ON DELETE CASCADE,
- PRIMARY KEY (`id`)
+ `id` int(11) NOT NULL,
+ `nombre` varchar(100) NOT NULL,
+ `tipo` enum('pildora','inyeccion','tratamiento') NOT NULL,
+ `competencias` text DEFAULT NULL,
+ `fecha_creacion` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
--- Tabla de alumnos
-CREATE TABLE `alumnos` (
- `id` INT(11) NOT NULL AUTO_INCREMENT,
- `nombre` VARCHAR(100) NOT NULL,
- `email` VARCHAR(100) UNIQUE NOT NULL,
- `telefono` VARCHAR(15) DEFAULT NULL,
- PRIMARY KEY (`id`)
+--
+-- Volcado de datos para la tabla `cursos`
+--
+
+INSERT INTO `cursos` (`id`, `nombre`, `tipo`, `competencias`, `fecha_creacion`) VALUES
+(1, 'Seguridad Informática', 'tratamiento', 'Análisis de datos, Comunicación efectiva', '2025-05-05 01:27:58'),
+(2, 'Introducción a Python', 'pildora', NULL, '2025-05-05 01:27:58'),
+(3, 'Machine Learning Avanzado', 'tratamiento', 'Modelado predictivo, Python', '2025-05-05 01:27:58');
+
+-- --------------------------------------------------------
+
+--
+-- Estructura de tabla para la tabla `usuarios`
+--
+
+CREATE TABLE `usuarios` (
+ `id` int(11) NOT NULL,
+ `username` varchar(50) NOT NULL,
+ `password` varchar(255) NOT NULL,
+ `nombre` varchar(100) NOT NULL,
+ `email` varchar(100) NOT NULL,
+ `rol` enum('admin','user') NOT NULL DEFAULT 'user',
+ `fecha_registro` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
--- Tabla para vincular alumnos con cursos
-CREATE TABLE `alumnos_cursos` (
- `id` INT(11) NOT NULL AUTO_INCREMENT,
- `alumno_id` INT(11) NOT NULL,
- `curso_id` INT(11) NOT NULL,
- `estado` ENUM('cursando', 'aprobado', 'reprobado') NOT NULL DEFAULT 'cursando',
- `competencias` TEXT DEFAULT NULL, -- Solo para tratamiento
- FOREIGN KEY (`alumno_id`) REFERENCES `alumnos`(`id`) ON DELETE CASCADE,
- FOREIGN KEY (`curso_id`) REFERENCES `cursos`(`id`) ON DELETE CASCADE,
- PRIMARY KEY (`id`)
+--
+-- Volcado de datos para la tabla `usuarios`
+--
+
+INSERT INTO `usuarios` (`id`, `username`, `password`, `nombre`, `email`, `rol`, `fecha_registro`) VALUES
+(1, 'admin', '$2y$10$H3tCRUt444g0jo996uiKXenINy2d84FfuwQhoDBfa3tNblZLtNZpK', 'Administrador', 'admin@diplomaster.com', 'admin', '2025-05-05 01:27:58'),
+(2, 'usuario1', '$2y$10$SjyU29E200ax73/m0NTjqe0sMLmpsPBThlIUucGKyxvqh/znHiwh.', 'Juan Pérez', 'juan@example.com', 'user', '2025-05-05 01:27:58');
+
+-- --------------------------------------------------------
+
+--
+-- Estructura de tabla para la tabla `usuario_cursos`
+--
+
+CREATE TABLE `usuario_cursos` (
+ `id` int(11) NOT NULL,
+ `usuario_id` int(11) NOT NULL,
+ `curso_id` int(11) NOT NULL,
+ `estado` enum('En progreso','Aprobado','Completado') NOT NULL DEFAULT 'En progreso',
+ `fecha_inicio` date DEFAULT NULL,
+ `fecha_fin` date DEFAULT NULL,
+ `profesor` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
--- Tabla de diplomas
-CREATE TABLE `diplomas` (
- `id` INT(11) NOT NULL AUTO_INCREMENT,
- `alumno_curso_id` INT(11) NOT NULL,
- `fecha_emision` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
- `competencias` TEXT DEFAULT NULL,
- FOREIGN KEY (`alumno_curso_id`) REFERENCES `alumnos_cursos`(`id`) ON DELETE CASCADE,
- PRIMARY KEY (`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
+--
+-- Volcado de datos para la tabla `usuario_cursos`
+--
+INSERT INTO `usuario_cursos` (`id`, `usuario_id`, `curso_id`, `estado`, `fecha_inicio`, `fecha_fin`, `profesor`) VALUES
+(1, 2, 1, 'Aprobado', '2023-01-15', '2023-04-20', 'Dra. Ana López'),
+(2, 2, 2, 'En progreso', '2023-05-10', NULL, 'Prof. Carlos Ruiz');
+
+--
+-- Índices para tablas volcadas
+--
+
+--
+-- Indices de la tabla `cursos`
+--
+ALTER TABLE `cursos`
+ ADD PRIMARY KEY (`id`);
+
+--
+-- Indices de la tabla `usuarios`
+--
+ALTER TABLE `usuarios`
+ ADD PRIMARY KEY (`id`),
+ ADD UNIQUE KEY `username` (`username`),
+ ADD UNIQUE KEY `email` (`email`);
+
+--
+-- Indices de la tabla `usuario_cursos`
+--
+ALTER TABLE `usuario_cursos`
+ ADD PRIMARY KEY (`id`),
+ ADD KEY `usuario_id` (`usuario_id`),
+ ADD KEY `curso_id` (`curso_id`);
+
+--
+-- AUTO_INCREMENT de las tablas volcadas
+--
+
+--
+-- AUTO_INCREMENT de la tabla `cursos`
+--
+ALTER TABLE `cursos`
+ MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
+
+--
+-- AUTO_INCREMENT de la tabla `usuarios`
+--
+ALTER TABLE `usuarios`
+ MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
+
+--
+-- AUTO_INCREMENT de la tabla `usuario_cursos`
+--
+ALTER TABLE `usuario_cursos`
+ MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
+
+--
+-- Restricciones para tablas volcadas
+--
+
+--
+-- Filtros para la tabla `usuario_cursos`
+--
+ALTER TABLE `usuario_cursos`
+ ADD CONSTRAINT `usuario_cursos_ibfk_1` FOREIGN KEY (`usuario_id`) REFERENCES `usuarios` (`id`),
+ ADD CONSTRAINT `usuario_cursos_ibfk_2` FOREIGN KEY (`curso_id`) REFERENCES `cursos` (`id`);
+COMMIT;
+
+/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
+/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
+/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;