From 556d6ff01f7e7b92dc33d7670d24db0ca0d4a864 Mon Sep 17 00:00:00 2001 From: Marc15975 <91290441+Marc15975@users.noreply.github.com> Date: Thu, 10 Nov 2022 01:18:52 -0400 Subject: [PATCH] TengoHAMBRE --- app/Http/Controllers/HistorialController.php | 76 +++++++++++++++++++ app/Models/Historial.php | 15 ++++ .../views/admin/Historial/create.blade.php | 39 ++++++++++ .../views/admin/Historial/edit.blade.php | 32 ++++++++ .../views/admin/Historial/index.blade.php | 55 ++++++++++++++ .../views/admin/Historial/show.blade.php | 18 +++++ routes/web.php | 4 +- 7 files changed, 238 insertions(+), 1 deletion(-) create mode 100644 app/Http/Controllers/HistorialController.php create mode 100644 app/Models/Historial.php create mode 100644 resources/views/admin/Historial/create.blade.php create mode 100644 resources/views/admin/Historial/edit.blade.php create mode 100644 resources/views/admin/Historial/index.blade.php create mode 100644 resources/views/admin/Historial/show.blade.php diff --git a/app/Http/Controllers/HistorialController.php b/app/Http/Controllers/HistorialController.php new file mode 100644 index 0000000..86d4677 --- /dev/null +++ b/app/Http/Controllers/HistorialController.php @@ -0,0 +1,76 @@ +except('_token'); + + Historial::create($Datos_Historia); + + return redirect('/Historial'); + } + + + public function show(Historial $Historial) + { + + // $Historia= Historial::find($Historial); + return View ('admin.Historial.show',compact('Historial')); + + } + + + public function edit($historial) + { + // + $Historia= Historial::find($historial); + return View ('admin.Historial.edit',compact('Historia')); + } + + + public function update(Request $request, $historial) + { + // + $input = $request->all(); + + $Historia = Historial::find($historial); + + $Historia->update($input); + + //Redirecionas para no bugear el jalar de datos con reddirect para recargar la vista totalmente + return redirect('/Historial'); + + } + + + public function destroy( $Historial) + { + // + Historial::destroy($Historial); + + // $Historial->delete(); + + return redirect('/Historial'); + } +} diff --git a/app/Models/Historial.php b/app/Models/Historial.php new file mode 100644 index 0000000..66aaa09 --- /dev/null +++ b/app/Models/Historial.php @@ -0,0 +1,15 @@ + + +
+
+
Registro de Historias
+
+ +
+ {!! csrf_field() !!} +
+
+
+
+
+
+ +
+
+ +
+
+ + + {{--
+ --}} + +
+
+ +
+
+
+ + diff --git a/resources/views/admin/Historial/edit.blade.php b/resources/views/admin/Historial/edit.blade.php new file mode 100644 index 0000000..75c1bf3 --- /dev/null +++ b/resources/views/admin/Historial/edit.blade.php @@ -0,0 +1,32 @@ + + +
+
Editar Sede
+
+ +
+ {!! csrf_field() !!} + @method("PATCH") + + +
+
+
+
+
+
+ +
+
+ +
+
+ + + +
+
+ +
+
+
diff --git a/resources/views/admin/Historial/index.blade.php b/resources/views/admin/Historial/index.blade.php new file mode 100644 index 0000000..27a5c6c --- /dev/null +++ b/resources/views/admin/Historial/index.blade.php @@ -0,0 +1,55 @@ + + +
+
+
+
+
+

Historias

+
+
+ + Nueva Historia + +
+
+
+ + + + + + + + + + + + @foreach ($Historias as $Historia) + + + + + + + + + + @endforeach + +
PersonaSedeMedicoFecha del HistorialDetalles de la Historia
{{ $Historia['id_persona'] }}{{ $Historia['id_sede'] }}{{ $Historia['id_medico'] }}{{ $Historia['fecha_historial'] }}{{ $Historia['detalles_historial'] }} + +
+ {{ method_field('DELETE') }} + {{ csrf_field() }} + +
+
+
+
+
+
+
+
+ +
diff --git a/resources/views/admin/Historial/show.blade.php b/resources/views/admin/Historial/show.blade.php new file mode 100644 index 0000000..27117f4 --- /dev/null +++ b/resources/views/admin/Historial/show.blade.php @@ -0,0 +1,18 @@ + +
+
Datos de la Historia
+
+ +
+
Nombre de la Persona: {{ $Historial->id_persona }}
+

Nombre de la Sede : {{ $Historial->id_sede }}

+

Nombre del Medico : {{ $Historial->id_medico }}

+

Fecha del Historial: {{ $Historial->fecha_historial }}

+

Detalles de la Historia: {{ $Historial->detalles_historial }}

+
+ + + +
+
+
diff --git a/routes/web.php b/routes/web.php index 55e1f20..93b0652 100644 --- a/routes/web.php +++ b/routes/web.php @@ -6,7 +6,7 @@ use App\Models\TipoPatologia; use Illuminate\Support\Facades\Route; use App\Http\Controllers\PatologiaController; - +use App\Http\Controllers\HistorialController; /* |-------------------------------------------------------------------------- | Web Routes @@ -41,3 +41,5 @@ Route::resource('TipoSangre', TipoSangreController::class); Route::resource('TipoPatologia', TipoPatologiaController::class); Route::resource('Patologia', PatologiaController::class); +Route::resource('Historial', HistorialController::class); +