Exemplo n.º 1
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     $poliza = Poliza::find($id);
     $con = $poliza->seguro->items;
     if (isset($poliza->vehiculo->uso) && $poliza->vehiculo->uso == "SERV. PARTICULAR") {
         if ($poliza->subramo == 'Reemplacamiento') {
             $coberturas = Cobertura::where('is_priv', true)->where($poliza->ramo, true)->where('is_fixed', true)->get();
         } else {
             $coberturas = Cobertura::where('is_priv', true)->where($poliza->ramo, true)->where('is_fixed', false)->get();
         }
     } elseif (isset($poliza->vehiculo->uso) && $poliza->vehiculo->uso == "SERV. PÚBLICO") {
         $coberturas = Cobertura::where('is_pub', true)->get();
     } else {
         $coberturas = Cobertura::all();
     }
     return view('poliza.edit', compact('poliza', 'coberturas', 'con'));
 }
Exemplo n.º 2
0
 public function getConceptos(Request $request)
 {
     $cob = $request->input('cobertura');
     $cobertura = Cobertura::where('id', $cob)->get();
     $conceptos = Concepto::where('cobertura_id', $cobertura[0]['id'])->get();
     if ($request->ajax()) {
         return response()->json(["conceptos" => $conceptos]);
     }
 }