public function show($id) { $events = Events::findOrFail($id); $data['room'] = Rooms::select('roomtype.RoomType_Name', 'roomtype.ID_RoomType', 'roomtype_pic.Picture')->join('roomtype_pic', 'roomtype.ID_RoomType', '=', 'roomtype_pic.ID_RoomType')->where('roomtype_pic.Main_Pic', '=', 'YES')->where('roomtype.Status', '=', 'Active')->take(40)->get()->all(); $data['offer'] = Offer::where('Status', '=', 'Active')->take(40)->get()->all(); $data['about'] = About::get()->all(); return View::make('Events.show', compact('events'))->with('event_active', 'active')->with('data', $data); }
public function show($id) { $dinas = Dinasevents::orderby('Event_Date', 'Desc')->where('Event_ID', '=', $id)->firstOrFail(); $data['room'] = Rooms::select('roomtype.RoomType_Name', 'roomtype.ID_RoomType', 'roomtype_pic.Picture')->join('roomtype_pic', 'roomtype.ID_RoomType', '=', 'roomtype_pic.ID_RoomType')->where('roomtype_pic.Main_Pic', '=', 'YES')->where('roomtype.Status', '=', 'Active')->take(40)->get()->all(); $data['offer'] = Offer::where('Status', '=', 'Active')->take(40)->get()->all(); $data['about'] = About::get()->all(); return View::make('dinasevents.show', compact('dinas'))->with('data', $data); }
public function index() { $faqs = Faq::where('Status', '=', 'Active')->get(); $data['room'] = Rooms::select('roomtype.RoomType_Name', 'roomtype.ID_RoomType', 'roomtype_pic.Picture')->join('roomtype_pic', 'roomtype.ID_RoomType', '=', 'roomtype_pic.ID_RoomType')->where('roomtype_pic.Main_Pic', '=', 'YES')->where('roomtype.Status', '=', 'Active')->take(40)->get()->all(); $data['offer'] = Offer::where('Status', '=', 'Active')->take(40)->get()->all(); $data['about'] = About::get()->all(); return View::make('faqs.index', compact('faqs'))->with('data', $data); }
public function index() { $testimonial = Testimonial::orderby('date', 'DESC')->where('Status', '=', 'Confirm')->paginate(10, ['Name', 'Email', 'Subject', 'Message', 'Date'], 'ID_Feedback'); $data['room'] = Rooms::select('roomtype.RoomType_Name', 'roomtype.ID_RoomType', 'roomtype_pic.Picture')->join('roomtype_pic', 'roomtype.ID_RoomType', '=', 'roomtype_pic.ID_RoomType')->where('roomtype_pic.Main_Pic', '=', 'YES')->where('roomtype.Status', '=', 'Active')->take(40)->get()->all(); $data['offer'] = Offer::where('Status', '=', 'Active')->take(40)->get()->all(); $data['about'] = About::get()->all(); return View::make('Testimonials.index', compact('testimonial'))->with('data', $data); }
public function show($id) { $rooms = Rooms::where('ID_RoomType', '=', $id)->firstOrFail(); $listRooms = Rooms::where('Status', '=', 'Active')->get(); $data['offer'] = Offer::where('Status', '=', 'Active')->take(40)->get()->all(); $data['about'] = About::get()->all(); return View::make('Rooms.show', compact('rooms', 'listRooms'))->with('room_active', 'active')->with('listRoom', $listRooms)->with('data', $data); }
public function show($id) { $destination = Destination::where('ID_Destination', '=', $id)->firstOrFail(); $listDest = Destination::where('Status', '=', 'Active')->get(); $data['room'] = Rooms::select('roomtype.RoomType_Name', 'roomtype.ID_RoomType', 'roomtype_pic.Picture')->join('roomtype_pic', 'roomtype.ID_RoomType', '=', 'roomtype_pic.ID_RoomType')->where('roomtype_pic.Main_Pic', '=', 'YES')->where('roomtype.Status', '=', 'Active')->take(40)->get()->all(); $data['offer'] = Offer::where('Status', '=', 'Active')->take(40)->get()->all(); $data['about'] = About::get()->all(); return View::make('Destinations.show', compact('destination', 'listDest'))->with('data', $data); }
public function show($id) { $travel = Travel::where('ID_Travel', '=', $id)->firstOrFail(); $data['room'] = Rooms::select('roomtype.RoomType_Name', 'roomtype.ID_RoomType', 'roomtype_pic.Picture')->join('roomtype_pic', 'roomtype.ID_RoomType', '=', 'roomtype_pic.ID_RoomType')->where('roomtype_pic.Main_Pic', '=', 'YES')->where('roomtype.Status', '=', 'Active')->take(40)->get()->all(); $data['offer'] = Offer::where('Status', '=', 'Active')->take(40)->get()->all(); $data['about'] = About::get()->all(); $package = TravelPackage::where('ID_Travel', '=', $id)->get(); return View::make('travels.show', compact('travel'))->with('package', $package)->with('data', $data); }
public function show($id) { $facility = Facilities::where('ID_Facility', '=', $id)->firstOrFail(); $faciList = Facilities::where('Status', '=', 'Active')->get(); $data['room'] = Rooms::select('roomtype.RoomType_Name', 'roomtype.ID_RoomType', 'roomtype_pic.Picture')->join('roomtype_pic', 'roomtype.ID_RoomType', '=', 'roomtype_pic.ID_RoomType')->where('roomtype_pic.Main_Pic', '=', 'YES')->where('roomtype.Status', '=', 'Active')->take(40)->get()->all(); $data['offer'] = Offer::where('Status', '=', 'Active')->take(40)->get()->all(); $data['about'] = About::get()->all(); return View::make('Facilities.show', compact('facility', 'listFaci'))->with('faci_active', 'active')->with('faciList', $faciList)->with('data', $data); }
public function index() { $room = Rooms::select('roomtype.ID_RoomType', 'roomtype_pic.Picture')->join('roomtype_pic', 'roomtype.ID_RoomType', '=', 'roomtype_pic.ID_RoomType')->where('roomtype_pic.Main_Pic', '=', 'YES')->where('roomtype.Status', '=', 'Active')->take(15)->get(); $data['about'] = About::get()->all(); $countRoom = Rooms::where('Status', '=', 'Active')->count(); $offer = Offer::where('Status', '=', 'Active')->take(15)->get(); $countOffer = Offer::where('Status', '=', 'Active')->count(); $about = About::all(); return View::make('Books.View.index')->with('data', $data)->with('room', $room)->with('countRoom', $countRoom)->with('offer', $offer)->with('countOffer', $countOffer)->with('about', $about); }
public function indexTravel() { $getoff_id = Offer::where('Status', '=', 'Active')->get(); $offer = Offer::join('detail_offer', 'detail_offer.ID_Offer', '=', 'offer.ID_Offer')->join('roomtype_pic', 'roomtype_pic.ID_RoomType', '=', 'detail_offer.ID_RoomType')->join('roomtype', 'roomtype.ID_RoomType', '=', 'detail_offer.ID_RoomType')->where('offer.Status', '=', 'Active')->where('roomtype_pic.Main_Pic', '=', 'YES')->get(); $countOffer = Offer::where('Status', '=', 'Active')->count(); $countDetail = DetailOffer::join('offer', 'offer.ID_Offer', '=', 'detail_offer.ID_Offer')->where('offer.Status', '=', 'Active')->count(); $rooms = Rooms::join('roomtype_pic', 'roomtype.ID_RoomType', '=', 'roomtype_pic.ID_RoomType')->where('roomtype_pic.Main_Pic', '=', 'YES')->where('roomtype.Status', '=', 'Active')->paginate(5, ['roomtype.RoomType_Name', 'roomtype.Price', 'roomtype_pic.Picture', DB::raw("CONCAT(SUBSTRING(roomtype.Description, 1, 100), '...') as IsiRoom"), 'roomtype.ID_RoomType']); $data['about'] = About::get()->all(); $travel = Travel::where('ID_Travel', '=', Cache::get('travel_session'))->where('Status', '=', 'Active')->get(); return View::make('Books.Travel.index', compact('rooms'))->with('travel', $travel)->with('data', $data)->with('countOffer', $countOffer)->with('offer', $offer)->with('countDetail', $countDetail); }
/** * Display the specified resource. * GET /orders/{id} * * @param int $id * @return Response */ public function show($company, $order) { if (is_numeric($order)) { $orders = Company::findOrFail($company)->orders->find($order); $offers = Offer::where('order_id', '=', $order)->where('provider_id', '=', Auth::user()->provider_id)->get(); $company = Company::find($company); $interval = calculate_time_interval($orders->start_date, $orders->end_date); $dates = extract_dates($orders->start_date, $interval); $offer_dates = array_pluck($offers, 'date'); } return View::make('orders.show', compact('offer_dates', 'offers', 'orders', 'company', 'interval', 'dates', 'start_at')); }
public function isDuplicate($key_word, $id = 0) { $duplicateOffer = Offer::where('key_word', $key_word)->first(); if (empty($duplicateOffer)) { return false; } if ($id != 0) { if ($duplicateOffer->id == $id) { return false; } } return true; }
public function loadOffer($id) { $squeeb = Offer::where('id', '=', $id)->first(); View::share('squeeb', $squeeb); view::share('model', 'Offer'); //detect device $detect = new Mobile_Detect(); $deviceType = $detect->isMobile() ? $detect->isTablet() ? 'tablet' : 'phone' : 'computer'; View::share('deviceType', $deviceType); //update the squeeb table $this->sqFactor($squeeb); if (Auth::user()) { return View::make('member.squeeb'); } return View::make('guest.squeeb'); }
} $view->with('data', $data); }); View::creator('includes.backend.cycles', function ($view) { $user = Auth::user(); $id = $user->id; $ammount = 0; // Get last investment. $transactions = Transaction::where('user_id', '=', $id)->where('transaction_direction', '=', 'invested')->orderBy('id', 'desc')->first(); if ($transactions) { $ammount = $transactions->ammount; } if ($user->awaiting_award == 1 && $user->investor != 1) { $data = Helper::reward($ammount, $user->cycle_duration, $user->investment_rate); } elseif ($user->awaiting_award == 1 && $user->investor == 1 && $ammount >= 1000) { $offer = Offer::where('recipient_id', '=', $id)->orderBy('id', 'DESC')->first(); if ($offer != null) { $rate = $offer->daily_rate; } else { $rate = $user->investment_rate; } $data = Helper::reward($ammount, $user->cycle_duration, $rate); } elseif ($user->awaiting_award == 1 && $user->investor == 1 && $ammount >= 100) { $data = Helper::reward($ammount, $user->cycle_duration, $user->investment_rate); } $view->with('data', $data); }); View::creator('includes.backend.newoffer', function ($view) { $uid = Auth::user()->id; $user = User::where('id', '=', $uid)->first(); $totalAdded = $user->userMoney->ammount_added;
/** * Display the specified offer. * * @param int $id * @return Response */ public function show($companies, $orders) { $offers = Offer::where('order_id', '=', $orders)->where('provider_id', '=', Auth::user()->provider_id)->get(); $company = Company::find($companies); return View::make('offers.show', compact('offers', 'company')); }
/** * Execute the console command. * * @return mixed */ public function fire() { $users = User::all(); foreach ($users as $user) { $dateInvested = new DateTime($user->invested_date); $days = Config::get('rate.days'); $dateInvested->modify('+' . $days . ' days'); $formattedDate = $dateInvested->format('Y-m-d H:i:s'); $currentDate = date('Y-m-d H:i:s'); if ($formattedDate <= $currentDate) { $transactions = Transaction::where('user_id', '=', $user->id)->where('transaction_direction', '=', 'invested')->get(); $transactionsCount = count($transactions); if (count($transactions) == 0) { $ammount = 0; } else { $ammount = $transactions[$transactionsCount - 1]->ammount; } if ($user->investor == 0 || $user->investor == 1 && $ammount < 1000) { $lastInvest = Transaction::where('user_id', '=', $user->id)->where('transaction_direction', '=', 'invested')->orderBy('id', 'DESC')->first(); $reward = new Transaction(); $reward->ammount = Helper::reward($ammount, $user->cycle_duration, $user->investment_rate); $reward->transaction_direction = 'reward'; $reward->user_id = $user->id; $reward->confirmed = 1; $reward->date = date('Y-m-d H:i:s'); $reward->save(); $user->investor = 1; $user->awarded = 1; $user->awaiting_award = 0; $user->invested_date = NULL; $user->cycle_duration = NULL; $user->investment_rate = 0; $user->save(); $user->userMoney->current_available += $reward->ammount + $lastInvest->ammount; $user->userMoney->times_won++; $user->userMoney->ammount_won += $reward->ammount; $user->userMoney->save(); } elseif ($user->investor == 1) { $offer = Offer::where('recipient_id', '=', $user->id)->orderBy('id', 'DESC')->first(); if ($offer != null) { $rate = $offer->daily_rate; } else { $rate = $user->investment_rate; } $lastInvest = Transaction::where('user_id', '=', $user->id)->where('transaction_direction', '=', 'invested')->orderBy('id', 'DESC')->first(); $reward = new Transaction(); $reward->ammount = Helper::reward($ammount, $user->cycle_duration, $rate); $reward->transaction_direction = 'reward'; $reward->user_id = $user->id; $reward->confirmed = 1; $reward->date = date('Y-m-d H:i:s'); $reward->save(); $user->awarded = 1; $user->awaiting_award = 0; $user->invested_date = NULL; $user->cycle_duration = NULL; $user->investment_rate = 0; $user->save(); $user->userMoney->current_available += $reward->ammount + $lastInvest->ammount; $user->userMoney->times_won++; $user->userMoney->ammount_won += $reward->ammount; $user->userMoney->save(); } } } }
} $package->delete(); } else { for ($i = 0; $i < $package->count(); $i++) { if (File::exists($filename)) { File::delete($filename); } $package->delete(); } } }); /*---------------------------------------------------*/ //home Route::get('/', function () { $data['room'] = Rooms::select('roomtype.RoomType_Name', 'roomtype.ID_RoomType', 'roomtype_pic.Picture')->join('roomtype_pic', 'roomtype.ID_RoomType', '=', 'roomtype_pic.ID_RoomType')->where('roomtype_pic.Main_Pic', '=', 'YES')->where('roomtype.Status', '=', 'Active')->take(40)->get()->all(); $data['offer'] = Offer::where('Status', '=', 'Active')->take(40)->get()->all(); $data['dinas'] = Dinasevents::select(DB::raw("Event_ID, Event_Picture, Event_Date, Event_Title, CONCAT(SUBSTRING(Event_Description,1,100),'...') as IsiEvent"))->orderby('Event_Date', 'DESC')->take(40)->get()->all(); $data['travel'] = Travel::where('Status', '=', 'Active')->take(40)->get()->all(); $data['destination'] = Destination::where('Status', '=', 'Active')->take(40)->get()->all(); $data['gallery'] = Gallery::where("Status", "!=", "Delete")->get()->all(); $data['about'] = About::get()->all(); Session::put('key', 'expiry', 1); $value = Session::get('key'); return View::make('home')->with('index', 'active')->with('data', $data); }); Route::get('post/listing', array('uses' => 'PostController@listing', 'as' => 'get.post.listing')); Route::get('post/{id}', array('uses' => 'PostController@single', 'as' => 'get.post.single'))->where(array('id' => '[1-9][0-9]*', 'slug' => '[a-zA-Z0-9-_]+')); Route::post('post/{id}', array('uses' => 'PostController@update', 'as' => 'post.post.update'))->where(array('id' => '[1-9][0-9]*')); Route::resource('user', 'UserController'); //resource Route::resource('/tourism', 'DestinationController');