/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $newscount = News::where('id', '!=', 'null')->count(); $chartercount = Charters::where('id', '!=', 'null')->count(); $userscount = User::where('id', '!=', 'null')->count(); $categories = \DB::table('news_categories')->lists('name', 'id'); $publisher = \DB::table('users')->lists('name', 'id'); return view('backend.home', compact('newscount', 'userscount', 'chartercount'))->with(['categories' => $categories, 'publisher' => $publisher]); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function inquiry_store($slug) { $tour = Charters::where('slug', '=', $slug)->first(); $customers = Customers::first(); $booking = Booking::first(); $customers = new Customers(array($email = \Input::get('email'), $phone = \Input::get('phone'), $country = \Input::get('country'))); $bookings = new Booking(array($cust_name = \Input::get('name'), $message = \Input::get('message'))); $bookings->cust_name = $cust_name; $bookings->tour_name = $tour->name; $customers->cust_name = $cust_name; $customers->email = $email; $customers->phone = $phone; $customers->country = $country; //$bookings->tour_date = $tour_date; $bookings->price = $tour->price; //$bookings->status = $status; $bookings->save(); $customers->save(); return \Redirect::back()->with('message', 'Your inquiry has been successfully send to us.', $tour); }
public function getDatatable() { $news = Charters::leftJoin('lokasis', 'charters.lokasi', '=', 'lokasis.id')->leftJoin('categories', 'charters.categories', '=', 'categories.id')->select(array('charters.id', 'charters.image', 'charters.name', 'lokasis.name as lokasi', 'categories.name as categories', 'charters.price', 'charters.headline')); return Datatables::of($news)->addColumn('image', function ($news) { return '<img src="../' . $news->image . '"class="img-responsive" width="200" height="200"></img>'; })->addColumn('action', function ($news) { return '<a href="charters/edit/' . $news->id . '" class="btn btn-xs btn-primary">Edit</a> <a href="charters/delete/' . $news->id . '" class="btn btn-xs btn-danger">Delete</a>'; })->removeColumn('created_at', 'update_at')->make(true); }