Browse Source
Mejora en la barra de busqueda y agregamos los iconos para convertir en archivos las tablasmain
8 changed files with 192 additions and 18 deletions
@ -0,0 +1,33 @@ |
|||
<?php |
|||
|
|||
namespace App\Exports; |
|||
|
|||
use Maatwebsite\Excel\Concerns\FromCollection; |
|||
use Maatwebsite\Excel\Concerns\WithHeadings; |
|||
|
|||
class DocentesExport implements FromCollection, WithHeadings |
|||
{ |
|||
protected $docentes; |
|||
|
|||
public function __construct($docentes) |
|||
{ |
|||
$this->docentes = $docentes; |
|||
} |
|||
|
|||
public function collection() |
|||
{ |
|||
return $this->docentes; |
|||
} |
|||
|
|||
public function headings(): array |
|||
{ |
|||
return [ |
|||
'ID', |
|||
'Nombre', |
|||
'Teléfono', |
|||
'Correo', |
|||
'Tipo de Licencia', |
|||
'Materia' |
|||
]; |
|||
} |
|||
} |
@ -0,0 +1,47 @@ |
|||
<!DOCTYPE html> |
|||
<html> |
|||
<head> |
|||
<title>Docentes</title> |
|||
<style> |
|||
table { |
|||
width: 100%; |
|||
border-collapse: collapse; |
|||
} |
|||
th, td { |
|||
border: 1px solid #ddd; |
|||
padding: 8px; |
|||
text-align: left; |
|||
} |
|||
th { |
|||
background-color: #f2f2f2; |
|||
} |
|||
</style> |
|||
</head> |
|||
<body> |
|||
<h2>Lista de Docentes</h2> |
|||
<table> |
|||
<thead> |
|||
<tr> |
|||
<th>ID</th> |
|||
<th>Nombre</th> |
|||
<th>Teléfono</th> |
|||
<th>Correo</th> |
|||
<th>Tipo de Licencia</th> |
|||
<th>Materia</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
@foreach($docentes as $docente) |
|||
<tr> |
|||
<td>{{ $docente->id }}</td> |
|||
<td>{{ $docente->nombre }}</td> |
|||
<td>{{ $docente->telefono }}</td> |
|||
<td>{{ $docente->correo }}</td> |
|||
<td>{{ $docente->tipo_licencia }}</td> |
|||
<td>{{ $docente->materia }}</td> |
|||
</tr> |
|||
@endforeach |
|||
</tbody> |
|||
</table> |
|||
</body> |
|||
</html> |
Loading…
Reference in new issue