Alta de modificaciones de grupo con alumbnos y docentes
This commit is contained in:
@@ -5,144 +5,164 @@
|
||||
@section('content')
|
||||
|
||||
<div class="container-fluid">
|
||||
{{-- Card editar grupo --}}
|
||||
<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">Editar grupo</h6>
|
||||
<a href="{{route('grupo.index')}}" class="d-sm-inline-block btn btn-sm btn-primary shadow-sm"><i class="fas fa-download fa-sm text-white-50"></i> Regresar</a>
|
||||
<h6 class="m-0 font-weight-bold text-primary">Editar grupo</h6>
|
||||
<a href="{{route('grupo.index')}}" class="d-sm-inline-block btn btn-sm btn-primary shadow-sm">
|
||||
<i class="fas fa-download fa-sm text-white-50"></i> Regresar
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
@if (session('info'))
|
||||
<div class="alert alert-success">
|
||||
<strong>{{session('info')}}</strong>
|
||||
</div>
|
||||
@endif
|
||||
<form action="{{route('grupo.update',$grupo->id)}}" method="POST">
|
||||
@method('PUT')
|
||||
@csrf
|
||||
<div class="mb-3">
|
||||
<label for="status">Seleccionar Carrera</label>
|
||||
<label>Seleccionar Carrera</label>
|
||||
<select class="form-control" name="plan_id">
|
||||
|
||||
<option value="">Seleccionar plan</option>
|
||||
|
||||
@foreach ($plans as $nivel => $grupos)
|
||||
<optgroup label="{{ $nivel }}">
|
||||
@foreach ($grupos as $plan)
|
||||
<option value="{{ $plan->id }}" {{ $plan->id == $grupo->id ? 'selected' : '' }}>
|
||||
<option value="{{ $plan->id }}" {{ $plan->id == $grupo->plan_id ? 'selected' : '' }}>
|
||||
{{ $plan->carreraRel->name }}
|
||||
({{ $plan->name }}-{{ $plan->rvoe }})
|
||||
</option>
|
||||
@endforeach
|
||||
</optgroup>
|
||||
@endforeach
|
||||
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="status">Seleccionar ciclo</label>
|
||||
<label>Seleccionar ciclo</label>
|
||||
<select class="form-control" name="ciclo">
|
||||
<option value="0">Seleccionar ciclo</option>
|
||||
|
||||
@for ($i=1 ; $i <= $ciclos->duracion ; $i++)
|
||||
<option value="{{ $i }}" @selected($i == $grupo->ciclo)>{{$i}}</option>
|
||||
<option value="{{ $i }}" @selected($i == $grupo->ciclo)>{{$i}}</option>
|
||||
@endfor
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="status">Seleccionar turno</label>
|
||||
<label>Seleccionar turno</label>
|
||||
<select class="form-control" name="turno">
|
||||
<option value="0">Seleccionar turno</option>
|
||||
@foreach ($turnos as $turno)
|
||||
<option value="{{ $turno->id }}" {{ $turno->id == $grupo->turno ? 'selected' : '' }}>{{$turno->name}}</option>
|
||||
<option value="{{ $turno->id }}" {{ $turno->id == $grupo->turno ? 'selected' : '' }}>
|
||||
{{$turno->name}}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="status">Seleccionar plantel</label>
|
||||
<label>Seleccionar plantel</label>
|
||||
<select class="form-control" name="plantel">
|
||||
<option value="0">Seleccionar plantel</option>
|
||||
@foreach ($planteles as $plantel)
|
||||
<option value="{{ $plantel->id }}" {{ $plantel->id == $grupo->plantel ? 'selected' : '' }}>{{$plantel->name}}</option>
|
||||
<option value="{{ $plantel->id }}" {{ $plantel->id == $grupo->plantel ? 'selected' : '' }}>
|
||||
{{$plantel->name}}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="status">Seleccionar status</label>
|
||||
<select class="form-control" name="status" id="status">
|
||||
<label>Seleccionar status</label>
|
||||
<select class="form-control" name="status">
|
||||
<option value="1" {{ 1 == $grupo->status ? 'selected' : '' }}>Activo</option>
|
||||
<option value="0" {{ 0 == $grupo->status ? 'selected' : '' }}>Inactivo</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<input class="btn btn-primary" type="submit" value="Guardar">
|
||||
<input class="btn btn-primary" type="submit" value="Guardar">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{{-- contenedor de materias --}}
|
||||
{{-- Card Materias y Docentes --}}
|
||||
<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">Alumnos</h6>
|
||||
@can('grupo.create')
|
||||
<button onclick="Livewire.dispatch('create-grupo')" class="d-sm-inline-block btn btn-sm btn-success shadow-sm"><i class="fas fa-download fa-sm text-white-50"></i> Agregar</button>
|
||||
@endcan
|
||||
<h6 class="m-0 font-weight-bold text-primary">Materias</h6>
|
||||
@hasrole('Coordinación académica')
|
||||
<button onclick="$('#modalDocente').modal('show')"
|
||||
class="d-sm-inline-block btn btn-sm btn-success shadow-sm">
|
||||
<i class="fas fa-plus fa-sm text-white-50"></i> Asignar materia a docente
|
||||
</button>
|
||||
@endcan
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
@if (session('infogrupo'))
|
||||
<div class="alert alert-success">
|
||||
<strong>{{session('infogrupo')}}</strong>
|
||||
</div>
|
||||
@endif
|
||||
<livewire:grupo-docente :grupo="$grupo"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container-fluid">
|
||||
{{-- Card Alumnos --}}
|
||||
<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">Alumnos</h6>
|
||||
@can('grupo.create')
|
||||
<button onclick="Livewire.dispatch('create-grupo')"
|
||||
class="d-sm-inline-block btn btn-sm btn-success shadow-sm">
|
||||
<i class="fas fa-plus fa-sm text-white-50"></i> Agregar alumno
|
||||
</button>
|
||||
@endcan
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table id="tcont" class="table table-striped table-bordered nowrap table-hover" style="width:100%;">
|
||||
<thead>
|
||||
<div class="card-body">
|
||||
<div class="container-fluid">
|
||||
<table id="tcont2" class="table table-striped table-bordered nowrap table-hover" style="width:100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<th>Nombre</th>
|
||||
<th>Opciones</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@forelse ($grupo->alumnos as $alumno)
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<th>Nombre</th>
|
||||
<th>Opciones</th>
|
||||
<td>{{$alumno->id}}</td>
|
||||
<td>
|
||||
{{$alumno->usuario->first()?->name}}
|
||||
{{$alumno->usuario->first()?->apellidoPaterno}}
|
||||
{{$alumno->usuario->first()?->apellidoMaterno}}
|
||||
</td>
|
||||
<td>
|
||||
@can('grupo.destroy')
|
||||
<form class="delete-form"
|
||||
action="{{route('grupo.destroy',$grupo->id)}}"
|
||||
method="POST">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<input class="d-none" name="alumno" value="{{$alumno->id}}">
|
||||
<button type="submit" style="border:none; background:none;">
|
||||
<i class="fa-solid fa-circle-xmark fa-xl"
|
||||
style="color:#e66565;"></i>
|
||||
</button>
|
||||
</form>
|
||||
@endcan
|
||||
</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@forelse ($grupo->alumnos as $alumno)
|
||||
<tr style="width:100%">
|
||||
<td>{{$alumno->id}}</td>
|
||||
<td>{{$alumno->usuario->first()?->name}} {{$alumno->usuario->first()?->apellidoPaterno}} {{$alumno->usuario->first()?->apellidoMaterno}}</td>
|
||||
<td>
|
||||
@can('grupo.destroy')
|
||||
<div>
|
||||
<form class="delete-form" action="{{route('grupo.destroy',$grupo->id)}}" method="POST">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
|
||||
<input class="d-none" name="alumno" value="{{$alumno->id}}">
|
||||
|
||||
<button type="submit" style="border:none; background:none;">
|
||||
<i class="fa-duotone fa-regular fa-circle-user-circle-xmark fa-2xl" style="--fa-primary-color: rgb(172, 5, 18); --fa-secondary-color: rgb(245, 112, 123);"></i>
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
@endcan
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<p>Sin alumnos.</p>
|
||||
@endforelse
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
</div>
|
||||
@empty
|
||||
<tr><td colspan="3">Sin alumnos.</td></tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<livewire:grupo-alumno :grupo="$grupo"/>
|
||||
</div>
|
||||
@@ -160,12 +180,55 @@ document.addEventListener('livewire:init', () => {
|
||||
Livewire.on('open-grupo-modal', () => {
|
||||
$('#exampleModal').modal('show');
|
||||
});
|
||||
});
|
||||
|
||||
document.addEventListener('livewire:init', () => {
|
||||
Livewire.on('close-modal', () => {
|
||||
$('#exampleModal').modal('hide');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<script> new DataTable('#tcont2', {
|
||||
responsive: true,
|
||||
language: {
|
||||
"decimal": "",
|
||||
"emptyTable": "No hay información",
|
||||
"info": "Mostrando _START_ a _END_ de _TOTAL_ Entradas",
|
||||
"infoEmpty": "Mostrando 0 to 0 of 0 Entradas",
|
||||
"infoFiltered": "(Filtrado de _MAX_ total entradas)",
|
||||
"infoPostFix": "",
|
||||
"thousands": ",",
|
||||
"lengthMenu": "Mostrar _MENU_ Entradas",
|
||||
"loadingRecords": "Cargando...",
|
||||
"processing": "Procesando...",
|
||||
"search": "Buscar:",
|
||||
"zeroRecords": "Sin resultados encontrados"
|
||||
},
|
||||
lengthMenu: [
|
||||
[10, 25, 50, -1],
|
||||
['10 filas', '25 filas', '50 filas', 'Todos']
|
||||
],
|
||||
layout: {
|
||||
topStart: {
|
||||
buttons: ['colvis', 'pageLength']
|
||||
},
|
||||
topEnd: ['search'],
|
||||
bottomStart: [{
|
||||
buttons: [{
|
||||
extend: 'excel',
|
||||
title: 'Excel'
|
||||
},
|
||||
{
|
||||
extend: 'pdfHtml5',
|
||||
title: 'PDF'
|
||||
},
|
||||
{
|
||||
extend: 'print'
|
||||
}
|
||||
]
|
||||
}, 'info'],
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$("#tcont2_wrapper").removeClass("form-inline");
|
||||
$("#tcont2_wrapper").addClass("w-100"); </script>
|
||||
@endsection
|
||||
|
||||
Reference in New Issue
Block a user