diff --git a/PAGINA WEB/ASISTENCIA/cambios-as.css b/PAGINA WEB/ASISTENCIA/cambios-as.css
new file mode 100644
index 0000000..45c7a0f
--- /dev/null
+++ b/PAGINA WEB/ASISTENCIA/cambios-as.css
@@ -0,0 +1,867 @@
+:root {
+ --primary: #2c3e50;
+ --secondary: #3498db;
+ --accent: #ff9900;
+ --light: #ecf0f1;
+ --dark: #2c3e50;
+ --success: #2ecc71;
+ --warning: #f39c12;
+ --info: #1abc9c;
+ --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
+ --transition: all 0.3s ease;
+}
+
+body {
+ font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
+ margin: 0;
+ background-color: #f5f7fa;
+ color: #333;
+ display: flex;
+ flex-direction: column;
+ min-height: 100vh;
+}
+
+/* Formulario de registro de estudiantes */
+.form-container {
+ background-color: #ffffff;
+ padding: 30px;
+ border-radius: 8px;
+ box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
+ margin-bottom: 30px;
+}
+
+.form-container h3 {
+ margin-bottom: 20px;
+}
+
+/* Navbar superior */
+.navbar {
+ background: linear-gradient(135deg, var(--primary) 0%, #1a2a3a 100%);
+ box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
+ z-index: 1030;
+ padding: 12px 25px;
+ height: 70px;
+ position: fixed;
+ top: 0;
+ left: 0;
+ right: 0;
+}
+
+.navbar-brand {
+ font-weight: 100;
+ font-size: 1.8rem;
+ letter-spacing: 1px;
+ color: white !important;
+ display: flex;
+ align-items: center;
+}
+
+.navbar-brand i {
+ margin-right: 10px;
+ color: var(--accent);
+}
+
+/* Sidebar izquierdo */
+.sidebar {
+ width: 250px;
+ background: linear-gradient(180deg, var(--primary) 0%, #1a2a3a 100%);
+ position: fixed;
+ top: 70px;
+ bottom: 0;
+ left: 0;
+ box-shadow: 3px 0 15px rgba(0, 0, 0, 0.1);
+ transition: var(--transition);
+ z-index: 1020;
+ overflow-y: auto;
+}
+
+.sidebar h2 {
+ margin: 20px 0;
+ font-size: 1.4rem;
+ text-align: center;
+ color: var(--light);
+ padding: 15px 0;
+ border-bottom: 1px solid rgba(255, 255, 255, 0.15);
+ font-weight: 600;
+}
+
+.sidebar .menu {
+ padding: 0;
+}
+
+.sidebar .menu li {
+ overflow: hidden;
+}
+
+.sidebar .menu li a,
+.sidebar .menu li summary {
+ color: var(--light);
+ text-decoration: none;
+ font-size: 1rem;
+ padding: 14px 20px;
+ display: block;
+ transition: var(--transition);
+ border-left: 4px solid transparent;
+ font-weight: 500;
+ padding-left: 18px !important;
+}
+
+.sidebar .menu li a:hover,
+.sidebar .menu li summary:hover,
+.sidebar .menu li a.active {
+ background-color: rgba(255, 255, 255, 0.1);
+ border-left-color: var(--accent);
+}
+
+.sidebar .menu li a i,
+.sidebar .menu li summary i {
+ width: 25px;
+ text-align: center;
+ margin-right: 12px;
+ font-size: 1.1rem;
+}
+
+.sidebar .submenu {
+ background-color: rgba(0, 0, 0, 0.15);
+ padding: 0;
+}
+
+.sidebar .submenu li a {
+ font-size: 0.95rem;
+}
+
+.sidebar .submenu li a:hover {
+ background-color: rgba(255, 255, 255, 0.08);
+}
+
+/* Panel de contenido principal */
+.main-content {
+ margin-left: 250px;
+ margin-top: 70px;
+ padding: 30px;
+ flex: 1;
+ transition: var(--transition);
+}
+
+.suboption-panel {
+ display: flex;
+ flex-direction: column;
+ height: 100%;
+}
+
+/* Secciones de contenido */
+.dashboard,
+.gestion-estudiante,
+.gestion-docente,
+.gestion-curso,
+.reporte,
+.configuracion {
+ display: none;
+}
+
+.dashboard {
+ display: block;
+}
+
+/* Títulos de sección */
+.section-title {
+ font-size: 1.8rem;
+ font-weight: 700;
+ margin-bottom: 30px;
+ color: var(--primary);
+ position: relative;
+}
+
+/* Tarjetas */
+.dashboard-cards {
+ display: grid;
+ grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
+ gap: 25px;
+ margin-bottom: 40px;
+}
+
+.card {
+ background: white;
+ border: none;
+ border-radius: 12px;
+ padding: 25px;
+ box-shadow: var(--card-shadow);
+ transition: var(--transition);
+ position: relative;
+ overflow: hidden;
+}
+
+.card:hover {
+ box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
+}
+
+.card::before {
+ content: '';
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 5px;
+ background: var(--accent);
+}
+
+.card h3 {
+ font-size: 1.1rem;
+ margin-bottom: 15px;
+ color: #555;
+ font-weight: 600;
+}
+
+.card p {
+ font-size: 2.3rem;
+ font-weight: 700;
+ color: var(--secondary);
+ margin: 0;
+}
+
+.card small {
+ display: block;
+ color: #777;
+ font-size: 0.95rem;
+ margin-top: 5px;
+}
+
+/* Gráficos */
+.dashboard-charts {
+ display: grid;
+ grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
+ gap: 30px;
+ margin-bottom: 40px;
+}
+
+.chart-container {
+ background: white;
+ border: none;
+ border-radius: 12px;
+ padding: 25px;
+ box-shadow: var(--card-shadow);
+}
+
+.chart-container h4 {
+ font-size: 1.25rem;
+ margin-bottom: 25px;
+ color: var(--primary);
+ display: flex;
+ align-items: center;
+ gap: 10px;
+ font-weight: 600;
+}
+
+.chart-container h4 i {
+ color: var(--accent);
+ background: rgba(231, 76, 60, 0.1);
+ width: 40px;
+ height: 40px;
+ border-radius: 50%;
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+}
+
+/* Tablas y actividades */
+.recent-activities {
+ background: white;
+ border-radius: 12px;
+ padding: 25px;
+ box-shadow: var(--card-shadow);
+}
+
+.recent-activities h3 {
+ font-size: 1.35rem;
+ margin-bottom: 25px;
+ color: var(--primary);
+ display: flex;
+ align-items: center;
+ gap: 10px;
+ font-weight: 600;
+}
+
+.recent-activities h3 i {
+ color: var(--accent);
+ background: rgba(231, 76, 60, 0.1);
+ width: 40px;
+ height: 40px;
+ border-radius: 50%;
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+}
+
+/* Botones personalizados */
+.btn-custom {
+ padding: 10px 25px;
+ background: linear-gradient(135deg, var(--secondary) 0%, #2980b9 100%);
+ color: white;
+ border: none;
+ border-radius: 8px;
+ cursor: pointer;
+ transition: var(--transition);
+ font-weight: 500;
+}
+
+.btn-custom:hover {
+ background: linear-gradient(135deg, #2980b9 0%, #1a5a8a 100%);
+ background-color: #0056b3;
+ color: #fff;
+}
+
+.dataTables_length {
+ padding: 5px 10px;
+}
+
+/* Responsividad */
+@media (max-width: 1200px) {
+ .dashboard-charts {
+ grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
+ }
+}
+
+/* Nuevos estilos para el navbar */
+.navbar-icons {
+ display: flex;
+ align-items: center;
+ gap: 15px;
+ margin-right: 20px;
+}
+
+.notification-icon,
+.chat-icon {
+ position: relative;
+ color: white;
+ font-size: 1.2rem;
+ cursor: pointer;
+ transition: var(--transition);
+}
+
+.notification-icon:hover,
+.chat-icon:hover {
+ color: var(--accent);
+}
+
+.notification-badge {
+ position: absolute;
+ top: -5px;
+ right: -8px;
+ background-color: var(--accent);
+ color: white;
+ border-radius: 50%;
+ width: 18px;
+ height: 18px;
+ font-size: 0.7rem;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+
+/* Perfil de usuario en sidebar */
+.profile-section {
+ padding: 20px 15px;
+ text-align: center;
+ border-bottom: 1px solid rgba(255, 255, 255, 0.15);
+}
+
+.profile-img {
+ width: 80px;
+ height: 80px;
+ border-radius: 50%;
+ object-fit: cover;
+ border: 3px solid var(--accent);
+ margin-bottom: 15px;
+}
+
+.profile-name {
+ color: var(--light);
+ font-size: 1.1rem;
+ margin-bottom: 5px;
+ font-weight: 600;
+}
+
+.profile-role {
+ color: var(--accent);
+ font-size: 0.9rem;
+ margin-bottom: 0;
+}
+
+/* Ajuste para acomodar el perfil */
+.sidebar h2 {
+ margin: 10px 0;
+}
+
+/* Otros ajustes menores */
+.navbar-brand {
+ font-size: 1.6rem;
+ /* Ligeramente más pequeño */
+}
+
+.config-container {
+ max-width: 1400px;
+ margin: 0 auto;
+ padding: 20px;
+}
+
+.config-header {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ margin-bottom: 30px;
+ padding-bottom: 15px;
+ border-bottom: 2px solid var(--primary);
+}
+
+.config-card {
+ background: white;
+ border-radius: 12px;
+ box-shadow: var(--card-shadow);
+ margin-bottom: 25px;
+ height: 100%;
+ transition: var(--transition);
+ overflow: hidden;
+}
+
+.card-header {
+ padding: 18px 25px;
+ font-weight: 600;
+ display: flex;
+ align-items: center;
+ gap: 12px;
+}
+
+.card-body {
+ padding: 25px;
+}
+
+.config-card:hover {
+ box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
+}
+
+.form-control-lg {
+ border-radius: 8px;
+ border: 1px solid #ddd;
+}
+
+.form-control-lg:focus {
+ border-color: var(--secondary);
+ box-shadow: 0 0 0 0.25rem rgba(52, 152, 219, 0.25);
+}
+
+.btn-lg {
+ padding: 12px 25px;
+ border-radius: 8px;
+ font-weight: 500;
+ transition: var(--transition);
+}
+
+.btn-info {
+ background: linear-gradient(135deg, var(--info) 0%, #16a085 100%);
+ border: none;
+ color: white;
+}
+
+.btn-info:hover {
+ background: linear-gradient(135deg, #16a085 0%, #138a72 100%);
+}
+
+.btn-warning {
+ background: linear-gradient(135deg, var(--warning) 0%, #e67e22 100%);
+ border: none;
+ color: white;
+}
+
+.btn-warning:hover {
+ background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
+}
+
+.btn-primary {
+ background: linear-gradient(135deg, var(--primary) 0%, #1a2a3a 100%);
+ border: none;
+ color: white;
+}
+
+.btn-primary:hover {
+ background: linear-gradient(135deg, #1a2a3a 0%, #0e1a25 100%);
+}
+
+.btn-secondary {
+ background: linear-gradient(135deg, var(--secondary) 0%, #2980b9 100%);
+ border: none;
+ color: white;
+}
+
+.btn-secondary:hover {
+ background: linear-gradient(135deg, #2980b9 0%, #1a5a8a 100%);
+}
+
+.progress {
+ height: 10px;
+ border-radius: 5px;
+}
+
+.progress-bar {
+ background: var(--secondary);
+}
+
+.config-row {
+ display: grid;
+ grid-template-columns: repeat(3, 1fr);
+ gap: 20px;
+ margin-bottom: 30px;
+}
+
+.system-card {
+ grid-column: span 3;
+}
+
+.toggle-switch {
+ position: relative;
+ display: inline-block;
+ width: 60px;
+ height: 30px;
+}
+
+.toggle-switch input {
+ opacity: 0;
+ width: 0;
+ height: 0;
+}
+
+.slider {
+ position: absolute;
+ cursor: pointer;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ background-color: #ccc;
+ transition: .4s;
+ border-radius: 34px;
+}
+
+.slider:before {
+ position: absolute;
+ content: "";
+ height: 22px;
+ width: 22px;
+ left: 4px;
+ bottom: 4px;
+ background-color: white;
+ transition: .4s;
+ border-radius: 50%;
+}
+
+input:checked+.slider {
+ background-color: var(--success);
+}
+
+input:checked+.slider:before {
+ transform: translateX(30px);
+}
+
+.switch-container {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ padding: 15px 0;
+ border-bottom: 1px solid #eee;
+}
+
+.switch-label {
+ flex: 1;
+}
+
+.system-metric {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ margin-bottom: 15px;
+ padding: 12px;
+ background: #f8f9fa;
+ border-radius: 8px;
+}
+
+.metric-label {
+ font-weight: 500;
+}
+
+.metric-value {
+ font-weight: 600;
+ color: var(--primary);
+}
+
+.theme-selector {
+ border: 2px solid transparent;
+ border-radius: 10px;
+ padding: 20px;
+ text-align: center;
+ cursor: pointer;
+ transition: var(--transition);
+}
+
+.theme-selector:hover,
+.theme-selector.active {
+ border-color: var(--accent);
+ background: rgba(255, 153, 0, 0.05);
+}
+
+.theme-selector i {
+ font-size: 2.5rem;
+ margin-bottom: 15px;
+}
+
+.status-badge {
+ display: inline-block;
+ padding: 5px 12px;
+ border-radius: 20px;
+ font-size: 0.85rem;
+ font-weight: 500;
+}
+
+.status-active {
+ background: rgba(46, 204, 113, 0.15);
+ color: var(--success);
+}
+
+.status-warning {
+ background: rgba(243, 156, 18, 0.15);
+ color: var(--warning);
+}
+
+.card-title {
+ font-size: 1.25rem;
+ font-weight: 600;
+ margin-bottom: 15px;
+ color: var(--primary);
+}
+
+.card-subtitle {
+ color: #777;
+ margin-bottom: 20px;
+}
+
+/* Estilos para modo oscuro */
+body.theme-dark {
+ background-color: #18191a;
+ color: #e4e6eb;
+}
+
+body.theme-dark .navbar {
+ background: linear-gradient(135deg, #242526 0%, #18191a 100%);
+}
+
+body.theme-dark .sidebar {
+ background: linear-gradient(180deg, #242526 0%, #18191a 100%);
+}
+
+body.theme-dark .card,
+body.theme-dark .chart-container,
+body.theme-dark .recent-activities,
+body.theme-dark .form-container,
+body.theme-dark .config-card {
+ background-color: #242526;
+ color: #e4e6eb;
+ border: 1px solid #3a3b3c;
+}
+
+body.theme-dark .table {
+ color: #e4e6eb;
+}
+
+body.theme-dark .table thead {
+ background-color: #3a3b3c;
+}
+
+body.theme-dark .table-hover tbody tr:hover {
+ background-color: #3a3b3c;
+ color: #e4e6eb;
+}
+
+body.theme-dark .section-title {
+ color: #e4e6eb;
+}
+
+body.theme-dark .card h3,
+body.theme-dark .card p,
+body.theme-dark .card small {
+ color: #e4e6eb;
+}
+
+body.theme-dark .card small {
+ color: #b0b3b8;
+}
+
+body.theme-dark .form-control,
+body.theme-dark .form-select {
+ background-color: #3a3b3c;
+ color: #e4e6eb;
+ border: 1px solid #3a3b3c;
+}
+
+body.theme-dark .form-control:focus,
+body.theme-dark .form-select:focus {
+ background-color: #3a3b3c;
+ color: #e4e6eb;
+ border-color: #4a4b4c;
+ box-shadow: 0 0 0 0.25rem rgba(65, 66, 68, 0.25);
+}
+
+body.theme-dark .dropdown-menu {
+ background-color: #242526;
+ border: 1px solid #3a3b3c;
+}
+
+body.theme-dark .dropdown-item {
+ color: #e4e6eb;
+}
+
+body.theme-dark .dropdown-item:hover {
+ background-color: #3a3b3c;
+ color: #e4e6eb;
+}
+
+body.theme-dark .progress {
+ background-color: #3a3b3c;
+}
+
+body.theme-dark .dt-buttons .btn {
+ background-color: #3a3b3c !important;
+ color: #e4e6eb !important;
+ border: 1px solid #4a4b4c !important;
+}
+
+body.theme-dark .config-card .card-header {
+ color: #e4e6eb;
+}
+
+body.theme-dark .switch-label h6,
+body.theme-dark .metric-label,
+body.theme-dark .metric-value {
+ color: #e4e6eb;
+}
+
+body.theme-dark .form-control-color {
+ background-color: #3a3b3c;
+}
+
+body.theme-dark {
+ --light: #e4e6eb;
+ --dark: #b0b3b8;
+}
+
+#theme-toggle i {
+ transition: color 0.3s ease;
+}
+
+@media (max-width: 1200px) {
+ .config-row {
+ grid-template-columns: repeat(2, 1fr);
+ }
+
+ .system-card {
+ grid-column: span 2;
+ }
+}
+
+@media (max-width: 992px) {
+ .sidebar {
+ width: 70px;
+ }
+
+ .sidebar h2 span,
+ .sidebar .menu li a span,
+ .sidebar .menu li summary span {
+ display: none;
+ }
+
+ .sidebar h2 {
+ font-size: 1.8rem;
+ padding: 15px 0;
+ }
+
+ .sidebar .menu li a,
+ .sidebar .menu li summary {
+ text-align: center;
+ padding: 15px 10px;
+ }
+
+ .sidebar .menu li a i,
+ .sidebar .menu li summary i {
+ margin-right: 0;
+ font-size: 1.4rem;
+ display: block;
+ margin: 0 auto 5px;
+ }
+
+ .sidebar .submenu {
+ position: absolute;
+ left: 70px;
+ width: 200px;
+ display: none;
+ }
+
+ .sidebar .menu li details[open] .submenu {
+ display: block;
+ }
+
+ .main-content {
+ margin-left: 70px;
+ }
+
+ .dashboard-charts {
+ grid-template-columns: 1fr;
+ }
+}
+
+@media (max-width: 768px) {
+ .main-content {
+ padding: 20px;
+ }
+
+ .dashboard-cards {
+ grid-template-columns: 1fr;
+ }
+
+ .config-row {
+ grid-template-columns: 1fr;
+ }
+
+ .system-card {
+ grid-column: span 1;
+ }
+
+ .config-header {
+ flex-direction: column;
+ align-items: flex-start;
+ gap: 15px;
+ }
+}
+
+@media (max-width: 576px) {
+ .navbar {
+ padding: 10px 15px;
+ }
+
+ .navbar-brand {
+ font-size: 1.5rem;
+ }
+}
+
+#calendar {
+ background: #fff;
+ padding: 20px;
+ border-radius: 15px;
+ box-shadow: var(--card-shadow);
+}
+.fc-toolbar-title {
+ font-size: 1.5rem;
+ color: var(--primary);
+}
+.fc-daygrid-event {
+ border: none;
+ padding: 3px 6px;
+ border-radius: 6px;
+ font-weight: 500;
+}
\ No newline at end of file
diff --git a/PAGINA WEB/ASISTENCIA/cambios-as.html b/PAGINA WEB/ASISTENCIA/cambios-as.html
new file mode 100644
index 0000000..6a42e4a
--- /dev/null
+++ b/PAGINA WEB/ASISTENCIA/cambios-as.html
@@ -0,0 +1,842 @@
+
+
+
+
+
+ PRODIGIOS - Academia de Música
+
+
+
+
+
+
+
+
+
+
+
+
Bienvenido!
+
+
+
+
+
+
+
+ 0
+
+
+
+ 0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Panel de Control
+
+
+
Estudiantes Registrados
+
0
+
Total en el sistema
+
+
+
Docentes Activos
+
0
+
Enseñando actualmente
+
+
+
Cursos Disponibles
+
0
+
Ofertados este semestre
+
+
+
Clases Esta Semana
+
42
+
Programadas
+
+
+
+
+
+
Distribución por Niveles
+
+
+
+
Cursos por Categoría
+
+
+
+
Estudiantes por Curso
+
+
+
+
+
+
Actividades Recientes
+
+
+
+
+ | Fecha |
+ Descripción |
+ Usuario |
+
+
+
+
+ | 2023-11-15 |
+ Nuevo estudiante registrado: María Rodríguez |
+ Admin |
+
+
+ | 2023-11-14 |
+ Curso de Piano Avanzado creado |
+ Admin |
+
+
+ | 2023-11-13 |
+ Pago registrado: Carlos Mendoza |
+ Admin |
+
+
+ | 2023-11-12 |
+ Actualización de horarios |
+ Admin |
+
+
+ | 2023-11-10 |
+ Nueva docente: Laura Méndez |
+ Admin |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ | ID |
+ Nombre |
+ DNI |
+ Fecha Nac. |
+ Dirección |
+ Contacto |
+ Curso |
+ Nivel |
+ Horario |
+ Estado |
+ Acciones |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ | ID |
+ Nombres |
+ DNI |
+ Fecha Nac. |
+ Especialidad |
+ Grado Académico |
+ Experiencia |
+ Horario |
+ Contacto |
+ Salario |
+ Acciones |
+
+
+
+
+
+
+
+
+
+
+
+
+
+ | ID |
+ Nombres |
+ Descripción |
+ Duración |
+ Nivel |
+ Horario |
+ Docente |
+ N° de Plazas |
+ Costo |
+ Material |
+ Acciones |
+
+
+
+
+
+
+
+
+
+
+
Reportes Generales
+
+
+
+
+
+
+
+
+
+
+
+
Configuración del Sistema
+
+
+
+
+
+
+
+
+
+
+
+
+
Tema
+
+
+
Personalización
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Fuentes
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Información del Sistema
+
+
+
+
+
Última actualización
+
15 Nov 2023
+
+
+
+
Soporte
+
soporte@prodigios.edu
+
+
+
+
+
+
+
+
Próxima actualización
+
15 Dic 2023
+
+
+
+
+
Recursos del Sistema
+
+
+
+
+
Almacenamiento
+
15.8 GB de 50 GB usados
+
+
31.6%
+
+
+
+
+
+
+
+
Base de Datos
+
2.4 MB de 100 MB usados
+
+
2.4%
+
+
+
+
+
+
+
+
Uso de CPU
+
Promedio de los últimos 30 días
+
+
42%
+
+
+
+
+
+
+
+
Memoria
+
1.2 GB de 4 GB usados
+
+
30%
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Lista de Asistencia
+
+
+
+
+
+
+
Calendario de Cursos
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/PAGINA WEB/ASISTENCIA/cambios-as.js b/PAGINA WEB/ASISTENCIA/cambios-as.js
new file mode 100644
index 0000000..e43c237
--- /dev/null
+++ b/PAGINA WEB/ASISTENCIA/cambios-as.js
@@ -0,0 +1,941 @@
+
+let nivelEstudiantesChart;
+let categoriaCursosChart;
+let estudiantesPorCursoChart;
+
+let nextIds = { estudiantes: 1, docentes: 1, cursos: 1 };
+
+let editingInfo = { tipo: null, id: null };
+
+// Estado de la aplicación
+const state = {
+ estudiantes: [],
+ docentes: [],
+ cursos: [],
+ actividades: []
+};
+
+// Inicialización
+document.addEventListener('DOMContentLoaded', () => {
+ initCharts();
+
+ initializeDataTable();
+ initializeDataTableDocente();
+ initializeDataTableCurso();
+
+ updateCounters();
+ updateCharts();
+ initEventListeners();
+
+ loadTheme();
+ document.getElementById('theme-toggle').addEventListener('click', toggleTheme);
+});
+
+
+const registrarBtn = document.getElementById('registrar');
+const registrarBtnDocente = document.getElementById('registrarDocente');
+const registrarBtnCurso = document.getElementById('registrarCurso');
+
+// Funciones auxiliares
+function updateStateFromTable(type) {
+
+ const tableId = type === 'docentes' ? '#tablaDinamicaDocente' :
+ type === 'cursos' ? '#tablaDinamicaCurso' : '#tablaDinamica';
+
+ if ($.fn.DataTable.isDataTable(tableId)) {
+ const table = $(tableId).DataTable();
+ state[type] = table.rows().data().map(row => ({
+ id: parseInt(row[0]),
+ nombre: row[1],
+ dni: row[2],
+ fecha_nacimiento: row[3],
+ direccion: row[4],
+ contacto: row[5],
+ curso: row[6],
+ nivel: row[7],
+ horario: row[8],
+ estado: row[9]
+ })).toArray();
+ }
+}
+
+// FUNCIÓN updateCharts
+function updateCharts() {
+ // 1. Distribución por niveles
+ const niveles = { Principiante: 0, Intermedio: 0, Avanzado: 0 };
+ const estudiantesPorCurso = {};
+
+ // Verificar SI EXISTE la tabla de estudiantes
+ if ($.fn.DataTable.isDataTable('#tablaDinamica')) {
+ const studentTable = $('#tablaDinamica').DataTable();
+ const studentRows = studentTable.rows().data().toArray();
+
+ studentRows.forEach(row => {
+ const nivel = row[7];
+ const curso = row[6];
+
+ // Contar niveles
+ if (nivel) niveles[nivel]++;
+
+ // Contar cursos (dinámico)
+ if (curso) {
+ if (!estudiantesPorCurso[curso]) {
+ estudiantesPorCurso[curso] = 0;
+ }
+ estudiantesPorCurso[curso]++;
+ }
+ });
+ }
+
+ // 2. Actualizar gráfica de niveles
+ if (nivelEstudiantesChart) {
+ nivelEstudiantesChart.data.datasets[0].data = Object.values(niveles);
+ nivelEstudiantesChart.update();
+ }
+
+ // 3. Actualizar gráfica de estudiantes por curso (CORREGIDO)
+ if (estudiantesPorCursoChart) {
+ // Actualizar etiquetas Y datos
+ estudiantesPorCursoChart.data.labels = Object.keys(estudiantesPorCurso);
+ estudiantesPorCursoChart.data.datasets[0].data = Object.values(estudiantesPorCurso);
+ estudiantesPorCursoChart.update();
+ }
+
+ // 4. Cursos por categoría
+
+ const cursosPorCategoria = {};
+
+ // Verificar SI EXISTE la tabla de cursos
+ if ($.fn.DataTable.isDataTable('#tablaDinamicaCurso')) {
+ const courseTable = $('#tablaDinamicaCurso').DataTable();
+ const courseRows = courseTable.rows().data().toArray();
+
+ courseRows.forEach(row => {
+ const categoria = row[1];
+ if (categoria) {
+ if (!cursosPorCategoria[categoria]) {
+ cursosPorCategoria[categoria] = 0;
+ }
+ cursosPorCategoria[categoria]++;
+ }
+ });
+ }
+
+ // 5. Actualizar gráfica de cursos
+ if (categoriaCursosChart) {
+ // Actualizar etiquetas Y datos
+ categoriaCursosChart.data.labels = Object.keys(cursosPorCategoria);
+ categoriaCursosChart.data.datasets[0].data = Object.values(cursosPorCategoria);
+ categoriaCursosChart.update();
+ }
+}
+
+function initializeDataTable() {
+ if ($.fn.DataTable.isDataTable('#tablaDinamica')) $('#tablaDinamica').DataTable().destroy();
+
+ $('#tablaDinamica').DataTable({
+ dom: 'Blfrtip',
+ buttons: [
+ {
+ extend: "excelHtml5",
+ text: "",
+ titleAttr: "Exportar a Excel",
+ className: "btn btn-success",
+ exportOptions: {
+ columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+ }
+ },
+ {
+ extend: "pdfHtml5",
+ text: "",
+ titleAttr: "Esportar a PDF",
+ className: "btn btn-danger",
+ exportOptions: {
+ columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+ }
+ },
+ {
+ extend: "print",
+ text: "",
+ titleAttr: "Imprimir",
+ className: "btn btn-info",
+ exportOptions: {
+ columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+ },
+ },
+ ],
+ language: {
+ url: "https://cdn.datatables.net/plug-ins/1.13.6/i18n/es-ES.json"
+ },
+ lengthMenu: [3, 6, 9, 12],
+ columnDefs: [
+ { orderable: false, targets: [10] },
+ { searchable: false, targets: [10] },
+ { width: "10%", targets: [5] },
+ { targets: -1 },
+ { data: null },
+ ],
+ pageLength: 5,
+ });
+}
+
+registrarBtn.addEventListener('click', function () {
+ const nombre = document.getElementById('nombre').value;
+ const dni = document.getElementById('dni').value;
+ const fecha_nacimiento = document.getElementById('fecha_nacimiento').value;
+ const direccion = document.getElementById('direccion').value;
+ const contacto = document.getElementById('contacto').value;
+ const curso = document.getElementById('curso').value;
+ const nivel = document.getElementById('nivel').value;
+ const horario = document.getElementById('horario').value;
+ const estado = document.getElementById('estado').value;
+
+ if (nombre && dni && fecha_nacimiento && direccion && contacto && curso && nivel && horario && estado) {
+ const table = $('#tablaDinamica').DataTable();
+ if (editingInfo.tipo === 'estudiante' && editingInfo.id !== null) {
+ // Actualizar estudiante existente
+ table.rows().every(function () {
+ const data = this.data();
+ if (parseInt(data[0]) === editingInfo.id) {
+ this.data([editingInfo.id, nombre, dni, fecha_nacimiento, direccion, contacto, curso, nivel, horario, estado,
+ ' '
+ ]);
+ }
+ });
+ } else {
+ table.row.add([nextIds.estudiantes++, nombre, dni, fecha_nacimiento, direccion, contacto, curso, nivel, horario, estado,
+ ' ']).draw();
+ }
+
+ document.getElementById('nombre').value = '';
+ document.getElementById('dni').value = '';
+ document.getElementById('fecha_nacimiento').value = '';
+ document.getElementById('direccion').value = '';
+ document.getElementById('contacto').value = '';
+ document.getElementById('curso').value = '';
+ document.getElementById('nivel').value = '';
+ document.getElementById('horario').value = '';
+ document.getElementById('estado').value = '';
+
+ // Resetear estado
+ editingInfo = { tipo: null, id: null };
+ $('#registrar').text('Registrar Estudiante');
+
+ } else {
+ alert("Por favor, complete todos los campos antes de registrar.");
+ }
+
+ updateAll();
+});
+
+$('#tablaDinamica').on('click', '.btn-edit', function () {
+ const row = $(this).closest('tr');
+ const data = $('#tablaDinamica').DataTable().row(row).data();
+ editingInfo = { tipo: 'estudiante', id: parseInt(data[0]) };
+ document.getElementById('nombre').value = data[1];
+ document.getElementById('dni').value = data[2];
+ document.getElementById('fecha_nacimiento').value = data[3];
+ document.getElementById('direccion').value = data[4];
+ document.getElementById('contacto').value = data[5];
+ document.getElementById('curso').value = data[6];
+ document.getElementById('nivel').value = data[7];
+ document.getElementById('horario').value = data[8];
+ document.getElementById('estado').value = data[9];
+ $('#registrar').text('Actualizar');
+ updateAll();
+});
+$('#tablaDinamica').on('click', '.btn-delete', function () {
+ const row = $(this).closest('tr');
+ $('#tablaDinamica').DataTable().row(row).remove().draw();
+ updateAll();
+});
+
+function initializeDataTableDocente() {
+ if ($.fn.DataTable.isDataTable('#tablaDinamicaDocente')) {
+ $('#tablaDinamicaDocente').DataTable().destroy();
+ }
+
+ $('#tablaDinamicaDocente').DataTable({
+ dom: 'Blfrtip',
+ buttons: [
+ {
+ extend: "excelHtml5",
+ text: "",
+ titleAttr: "Exportar a Excel",
+ className: "btn btn-success",
+ exportOptions: {
+ columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+ }
+ },
+ {
+ extend: "pdfHtml5",
+ text: "",
+ titleAttr: "Exportar a PDF",
+ className: "btn btn-danger",
+ exportOptions: {
+ columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+ }
+ },
+ {
+ extend: "print",
+ text: "",
+ titleAttr: "Imprimir",
+ className: "btn btn-info",
+ exportOptions: {
+ columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+ }
+ }
+ ],
+ language: {
+ url: "https://cdn.datatables.net/plug-ins/1.13.6/i18n/es-ES.json"
+ },
+ lengthMenu: [3, 6, 9, 12],
+ columnDefs: [
+ { orderable: false, targets: [-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] }, // Deshabilitar ordenación en la última columna (Acciones)
+ { searchable: false, targets: -1 }, // Deshabilitar búsqueda en la última columna
+ { width: "10%", target: [6] }
+ ],
+ pageLength: 5,
+ });
+}
+
+registrarBtnDocente.addEventListener('click', function () {
+ const nombre = document.getElementById('nombreDocente').value;
+ const dni = document.getElementById('dniDocente').value;
+ const fechaNac = document.getElementById('fechaNacDocente').value;
+ const especialidad = document.getElementById('especialidadDocente').value;
+ const grado = document.getElementById('gradoDocente').value;
+ const experiencia = document.getElementById('experienciaDocente').value;
+ const horario = document.getElementById('horarioDocente').value;
+ const contacto = document.getElementById('contactoDocente').value;
+ const salario = document.getElementById('salarioDocente').value;
+
+ if (nombre && dni && fechaNac && especialidad && grado && experiencia && horario && contacto && salario) {
+ const table = $('#tablaDinamicaDocente').DataTable();
+ if (editingInfo.tipo === 'docente' && editingInfo.id !== null) {
+ // Actualizar la fila por ID
+ table.rows().every(function (rowIdx, tableLoop, rowLoop) {
+ const data = this.data();
+ if (parseInt(data[0]) === editingInfo.id) {
+ this.data([
+ editingInfo.id, nombre, dni, fechaNac, especialidad, grado, experiencia, horario, contacto, salario,
+ ' '
+ ]);
+ }
+ });
+ } else {
+ table.row.add([
+ nextIds.docentes++, nombre, dni, fechaNac, especialidad, grado, experiencia, horario, contacto, salario,
+ ' '
+ ]).draw();
+ }
+
+ document.getElementById('nombreDocente').value = '';
+ document.getElementById('dniDocente').value = '';
+ document.getElementById('fechaNacDocente').value = '';
+ document.getElementById('especialidadDocente').value = '';
+ document.getElementById('gradoDocente').value = '';
+ document.getElementById('experienciaDocente').value = '';
+ document.getElementById('horarioDocente').value = '';
+ document.getElementById('contactoDocente').value = '';
+ document.getElementById('salarioDocente').value = '';
+ editingInfo = { tipo: null, id: null };
+ $('#registrarDocente').text('Registrar Docente');
+
+ } else {
+ alert("Por favor, complete todos los campos antes de registrar.");
+ }
+ updateAll();
+});
+
+$('#tablaDinamicaDocente').on('click', '.btn-edit', function () {
+ const row = $(this).closest('tr');
+ const data = $('#tablaDinamicaDocente').DataTable().row(row).data();
+ editingInfo = { tipo: 'docente', id: parseInt(data[0]) };
+ document.getElementById('nombreDocente').value = data[1];
+ document.getElementById('dniDocente').value = data[2];
+ document.getElementById('fechaNacDocente').value = data[3];
+ document.getElementById('especialidadDocente').value = data[4];
+ document.getElementById('gradoDocente').value = data[5];
+ document.getElementById('experienciaDocente').value = data[6];
+ document.getElementById('horarioDocente').value = data[7];
+ document.getElementById('contactoDocente').value = data[8];
+ document.getElementById('salarioDocente').value = data[9];
+ $('#registrarDocente').text('Actualizar');
+ updateAll();
+});
+$('#tablaDinamicaDocente').on('click', '.btn-delete', function () {
+ const row = $(this).closest('tr');
+ $('#tablaDinamicaDocente').DataTable().row(row).remove().draw();
+ updateAll();
+});
+
+function initializeDataTableCurso() {
+ if ($.fn.DataTable.isDataTable('#tablaDinamicaCurso')) {
+ $('#tablaDinamicaCurso').DataTable().destroy();
+ }
+
+ $('#tablaDinamicaCurso').DataTable({
+ dom: 'Blfrtip',
+ buttons: [
+ {
+ extend: "excelHtml5",
+ text: "",
+ titleAttr: "Exportar a Excel",
+ className: "btn btn-success",
+ exportOptions: {
+ columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+ }
+ },
+ {
+ extend: "pdfHtml5",
+ text: "",
+ titleAttr: "Esportar a PDF",
+ className: "btn btn-danger",
+ exportOptions: {
+ columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+ }
+ },
+ {
+ extend: "print",
+ text: "",
+ titleAttr: "Imprimir",
+ className: "btn btn-info",
+ exportOptions: {
+ columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+ }
+ }
+ ],
+ language: {
+ url: "https://cdn.datatables.net/plug-ins/1.13.6/i18n/es-ES.json"
+ },
+ lengthMenu: [3, 6, 9, 12],
+ columnDefs: [
+ { orderable: false, targets: [-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] },
+ { searchable: false, targets: -1 },
+ { width: "1%", targets: [5] },
+ { targets: -1 },
+ { data: null }
+ ],
+ pageLength: 5
+ });
+};
+
+registrarBtnCurso.addEventListener('click', function () {
+ const nombreCurso = document.getElementById('nombreCurso').value;
+ const descripcionCurso = document.getElementById('descripcionCurso').value;
+ const duracionCurso = document.getElementById('duracionCurso').value;
+ const nivelCurso = document.getElementById('nivelCurso').value;
+ const horarioCurso = document.getElementById('horarioCurso').value;
+ const docenteCurso = document.getElementById('docenteCurso').value;
+ const numPlazaCurso = document.getElementById('numPlazaCurso').value;
+ const costoCurso = document.getElementById('costoCurso').value;
+ const materialCurso = document.getElementById('materialCurso').value;
+ if (nombreCurso && descripcionCurso && duracionCurso && nivelCurso && horarioCurso && docenteCurso && numPlazaCurso && costoCurso && materialCurso) {
+ const table = $('#tablaDinamicaCurso').DataTable();
+ if (editingInfo.tipo === 'curso' && editingInfo.id !== null) {
+ // Actualizar la fila por ID
+ table.rows().every(function (rowIdx, tableLoop, rowLoop) {
+ const data = this.data();
+ if (parseInt(data[0]) === editingInfo.id) {
+ this.data([editingInfo.id, nombreCurso, descripcionCurso, duracionCurso, nivelCurso, horarioCurso, docenteCurso, numPlazaCurso, costoCurso, materialCurso,
+ ' ']);
+ }
+ });
+ } else {
+ table.row.add([nextIds.cursos++, nombreCurso, descripcionCurso, duracionCurso, nivelCurso, horarioCurso, docenteCurso, numPlazaCurso, costoCurso, materialCurso,
+ ' ']).draw();
+ }
+ document.getElementById('nombreCurso').value = '';
+ document.getElementById('descripcionCurso').value = '';
+ document.getElementById('duracionCurso').value = '';
+ document.getElementById('nivelCurso').value = '';
+ document.getElementById('horarioCurso').value = '';
+ document.getElementById('docenteCurso').value = '';
+ document.getElementById('numPlazaCurso').value = '';
+ document.getElementById('costoCurso').value = '';
+ document.getElementById('materialCurso').value = '';
+ editingInfo = { tipo: null, id: null };
+ $('#registrarCurso').text('Registrar Curso');
+ } else {
+ alert('Por favor, complete todos los campos antes de registrar.');
+ }
+ updateAll();
+});
+
+$('#tablaDinamicaCurso').on('click', '.btn-edit', function () {
+ const row = $(this).closest('tr');
+ const data = $('#tablaDinamicaCurso').DataTable().row(row).data();
+ editingInfo = { tipo: 'curso', id: parseInt(data[0]) };
+ document.getElementById('nombreCurso').value = data[1];
+ document.getElementById('descripcionCurso').value = data[2];
+ document.getElementById('duracionCurso').value = data[3];
+ document.getElementById('nivelCurso').value = data[4];
+ document.getElementById('horarioCurso').value = data[5];
+ document.getElementById('docenteCurso').value = data[6];
+ document.getElementById('numPlazaCurso').value = data[7];
+ document.getElementById('costoCurso').value = data[8];
+ document.getElementById('materialCurso').value = data[9];
+ $('#registrarCurso').text('Actualizar');
+ updateAll();
+});
+$('#tablaDinamicaCurso').on('click', '.btn-delete', function () {
+ const row = $(this).closest('tr');
+ $('#tablaDinamicaCurso').DataTable().row(row).remove().draw();
+ updateAll();
+});
+
+function initEventListeners() {
+ // Event listener para logout
+ document.getElementById('logoutBtn').addEventListener('click', function () {
+ localStorage.removeItem('loggedIn');
+ window.location.href = 'index.html';
+ });
+
+ // Event listeners para menú
+ document.querySelectorAll('.sidebar a').forEach(link => {
+ link.addEventListener('click', function () {
+ document.querySelectorAll('.sidebar a').forEach(el => el.classList.remove('active'));
+ this.classList.add('active');
+ });
+ });
+}
+
+function updateCounters() {
+ let totalEst = 0;
+ if ($.fn.DataTable.isDataTable('#tablaDinamica')) {
+ totalEst = $('#tablaDinamica').DataTable().rows().count();
+ }
+ document.getElementById('total-estudiantes').textContent = totalEst;
+
+ let totalDoc = 0;
+ if ($.fn.DataTable.isDataTable('#tablaDinamicaDocente')) {
+ totalDoc = $('#tablaDinamicaDocente').DataTable().rows().count();
+ }
+ document.getElementById('total-docentes').textContent = totalDoc;
+
+ let totalCur = 0;
+ if ($.fn.DataTable.isDataTable('#tablaDinamicaCurso')) {
+ totalCur = $('#tablaDinamicaCurso').DataTable().rows().count();
+ }
+ document.getElementById('total-cursos').textContent = totalCur;
+}
+
+
+function toggleVisibility(mainOption, subOption, title) {
+ if (typeof calendar !== 'undefined' && calendar) {
+ calendar.destroy();
+ calendar = null;
+ }
+
+ document.querySelectorAll('.dashboard, .asistencia, .calendario').forEach(div => {
+ div.style.display = 'none';
+ });
+
+ document.querySelectorAll('.suboption-panel > div').forEach(div => {
+ div.style.display = 'none';
+ });
+
+ if (mainOption) {
+ const section = document.querySelector(`.${mainOption.toLowerCase()}`);
+ if (section) section.style.display = 'block';
+
+ if (mainOption.toLowerCase() === 'calendario') {
+ setTimeout(() => {
+ const calendarContainer = document.getElementById('calendar');
+ if (calendarContainer && calendarContainer.offsetParent !== null) {
+ mostrarCalendario();
+ }
+ }, 100);
+ }
+ }
+
+ if (subOption) {
+ const section = document.querySelector(`.gestion-${subOption}`);
+ if (section) section.style.display = 'block';
+ }
+
+ // Actualizar el título
+ if (title) document.querySelector('.navbar-brand').innerHTML = `${title}`;
+
+ // Inicializar DataTables
+ if (subOption === 'estudiante') {
+ initializeDataTable();
+ } else if (subOption === 'docente') {
+ initializeDataTableDocente();
+ } else if (subOption === 'curso') {
+ initializeDataTableCurso();
+ }
+
+ // Reset de edición
+ editingInfo = { tipo: null, id: null };
+
+ // Restaurar texto de botones
+ document.querySelectorAll('#registrar, #registrarDocente, #registrarCurso')
+ .forEach(btn => {
+ if (btn.id === 'registrar') btn.textContent = 'Registrar Estudiante';
+ if (btn.id === 'registrarDocente') btn.textContent = 'Registrar Docente';
+ if (btn.id === 'registrarCurso') btn.textContent = 'Registrar Curso';
+ });
+
+ if (mainOption === 'dashboard') updateAll();
+}
+
+
+function initCharts() {
+ // Gráfico de distribución por niveles
+ const ctxNivel = document.getElementById('nivelEstudiantesChart');
+ nivelEstudiantesChart = new Chart(ctxNivel, {
+ type: 'doughnut',
+ data: {
+ labels: ['Principiante', 'Intermedio', 'Avanzado'],
+ datasets: [{
+ label: "Estudiantes por Nivel",
+ data: [0, 0, 0], // Datos iniciales vacíos
+ backgroundColor: ['#4e73df', '#1cc88a', '#36b9cc'],
+ borderWidth: 0
+ }]
+ },
+ options: {
+ maintainAspectRatio: true,
+ plugins: {
+ legend: {
+ position: 'bottom',
+ labels: { font: { size: 14 } }
+ },
+ tooltip: {
+ bodyFont: { size: 14 },
+ titleFont: { size: 16 }
+ }
+ }
+ }
+ });
+
+ // Gráfico de categorías de cursos
+ const ctxCategoria = document.getElementById('categoriaCursosChart');
+ categoriaCursosChart = new Chart(ctxCategoria, {
+ type: 'bar',
+ data: {
+ labels: [''],
+ datasets: [{
+ label: 'Cursos por categoría',
+ data: [0, 0, 0, 0, 0], // Datos iniciales vacíos
+ backgroundColor: ['#4e73df', '#1cc88a', '#36b9cc', '#f6c23e', '#e74c3c'],
+ borderWidth: 0
+ }]
+ },
+ options: {
+ maintainAspectRatio: true,
+ scales: {
+ y: {
+ beginAtZero: true,
+ ticks: { font: { size: 12 } }
+ },
+ x: {
+ ticks: { font: { size: 12 } }
+ }
+ },
+ plugins: { legend: { display: false } }
+ }
+ });
+
+ //Gráfico de Estudiantes por Curso
+ estudiantesPorCursoChart = new Chart(
+ document.getElementById('estudiantesPorCursoChart'),
+ {
+ type: 'bar',
+ data: {
+ labels: [''],
+ datasets: [{
+ label: 'Estudiantes por Curso',
+ data: [0, 0, 0, 0, 0],
+ backgroundColor: [
+ '#4e73df',
+ '#1cc88a',
+ '#36b9cc',
+ '#f6c23e',
+ '#e74c3c'
+ ],
+ borderRadius: 5,
+ barThickness: 20
+ }]
+ },
+ options: {
+ maintainAspectRatio: true,
+ scales: {
+ y: {
+ beginAtZero: true,
+ ticks: {
+ font: { size: 12 }
+ }
+ },
+ x: {
+ ticks: {
+ font: { size: 12 }
+ }
+ }
+ },
+ plugins: {
+ legend: { display: false },
+ tooltip: {
+ bodyFont: { size: 14 },
+ titleFont: { size: 16 }
+ }
+ }
+ }
+ }
+ );
+
+
+ // Gráfico para reportes
+ new Chart(
+ document.getElementById('reporteEstudiantesCurso'),
+ {
+ type: 'pie',
+ data: {
+ labels: ['Guitarra', 'Piano', 'Canto', 'Violín', 'Teoría'],
+ datasets: [{
+ label: 'Estudiantes por Curso',
+ data: [15, 12, 8, 5, 3],
+ backgroundColor: [
+ '#4e73df',
+ '#1cc88a',
+ '#36b9cc',
+ '#f6c23e',
+ '#e74c3c'
+ ],
+ borderWidth: 0
+ }]
+ },
+ options: {
+ maintainAspectRatio: false,
+ plugins: {
+ legend: {
+ position: 'bottom',
+ labels: {
+ font: {
+ size: 14
+ }
+ }
+ },
+ tooltip: {
+ bodyFont: {
+ size: 14
+ },
+ titleFont: {
+ size: 16
+ }
+ }
+ }
+ }
+ }
+ );
+
+ new Chart(
+ document.getElementById('reporteNiveles'),
+ {
+ type: 'polarArea',
+ data: {
+ labels: ['Principiante', 'Intermedio', 'Avanzado'],
+ datasets: [{
+ label: 'Distribución de Niveles',
+ data: [25, 15, 10],
+ backgroundColor: [
+ 'rgba(78, 115, 223, 0.7)',
+ 'rgba(28, 200, 138, 0.7)',
+ 'rgba(54, 185, 204, 0.7)'
+ ],
+ borderWidth: 0
+ }]
+ },
+ options: {
+ maintainAspectRatio: false,
+ plugins: {
+ legend: {
+ position: 'bottom',
+ labels: {
+ font: {
+ size: 14
+ }
+ }
+ },
+ tooltip: {
+ bodyFont: {
+ size: 14
+ },
+ titleFont: {
+ size: 16
+ }
+ }
+ }
+ }
+ }
+ );
+ updateCharts();
+}
+
+function updateAll() {
+ updateStateFromTable('estudiantes');
+ updateStateFromTable('docentes');
+ updateStateFromTable('cursos');
+ updateCounters();
+ updateCharts();
+}
+
+document.querySelectorAll('.theme-selector').forEach(selector => {
+ selector.addEventListener('click', function () {
+ const theme = this.dataset.theme;
+ applyTheme(theme);
+
+ document.querySelectorAll('.theme-selector').forEach(el => {
+ el.classList.remove('active');
+ });
+ this.classList.add('active');
+ });
+});
+
+// Sistema de temas
+const themeToggle = document.getElementById('theme-toggle');
+const themeToggleIcon = document.getElementById('theme-icon');
+console.log(themeToggleIcon)
+
+// Función para aplicar el tema
+function applyTheme(theme) {
+ document.body.classList.remove('theme-light', 'theme-dark');
+ document.querySelectorAll('.theme-selector').forEach(el => {
+ el.classList.remove('theme-light', 'theme-dark', 'theme-auto');
+ });
+
+ if (theme !== 'default') {
+ document.body.classList.add(`theme-${theme}`);
+ }
+
+ localStorage.setItem('theme', theme);
+
+ const themeIcon = document.getElementById('theme-icon');
+ themeIcon.className = theme === 'dark' ? 'fas fa-sun' : 'fas fa-moon';
+}
+
+// Cargar tema guardado o detectar preferencia del sistema
+function loadTheme() {
+ const savedTheme = localStorage.getItem('theme') || 'default';
+ applyTheme(savedTheme);
+}
+
+// Alternar entre temas
+function toggleTheme() {
+ const currentTheme = localStorage.getItem('theme') || 'default';
+ const newTheme = currentTheme === 'dark' ? 'light' : 'dark';
+ applyTheme(newTheme)
+}
+// FUNCIONES PARA ASISTENCIA
+// Funcion marcar
+function marcar(boton, estado) {
+ const fila = boton.closest("tr");
+ const estadoCelda = fila.querySelector(".estado");
+
+ if (estado === 'presente') {
+ estadoCelda.textContent = "Presente";
+ estadoCelda.className = "estado estado-presente";
+ } else if (estado === 'ausente') {
+ estadoCelda.textContent = "Ausente";
+ estadoCelda.className = "estado estado-ausente";
+ } else if (estado === 'tardanza') {
+ estadoCelda.textContent = "Tardanza";
+ estadoCelda.className = "estado estado-tardanza";
+ } else if (estado === 'justificado') {
+ estadoCelda.textContent = "Justificado";
+ estadoCelda.className = "estado estado-justificado";
+ }
+}
+//Funcion para resetear todo
+function resetearTodo() {
+ document.querySelectorAll("#tablaAsistencia .estado").forEach(celda => {
+ celda.textContent = "Sin marcar";
+ celda.className = "estado estado-pendiente";
+ });
+}
+
+//calendario
+let calendar;
+let eventos = JSON.parse(localStorage.getItem('eventosCursos')) || [];
+
+function mostrarCalendario() {
+ const calendarEl = document.getElementById('calendar');
+ const contenedorCalendario = document.getElementById('calendario');
+
+ // Asegurar que el contenedor esté visible antes de renderizar
+ if (contenedorCalendario.style.display === 'none') return;
+
+ if (calendar) {
+ calendar.destroy();
+ }
+
+ calendar = new FullCalendar.Calendar(calendarEl, {
+ initialView: 'dayGridMonth',
+ locale: 'es',
+ height: 'auto',
+ selectable: true,
+ headerToolbar: {
+ left: 'prev,next today',
+ center: 'title',
+ right: ''
+ },
+ events: eventos,
+ dateClick: function (info) {
+ document.getElementById('cursoId').value = '';
+ document.getElementById('fechaCurso').value = info.dateStr;
+ document.getElementById('tituloCurso').value = '';
+ document.getElementById('colorCurso').value = '#3498db';
+ document.getElementById('btnEliminar').style.display = 'none';
+ const modal = new bootstrap.Modal(document.getElementById('modalCurso'));
+ modal.show();
+ },
+ eventClick: function (info) {
+ const evento = info.event;
+ document.getElementById('cursoId').value = evento.id;
+ document.getElementById('tituloCurso').value = evento.title;
+ document.getElementById('fechaCurso').value = evento.startStr;
+ document.getElementById('colorCurso').value = evento.backgroundColor;
+ document.getElementById('btnEliminar').style.display = 'inline-block';
+ const modal = new bootstrap.Modal(document.getElementById('modalCurso'));
+ modal.show();
+ }
+ });
+
+ calendar.render();
+}
+
+// Listeners de formulario
+document.addEventListener('DOMContentLoaded', function () {
+ document.getElementById('formCurso').addEventListener('submit', function (e) {
+ e.preventDefault();
+ const id = document.getElementById('cursoId').value;
+ const title = document.getElementById('tituloCurso').value;
+ const date = document.getElementById('fechaCurso').value;
+ const color = document.getElementById('colorCurso').value;
+
+ if (id) {
+ eventos = eventos.map(ev => ev.id === id ? { id, title, start: date, backgroundColor: color } : ev);
+ } else {
+ const newId = Date.now().toString();
+ eventos.push({ id: newId, title, start: date, backgroundColor: color });
+ }
+
+ localStorage.setItem('eventosCursos', JSON.stringify(eventos));
+ const modal = bootstrap.Modal.getInstance(document.getElementById('modalCurso'));
+ modal.hide();
+ calendar.destroy();
+ mostrarCalendario();
+ });
+
+ document.getElementById('btnEliminar').addEventListener('click', function () {
+ const id = document.getElementById('cursoId').value;
+ eventos = eventos.filter(ev => ev.id !== id);
+ localStorage.setItem('eventosCursos', JSON.stringify(eventos));
+ const modal = bootstrap.Modal.getInstance(document.getElementById('modalCurso'));
+ modal.hide();
+ calendar.destroy();
+ mostrarCalendario();
+ });
+});
diff --git a/PAGINA WEB/ASISTENCIA/cambios_of.html b/PAGINA WEB/ASISTENCIA/cambios_of.html
new file mode 100644
index 0000000..4fb4c38
--- /dev/null
+++ b/PAGINA WEB/ASISTENCIA/cambios_of.html
@@ -0,0 +1,2375 @@
+
+
+
+
+
+ PRODIGIOS - Academia de Música
+
+
+
+
+
+
+
+
+
+
+
+
+
Bienvenido!
+
+
+
+
+
+
+
+ 0
+
+
+
+ 0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Panel de Control
+
+
+
Estudiantes Registrados
+
0
+
Total en el sistema
+
+
+
Docentes Activos
+
0
+
Enseñando actualmente
+
+
+
Cursos Disponibles
+
0
+
Ofertados este semestre
+
+
+
Clases Esta Semana
+
42
+
Programadas
+
+
+
+
+
+
Distribución por Niveles
+
+
+
+
Cursos por Categoría
+
+
+
+
Estudiantes por Curso
+
+
+
+
+
+
Actividades Recientes
+
+
+
+
+ | Fecha |
+ Descripción |
+ Usuario |
+
+
+
+
+ | 2023-11-15 |
+ Nuevo estudiante registrado: María Rodríguez |
+ Admin |
+
+
+ | 2023-11-14 |
+ Curso de Piano Avanzado creado |
+ Admin |
+
+
+ | 2023-11-13 |
+ Pago registrado: Carlos Mendoza |
+ Admin |
+
+
+ | 2023-11-12 |
+ Actualización de horarios |
+ Admin |
+
+
+ | 2023-11-10 |
+ Nueva docente: Laura Méndez |
+ Admin |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ | ID |
+ Nombre |
+ DNI |
+ Fecha Nac. |
+ Dirección |
+ Contacto |
+ Curso |
+ Nivel |
+ Horario |
+ Estado |
+ Acciones |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ | ID |
+ Nombres |
+ DNI |
+ Fecha Nac. |
+ Especialidad |
+ Grado Académico |
+ Experiencia |
+ Horario |
+ Contacto |
+ Salario |
+ Acciones |
+
+
+
+
+
+
+
+
+
+
+
+
+
+ | ID |
+ Nombres |
+ Descripción |
+ Duración |
+ Nivel |
+ Horario |
+ Docente |
+ N° de Plazas |
+ Costo |
+ Material |
+ Acciones |
+
+
+
+
+
+
+
+
+
+
+
Reportes Generales
+
+
+
+
+
+
+
+
+
+
+
+
Configuración del Sistema
+
+
+
+
+
+
+
+
+
+
+
+
+
Tema
+
+
+
Personalización
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Fuentes
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Información del Sistema
+
+
+
+
+
Última actualización
+
15 Nov 2023
+
+
+
+
Soporte
+
soporte@prodigios.edu
+
+
+
+
+
+
+
+
Próxima actualización
+
15 Dic 2023
+
+
+
+
+
Recursos del Sistema
+
+
+
+
+
Almacenamiento
+
15.8 GB de 50 GB usados
+
+
31.6%
+
+
+
+
+
+
+
+
Base de Datos
+
2.4 MB de 100 MB usados
+
+
2.4%
+
+
+
+
+
+
+
+
Uso de CPU
+
Promedio de los últimos 30 días
+
+
42%
+
+
+
+
+
+
+
+
Memoria
+
1.2 GB de 4 GB usados
+
+
30%
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/PAGINA WEB/ASISTENCIA/user.jpg b/PAGINA WEB/ASISTENCIA/user.jpg
new file mode 100644
index 0000000..e960efc
Binary files /dev/null and b/PAGINA WEB/ASISTENCIA/user.jpg differ
diff --git a/PAGINA WEB/conexion.php b/PAGINA WEB/conexion.php
index d295c5d..4056005 100644
--- a/PAGINA WEB/conexion.php
+++ b/PAGINA WEB/conexion.php
@@ -1,7 +1,7 @@
+
PRODIGIOS
@@ -232,12 +233,39 @@
background: #007bff;
color: #ffffff;
}
+ .profile-icon {
+ position: absolute;
+ top: 15px;
+ right: 20px;
+ font-size: 26px;
+ color: white;
+ z-index: 1101;
+ background: transparent;
+ border: none;
+ }
+
+ .profile-icon a {
+ color: white;
+ text-decoration: none;
+ }
+
+ .profile-icon a:hover {
+ color: #ffcc00;
+ }
-
+
+