/** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id) { // $breed = Breed::find($id); $listSpecies = Species::lists('species', 'id'); $species_id = $breed['species_id']; return view('breed.edit', ['breed' => $breed, 'listSpecies' => $listSpecies, 'species_id' => $species_id]); }
</div> </div> <div class="modal fade" id="alertType{{$alert->id}}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> <h4 class="modal-title" id="myModalLabel">{{$alert->title}}</h4> </div> <div class="modal-body text-justify" id="alertTypeBody{{$alert->id}}"> @foreach($alertsFound as $alertFound) <?php $pet = \Veterinaria\Pet::find($alertFound->pets_id); $breed = \Veterinaria\Breed::find($pet->breed_id); $client = \Veterinaria\Client::find($pet->client_id); $specie = \Veterinaria\Species::find($breed->species_id); $age = \Veterinaria\Http\Controllers\UtilsController::calculateAge($pet->birth_date); ?> <div> <label>Nombre Cliente:</label> {{$client->name}} {{$client->lastname}} </div> <div> <label>Teléfono:</label> {{$client->phone}} {{$client->cellphone}} </div> <div><label>Email:</label> {{$client->email}}</div> <div><label>Nombre Paciente:</label> {{$pet->name}}</div> <div><label>Especie:</label> {{$specie->species}}</div>
public function createPetByClient($id) { //To create pet by client $client = Client::find($id); $species = Species::lists('species', 'id'); $number = Pet::max('record_number'); if ($number == null) { $number = 1; } else { $number++; } return view('pet.create', compact('client', 'species', 'number')); }
<!-- Modal --> <?php $petBreed = \Veterinaria\Breed::find($pet->breed_id); $breedName = $petBreed->name; $specieId = $petBreed->species_id; $specieName = \Veterinaria\Species::find($specieId)->species; ?> <div class="modal fade" id="information{{$pet->id}}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> <h4 class="modal-title" id="myModalLabel">Información Mascota {{ucfirst ( strtolower ( $pet->name ))}}</h4> </div> <div class="modal-body text-justify"> <div>{!!Form::label('Nombre:')!!} {{$pet->name}}</div> <div> {!!Form::label('Sexo:')!!} @if ($pet->sex == 1) MACHO @else HEMBRA @endif </div> <div>{!!Form::label('Fecha Nacimiento:')!!} {{$pet->birth_date}}</div> <div>{!!Form::label('Edad:')!!} {{$date}}</div> <div>{!!Form::label('Especie:')!!} {{$specieName}}</div> <div>{!!Form::label('Raza:')!!} {{$breedName}}</div> <div>{!!Form::label('Número de Ficha:')!!} {{$pet->record_number}}</div> </div> <div class="modal-footer">
public function pdf($id) { $atention = Atention::find($id); $pet = Pet::find($atention->pet_id); $age = UtilsController::calculateAge($pet->birth_date); $breed = Breed::find($pet->breed_id); $specie = Species::find($breed->species_id); $client = Client::find($pet->client_id); $view = View::make('atention.pdf', compact('atention', 'pet', 'age', 'breed', 'specie', 'client'))->render(); $pdf = App::make('dompdf.wrapper'); $pdf->loadHTML($view); $nameFile = "Receta-" . $pet->name . "-" . $atention->created_at->format('Y-m-d') . ".pdf"; return $pdf->download($nameFile); }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { // Species::destroy($id); Session::flash('message', 'Especie eliminada correctamente'); return Redirect::to('/species'); }