/**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     $pet = Pet::find($id);
     $clientId = Client::find($pet->client_id)->id;
     $breed = Breed::find($pet->breed_id);
     $breedsList = Breed::breeds($breed->species_id)->lists('name', 'id');
     $species = Species::lists('species', 'id');
     $specie_id = $breed->species_id;
     return view('pet.edit', compact('pet', 'breedsList', 'species', 'specie_id', 'clientId'));
 }
                                </div>
                            </a>
                        </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">&times;</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>
                                            &nbsp;{{$client->name}}
                                            &nbsp;{{$client->lastname}}
                                        </div>
                                        <div>
                                            <label>Teléfono:</label>
                                            &nbsp;{{$client->phone}}
                                            &nbsp;&nbsp;{{$client->cellphone}}
                                        </div>
                                        <div><label>Email:</label>&nbsp;{{$client->email}}</div>
Example #3
0
 public static function breeds($id)
 {
     return Breed::where('species_id', '=', $id)->get();
 }
 public static function getFontAwesobeByFont($font)
 {
     return Breed::where('font', '=', $font)->get();
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     //
     Breed::destroy($id);
     Session::flash('message', 'Raza eliminada correctamente');
     return Redirect::to('/breed');
 }
 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);
 }
 public function getBreeds(Request $request, $id)
 {
     if ($request->ajax()) {
         $breeds = Breed::breeds($id);
         return response()->json($breeds);
     }
     return null;
 }