Skip to content
This repository has been archived by the owner on Apr 14, 2023. It is now read-only.

Commit

Permalink
borrar pariente, ajustes en persona
Browse files Browse the repository at this point in the history
  • Loading branch information
rats4final committed Dec 11, 2022
1 parent 8754fab commit a16e561
Show file tree
Hide file tree
Showing 10 changed files with 2 additions and 46 deletions.
6 changes: 2 additions & 4 deletions app/Http/Controllers/PersonaController.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@ public function index()
*/
public function create()
{
$personas = Persona::get();
$tipos_sangre = TipoSangre::get();
return view('admin.Persona.create', compact('tipos_sangre','personas'));
return view('admin.Persona.create', compact('tipos_sangre'));
}

/**
Expand Down Expand Up @@ -66,9 +65,8 @@ public function show(Persona $persona)
*/
public function edit(Persona $persona)
{
$personas = Persona::get();
$tipos_sangre = TipoSangre::get();
return view('admin.Persona.edit', compact('tipos_sangre','personas','persona'));
return view('admin.Persona.edit', compact('tipos_sangre','persona'));
}

/**
Expand Down
1 change: 0 additions & 1 deletion app/Http/Requests/StorePersonaRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ public function rules()
'num_seguro'=> 'nullable',
'donante'=> 'required',
'id_tipo_sangre'=> 'required',
'id_pariente'=>'required'
];
}
}
4 changes: 0 additions & 4 deletions app/Models/Persona.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ public function tipo_sangre(){
return $this->belongsTo(TipoSangre::class,'id_tipo_sangre','id_tipo_sangre');
}

public function pariente(){
return $this->belongsTo(Persona::class,'id_pariente','id_persona');
}

public function has_especialidad()
{
return $this->hasMany(Usario_has_especialidad::class,'id_medico','id_persona');
Expand Down
2 changes: 0 additions & 2 deletions database/migrations/2022_09_22_152240_create_personas.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ public function up()
$table->date('fecha_nac');
$table->Integer('id_tipo_sangre')->unsigned();
$table->foreign('id_tipo_sangre')->references('id_tipo_sangre')->on('tipos_sangre');
$table->integer('id_pariente')->unsigned()->nullable();
$table->foreign('id_pariente')->references('id_persona')->on('personas');
$table->timestamps();
});
}
Expand Down
6 changes: 0 additions & 6 deletions resources/views/admin/Persona/create.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,6 @@
<option value="{{ $tipo_sangre->id_tipo_sangre }}">{{$tipo_sangre->nombre_tipo_sangre}}</option>
@endforeach
</select> <br>
<label>Pariente Donante</label></br>
<select class="form-control" name="id_pariente">
@foreach($personas as $persona)
<option value="{{ $persona->id_persona }}">{{$persona->nombre_per}}</option>
@endforeach
</select> <br>
<label>Es donante</label></br>
<select name="donante" class="form-control">
<option value="1">Si</option>
Expand Down
10 changes: 0 additions & 10 deletions resources/views/admin/Persona/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,6 @@
>{{$tipo_sangre->nombre_tipo_sangre}}</option>
@endforeach
</select> <br>
<label>Pariente Donante</label></br>
<select class="form-control" name="id_pariente">
@foreach($personas as $persona)
<option value="{{ $persona->id_pariente }}"
@if ($persona->id_pariente == $persona->id_persona)
selected
@endif
>{{$persona->nombre_per}}</option>
@endforeach
</select> <br>
<label>Es donante</label></br>
<select name="donante" class="form-control">
@if ($persona->donante==1)
Expand Down
2 changes: 0 additions & 2 deletions resources/views/admin/Persona/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
<th># Seguro</th>
<th>Es donante</th>
<th>Tipo Sangre</th>
<th>Pariente</th>
<th>Acciones</th>
</tr>
</thead>
Expand Down Expand Up @@ -62,7 +61,6 @@ class="bi bi-check-square-fill" viewBox="0 0 16 16">
@endif
</td>
<td>{{ $persona->tipo_sangre->nombre_tipo_sangre }}</td>
<td>{{ $persona->pariente->nombre_per }}</td>
<td>
<a href="{{ route('personas.show', $persona) }}"
title="View Student"><button class="btn btn-info btn-sm"><i
Expand Down
7 changes: 0 additions & 7 deletions resources/views/admin/user/create.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,6 @@
</select> <br>


<label>Pariente Donante</label></br>
<select class="form-control" required name="id_pariente">
@foreach($personas as $persona)
<option value="{{ $persona->id_persona }}">{{$persona->nombre_per}}</option>
@endforeach
</select> <br>


<label>Es donante</label></br>
<input type="text" name="donante" class="form-control" required></br>
Expand Down
2 changes: 0 additions & 2 deletions resources/views/admin/user/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
<th># Seguro</th>
<th>Es donante</th>
<th>Tipo Sangre</th>
<th>Pariente</th>
<th>Username</th>
<th>Correo</th>
<th>Acciones</th>
Expand All @@ -44,7 +43,6 @@
<td>{{ $usuario->persona->num_seguro }}</td>
<td>{{ $usuario->persona->donante }}</td>
<td>{{ $usuario->persona->tipo_sangre->nombre_tipo_sangre }}</td>
<td>{{ $usuario->persona->pariente->nombre_per }}</td>

<td>{{ $usuario->username }}</td>

Expand Down
8 changes: 0 additions & 8 deletions resources/views/auth/register.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,6 @@ class="absolute inset-0 bg-gradient-to-r from-blue-300 to-blue-600 shadow-lg tra
</div>
<div class="divide-y divide-gray-200">
<div class="py-8 text-base leading-6 space-y-4 text-gray-700 sm:text-lg sm:leading-7">
<div class="relative">
<input id="name" name="name" type="text"
class="peer placeholder-transparent h-10 w-full border-b-2 border-gray-300 text-gray-900 focus:outline-none focus:borer-rose-600"
placeholder="Nombre" />
<label for="name"
class="absolute left-0 -top-3.5 text-gray-600 text-sm peer-placeholder-shown:text-base peer-placeholder-shown:text-gray-440 peer-placeholder-shown:top-2 transition-all peer-focus:-top-3.5 peer-focus:text-gray-600 peer-focus:text-sm">Nombre
</label>
</div>
<div class="relative">
<input id="email" name="email" type="email"
class="peer placeholder-transparent h-10 w-full border-b-2 border-gray-300 text-gray-900 focus:outline-none focus:borer-rose-600"
Expand Down

0 comments on commit a16e561

Please sign in to comment.