public function acaraDetail($slug) { if ($slug == 'kajian') { $acara = null; } else { $acara = Acara::where('active', '1')->where('slug', $slug)->first(); } return view('sub.acaraDetail', compact('acara')); }
public function get_data_for_dashboard() { $userid = Users::where('id', '=', Session::get('user_id'))->first()->id; $data['user'] = Users::find(Session::get('user_id')); $data['komunitas'] = Komunitas::orderBy('avg_rate', 'DESC')->take(5)->get(); $data['rekomen'] = $this->predict->recommendation($userid); $data['rating'] = $this->rating->count_rate_row_by_id($userid); $data['cek'] = $this->predict->has_recommendation($userid); $data['rand'] = Komunitas::orderByRaw("RAND()")->take(5)->get(); // $data['test'] = $this->komunitas->get_recommendation($userid); // $data['komunitas'] = $this->komunitas->get_initial_recommendation(); $data['acara'] = Acara::where('tanggal', '>=', DB::raw('CURDATE()'))->take(4)->orderBy('tanggal', 'ASC')->get(); // $count = Komunitas::where('id_kategori', '=', 1)->count(); $allkom = $this->predict->has_recommendation($userid); //var_dump($allkom); //var_dump($data['test']); return View::make('dashboard', $data); }
public function destroy($id) { Acara::find($id)->delete(); return back()->with('status', 'Successfully delete client'); }
public function fetch_event_list() { $data['user'] = Users::find(Session::get('user_id')); $data['acara'] = Acara::where('tanggal', '>=', DB::raw('CURDATE()'))->paginate(10); return View::make('list_acara', $data); }