Modificación del de vista de dopcumentos del alumno
This commit is contained in:
@@ -27,7 +27,138 @@
|
||||
<input class="btn btn-primary" type="submit" value="Actualizar">
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-lg-8">
|
||||
<div class="card shadow mb-4">
|
||||
<div class="card-header py-3">
|
||||
<div class="d-sm-flex align-items-center justify-content-between">
|
||||
<h6 class="m-0 font-weight-bold text-primary">Expediente del alumno</h6>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
|
||||
<div>
|
||||
|
||||
@php
|
||||
$nivel = $alumno->nivelRel ?? null;
|
||||
|
||||
$tipos = $nivel
|
||||
? $nivel->documentosRequeridos
|
||||
: collect();
|
||||
|
||||
$documentos = collect($alumno?->documentos)->keyBy('tipo');
|
||||
@endphp
|
||||
|
||||
@foreach($tipos as $tipo)
|
||||
|
||||
@php
|
||||
$doc = $documentos[$tipo->slug] ?? null;
|
||||
@endphp
|
||||
|
||||
<div class="mb-3">
|
||||
|
||||
@if($doc)
|
||||
|
||||
@if($doc->status == 1)
|
||||
<div class="alert alert-success d-sm-flex align-items-center justify-content-between">
|
||||
<strong>{{ strtoupper($tipo->name) }} : Validado</strong>
|
||||
|
||||
<button
|
||||
onclick="verDocumento('{{ url('documento/ver/'.$doc->id) }}', {{ $doc->id }})"
|
||||
class="btn btn-sm btn-primary mt-2">
|
||||
<i class="fa-duotone fa-solid fa-eye"></i> Ver documento
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@elseif($doc->status == 2)
|
||||
<div class="alert alert-danger d-sm-flex align-items-center justify-content-between">
|
||||
<strong>{{ strtoupper($tipo->name) }} : Rechazado</strong>
|
||||
|
||||
<button
|
||||
onclick="verDocumento('{{ url('documento/ver/'.$doc->id) }}', {{ $doc->id }})"
|
||||
class="btn btn-sm btn-primary mt-2">
|
||||
<i class="fa-duotone fa-solid fa-eye"></i> Ver documento
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@else
|
||||
|
||||
<div class="alert alert-warning d-sm-flex align-items-center justify-content-between">
|
||||
|
||||
<strong>{{ strtoupper($tipo->name) }} : Pendiente de revisión</strong>
|
||||
|
||||
<button
|
||||
onclick="verDocumento('{{ url('documento/ver/'.$doc->id) }}', {{ $doc->id }})"
|
||||
class="btn btn-sm btn-primary mt-2">
|
||||
<i class="fa-duotone fa-solid fa-eye"></i> Ver documento
|
||||
</button>
|
||||
|
||||
</div>
|
||||
|
||||
@endif
|
||||
|
||||
|
||||
|
||||
@else
|
||||
<div class="alert alert-danger">
|
||||
<strong>{{ strtoupper($tipo->name) }} : Faltante</strong>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
</div>
|
||||
@endforeach
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4">
|
||||
<div class="card shadow mb-4 ">
|
||||
<div class="card-header py-3">
|
||||
<div class="d-sm-flex align-items-center justify-content-between">
|
||||
<h6 class="m-0 font-weight-bold text-primary">Asignación de beca</h6>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="visorModal" tabindex="-1">
|
||||
<div class="modal-dialog modal-xl">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">Vista previa</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<iframe id="visorFrame" width="100%" height="600px" style="border:none;"></iframe>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
||||
@@ -11,22 +11,23 @@
|
||||
<div class="card shadow mb-4">
|
||||
<div class="card-header py-3">
|
||||
<div class="d-sm-flex align-items-center justify-content-between">
|
||||
@hasrole('Promotor')
|
||||
<h6 class="m-0 font-weight-bold text-primary">Prospectos</h6>
|
||||
@endrole
|
||||
|
||||
@hasrole('Control escolar')
|
||||
<h6 class="m-0 font-weight-bold text-primary">Alumnos</h6>
|
||||
@endrole
|
||||
@can('alumno.create')
|
||||
@if (Auth::user()->roles->contains('name', 'Promotor'))
|
||||
<h6 class="m-0 font-weight-bold text-primary">Prospectos</h6>
|
||||
<button onclick="Livewire.dispatch('create-prospecto')" class="d-sm-inline-block btn btn-sm btn-primary shadow-sm"><i class="fas fa-download fa-sm text-white-50"></i> Agregar</button>
|
||||
@endcan
|
||||
|
||||
@else
|
||||
<h6 class="m-0 font-weight-bold text-primary">Alumnos</h6>
|
||||
|
||||
@endif
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body row">
|
||||
|
||||
@hasrole('Promotor')
|
||||
@if (Auth::user()->roles->contains('name', 'Promotor'))
|
||||
<div class="col-sm-2 overflow-auto" style="height: 80vh">
|
||||
<div class="list-group">
|
||||
@forelse ($alumnos as $alumno)
|
||||
@@ -64,14 +65,16 @@
|
||||
</div>
|
||||
|
||||
@livewire('modal-prospecto')
|
||||
@endrole
|
||||
|
||||
@hasrole('Control escolar')
|
||||
|
||||
@else
|
||||
|
||||
|
||||
<table id="tcont" class="table table-striped table-bordered nowrap table-hover" style="width:100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<th>Foto</th>
|
||||
<th>Alumno</th>
|
||||
<th>Campus</th>
|
||||
<th>Status</th>
|
||||
@@ -86,10 +89,18 @@
|
||||
|
||||
<td>{{ $alumno->id }}</td>
|
||||
|
||||
|
||||
<td class="text-center">
|
||||
@foreach($alumno->alumnos as $user)
|
||||
<img src="{{ $user?->profile_photo_url }}"
|
||||
class="rounded-circle mr-3"
|
||||
style="width:48px; height:48px; object-fit:cover; border:2px solid #36b9cc;" onclick="verFoto('{{ $user?->profile_photo_url }}','{{ $user->name }} {{ $user->apellidoPaterno }}')">
|
||||
@endforeach
|
||||
</td>
|
||||
<td>
|
||||
@foreach($alumno->alumnos as $user)
|
||||
<a href="{{ route('alumno.show', $alumno->id) }}">
|
||||
{{ $user->name }}
|
||||
{{ $user->name }} {{ $user->apellidoPaterno }} {{ $user->apellidoMaterno }}
|
||||
</a>
|
||||
@endforeach
|
||||
</td>
|
||||
@@ -118,24 +129,20 @@
|
||||
</span>
|
||||
</td>
|
||||
|
||||
<td class="row mx-auto">
|
||||
<td>
|
||||
|
||||
@can('alumno.edit')
|
||||
<div class="col-sm-6 col-md-6">
|
||||
<a class="btn btn-primary" href="{{ route('alumno.edit',$alumno->id) }}">
|
||||
Edit
|
||||
</a>
|
||||
</div>
|
||||
@endcan
|
||||
|
||||
@can('alumno.destroy')
|
||||
<div class="col-sm-6 col-md-6">
|
||||
<form class="delete-form" action="{{ route('alumno.destroy',$alumno->id) }}" method="POST">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<input type="submit" value="DELETE" class="btn btn-danger">
|
||||
</form>
|
||||
</div>
|
||||
@endcan
|
||||
|
||||
</td>
|
||||
@@ -151,8 +158,7 @@
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@endrole
|
||||
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -192,7 +198,6 @@ function verDocumento(url, docId) {
|
||||
|
||||
Livewire.dispatch('set-documento', { id: docId });
|
||||
|
||||
// 🔥 guardar instancia global
|
||||
visorModalInstance = new bootstrap.Modal(
|
||||
document.getElementById('visorModal')
|
||||
);
|
||||
@@ -208,12 +213,21 @@ document.addEventListener('livewire:init', () => {
|
||||
visorModalInstance.hide();
|
||||
}
|
||||
|
||||
// 🔥 limpiar iframe
|
||||
document.getElementById('visorFrame').src = "";
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function verFoto(url,nombre){
|
||||
Swal.fire({
|
||||
text: nombre,
|
||||
imageUrl: url,
|
||||
imageWidth: 400,
|
||||
imageHeight: 400,
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
@endsection
|
||||
|
||||
Reference in New Issue
Block a user