-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #44 from IrvingCM123/develop
Develop
- Loading branch information
Showing
10 changed files
with
132 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<div class="table-container"> | ||
<table class="table"> | ||
<thead> | ||
<tr> | ||
<th>ID</th> | ||
<th>Matricula</th> | ||
<th>Nombre</th> | ||
<th>Estado</th> | ||
<th>Hora</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<ng-container *ngFor="let alumno_recibido of listaAsistencia; let i = index"> | ||
<tr class="Datos" > | ||
<th scope="row">{{ i + 1 }}</th> | ||
<td>{{ alumno_recibido.Matricula }}</td> | ||
<td>{{ alumno_recibido.Nombre }}</td> | ||
<td>{{ alumno_recibido.Estado }}</td> | ||
<td>{{ alumno_recibido.Hora }}</td> | ||
</tr> | ||
</ng-container> | ||
</tbody> | ||
</table> | ||
</div> | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,45 @@ | ||
import { Component, OnDestroy, OnInit } from '@angular/core'; | ||
import { AngularFirestore, AngularFirestoreCollection } from '@angular/fire/compat/firestore'; | ||
import { Observable, Subscription } from 'rxjs'; | ||
import { Component, Inject, OnInit } from '@angular/core'; | ||
import { FirestoreService } from '../listas/FirestoreListas.service'; | ||
import { AngularFirestore } from '@angular/fire/compat/firestore'; | ||
import { DatosService } from '../inicio/Datos.Service'; | ||
|
||
|
||
interface Dato { | ||
id?: string; | ||
Hora: string; | ||
export interface Estructura { | ||
Matricula: string; | ||
Nombre: string; | ||
Status: string; | ||
Estado: string; | ||
Hora: string; | ||
} | ||
|
||
@Component({ | ||
selector: 'app-listado', | ||
templateUrl: './listado.component.html', | ||
styleUrls: ['./listado.component.scss'] | ||
styleUrls: ['./listado.component.scss'], | ||
}) | ||
export class ListadoComponent implements OnInit, OnDestroy { | ||
NRC: any; | ||
datos: Dato[] = []; | ||
datosCollection: AngularFirestoreCollection<Dato> | undefined; | ||
subscription: Subscription = new Subscription(); | ||
datosCargados = false; | ||
items: any[] = []; | ||
|
||
dia: number; | ||
mes: number; | ||
anio: number; | ||
fechaFormateada: string; | ||
|
||
constructor(readonly afs: AngularFirestore, private recibirDato: DatosService,) { | ||
const fechaActual = new Date(); | ||
this.dia = fechaActual.getDate(); | ||
this.mes = fechaActual.getMonth() + 1; | ||
this.anio = fechaActual.getFullYear(); | ||
this.fechaFormateada = `${this.anio}-${this.mes}-${this.dia}`; | ||
console.log(this.fechaFormateada) | ||
export class ListadoComponent implements OnInit { | ||
mostrarLista: Estructura[] = []; | ||
listaAsistencia: any = []; | ||
nrcMateria: string = ''; | ||
carrera: string = ''; | ||
datosCargados: boolean = false; | ||
fechaCompleta: string; | ||
|
||
constructor( | ||
private firestoreService: FirestoreService, | ||
private datos: DatosService | ||
) { | ||
this.carrera = datos.getCarrera(); | ||
this.nrcMateria = datos.getNrc(); | ||
|
||
let fecha = new Date(); | ||
let dia = fecha.getDate(); | ||
let mes = fecha.getMonth() + 1; | ||
let año = fecha.getFullYear(); | ||
this.fechaCompleta = año + ':' + mes + ':' + dia; | ||
} | ||
|
||
|
||
ngOnInit(): void { | ||
console.log(this.NRC) | ||
const ruta = this.fechaFormateada; | ||
this.datosCollection = this.afs.collection<Dato>('JorgeDiaz/Sistemas en red/' + ruta); | ||
this.subscription.add(this.datosCollection.valueChanges().subscribe((datos: Dato[]) => { | ||
this.datos = datos; | ||
this.datosCargados = true; | ||
})); | ||
async ngOnInit() { | ||
this.listaAsistencia = await this.firestoreService.getDatosLeidos(this.nrcMateria, this.fechaCompleta); | ||
console.log('aa', this.listaAsistencia) | ||
} | ||
|
||
ngOnDestroy(): void { | ||
this.subscription.unsubscribe(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters