Exemplo n.º 1
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($card_id, $id)
 {
     Card::findOrFail($card_id);
     $data[$this->card_id] = $card_id;
     $data['camp'] = Camp::select(DB::raw('X(geoPoint) as latitude, Y(geoPoint) as longitude,name,card_id,start_date,end_date,no_of_people,target,address,id,document,status,budget,comments,actual_budget,actual_orders,actual_deliver_time,village_details'), 'order')->findOrFail($id);
     return view('camps.edit', $data);
 }
Exemplo n.º 2
0
 /**
  * get the palnned goal completion for the specified cards with camps
  * params @int $id
  *
  * return array
  */
 public static function get_panned_campgoals($id)
 {
     $pannedcamp = Camp::select(DB::Raw('sum(rb_camps.budget) as budget'), DB::Raw('count(rb_camps.id) as camps'), DB::Raw('sum(rb_camps.no_of_people) as total_villagers'), DB::Raw('sum(rb_camps.order) as orders'), DB::Raw('avg(rb_camps.deliver_time) as deliver_time'));
     $pannedcamp->join(static::$cards, static::$c_id, '=', 'camps.card_id');
     $pannedcamp->where('camps.card_id', $id);
     return $pannedcamp->first();
 }