table alumnos
Browse files
app/app/Http/Controllers/UsuarioController.php
CHANGED
|
@@ -11,8 +11,7 @@ use Illuminate\Support\Facades\Hash;
|
|
| 11 |
use Illuminate\Validation\Rule;
|
| 12 |
use Illuminate\Support\Facades\Validator;
|
| 13 |
|
| 14 |
-
class UsuarioController extends Controller
|
| 15 |
-
{
|
| 16 |
/**
|
| 17 |
* Display a listing of the resource.
|
| 18 |
*/
|
|
|
|
| 11 |
use Illuminate\Validation\Rule;
|
| 12 |
use Illuminate\Support\Facades\Validator;
|
| 13 |
|
| 14 |
+
class UsuarioController extends Controller{
|
|
|
|
| 15 |
/**
|
| 16 |
* Display a listing of the resource.
|
| 17 |
*/
|
app/resources/views/admin/alumnos/index.blade.php
CHANGED
|
@@ -1,120 +1,167 @@
|
|
| 1 |
@extends('layouts.admin')
|
| 2 |
|
| 3 |
@section('content')
|
| 4 |
-
|
| 5 |
<h1 class="m-0">Listado de alumnos</h1>
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
<div class="card card-outline card-primary mx-4">
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
<script>
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
</script>
|
| 112 |
-
|
| 113 |
-
|
| 114 |
</div>
|
| 115 |
<!-- /.card -->
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
@endsection
|
|
|
|
| 1 |
@extends('layouts.admin')
|
| 2 |
|
| 3 |
@section('content')
|
| 4 |
+
<div class="col-sm-15 mx-3">
|
| 5 |
<h1 class="m-0">Listado de alumnos</h1>
|
| 6 |
+
</div>
|
| 7 |
+
<hr>
|
| 8 |
+
<div class="row">
|
| 9 |
+
<div class="col-md-15">
|
| 10 |
<div class="card card-outline card-primary mx-4">
|
| 11 |
+
<div class="card-header">
|
| 12 |
+
<h3 class="card-title">alumnos registrados</h3>
|
| 13 |
+
<!-- /.card-tools -->
|
| 14 |
+
<div class="card-tools d-flex flex-column align-items-end">
|
| 15 |
+
<a href="{{url('/admin/alumnos/create')}}" class="btn btn-primary mb-2"><i class="bi bi-plus-square-dotted"></i> Nuevo alumno</a>
|
| 16 |
|
| 17 |
+
<a href="{{ route('alumnos.promocionar') }}" class="btn btn-success"
|
| 18 |
+
onclick="confirmarPromocion(event)">
|
| 19 |
+
<i class="bi bi-arrow-up-square"></i> Promover Alumnos
|
| 20 |
+
</a>
|
| 21 |
+
<script>
|
| 22 |
+
function confirmarPromocion(event) {
|
| 23 |
+
event.preventDefault();
|
| 24 |
+
Swal.fire({
|
| 25 |
+
title: '¿Estás seguro?',
|
| 26 |
+
text: "Esta acción no se puede deshacer. Se promoverán los alumnos automáticamente.",
|
| 27 |
+
icon: 'warning',
|
| 28 |
+
showCancelButton: true,
|
| 29 |
+
confirmButtonColor: '#28a745',
|
| 30 |
+
cancelButtonColor: '#d33',
|
| 31 |
+
confirmButtonText: 'Aceptar',
|
| 32 |
+
cancelButtonText: 'Cancelar'
|
| 33 |
+
}).then((result) => {
|
| 34 |
+
if (result.isConfirmed) {
|
| 35 |
+
window.location.href = "{{ route('alumnos.promocionar') }}";
|
| 36 |
+
}
|
| 37 |
+
});
|
| 38 |
+
}
|
| 39 |
+
</script>
|
| 40 |
+
</div>
|
| 41 |
+
</div>
|
| 42 |
+
<!-- /.card-header -->
|
| 43 |
+
<div class="card-body">
|
| 44 |
+
<table id="example1" class="table table-bordered table-sm table-striped table-hover">
|
| 45 |
+
<thead>
|
| 46 |
+
<tr>
|
| 47 |
+
<th><center>Nro</center></th>
|
| 48 |
+
<th><center>Alumno</center></th>
|
| 49 |
+
<th><center>Numero de control</center></th>
|
| 50 |
+
<th><center>Tutor</center></th>
|
| 51 |
+
<th><center>Grado</center></th>
|
| 52 |
+
<th><center>Curp</center></th>
|
| 53 |
+
<th><center>Acciones</center></th>
|
| 54 |
+
</tr>
|
| 55 |
+
</thead>
|
| 56 |
+
<tbody>
|
| 57 |
+
@php
|
| 58 |
+
$contador = 0;
|
| 59 |
+
@endphp
|
| 60 |
|
| 61 |
+
@foreach($alumnos as $alumno)
|
| 62 |
+
@php
|
| 63 |
+
$contador++;
|
| 64 |
+
$id = $alumno->id;
|
| 65 |
+
@endphp
|
| 66 |
+
<tr>
|
| 67 |
+
<td><center>{{$contador}}</center></td>
|
| 68 |
+
<!-- <td><center>{{$alumno->id_alumno}}</center></td> -->
|
| 69 |
+
<!-- <td><center>{{$alumno->persona}}</center></td> -->
|
| 70 |
+
<td><center>{{$alumno->persona->nombre}}</center></td>
|
| 71 |
+
<td><center>{{$alumno->numero_control}}</center></td>
|
| 72 |
+
<td><center>{{$alumno->id_tutor}}</center></td>
|
| 73 |
+
<td><center>{{$alumno->id_grupo }}</center></td>
|
| 74 |
+
<td><center>{{$alumno->curp}}</center></td>
|
| 75 |
+
<td style="text-align:center">
|
| 76 |
+
<div class="btn-group" role="group" aria-label="Basic example">
|
| 77 |
+
<a href="{{route('alumnos.show', $alumno->id_alumno)}}" type="button" class="btn btn-info"><i class="bi bi-eye"></i></a>
|
| 78 |
+
<a href="{{route('alumnos.edit',$alumno->id_alumno)}}" type="button" class="btn btn-success"><i class="bi bi-pencil"></i></a>
|
| 79 |
+
<form action="{{route('alumnos.destroy', $alumno->id_alumno)}}" onclick="preguntar<?=$id;?>(event)" method="post" id="miFormulario<?=$id;?>" >
|
| 80 |
+
@csrf
|
| 81 |
+
@method('DELETE')
|
| 82 |
+
<button type="submit" class="btn btn-danger" style="border-radius: 0px 5px 5px 0px"><i class="bi bi-trash"></i></button>
|
| 83 |
+
</form>
|
| 84 |
+
<script>
|
| 85 |
+
function preguntar<?=$id;?>(event) {
|
| 86 |
+
event.preventDefault();
|
| 87 |
+
swal.fire({
|
| 88 |
+
title: 'Eliminar registro',
|
| 89 |
+
text: '¿Desea eliminar este registro?',
|
| 90 |
+
icon: 'question',
|
| 91 |
+
showDenyButton: true,
|
| 92 |
+
confirmButtonText: 'Eliminar',
|
| 93 |
+
confirmButtonColor: '#a5161d',
|
| 94 |
+
denyButtonColor: '#270a0a',
|
| 95 |
+
denyButtonText: 'Cancelar',
|
| 96 |
+
}).then((result) =>{
|
| 97 |
+
if (result.isConfirmed) {
|
| 98 |
+
var form = $('#miFormulario<?=$id;?>');
|
| 99 |
+
form.submit();
|
| 100 |
+
//swal.fire('Eliminado', 'Se elimino el registro', 'success');
|
| 101 |
+
}
|
| 102 |
+
});
|
| 103 |
+
}
|
| 104 |
+
</script>
|
| 105 |
+
</div>
|
| 106 |
+
</td>
|
| 107 |
+
</tr>
|
| 108 |
+
@endforeach
|
| 109 |
+
</tbody>
|
| 110 |
+
</table>
|
| 111 |
<script>
|
| 112 |
+
$(function () {
|
| 113 |
+
$("#example1").DataTable({
|
| 114 |
+
"pageLength": 5,
|
| 115 |
+
"language": {
|
| 116 |
+
"emptyTable": "No hay información",
|
| 117 |
+
"info": "Mostrando _START_ a _END_ de _TOTAL_ Alumnos",
|
| 118 |
+
"infoEmpty": "Mostrando 0 a 0 de 0 Roles",
|
| 119 |
+
"infoFiltered": "(Filtrando de _MAX_ total Alumnos)",
|
| 120 |
+
"infoPostFix": "",
|
| 121 |
+
"thousands": ",",
|
| 122 |
+
"lengthMenu": "Mostrar _MENU_ Alumnos",
|
| 123 |
+
"loadingRecords": "Cargando...",
|
| 124 |
+
"processing": "Procesando...",
|
| 125 |
+
"search": "Buscador:",
|
| 126 |
+
"zeroRecords": "Sin resultados encontrados",
|
| 127 |
+
"paginate": {
|
| 128 |
+
"first": "Primero",
|
| 129 |
+
"last": "Último",
|
| 130 |
+
"next": "Siguiente",
|
| 131 |
+
"previous": "Anterior"
|
| 132 |
+
}
|
| 133 |
+
},
|
| 134 |
+
"responsive": true,
|
| 135 |
+
"lengthChange": true,
|
| 136 |
+
"autoWidth": false,
|
| 137 |
+
buttons: [
|
| 138 |
+
{
|
| 139 |
+
extend: 'collection',
|
| 140 |
+
text: 'Reportes',
|
| 141 |
+
orientation: 'landscape',
|
| 142 |
+
buttons: [
|
| 143 |
+
{ text: 'Copiar', extend: 'copy' },
|
| 144 |
+
{ extend: 'pdf' },
|
| 145 |
+
{ extend: 'csv' },
|
| 146 |
+
{ extend: 'excel' },
|
| 147 |
+
{ text: 'Imprimir', extend: 'print' }
|
| 148 |
+
]
|
| 149 |
+
},
|
| 150 |
+
{
|
| 151 |
+
extend: 'colvis',
|
| 152 |
+
text: 'Visor de columnas',
|
| 153 |
+
collectionLayout: 'fixed three-column'
|
| 154 |
+
}
|
| 155 |
+
]
|
| 156 |
+
}).buttons().container().appendTo('#example1_wrapper .col-md-6:eq(0)');
|
| 157 |
+
});
|
| 158 |
+
</script>
|
| 159 |
+
</div>
|
| 160 |
+
<!-- /.card-body -->
|
| 161 |
</div>
|
| 162 |
<!-- /.card -->
|
| 163 |
+
</div>
|
| 164 |
+
<div class="col-12 col-sm-8 col-md-6">
|
| 165 |
+
</div>
|
| 166 |
+
</div>
|
| 167 |
@endsection
|