Alta de modificaciones de grupo con alumbnos y docentes
This commit is contained in:
@@ -2,7 +2,15 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Docente;
|
||||
use App\Models\Role;
|
||||
use App\Models\User;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Password;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Auth\Notifications\ResetPassword;
|
||||
|
||||
class DocenteController extends Controller
|
||||
{
|
||||
@@ -11,7 +19,19 @@ class DocenteController extends Controller
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
//
|
||||
|
||||
$user = Auth::user();
|
||||
$plantelesIds = $user->plantelUsuarios->pluck('id');
|
||||
|
||||
$docentes = Docente::with(['docentes.plantelUsuarios', 'docentes.roles'])
|
||||
->whereHas('docentes', function($query) use ($plantelesIds) {
|
||||
$query->whereHas('plantelUsuarios', function($q) use ($plantelesIds) {
|
||||
$q->whereIn('plantels.id', $plantelesIds);
|
||||
});
|
||||
})
|
||||
->get();
|
||||
|
||||
return view('Docente.index', compact('docentes'));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -19,7 +39,10 @@ class DocenteController extends Controller
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
//
|
||||
$user = Auth::user();
|
||||
$roles = Role::where('name','Docente')->get();
|
||||
$plantels = $user->plantelUsuarios;
|
||||
return view('Docente.create',compact(['plantels','roles']));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -27,7 +50,49 @@ class DocenteController extends Controller
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
//
|
||||
if (User::where('email', $request->email)
|
||||
->orWhere('telefono', $request->telefono)
|
||||
->exists()) {
|
||||
|
||||
return redirect()->route('docente.create')->with('warn','Ya se encuentra registrado el número de teléfono o correo electrónico, porfavor cambialos')->withInput();
|
||||
}
|
||||
|
||||
if ($request->plantel ==0) {
|
||||
return redirect()->route('docente.create')->with('warn','Selecciona el campus')->withInput();
|
||||
}
|
||||
|
||||
if ($request->rol ==0) {
|
||||
return redirect()->route('docente.create')->with('warn','Selecciona el rol')->withInput();
|
||||
}
|
||||
|
||||
$passwordTemporal = Str::random(12);
|
||||
|
||||
$user = User::create([
|
||||
'name' => mb_strtoupper($request->name, 'UTF-8'),
|
||||
'apellidoPaterno' => mb_strtoupper($request->apellidoPaterno, 'UTF-8'),
|
||||
'apellidoMaterno' => mb_strtoupper($request->apellidoMaterno, 'UTF-8'),
|
||||
'email' => $request->email,
|
||||
'telefono' => $request->telefono,
|
||||
'direccion' => $request->direccion,
|
||||
'password' => Hash::make($passwordTemporal),
|
||||
'status' => $request->status
|
||||
]);
|
||||
|
||||
$user->roles()->sync($request->rol);
|
||||
$user->plantelUsuarios()->sync([$request->plantel]);
|
||||
|
||||
$token = Password::createToken($user);
|
||||
$user->notify(new ResetPassword($token));
|
||||
|
||||
$docente = Docente::create([
|
||||
'usuario_registro' => Auth::id(),
|
||||
'status' => $request->status,
|
||||
]);
|
||||
|
||||
$docente->docentes()->sync([$user->id]);
|
||||
|
||||
return redirect()->route('docente.edit',compact('docente'))->with('info','Se creó el docente correctamente');
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -41,9 +106,14 @@ class DocenteController extends Controller
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit(string $id)
|
||||
public function edit(Docente $docente)
|
||||
{
|
||||
//
|
||||
$user = Auth::user();
|
||||
$roles = Role::where('name', 'Docente')->get();
|
||||
$plantels = $user->plantelUsuarios;
|
||||
$usr = $docente->docentes->first();
|
||||
|
||||
return view('Docente.edit', compact(['docente', 'plantels', 'roles', 'usr']));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -57,8 +127,28 @@ class DocenteController extends Controller
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy(string $id)
|
||||
public function destroy(Docente $docente)
|
||||
{
|
||||
//
|
||||
$user = $docente->docentes->first();
|
||||
|
||||
$docente->grupos()->detach();
|
||||
|
||||
$docente->docentes()->detach();
|
||||
|
||||
$docente->delete();
|
||||
|
||||
if ($user) {
|
||||
$user->roles()->detach();
|
||||
$user->plantelUsuarios()->detach();
|
||||
$user->delete();
|
||||
}
|
||||
|
||||
session()->flash('swal', [
|
||||
'icon' => 'success',
|
||||
'title' => 'Eliminado!',
|
||||
'text' => 'Se ha eliminado el registro correctamente'
|
||||
]);
|
||||
|
||||
return redirect()->route('docente.index');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\DocumentoTipo;
|
||||
use App\Models\documentoTipo;
|
||||
use App\Models\Nivel;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Routing\Controller;
|
||||
|
||||
class DocumentoTipoController extends Controller
|
||||
class documentoTipoController extends Controller
|
||||
{
|
||||
public function __construct() {
|
||||
$this->middleware('can:documentoTipo.index')->only('index','show');
|
||||
@@ -18,8 +18,8 @@ class DocumentoTipoController extends Controller
|
||||
|
||||
public function index()
|
||||
{
|
||||
$documentotipos=DocumentoTipo::all();
|
||||
return view('documento.index',compact('documentotipos'));
|
||||
$documentoTipos=documentoTipo::all();
|
||||
return view('documento.index',compact('documentoTipos'));
|
||||
}
|
||||
|
||||
|
||||
@@ -40,15 +40,15 @@ class DocumentoTipoController extends Controller
|
||||
'extensiones' => 'required|array'
|
||||
]);
|
||||
|
||||
$documentotipo=DocumentoTipo::create([
|
||||
$documentoTipo=documentoTipo::create([
|
||||
'name' => $request->name,
|
||||
'slug' => $request->slug,
|
||||
'extensiones' => $request->extensiones
|
||||
]);
|
||||
|
||||
$documentotipo->niveles()->sync($request->nivels ?? []);
|
||||
$documentoTipo->niveles()->sync($request->nivels ?? []);
|
||||
|
||||
return redirect()->route('documentotipo.edit',compact('documentotipo'))->with('info','Se creó la la documentación correctamente');
|
||||
return redirect()->route('documentoTipo.edit',compact('documentoTipo'))->with('info','Se creó la la documentación correctamente');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -62,42 +62,42 @@ class DocumentoTipoController extends Controller
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit(DocumentoTipo $documentotipo)
|
||||
public function edit(documentoTipo $documentoTipo)
|
||||
{
|
||||
$documentotipo->load('niveles');
|
||||
$documentoTipo->load('niveles');
|
||||
$nivels = Nivel::where('status','=','1')->get();
|
||||
return view('documento.edit',compact(['documentotipo','nivels']));
|
||||
return view('documento.edit',compact(['documentoTipo','nivels']));
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(Request $request, DocumentoTipo $documentotipo)
|
||||
public function update(Request $request, documentoTipo $documentoTipo)
|
||||
{
|
||||
$documentotipo->update([
|
||||
$documentoTipo->update([
|
||||
'name' => $request->name,
|
||||
'slug' => $request->slug,
|
||||
'extensiones' => $request->extensiones
|
||||
]);
|
||||
|
||||
$documentotipo->niveles()->sync($request->nivels ?? []);
|
||||
$documentoTipo->niveles()->sync($request->nivels ?? []);
|
||||
|
||||
return redirect()->route('documentotipo.edit',compact('documentotipo'))->with('info','Se modificó la la documentación correctamente');
|
||||
return redirect()->route('documentoTipo.edit',compact('documentoTipo'))->with('info','Se modificó la la documentación correctamente');
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy(DocumentoTipo $documentotipo)
|
||||
public function destroy(documentoTipo $documentoTipo)
|
||||
{
|
||||
$documentotipo->niveles()->detach();
|
||||
$documentotipo->delete();
|
||||
$documentoTipo->niveles()->detach();
|
||||
$documentoTipo->delete();
|
||||
|
||||
session()->flash('swal',[
|
||||
'icon'=>'success',
|
||||
'title'=>'Eliminado!',
|
||||
'text'=>'Se han eliminado los registros correctamente'
|
||||
]);
|
||||
return redirect()->route('documentotipo.index');
|
||||
return redirect()->route('documentoTipo.index');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class TareaController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*/
|
||||
public function show(string $id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit(string $id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(Request $request, string $id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy(string $id)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
<?php
|
||||
namespace App\Livewire;
|
||||
|
||||
use App\Models\Docente;
|
||||
use App\Models\Material;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Livewire\Component;
|
||||
|
||||
class GrupoDocente extends Component
|
||||
{
|
||||
public $grupo;
|
||||
public $docentes;
|
||||
public $materias;
|
||||
public $docente_id;
|
||||
public $materia_id;
|
||||
public $materiasSelect;
|
||||
|
||||
public function mount($grupo)
|
||||
{
|
||||
$this->grupo = $grupo; // <- primero asignar el grupo
|
||||
|
||||
$user = Auth::user();
|
||||
$plantelesIds = $user->plantelUsuarios->pluck('id');
|
||||
|
||||
$this->docentes = Docente::with(['docentes.plantelUsuarios'])
|
||||
->whereHas('docentes', function($query) use ($plantelesIds) {
|
||||
$query->whereHas('plantelUsuarios', function($q) use ($plantelesIds) {
|
||||
$q->whereIn('plantels.id', $plantelesIds);
|
||||
});
|
||||
})
|
||||
->get();
|
||||
|
||||
// Todas las materias de la carrera sin filtro de ciclo
|
||||
$this->materias = Material::whereHas('carreraMaterial', function($query) use ($grupo) {
|
||||
$query->where('carreras.id', $grupo->plan->carrera);
|
||||
})
|
||||
->orderBy('ciclo')
|
||||
->get();
|
||||
|
||||
$materiasAsignadas = DB::table('docente_grupo')
|
||||
->where('grupo_id', $this->grupo->id)
|
||||
->pluck('materia_id')
|
||||
->toArray();
|
||||
|
||||
$this->materiasSelect = Material::whereHas('carreraMaterial', function($query) use ($grupo) {
|
||||
$query->where('carreras.id', $grupo->plan->carrera);
|
||||
})
|
||||
->where('ciclo', $this->grupo->ciclo) // solo ciclo actual
|
||||
->when(!empty($materiasAsignadas), function($query) use ($materiasAsignadas) {
|
||||
$query->whereNotIn('id', $materiasAsignadas); // excluir ya asignadas
|
||||
})
|
||||
->get();
|
||||
}
|
||||
|
||||
public function guardar()
|
||||
{
|
||||
$this->validate([
|
||||
'docente_id' => 'required|exists:docentes,id',
|
||||
'materia_id' => 'required|exists:materials,id',
|
||||
]);
|
||||
|
||||
$this->grupo->docentes()->attach($this->docente_id, [
|
||||
'materia_id' => $this->materia_id
|
||||
]);
|
||||
|
||||
$this->reset(['docente_id', 'materia_id']);
|
||||
$this->dispatch('close-modal-docente');
|
||||
|
||||
$this->dispatch('swal',
|
||||
icon: 'success',
|
||||
title: '¡Listo!',
|
||||
text: 'Docente asignado correctamente',
|
||||
timer: 2000,
|
||||
confirm: false,
|
||||
closeModal: true,
|
||||
reload: true
|
||||
);
|
||||
}
|
||||
|
||||
public function eliminar($docenteId)
|
||||
{
|
||||
$this->grupo->docentes()->detach($docenteId);
|
||||
|
||||
$this->dispatch('swal',
|
||||
icon: 'success',
|
||||
title: '¡Eliminado!',
|
||||
text: 'Docente removido correctamente',
|
||||
timer: 2000,
|
||||
confirm: false,
|
||||
closeModal: false,
|
||||
reload: true
|
||||
);
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.grupo-docente');
|
||||
}
|
||||
}
|
||||
+24
-1
@@ -3,8 +3,31 @@
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
|
||||
class Docente extends Model
|
||||
{
|
||||
//
|
||||
protected $guarded = [];
|
||||
|
||||
public $timestamps = false;
|
||||
|
||||
// Relación con User
|
||||
public function docentes(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(User::class);
|
||||
}
|
||||
|
||||
// Relación con Grupo
|
||||
public function grupos(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Grupo::class, 'docente_grupo')
|
||||
->withPivot('materia_id');
|
||||
}
|
||||
|
||||
// Relación con Material
|
||||
public function materias(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Material::class, 'docente_grupo')
|
||||
->withPivot('grupo_id');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,9 +15,14 @@ class Grupo extends Model
|
||||
return $this->belongsToMany(Alumno::class);
|
||||
}
|
||||
|
||||
public function plan()
|
||||
{
|
||||
return $this->belongsTo(Plan::class);
|
||||
}
|
||||
public function docentes(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Docente::class, 'docente_grupo')
|
||||
->withPivot('materia_id');
|
||||
}
|
||||
|
||||
public function plan()
|
||||
{
|
||||
return $this->belongsTo(Plan::class);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Materia extends Model
|
||||
{
|
||||
//
|
||||
protected $guarded = [];
|
||||
|
||||
public function plan() { return $this->belongsTo(Plan::class); }
|
||||
public function tareas() { return $this->hasMany(Tarea::class); }
|
||||
public function docentes() {
|
||||
return $this->belongsToMany(Docente::class, 'docente_grupo')
|
||||
->withPivot('grupo_id');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Models\Tarea;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
|
||||
class Material extends Model
|
||||
@@ -12,9 +12,15 @@ class Material extends Model
|
||||
|
||||
public $timestamps = false;
|
||||
|
||||
public function carreraMaterial() : BelongsToMany
|
||||
// Relación con Carrera
|
||||
public function carreraMaterial(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Carrera::class);
|
||||
}
|
||||
|
||||
// Tareas de esta materia
|
||||
public function tareas()
|
||||
{
|
||||
return $this->hasMany(Tarea::class);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
|
||||
class Material extends Model
|
||||
{
|
||||
protected $guarded = [];
|
||||
|
||||
public $timestamps = false;
|
||||
|
||||
// Relación con Carrera
|
||||
public function carreraMaterial(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Carrera::class);
|
||||
}
|
||||
}
|
||||
@@ -14,6 +14,8 @@ return new class extends Migration
|
||||
Schema::create('alumno_status', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->string('color');
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,13 @@ return new class extends Migration
|
||||
{
|
||||
Schema::create('materias', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->string('clave')->nullable();
|
||||
$table->unsignedBigInteger('plan_id'); // pertenece a un plan de estudios
|
||||
$table->integer('ciclo'); // en qué ciclo se imparte
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('plan_id')->references('id')->on('plans');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,8 @@ return new class extends Migration
|
||||
{
|
||||
Schema::create('docentes', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->timestamps();
|
||||
$table->unsignedBigInteger('usuario_registro');
|
||||
$table->unsignedBigInteger('status')->default('1');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('becas', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->string('description');
|
||||
$table->unsignedBigInteger('inscripcion')->default(0);
|
||||
$table->unsignedBigInteger('reinscripcion')->default(0);
|
||||
$table->unsignedBigInteger('seguro')->default(0);
|
||||
$table->unsignedBigInteger('colegiatura')->default(0);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('becas');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('docente_user', function (Blueprint $table) {
|
||||
$table->unsignedBigInteger('docente_id');
|
||||
$table->foreign('docente_id')->references('id')->on('docentes');
|
||||
$table->unsignedBigInteger('user_id');
|
||||
$table->foreign('user_id')->references('id')->on('users');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('docente_user');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('tareas', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('tareas');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('docente_grupo', function (Blueprint $table) {
|
||||
$table->unsignedBigInteger('docente_id');
|
||||
$table->unsignedBigInteger('grupo_id');
|
||||
$table->unsignedBigInteger('materia_id');
|
||||
|
||||
$table->foreign('docente_id')->references('id')->on('docentes');
|
||||
$table->foreign('grupo_id')->references('id')->on('grupos');
|
||||
$table->foreign('materia_id')->references('id')->on('materials');
|
||||
|
||||
$table->unique(['docente_id', 'grupo_id', 'materia_id']);
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('docente_grupo');
|
||||
}
|
||||
};
|
||||
@@ -11,27 +11,33 @@ class AlumnoStatusSeeder extends Seeder
|
||||
public function run(): void
|
||||
{
|
||||
DB::table('alumno_status')->insert([
|
||||
'name' => 'prospecto'
|
||||
'name' => 'prospecto',
|
||||
'color' => 'primary'
|
||||
]);
|
||||
|
||||
DB::table('alumno_status')->insert([
|
||||
'name' => 'inscrito'
|
||||
'name' => 'inscrito',
|
||||
'color' => 'warning'
|
||||
]);
|
||||
|
||||
DB::table('alumno_status')->insert([
|
||||
'name' => 'alumno'
|
||||
'name' => 'alumno',
|
||||
'color' => 'success'
|
||||
]);
|
||||
|
||||
DB::table('alumno_status')->insert([
|
||||
'name' => 'baja temporal'
|
||||
'name' => 'baja temporal',
|
||||
'color' => 'secondary'
|
||||
]);
|
||||
|
||||
DB::table('alumno_status')->insert([
|
||||
'name' => 'baja definitiva'
|
||||
'name' => 'baja definitiva',
|
||||
'color' => 'danger'
|
||||
]);
|
||||
|
||||
DB::table('alumno_status')->insert([
|
||||
'name' => 'graduado'
|
||||
'name' => 'graduado',
|
||||
'color' => ''
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ class PlanSeeder extends Seeder
|
||||
'duracion'=>6,
|
||||
'duration_id'=>1,
|
||||
'nivel'=>1,
|
||||
'carrera'=>2
|
||||
'carrera'=>1
|
||||
]);
|
||||
$plan1->planesPlantel()->sync([1,2,3]);
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ class PlaneSeeder extends Seeder
|
||||
'status' => 1
|
||||
]);
|
||||
$plan1->planPlantel()->sync([1,2,3]);
|
||||
$plan1->nivelPlane()->sync([1]);
|
||||
|
||||
$plan2=Plane::create([
|
||||
'name' => 'LICENCIATURA',
|
||||
@@ -23,6 +24,8 @@ class PlaneSeeder extends Seeder
|
||||
]);
|
||||
|
||||
$plan2->planPlantel()->sync([1,2,3]);
|
||||
$plan2->nivelPlane()->sync([2]);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -136,9 +136,9 @@ class RoleSeeder extends Seeder
|
||||
Permission::create(['name'=>'docente.edit','description'=>'Editar docentes'])->syncRoles([$role1,$role6]);
|
||||
Permission::create(['name'=>'docente.destroy','description'=>'Eliminar docentes'])->syncRoles([$role1,$role6]);
|
||||
|
||||
Permission::create(['name'=>'documentoTipo.index','description'=>'Ver documentos por nivel'])->syncRoles([$role1]);
|
||||
Permission::create(['name'=>'documentoTipo.create','description'=>'Crear documentos por nivel'])->syncRoles([$role1]);
|
||||
Permission::create(['name'=>'documentoTipo.edit','description'=>'Editar documentos por nivel'])->syncRoles([$role1]);
|
||||
Permission::create(['name'=>'documentoTipo.destroy','description'=>'Eliminar documentos por nivel'])->syncRoles([$role1]);
|
||||
Permission::create(['name'=>'documentoTipo.index','description'=>'Ver documentación'])->syncRoles([$role1]);
|
||||
Permission::create(['name'=>'documentoTipo.create','description'=>'Crear documentación'])->syncRoles([$role1]);
|
||||
Permission::create(['name'=>'documentoTipo.edit','description'=>'Editar documentación'])->syncRoles([$role1]);
|
||||
Permission::create(['name'=>'documentoTipo.destroy','description'=>'Eliminar documentación'])->syncRoles([$role1]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ class UserSeeder extends Seeder
|
||||
'medio' => 1,
|
||||
'usuario_registro' => 1,
|
||||
'plane_id' => 0,
|
||||
'status' => 2
|
||||
'status' => 1
|
||||
]);
|
||||
|
||||
$alumno->alumnos()->sync($usr->id);
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
@extends('layouts.landing')
|
||||
|
||||
@section('title',"Crear")
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="container-fluid">
|
||||
<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">Crear Docente</h6>
|
||||
<a href="{{route('docente.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('warn'))
|
||||
<div class="alert alert-danger">
|
||||
<strong>{{session('warn')}}</strong>
|
||||
</div>
|
||||
@endif
|
||||
<form action="{{route('docente.store')}}" method="POST">
|
||||
@csrf
|
||||
<div class="mb-3">
|
||||
<label class="small mb-1">Nombre</label>
|
||||
<input class="form-control" name="name" value="{{ old('name') }}">
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="small mb-1">Apellido Paterno</label>
|
||||
<input class="form-control" name="apellidoPaterno" value="{{ old('apellidoPaterno') }}">
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="small mb-1">Apellido Materno</label>
|
||||
<input class="form-control" name="apellidoMaterno" value="{{ old('apellidoMaterno') }}">
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="small mb-1">Correo</label>
|
||||
<input class="form-control" name="email" value="{{ old('email') }}">
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="small mb-1">Telefono</label>
|
||||
<input class="form-control" name="telefono" type="number" value="{{ old('telefono') }}">
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="small mb-1">Dirección</label>
|
||||
<input class="form-control" name="direccion" value="{{ old('direccion') }}">
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="plantel">Seleccionar campus</label>
|
||||
<select class="form-control" name="plantel" value="{{ old('plantel') }}">
|
||||
<option value="0">Seleccionar..</option>
|
||||
|
||||
@foreach ($plantels as $plantel)
|
||||
<option value="{{ $plantel->id }}">{{$plantel->name}}</option>
|
||||
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="rol">Seleccionar rol</label>
|
||||
<select class="form-control" name="rol" value="{{ old('rol') }}">
|
||||
<option value="0">Seleccionar..</option>
|
||||
|
||||
@foreach ($roles as $role)
|
||||
<option value="{{ $role->id }}">{{$role->name}}</option>
|
||||
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="status">Seleccionar status</label>
|
||||
<select class="form-control" name="status" value="{{ old('status') }}">
|
||||
<option value="1">Activo</option>
|
||||
<option value="0">Inactivo</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<input class="btn btn-primary" type="submit" value="Crear">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
@@ -0,0 +1,93 @@
|
||||
@extends('layouts.landing')
|
||||
|
||||
@section('title',"Edit")
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="container-fluid">
|
||||
<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 Docente</h6>
|
||||
<a href="{{route('docente.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('docente.update',$docente->id)}}" method="POST">
|
||||
@method('PUT')
|
||||
@csrf
|
||||
<div class="mb-3">
|
||||
<label class="small mb-1">Nombre</label>
|
||||
<input class="form-control" name="name" value="{{$usr->name}}">
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="small mb-1">Apellido Paterno</label>
|
||||
<input class="form-control" name="apellidoPaterno" value="{{$usr->apellidoPaterno}}">
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="small mb-1">Apellido Materno</label>
|
||||
<input class="form-control" name="apellidoMaterno" value="{{$usr->apellidoMaterno}}">
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="small mb-1">Correo</label>
|
||||
<input class="form-control" name="email" value="{{$usr->email}}">
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="small mb-1">Telefono</label>
|
||||
<input class="form-control" name="telefono" type="number" value="{{$usr->telefono}}">
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="small mb-1">Dirección</label>
|
||||
<input class="form-control" name="direccion" value="{{$usr->direccion}}">
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="plantel">Seleccionar campus</label>
|
||||
<select class="form-control" name="plantel">
|
||||
<option value="0">Seleccionar..</option>
|
||||
|
||||
@foreach ($plantels as $plantel)
|
||||
<option value="{{ $plantel->id }}" {{ $usr->existe($plantel->id) ? 'selected' : '' }} >{{$plantel->name}}</option>
|
||||
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="rol">Seleccionar rol</label>
|
||||
<select class="form-control" name="rol">
|
||||
<option value="0">Seleccionar..</option>
|
||||
|
||||
@foreach ($roles as $role)
|
||||
<option value="{{ $role->id }}" {{ $usr->roles->contains('id', $role->id) ? 'selected' : '' }}>{{$role->name}}</option>
|
||||
@endforeach
|
||||
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="status">Seleccionar status</label>
|
||||
<select class="form-control" name="status" id="status" >
|
||||
<option value="1" {{ $usr->status=='1' ? 'selected' : '' }}>Activo</option>
|
||||
<option value="0" {{ $usr->status=='0' ? 'selected' : '' }}>Inactivo</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<input class="btn btn-primary" type="submit" value="Update">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
@@ -0,0 +1,88 @@
|
||||
@extends('layouts.landing')
|
||||
|
||||
@section('head')
|
||||
@include('layouts._partials.tablaStyle')
|
||||
@endsection
|
||||
@section('title',"Inicio")
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="container-fluid">
|
||||
<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">docente</h6>
|
||||
@can('docente.create')
|
||||
<a href="{{route('docente.create')}}" class="d-sm-inline-block btn btn-sm btn-primary shadow-sm"><i class="fas fa-download fa-sm text-white-50"></i> Crear docente</a>
|
||||
@endcan
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<div class="container-fluid">
|
||||
|
||||
<table id="tcont" class="table table-striped table-bordered nowrap table-hover" style="width:100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<th>Nombre</th>
|
||||
<th>Campus</th>
|
||||
<th>Rol</th>
|
||||
<th>Correo</th>
|
||||
<th>Opciones</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@forelse ($docentes as $docente)
|
||||
@php $usr = $docente->docentes->first() @endphp
|
||||
<tr>
|
||||
<td>{{ $docente->id }}</td>
|
||||
<td>{{ $usr?->name }} {{ $usr?->apellidoPaterno }}</td>
|
||||
<td>
|
||||
@foreach($usr?->plantelUsuarios ?? [] as $plantel)
|
||||
<span class="badge bg-primary text-white">{{ $plantel->name }}</span>
|
||||
@endforeach
|
||||
</td>
|
||||
<td>
|
||||
@foreach($usr?->roles ?? [] as $rol)
|
||||
<span class="badge bg-primary text-white">{{ $rol->name }}</span>
|
||||
@endforeach
|
||||
</td>
|
||||
<td>{{ $usr?->email }}</td>
|
||||
<td class="row mx-auto">
|
||||
@can('docente.destroy')
|
||||
<div class="col-sm-6 col-md-6">
|
||||
<a href="{{ route('docente.edit', $docente->id) }}" class="btn btn-primary">Edit</a>
|
||||
</div>
|
||||
@endcan
|
||||
|
||||
@can('docente.destroy')
|
||||
<div class="col-sm-6 col-md-6">
|
||||
<form class="delete-form" action="{{route('docente.destroy',$docente->id)}}" method="POST">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<input type="submit" value="DELETE" class="btn btn-danger">
|
||||
</form>
|
||||
</div>
|
||||
@endcan
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<p>Sin docentes.</p>
|
||||
@endforelse
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
||||
@section('scripts')
|
||||
@include('layouts._partials.tablaScript')
|
||||
@include('layouts._partials.delete')
|
||||
@endsection
|
||||
@@ -9,7 +9,7 @@
|
||||
<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">Crear documentación</h6>
|
||||
<a href="{{route('documentotipo.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>
|
||||
<a href="{{route('documentoTipo.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>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<form method="POST" action="{{ route('documentotipo.store') }}">
|
||||
<form method="POST" action="{{ route('documentoTipo.store') }}">
|
||||
@csrf
|
||||
|
||||
{{-- NOMBRE --}}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<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 documentación</h6>
|
||||
<a href="{{route('documentotipo.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>
|
||||
<a href="{{route('documentoTipo.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>
|
||||
|
||||
@@ -19,19 +19,19 @@
|
||||
<strong>{{session('info')}}</strong>
|
||||
</div>
|
||||
@endif
|
||||
<form action="{{route('documentotipo.update',$documentotipo->id)}}" method="POST">
|
||||
<form action="{{route('documentoTipo.update',$documentoTipo->id)}}" method="POST">
|
||||
@method('PUT')
|
||||
@csrf
|
||||
{{-- NOMBRE --}}
|
||||
<div class="mb-3">
|
||||
<label>Nombre</label>
|
||||
<input type="text" name="name" class="form-control" value="{{$documentotipo->name}}" required>
|
||||
<input type="text" name="name" class="form-control" value="{{$documentoTipo->name}}" required>
|
||||
</div>
|
||||
|
||||
{{-- SLUG --}}
|
||||
<div class="mb-3">
|
||||
<label>Slug</label>
|
||||
<input type="text" name="slug" class="form-control" value="{{$documentotipo->slug}}" required>
|
||||
<input type="text" name="slug" class="form-control" value="{{$documentoTipo->slug}}" required>
|
||||
</div>
|
||||
|
||||
{{-- EXTENSIONES --}}
|
||||
@@ -40,21 +40,21 @@
|
||||
|
||||
<div class="form-check">
|
||||
<label>
|
||||
<input type="checkbox" name="extensiones[]" value="pdf" class="form-check-input cb" {{ in_array('pdf', $documentotipo->extensiones ?? []) ? 'checked' : '' }}>
|
||||
<input type="checkbox" name="extensiones[]" value="pdf" class="form-check-input cb" {{ in_array('pdf', $documentoTipo->extensiones ?? []) ? 'checked' : '' }}>
|
||||
PDF
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="form-check">
|
||||
<label>
|
||||
<input type="checkbox" name="extensiones[]" value="jpg" class="form-check-input cb" {{ in_array('jpg', $documentotipo->extensiones ?? []) ? 'checked' : '' }}>
|
||||
<input type="checkbox" name="extensiones[]" value="jpg" class="form-check-input cb" {{ in_array('jpg', $documentoTipo->extensiones ?? []) ? 'checked' : '' }}>
|
||||
JPG
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="form-check">
|
||||
<label>
|
||||
<input type="checkbox" name="extensiones[]" value="png" class="form-check-input cb" {{ in_array('png', $documentotipo->extensiones ?? []) ? 'checked' : '' }}>
|
||||
<input type="checkbox" name="extensiones[]" value="png" class="form-check-input cb" {{ in_array('png', $documentoTipo->extensiones ?? []) ? 'checked' : '' }}>
|
||||
PNG
|
||||
</label>
|
||||
</div>
|
||||
@@ -70,7 +70,7 @@
|
||||
<input type="checkbox" class="form-check-input cb"
|
||||
id="n-{{ $nivel->id }}"
|
||||
name="nivels[]" value="{{ $nivel->id }}"
|
||||
{{ $documentotipo->niveles->contains($nivel->id) ? 'checked' : '' }}
|
||||
{{ $documentoTipo->niveles->contains($nivel->id) ? 'checked' : '' }}
|
||||
>
|
||||
<label class="form-check-label" for="n-{{ $nivel->id }}">
|
||||
{{ $nivel->name }}
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<div class="d-sm-flex align-items-center justify-content-between">
|
||||
<h6 class="m-0 font-weight-bold text-primary">Documentación</h6>
|
||||
@can('documentoTipo.create')
|
||||
<a href="{{route('documentotipo.create')}}" class="d-sm-inline-block btn btn-sm btn-primary shadow-sm"><i class="fas fa-download fa-sm text-white-50"></i> Crear documentación</a>
|
||||
<a href="{{route('documentoTipo.create')}}" class="d-sm-inline-block btn btn-sm btn-primary shadow-sm"><i class="fas fa-download fa-sm text-white-50"></i> Crear documentación</a>
|
||||
@endcan
|
||||
</div>
|
||||
</div>
|
||||
@@ -29,18 +29,18 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@forelse ($documentotipos as $row)
|
||||
@forelse ($documentoTipos as $row)
|
||||
<tr style="width:100%">
|
||||
<td>{{$row->id}}</td>
|
||||
<td><a href="{{route('documentotipo.show',$row->id)}}">{{$row->name}}</a></td>
|
||||
<td><a href="{{route('documentoTipo.show',$row->id)}}">{{$row->name}}</a></td>
|
||||
<td class="row mx-auto">
|
||||
@can('documentoTipo.edit')
|
||||
<div class="col-sm-6 col-md-6"><a class="btn btn-primary" href="{{route('documentotipo.edit',$row->id)}}">Edit</a></div>
|
||||
<div class="col-sm-6 col-md-6"><a class="btn btn-primary" href="{{route('documentoTipo.edit',$row->id)}}">Edit</a></div>
|
||||
@endcan
|
||||
|
||||
@can('documentoTipo.destroy')
|
||||
<div class="col-sm-6 col-md-6">
|
||||
<form class="delete-form" action="{{route('documentotipo.destroy',$row->id)}}" method="POST">
|
||||
<form class="delete-form" action="{{route('documentoTipo.destroy',$row->id)}}" method="POST">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<input type="submit" value="DELETE" class="btn btn-danger">
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
{{ __('You may accept this invitation by clicking the button below:') }}
|
||||
@endif
|
||||
|
||||
|
||||
@component('mail::button', ['url' => $acceptUrl])
|
||||
{{ __('Accept Invitation') }}
|
||||
@endcomponent
|
||||
|
||||
@@ -5,44 +5,47 @@
|
||||
@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>
|
||||
<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>
|
||||
@endfor
|
||||
@@ -50,28 +53,32 @@
|
||||
</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>
|
||||
@@ -82,28 +89,42 @@
|
||||
</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>
|
||||
<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>
|
||||
<livewire:grupo-docente :grupo="$grupo"/>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
{{-- 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>
|
||||
|
||||
<div class="card-body">
|
||||
<div class="container-fluid">
|
||||
|
||||
<table id="tcont" class="table table-striped table-bordered nowrap table-hover" style="width:100%;">
|
||||
<table id="tcont2" class="table table-striped table-bordered nowrap table-hover" style="width:100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
@@ -113,35 +134,34 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
@forelse ($grupo->alumnos as $alumno)
|
||||
<tr style="width:100%">
|
||||
<tr>
|
||||
<td>{{$alumno->id}}</td>
|
||||
<td>{{$alumno->usuario->first()?->name}} {{$alumno->usuario->first()?->apellidoPaterno}} {{$alumno->usuario->first()?->apellidoMaterno}}</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">
|
||||
<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>
|
||||
<i class="fa-solid fa-circle-xmark fa-xl"
|
||||
style="color:#e66565;"></i>
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
@endcan
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<p>Sin alumnos.</p>
|
||||
<tr><td colspan="3">Sin alumnos.</td></tr>
|
||||
@endforelse
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<livewire:grupo-alumno :grupo="$grupo"/>
|
||||
@@ -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
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
@endcan
|
||||
|
||||
@can('documentoTipo.index')
|
||||
<a class="collapse-item" href="{{ route('documentotipo.index') }}" style="color:#85888e">Documentación</a>
|
||||
<a class="collapse-item" href="{{ route('documentoTipo.index') }}" style="color:#85888e">Documentación</a>
|
||||
@endcan
|
||||
|
||||
@can('permission.index')
|
||||
@@ -166,9 +166,9 @@
|
||||
<div class="bg-white py-2 collapse-inner rounded">
|
||||
<h6 class="collapse-header">Herramientas</h6>
|
||||
|
||||
{{-- @can('docente.index')
|
||||
@can('docente.index')
|
||||
<a class="collapse-item" href="{{ route('docente.index') }}" style="color:#85888e">Docentes</a>
|
||||
@endcan --}}
|
||||
@endcan
|
||||
|
||||
@can('grupo.index')
|
||||
<a class="collapse-item" href="{{ route('grupo.index') }}" style="color:#85888e">Grupos</a>
|
||||
|
||||
@@ -0,0 +1,114 @@
|
||||
<div>
|
||||
{{-- Modal --}}
|
||||
<div wire:ignore.self class="modal fade" id="modalDocente" tabindex="-1" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">Agregar Docente al Grupo</h5>
|
||||
<button type="button" class="close" data-dismiss="modal">
|
||||
<span>×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
{{-- Docente --}}
|
||||
<div class="mb-3">
|
||||
<label>Docente</label>
|
||||
<select class="form-control" wire:model="docente_id">
|
||||
<option value="">Seleccionar docente...</option>
|
||||
@foreach ($docentes as $docente)
|
||||
@php $usr = $docente->docentes->first() @endphp
|
||||
<option value="{{ $docente->id }}">
|
||||
{{ $usr?->name }}
|
||||
{{ $usr?->apellidoPaterno }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@error('docente_id')
|
||||
<span class="text-danger small">{{ $message }}</span>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
{{-- Materia --}}
|
||||
<div class="mb-3">
|
||||
<label>Materia</label>
|
||||
<select class="form-control" wire:model="materia_id">
|
||||
<option value="">Seleccionar materia...</option>
|
||||
@foreach ($materiasSelect as $materia)
|
||||
<option value="{{ $materia->id }}">
|
||||
ciclo {{ $materia->ciclo }} - {{ $materia->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@error('materia_id')
|
||||
<span class="text-danger small">{{ $message }}</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancelar</button>
|
||||
<button wire:click="guardar" class="btn btn-success">Guardar</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Tabla docentes asignados --}}
|
||||
<table id="tcont" class="table table-striped table-bordered table-hover" style="width:100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<th>Materia</th>
|
||||
<th>Ciclo</th>
|
||||
<th>Docente asignado</th>
|
||||
<th>Opciones</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@forelse ($materias as $materia)
|
||||
@php
|
||||
$docenteAsignado = $grupo->docentes->firstWhere('pivot.materia_id', $materia->id);
|
||||
$usr = $docenteAsignado?->docentes->first();
|
||||
@endphp
|
||||
<tr>
|
||||
<td>{{ $materia->id }}</td>
|
||||
<td>{{ $materia->name }}</td>
|
||||
<td>{{ $materia->ciclo }}</td>
|
||||
<td>
|
||||
@if($usr)
|
||||
{{ $usr->name }} {{ $usr->apellidoPaterno }}
|
||||
@else
|
||||
<span class="badge badge-secondary">Sin docente</span>
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if($docenteAsignado)
|
||||
@can('grupo.destroy')
|
||||
<button wire:click="eliminar({{ $docenteAsignado->id }})"
|
||||
style="border:none; background:none;">
|
||||
<i class="fa-solid fa-circle-xmark fa-xl" style="color:#e66565;"></i>
|
||||
</button>
|
||||
@endcan
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr><td colspan="5">Sin materias en este plan.</td></tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@push('scripts')
|
||||
<script>
|
||||
document.addEventListener('livewire:init', () => {
|
||||
Livewire.on('open-modal-docente', () => {
|
||||
$('#modalDocente').modal('show');
|
||||
});
|
||||
Livewire.on('close-modal-docente', () => {
|
||||
$('#modalDocente').modal('hide');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
@endpush
|
||||
@@ -1,117 +1,248 @@
|
||||
@extends('layouts.landing')
|
||||
|
||||
@section('title', 'Mi perfil')
|
||||
@section('title',"Editar")
|
||||
|
||||
@section('content')
|
||||
|
||||
<style>
|
||||
.custom-file-upload {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.custom-file-upload span {
|
||||
font-size: 13px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<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">Mi perfil</h6>
|
||||
|
||||
@hasrole('Alumno')
|
||||
<button onclick="Livewire.dispatch('documentos')"
|
||||
class="btn btn-sm btn-success shadow-sm">
|
||||
<i class="fas fa-file fa-sm text-white-50"></i> Expediente
|
||||
</button>
|
||||
@endrole
|
||||
<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">
|
||||
|
||||
@hasrole('Alumno')
|
||||
|
||||
<div>
|
||||
<h5>Expediente</h5>
|
||||
|
||||
|
||||
@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>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->plan_id ? 'selected' : '' }}>
|
||||
{{ $plan->carreraRel->name }}
|
||||
({{ $plan->name }}-{{ $plan->rvoe }})
|
||||
</option>
|
||||
@endforeach
|
||||
</optgroup>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<livewire:documentos/>
|
||||
|
||||
@endrole
|
||||
|
||||
@livewire('profile.update-profile-information-form')
|
||||
|
||||
<hr>
|
||||
|
||||
@livewire('profile.update-password-form')
|
||||
|
||||
<hr>
|
||||
|
||||
@livewire('profile.logout-other-browser-sessions-form')
|
||||
|
||||
<div class="mb-3">
|
||||
<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>
|
||||
@endfor
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<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>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<!-- 🔥 MODAL VISOR -->
|
||||
<div class="mb-3">
|
||||
<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>
|
||||
@endforeach
|
||||
</select>
|
||||
</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>
|
||||
<div class="mb-3">
|
||||
<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">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- 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">Materias</h6>
|
||||
@can('grupo.create')
|
||||
<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="modal-body">
|
||||
<iframe id="visorFrame" width="100%" height="600px" style="border:none;"></iframe>
|
||||
<div class="card-body">
|
||||
@if (session('infogrupo'))
|
||||
<div class="alert alert-success">
|
||||
<strong>{{session('infogrupo')}}</strong>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="container-fluid">
|
||||
<table id="tcont" class="table table-striped table-bordered nowrap table-hover" style="width:100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<th>Ciclo</th>
|
||||
<th>Nombre de la materia</th>
|
||||
<th>Docente</th>
|
||||
<th>Docente asignado</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@forelse ($grupo->plan->carreraRel->carreraMaterial as $material)
|
||||
@php
|
||||
$docenteAsignado = $grupo->docentes->firstWhere('pivot.materia_id', $material->id);
|
||||
$usr = $docenteAsignado?->docentes->first();
|
||||
@endphp
|
||||
<tr>
|
||||
<td>{{ $material->id }}</td>
|
||||
<td>{{ $material->ciclo }}</td>
|
||||
<td>{{ $material->name }}</td>
|
||||
<td>{{ $usr?->name }} {{ $usr?->apellidoPaterno ?? 'Sin docente' }}</td>
|
||||
<td>
|
||||
@if($docenteAsignado)
|
||||
@can('grupo.destroy')
|
||||
<form class="delete-form"
|
||||
action="{{route('grupo.destroy',$grupo->id)}}"
|
||||
method="POST">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<input class="d-none" name="docente" value="{{$docenteAsignado->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
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr><td colspan="5">Sin materias en este plan.</td></tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<livewire:grupo-docente :grupo="$grupo"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- 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>
|
||||
|
||||
<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>
|
||||
<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>
|
||||
@empty
|
||||
<tr><td colspan="3">Sin alumnos.</td></tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<livewire:grupo-alumno :grupo="$grupo"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
||||
@section('scripts')
|
||||
@include('layouts._partials.tablaScript')
|
||||
@include('layouts._partials.delete')
|
||||
|
||||
<script>
|
||||
document.addEventListener('livewire:init', () => {
|
||||
Livewire.on('open-documentos-modal', () => {
|
||||
// Modal agregar alumno
|
||||
Livewire.on('open-grupo-modal', () => {
|
||||
$('#exampleModal').modal('show');
|
||||
});
|
||||
});
|
||||
Livewire.on('close-modal', () => {
|
||||
$('#exampleModal').modal('hide');
|
||||
});
|
||||
|
||||
// 🔥 abrir documento en modal
|
||||
function verDocumento(url) {
|
||||
document.getElementById('visorFrame').src = url + '?t=' + new Date().getTime();
|
||||
|
||||
var modal = new bootstrap.Modal(document.getElementById('visorModal'));
|
||||
modal.show();
|
||||
}
|
||||
|
||||
// 🔥 limpiar iframe al cerrar
|
||||
document.getElementById('visorModal').addEventListener('hidden.bs.modal', function () {
|
||||
document.getElementById('visorFrame').src = '';
|
||||
// Modal agregar docente
|
||||
Livewire.on('open-modal-docente', () => {
|
||||
$('#modalDocente').modal('show');
|
||||
});
|
||||
Livewire.on('close-modal-docente', () => {
|
||||
$('#modalDocente').modal('hide');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
function updateFileName(input, targetId) {
|
||||
const fileName = input.files[0]?.name || 'Ningún archivo seleccionado';
|
||||
document.getElementById(targetId).textContent = fileName;
|
||||
}
|
||||
</script>
|
||||
|
||||
@endsection
|
||||
|
||||
+9
-9
@@ -9,6 +9,7 @@ use App\Http\Controllers\CarreraController;
|
||||
use App\Http\Controllers\ChatController;
|
||||
use App\Http\Controllers\CodeController;
|
||||
use App\Http\Controllers\ConceptoController;
|
||||
use App\Http\Controllers\DocenteController;
|
||||
use App\Http\Controllers\DocumentoController;
|
||||
use App\Http\Controllers\DocumentoTipoController;
|
||||
use App\Http\Controllers\DurationController;
|
||||
@@ -25,13 +26,11 @@ use App\Http\Controllers\PlanController;
|
||||
use App\Http\Controllers\PlaneController;
|
||||
use App\Http\Controllers\PlantelController;
|
||||
use App\Http\Controllers\RoleController;
|
||||
use App\Http\Controllers\StripeController;
|
||||
use App\Http\Controllers\StripeWebhookController;
|
||||
use App\Http\Controllers\TurnoController;
|
||||
use App\Http\Controllers\UnsubscribeController;
|
||||
use App\Http\Controllers\UserController;
|
||||
use App\Models\Documento;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Laravel\Jetstream\Http\Controllers\Livewire\UserProfileController;
|
||||
|
||||
@@ -53,15 +52,16 @@ Route::middleware(['auth:sanctum',config('jetstream.auth_session'),'verified',
|
||||
Route::resource('/carrera',CarreraController::class);
|
||||
Route::resource('/code',CodeController::class);
|
||||
Route::resource('/concepto',ConceptoController::class);
|
||||
Route::get('/chat/start/{user}',[ChatController::class, 'start']);
|
||||
Route::get('/chat/{conversation}',[ChatController::class, 'show']);
|
||||
Route::post('/chat/send',[ChatController::class,'send']);
|
||||
Route::post('/chat/typing', function (Request $request) {broadcast(new \App\Events\UserTyping($request->conversation_id,auth()->user()))->toOthers();return response()->json();});
|
||||
Route::post('/chat/stop-typing', function (Request $request) {broadcast(new \App\Events\UserStoppedTyping($request->conversation_id,auth()->user()))->toOthers();return response()->json();});
|
||||
// Route::get('/chat/start/{user}',[ChatController::class, 'start']);
|
||||
// Route::get('/chat/{conversation}',[ChatController::class, 'show']);
|
||||
// Route::post('/chat/send',[ChatController::class,'send']);
|
||||
// Route::post('/chat/typing', function (Request $request) {broadcast(new \App\Events\UserTyping($request->conversation_id,auth()->user()))->toOthers();return response()->json();});
|
||||
// Route::post('/chat/stop-typing', function (Request $request) {broadcast(new \App\Events\UserStoppedTyping($request->conversation_id,auth()->user()))->toOthers();return response()->json();});
|
||||
Route::resource('/docente',DocenteController::class);
|
||||
Route::resource('/documento',DocumentoController::class);
|
||||
Route::get('/documento/ver/{id}', function ($id) { $doc = Documento::findOrFail($id); $alumno = auth()->user()->alumnos()->first(); if (!$alumno || $doc->alumno_id !== $alumno->id) { abort(403); } return response()->file( storage_path('app/public/'.$doc->archivo) ); });
|
||||
Route::get('/documento/ver/{id}', [DocumentoController::class, 'ver'])->name('documento.ver');
|
||||
Route::resource('/documentotipo',DocumentoTipoController::class);
|
||||
Route::resource('/documentoTipo',DocumentoTipoController::class);
|
||||
Route::resource('/duration',DurationController::class);
|
||||
Route::resource('/grupo', GrupoController::class);
|
||||
Route::get('/horario', [HorarioController::class, 'index'])->name('horario.index');
|
||||
@@ -87,7 +87,7 @@ Route::middleware(['auth:sanctum',config('jetstream.auth_session'),'verified',
|
||||
Route::resource('/plantel',PlantelController::class);
|
||||
Route::get('/registros', [CodeController::class,'registros' ])->name('registros');
|
||||
Route::resource('/role',RoleController::class);
|
||||
Route::get('/test-chat', function () { broadcast(new MessageSent('Hola realtime 🚀')); return 'Mensaje enviado';});
|
||||
// Route::get('/test-chat', function () { broadcast(new MessageSent('Hola realtime ')); return 'Mensaje enviado';});
|
||||
Route::resource('/turno',TurnoController::class);
|
||||
Route::resource('/user',UserController::class);
|
||||
Route::resource('/mail',MailController::class);
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Facades\Livewire\Features\SupportFileUploads;
|
||||
|
||||
use Illuminate\Support\Facades\Facade;
|
||||
|
||||
/**
|
||||
* @mixin \Livewire\Features\SupportFileUploads\GenerateSignedUploadUrl
|
||||
*/
|
||||
class GenerateSignedUploadUrl extends Facade
|
||||
{
|
||||
/**
|
||||
* Get the registered name of the component.
|
||||
*/
|
||||
protected static function getFacadeAccessor(): string
|
||||
{
|
||||
return 'Livewire\Features\SupportFileUploads\GenerateSignedUploadUrl';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user