Selaa lähdekoodia

Merge remote-tracking branch 'origin/devAldrick' into devAldrick

EmilianoChavarria 1 kuukausi sitten
vanhempi
commit
b56ee45a7e

+ 5 - 3
Back/backendP-Educativa/app/Http/Controllers/Api/RegistroAcademico.php

@@ -852,9 +852,11 @@ public function editarRegistroAdmin(Request $request, $id)
 
             // Solo actualizar si cambia
             if ($registro->completado != $nuevoCompletado) {
-                DB::table('registroacademico')
-                    ->where('id', $registro->id)
-                    ->update(['completado' => $nuevoCompletado]);
+              DB::table('registroacademico')
+    ->where('idEscuela', $registro->idEscuela)
+    ->where('idAlumno', $registro->idAlumno)
+    ->update(['completado' => $nuevoCompletado]);
+
             }
         }
 

+ 1 - 1
Front/src/app/modules/Alumno/pages/tareas/tareas.component.html

@@ -1,6 +1,6 @@
 <div class="centrar fadeIn">
     <div class="fondo" [style.background-color]="color">
-        <p class="content" [style.color]="textColor">Circulares</p>
+        <p class="content" [style.color]="textColor">Mis Tareas</p>
     </div>
 </div>
 

+ 2 - 0
Front/src/app/modules/Padres/padres-routing.module.ts

@@ -10,6 +10,7 @@ import { CircularHijosComponent } from './pages/circularHijos/circular-hijos.com
 import { BitacoraHijosComponent } from './pages/bitacora-hijos/bitacora-hijos.component';
 import { FormulariosComponent } from './pages/formularios/formularios.component';
 import { ListaFormulariosComponent } from './pages/lista-formularios/lista-formularios.component';
+import { TareasHijosComponent } from './pages/tareas-hijos/tareas-hijos.component';
 
 
 
@@ -24,6 +25,7 @@ const routes: Routes = [
             { path: 'registro/:id', component: registroComponent },
             { path: 'registroAd/:id', component: RegistroAdComponent },
             { path: 'circularHijo/:id', component: CircularHijosComponent },
+            { path: 'tareaHijo/:id', component: TareasHijosComponent },
             { path: 'bitacoraHijo/:id', component: BitacoraHijosComponent },
             { path: 'formularios', component: FormulariosComponent },
           { path: 'formularios/lista', component: ListaFormulariosComponent },

+ 2 - 0
Front/src/app/modules/Padres/padres.module.ts

@@ -17,6 +17,7 @@ import { BitacoraHijosComponent } from './pages/bitacora-hijos/bitacora-hijos.co
 import { FormulariosComponent } from './pages/formularios/formularios.component';
 import { ListaFormulariosComponent } from './pages/lista-formularios/lista-formularios.component';
 import { TareasComponent } from './pages/tareas/tareas.component';
+import { TareasHijosComponent } from './pages/tareas-hijos/tareas-hijos.component';
 
 
 
@@ -35,6 +36,7 @@ import { TareasComponent } from './pages/tareas/tareas.component';
     FormulariosComponent,
     ListaFormulariosComponent,
     TareasComponent,
+    TareasHijosComponent,
   ],
   imports: [
     CommonModule,

+ 1 - 1
Front/src/app/modules/Padres/pages/cards-hijos/cards-hijos.component.html

@@ -36,7 +36,7 @@
                         </div>
                     </div>
                     <div class="card-option" style="margin-top: 10px; margin-bottom: 10px;">
-                        <div class="option-content cursor-pointer">
+                        <div class="option-content cursor-pointer" (click)="tareaHijo(user.idUser)">
                             Tareas
                             <mat-icon>task</mat-icon>
                         </div>

+ 4 - 0
Front/src/app/modules/Padres/pages/cards-hijos/cards-hijos.component.ts

@@ -75,6 +75,10 @@ getAlumnos() {
         console.log(data);
 
   }
+  tareaHijo(data: any){
+    this._router.navigate(['/homePadres/tareaHijo',btoa(data)]);
+        console.log(data);
+  }
   bitacoraHijo(data: any){
     this._router.navigate(['/homePadres/bitacoraHijo',btoa(data)]);
     console.log(data);

+ 14 - 0
Front/src/app/modules/Padres/pages/tareas-hijos/tareaAlumno.component.html

@@ -0,0 +1,14 @@
+<div style="display: flex; justify-content: space-between; padding-left: 20px; padding-right: 20px; padding-top: 20;">
+    <h2 mat-dialog-title>{{data.titulo}}</h2>
+    <mat-icon class="cursor-pointer" mat-dialog-close style="margin-top: 20px;">close</mat-icon>
+</div>
+<mat-dialog-content class="mat-typography" style="min-width: 300px;">
+   <div [innerHTML]="data.contenido"></div>
+
+</mat-dialog-content>
+<div style="width: 100; display: flex; align-items: center; justify-content: center; margin-bottom: 20px;">
+    <button class="red" mat-dialog-close style="display: flex; align-items: center; justify-content: center;">
+        Cerrar <mat-icon class="icon" matSuffix>cancel</mat-icon>
+    </button>
+</div>
+

+ 350 - 0
Front/src/app/modules/Padres/pages/tareas-hijos/tareas-hijos.component.css

@@ -0,0 +1,350 @@
+.centrar {
+    margin-top: 4%;
+    line-height: auto;
+    text-align: center;
+}
+
+.cerrar-b {
+  background-color: #fff;
+  border: none;
+}
+
+.fondo {
+    border-radius: 10px;
+    line-height: 1;
+    display: inline-block;
+    vertical-align: middle;
+}
+
+.content {
+    margin-bottom: 0;
+    margin-top: 0;
+    padding-top: 10px;
+    padding-bottom: 10px;
+    padding-left: 70px;
+    padding-right: 70px;
+    font-weight: 500;
+    font-size: 32px;
+    color: white;
+    font-family: "Serenity Medium";
+}
+
+.form-container {
+  display: grid;
+  grid-template-columns: repeat(3, 1fr); /* 4 columnas iguales */
+  gap: 10px; /* espacio entre columnas y filas */
+}
+
+.item {
+  box-sizing: border-box;
+  padding: 10px;
+}
+
+.item.two-columns {
+  grid-column: span 2;
+}
+
+.w-responsive {
+    width: 160px;
+}
+
+.input {
+    width: 500px;
+    color: rgb(0, 140, 255);
+}
+
+.file-input {
+  display: none;
+}
+
+.btnDelete {
+  display: flex;              
+  align-items: center;        
+  justify-content: center;
+  cursor: pointer;
+  border: none;
+  background-color: transparent;
+  height: 30px;
+  width: 30px;
+  color: #ccc;
+  border-radius: 5px;
+  padding: 0;
+}
+
+
+.btnDelete:hover {
+  color: #dd131a;
+  background-color: #f7e3e4;
+}
+
+.container-col {
+    display: flex;
+    flex-direction: column;
+    padding-top: 100px;
+    padding-left: 30px;
+    padding-right: 65px;
+    width: 100%;
+    box-sizing: border-box;
+}
+
+.yellow {
+    border: none;
+    border-radius: 5px;
+    padding: 5px 15px;
+    font-size: 1rem;
+    color: white;
+    margin-left: 10px;
+    background-color: #ebac3f;
+}
+
+.yellow:hover {
+    background-color: #be8b32;
+
+}
+
+.orange {
+    border: none;
+    border-radius: 5px;
+    padding: 5px 15px;
+    font-size: 1rem;
+    color: white;
+    margin-left: 10px;
+    background-color: #f56227;
+
+}
+
+.orange:hover {
+    background-color: #d15321;
+
+}
+
+.red {
+    border: none;
+    border-radius: 5px;
+    padding: 5px 15px;
+    font-size: 1rem;
+    color: white;
+    margin-left: 10px;
+    background-color: red;
+
+}
+
+.red:hover {
+    background-color: rgb(177, 0, 0);
+
+}
+
+.action-edit {
+    margin-left: 5px;
+    background-color: #1d156e;
+    color: white;
+    height: 30px;
+    width: 30px;
+}
+
+.action-delete {
+    margin-left: 5px;
+    background-color: #e43b3d;
+    color: white;
+    height: 30px;
+    width: 30px;
+}
+
+.inline {
+    display: flex;
+    align-items: center;
+    color: red;
+    cursor: pointer;
+}
+
+.icon {
+    transform: scale(0.8);
+    vertical-align: middle;
+}
+
+.green {
+    background-color: #2a6c42;
+    border: none;
+    color: white !important;
+    cursor: pointer;
+    border-radius: 6px;
+    height: 35px;
+}
+
+.green:hover {
+    background-color: #205232;
+}
+
+.buttons {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    width: 100%;
+    margin-bottom: 15px;
+    padding-left: 20px;
+}
+
+.badge-active {
+    color: #026AA2;
+    font-weight: 500;
+    padding: 3px 7px;
+    background-color: #E0F2FE;
+    border-radius: 15px;
+}
+
+.badge-inactive {
+    color: #AC2722;
+    font-weight: 500;
+    padding: 3px 7px;
+    background-color: #FEE4E2;
+    border-radius: 15px;
+}
+
+/* --------------- Table and responsive styles ---------------- */
+.table-container {
+    width: 100%;
+    overflow: auto;
+}
+
+.table-responsive {
+
+    overflow: auto;
+}
+
+/* --------------- Special button styles for Circulares ---------------- */
+.btn-grande {
+    display: inline-flex;
+    align-items: center;
+    background-color: rgb(184, 221, 247);
+    border-radius: 4px;
+    padding: 0 12px;
+    height: 36px;
+}
+
+.btn-movil {
+    display: none;
+    background: none;
+    border: none;
+    padding: 0;
+    margin: 0;
+}
+
+/* --------------- Modal and form styles ---------------- */
+.close {
+    padding-top: 20px;
+    padding-right: 20px;
+    display: flex;
+    justify-content: end;
+}
+
+.center {
+    text-align: center;
+    font-size: 32px;
+    font-weight: 600;
+}
+
+.responsive {
+    display: flex;
+    flex-direction: row;
+}
+
+.align {
+    margin-top: 30px;
+    display: flex;
+    justify-content: center;
+}
+
+/* --------------- Media Queries ---------------- */
+@media only screen and (max-width: 600px) {
+    .centrar {
+        margin-top: 8%;
+    }
+
+    .fondo {
+        width: 90%;
+    }
+
+    .content {
+        font-size: 24px;
+        padding: 10px 20px;
+    }
+
+    .container-col {
+        padding-top: 50px;
+        padding-left: 15px;
+        padding-right: 15px;
+    }
+
+    .input {
+        width: 100%;
+    }
+
+    .container-search {
+        flex-direction: column;
+    }
+
+    .buttons {
+        flex-direction: column;
+        align-items: stretch;
+        gap: 10px;
+        padding-left: 0;
+    }
+
+    .table-container {
+        width: 100%;
+    }
+
+    /* Special mobile styles for Circulares buttons */
+    .btn-grande {
+        display: none;
+    }
+
+    .btn-movil {
+        display: inline-flex;
+    }
+
+    .btn-movil img {
+        width: 24px;
+        height: 24px;
+    }
+
+    /* Adjust action buttons container */
+    .flex-row.items-center {
+        justify-content: center;
+    }
+}
+
+@media (max-width: 768px) {
+    .w-responsive {
+        width: 100%;
+    }
+
+    .content {
+        font-size: 22px;
+        padding: 10px 15px;
+    }
+
+    .item {
+        flex: 1 0 100%;
+    }
+
+    .table-responsive {
+
+        overflow-x: auto;
+    }
+
+    /* Ensure table cells have proper spacing */
+    .mat-cell,
+    .mat-header-cell {
+        padding: 4px 8px;
+    }
+
+    /* Adjust column widths for mobile */
+    .mat-column-acciones {
+        min-width: 80px;
+    }
+
+    .mat-column-adjuntos {
+        min-width: 100px;
+    }
+}

+ 117 - 0
Front/src/app/modules/Padres/pages/tareas-hijos/tareas-hijos.component.html

@@ -0,0 +1,117 @@
+<div class="centrar fadeIn">
+    <div class="fondo" [style.background-color]="color">
+        <p class="content" [style.color]="textColor">Tareas</p>
+    </div>
+</div>
+
+<div class="container-col fadeIn">
+    <div class="flex-row container-search">
+        <div class="">
+            <mat-form-field class="input">
+                <input class="input" (keyup)="applyFilter($event)" matInput placeholder="Buscar" #input>
+                <mat-icon matSuffix>search</mat-icon>
+            </mat-form-field>
+        </div>
+
+    </div>
+    <div class="table-container mat-elevation-z8">
+        <div class="table-responsive" #TABLE>
+            <table mat-table [dataSource]="dataSource" #table class="mat-elevation-z8">
+
+                <ng-container matColumnDef="materia">
+                    <th mat-header-cell *matHeaderCellDef> Materia</th>
+                    <td mat-cell *matCellDef="let tarea"> {{tarea.materia}}</td>
+                </ng-container>
+
+                <ng-container matColumnDef="titulo">
+                    <th mat-header-cell *matHeaderCellDef> Título </th>
+                    <td mat-cell *matCellDef="let tarea"> {{tarea.tituloTarea}} </td>
+                </ng-container>
+
+
+                <ng-container matColumnDef="tipoTarea">
+                    <th mat-header-cell *matHeaderCellDef> Tipo de Tarea </th>
+                    <td mat-cell *matCellDef="let tarea"> {{tarea.tipo_tarea}} </td>
+                </ng-container>
+
+                <ng-container matColumnDef="fechaPub">
+                    <th mat-header-cell *matHeaderCellDef> Fecha de Publicación </th>
+                    <td mat-cell *matCellDef="let tarea"> {{tarea.fechaPublicacion| date: 'dd/MM/yyyy hh:mm:ss'}}
+                    </td>
+                </ng-container>
+
+                <ng-container matColumnDef="fechaEntrega">
+                    <th mat-header-cell *matHeaderCellDef> Fecha de Entrega </th>
+                    <td mat-cell *matCellDef="let tarea"> {{tarea.fechaEntrega| date: 'dd/MM/yyyy hh:mm:ss'}}
+                    </td>
+                </ng-container>
+
+                <ng-container matColumnDef="enlaces">
+                    <th mat-header-cell *matHeaderCellDef style="text-align: center;"> Vinculos </th>
+                    <td mat-cell *matCellDef="let tarea" style="text-align: center;">
+                        <button *ngIf="tarea.vinculoTarea.length>0" mat-button [matMenuTriggerFor]="menuVin"
+                            class="btn-grande" style="background-color: rgb(184, 221, 247);">Vinculos <mat-icon
+                                matSuffix>keyboard_arrow_down</mat-icon></button>
+                        <button *ngIf="tarea.vinculoTarea.length>0" mat-button [matMenuTriggerFor]="menuVin"
+                            class="btn-movil">
+                            <img src="../../../../../assets/icons/carpeta.png" alt="icono carpeta" width="30"
+                                height="30">
+                        </button>
+                        <span *ngIf="tarea.vinculoTarea.length==0">No aplica</span>
+                        <mat-menu #menuVin="matMenu">
+                            <button mat-menu-item *ngFor="let option of tarea.vinculoTareaArray"
+                                (click)="buscarArchivo(option.url)">
+                                <span style="font-size: 13px;">
+                                    {{ option.nombre }}
+                                </span>
+                            </button>
+                        </mat-menu>
+                    </td>
+                </ng-container>
+
+                <ng-container matColumnDef="adjuntos">
+                    <th mat-header-cell *matHeaderCellDef style="text-align: center;"> Adjuntos </th>
+                    <td mat-cell *matCellDef="let tarea" style="text-align: center;">
+                        <button *ngIf="tarea.adjuntoTarea.length>0" mat-button [matMenuTriggerFor]="menuAd"
+                            class="btn-grande" style="background-color: rgb(184, 221, 247);">Adjuntos <mat-icon
+                                matSuffix>keyboard_arrow_down</mat-icon></button>
+                        <button *ngIf="tarea.adjuntoTarea.length>0" mat-button [matMenuTriggerFor]="menuAd"
+                            class="btn-movil">
+                            <img src="../../../../../assets/icons/carpeta.png" alt="icono carpeta" width="30"
+                                height="30">
+                        </button>
+                        <span *ngIf="tarea.adjuntoTarea.length==0">No aplica</span>
+                        <mat-menu #menuAd="matMenu">
+                            <button mat-menu-item *ngFor="let option of tarea.adjuntoTarea"
+                                (click)="buscarArchivo(option.ruta)">
+                                <span style="font-size: 13px;">
+                                    {{ option.nombre }}
+                                </span>
+                            </button>
+                        </mat-menu>
+                    </td>
+                </ng-container>
+
+                <ng-container matColumnDef="acciones">
+                    <th mat-header-cell *matHeaderCellDef> Acciones</th>
+                    <td mat-cell *matCellDef="let tarea">
+                        <div class="flex-row items-center">
+                            <button mat-menu-item (click)="openDialog(tarea)">
+                                <mat-icon>preview</mat-icon>
+                                <span>Visualizar</span>
+                            </button>
+                        </div>
+                    </td>
+                </ng-container>
+
+                <tr mat-header-row *matHeaderRowDef="columnas"></tr>
+                <tr mat-row *matRowDef="let row; columns: columnas;"></tr>
+                <tr class="mat-row" *matNoDataRow>
+                    <td class="mat-cell" colspan="7">No hay resultados para "{{input.value}}"</td>
+                </tr>
+            </table>
+            <mat-progress-bar *ngIf="isLoading" mode="indeterminate"></mat-progress-bar>
+        </div>
+        <mat-paginator [pageSizeOptions]="[5, 10, 15]" showFirstLastButtons class="mat-elevation-z8"></mat-paginator>
+    </div>
+</div>

+ 197 - 0
Front/src/app/modules/Padres/pages/tareas-hijos/tareas-hijos.component.ts

@@ -0,0 +1,197 @@
+import { Component, ElementRef, Inject, ViewChild } from '@angular/core';
+import { FormControl } from '@angular/forms';
+import { MatPaginator, MatPaginatorIntl } from '@angular/material/paginator';
+import { MatTableDataSource } from '@angular/material/table';
+import { CircularService } from '../../../Administrador/services/circular.service';
+import { MatIconModule, MatIconRegistry } from '@angular/material/icon';
+import { DomSanitizer } from '@angular/platform-browser';
+import { EnviarInfoService } from '../../../Administrador/services/enviar-info.service';
+import { MAT_DIALOG_DATA, MatDialog, MatDialogActions, MatDialogClose, MatDialogContent } from '@angular/material/dialog';
+import { ModalTarea } from '../../../Profesor/pages/tareas/tareas.component';
+
+import * as XLSX from 'xlsx';
+import { TareasService } from '../../services/tareas.service';
+import { ActivatedRoute } from '@angular/router';
+
+@Component({
+  selector: 'app-tareas',
+  templateUrl: './tareas-hijos.component.html',
+  styleUrl: './tareas-hijos.component.css'
+})
+export class TareasHijosComponent {
+  public checked = false;
+  public isLoading: boolean = true;
+  public searchInput = new FormControl('');
+  public color: string = '';
+  public textColor: string = '';
+  public columnas: string[] = ['titulo', 'materia', 'tipoTarea', 'fechaPub', 'fechaEntrega', 'enlaces', 'adjuntos', 'acciones'];
+  public dataSource = new MatTableDataSource<any>();
+  private userData = JSON.parse(localStorage.getItem('userData') || '');
+  private userDataS = JSON.parse(localStorage.getItem('userDataS') || '');
+  @ViewChild(MatPaginator, { static: true }) paginator!: MatPaginator;
+  @ViewChild('TABLE') table!: ElementRef;
+
+  constructor(
+    private circularService: CircularService,
+    private sanitizer: DomSanitizer,
+    private tareasService: TareasService,
+    private _MatIconRegister: MatIconRegistry,
+    private _DomSanitizer: DomSanitizer,
+    private paginatorIntl: MatPaginatorIntl,
+    private _enviarInfo: EnviarInfoService,
+    public dialog: MatDialog,
+    private route: ActivatedRoute
+  ) {
+    this._MatIconRegister.addSvgIcon('excel', this._DomSanitizer.bypassSecurityTrustResourceUrl('assets/icons/excel.svg'));
+    //paginador de tabla a español
+    const spanishRangeLabel = (page: number, pageSize: number, length: number): string => {
+      if (length === 0 || pageSize === 0) {
+        return `0 de ${length}`;
+      }
+      length = Math.max(length, 0);
+      const startIndex = page * pageSize;
+      const endIndex = startIndex < length ?
+        Math.min(startIndex + pageSize, length) :
+        startIndex + pageSize;
+      return `${startIndex + 1} - ${endIndex} de ${length}`;
+    };
+    this.paginatorIntl.nextPageLabel = "Siguiente";
+    this.paginatorIntl.previousPageLabel = "Anterior";
+    this.paginatorIntl.firstPageLabel = "Ir a la primer página";
+    this.paginatorIntl.lastPageLabel = "Ir a la última página";
+    this.paginatorIntl.itemsPerPageLabel = "Registros por página";
+    this.paginatorIntl.getRangeLabel = spanishRangeLabel;
+  }
+  private id: string = '';
+  ngOnInit(): void {
+
+    this.route.paramMap.subscribe((params: any) => {
+      const id = params.get('id');
+
+      this.id = atob(id || '');
+      console.log(this.id);
+    });
+
+    this._enviarInfo.currentTextColor.subscribe(textColor => {
+      this.textColor = textColor;
+    });
+    this._enviarInfo.currentColor.subscribe(color => {
+      this.color = color;
+    });
+
+    //suscribirse al subject que manda al servicio
+    this._enviarInfo.tabla$.subscribe(() => {
+      this.getCirculares();
+    });
+
+    this.getCirculares()
+
+  }
+
+  openDialog(circular: any) {
+    this.dialog.open(TareaAlumComponent, {
+      data: { titulo: circular.tituloTarea, contenido: this.sanitizer.bypassSecurityTrustHtml(circular.descripcionTarea) }
+    });
+
+    if (localStorage.getItem('userDataS')) {
+
+    } else {
+      let info = {
+        idCircular: circular.idCircular,
+        idUsuario: this.userData[0]
+      };
+      this.circularService.verCircular(info).subscribe((response) => {
+      });
+    }
+  }
+
+
+
+  public allInfo: any;
+  public files: any;
+  public urls: any = [];
+  //Traer la información y mostrarla en la tabla
+  getCirculares() {
+    this.tareasService.getTareas(this.id).subscribe((response: any) => {
+      this.isLoading = false;
+
+      this.allInfo = response.map((tarea: any) => {
+        // separar los vinculos en un arreglo de objetos con nombre
+        if (tarea.vinculoTarea) {
+          tarea.vinculoTareaArray = tarea.vinculoTarea.split("||").map((url: string, index: number) => {
+            return { nombre: url, url: url };
+          });
+        } else {
+          tarea.vinculoTareaArray = [];
+        }
+
+        if (tarea.adjuntoTarea) {
+          tarea.adjuntoTarea = JSON.parse(tarea.adjuntoTarea);
+        } else {
+          tarea.adjuntoTarea = [];
+        }
+
+        return tarea;
+      });
+
+
+      this.dataSource = new MatTableDataSource<any>(this.allInfo);
+      this.dataSource.paginator = this.paginator;
+    });
+  }
+
+  buscarArchivo(ruta: string) {
+    // console.log("🚀 ~ TareasComponent ~ buscarArchivo ~ ruta:", ruta)
+    window.open(ruta, '_blank');
+  }
+
+  //filtro de búsqueda
+  applyFilter(event: Event) {
+    const filterValue = (event.target as HTMLInputElement).value;
+    this.dataSource.filter = filterValue.trim().toLowerCase();
+  }
+
+
+
+
+  // openDialog1(id: string) {
+  //   const dialogRef = this.dialog.open(ModalCircular, {
+  //     autoFocus: false
+  //   });
+
+
+  //   dialogRef.componentInstance.setData(id);
+  // }
+
+
+
+  // openDialogEdit(circular: any) {
+  //   console.log("🚀 ~ CircularesComponent ~ openDialogEdit ~ circular:", circular)
+  //   const dialogRef = this.dialog.open(ModalCircularesEdit, {
+  //     autoFocus: false,
+  //     data: circular
+  //   });
+
+  //   dialogRef.componentInstance.circularActualizada.subscribe(() => {
+  //     this.getCirculares();
+  //   });
+
+
+  // }
+
+
+
+
+}
+
+@Component({
+  selector: 'App-circularAlumno-component',
+  templateUrl: './tareaAlumno.component.html',
+  styleUrls: ['./tareas-hijos.component.css'],
+  standalone: true,
+  imports: [MatIconModule, MatDialogContent, MatDialogActions, MatDialogClose]
+})
+export class TareaAlumComponent {
+  constructor(@Inject(MAT_DIALOG_DATA) public data: any) {
+  }
+}

+ 27 - 0
Front/src/app/modules/Padres/services/tareas.service.ts

@@ -0,0 +1,27 @@
+import { Injectable } from '@angular/core';
+import { environments } from '../../../../environments/environments';
+import { HttpClient, HttpHeaders } from '@angular/common/http';
+
+@Injectable({
+  providedIn: 'root'
+})
+export class TareasService {
+
+  private URL: string = environments.baseUrl;
+
+  constructor(private http: HttpClient) { }
+
+  private getHeaders(): HttpHeaders {
+    const token = localStorage.getItem('token') || '';
+    return new HttpHeaders({
+      'Content-Type': 'application/json',
+      'Authorization': `Bearer ${token}`
+    });
+  }
+
+  getTareas(idAlumno: string) {
+    return this.http.get(`${this.URL}/tareas/usuario/${idAlumno}`, { headers: this.getHeaders() });
+  }
+
+
+}