/** * Initializer. * * @return void */ public function __construct() { $this->messageBag = new MessageBag(); //$countries can be accessed by any controller now $countries = DB::table('countries')->orderBy('popular')->orderBy('name')->lists('name', 'id'); view::share('countries', $countries); }
public function loadEvent($id) { $squeeb = Lecture::where('id', '=', $id)->first(); View::share('squeeb', $squeeb); view::share('model', 'Event'); return View::make('guest.squeeb'); }
public function __construct(Service $service) { $this->beforeFilter('expired-session-check'); $this->service = $service; $servicesNotContainedByAdvisor = $this->service->servicesNotContainedByAdvisor(Auth::user()->id); $servicesContainedByAdvisor = $this->service->servicesContainedByAdvisor(Auth::user()->id); $locationFormPopulator = Location::lists('name', 'id'); View::share('servicesNotContainedByAdvisor', $servicesNotContainedByAdvisor); View::share('servicesContainedByAdvisor', $servicesContainedByAdvisor); view::share('locationFormPopulator', $locationFormPopulator); }
public function loadSqueeb($type, $id) { $squeeb = Squeeb::where('id', '=', $id)->first(); View::share('squeeb', $squeeb); view::share('model', $type); //detect device $detect = new Mobile_Detect(); $deviceType = $detect->isMobile() ? $detect->isTablet() ? 'tablet' : 'phone' : 'computer'; View::share('deviceType', $deviceType); $views = $squeeb->views; $squeeb->views = $views + 1; $saved = $squeeb->save(); if (Auth::user()) { return View::make('member.home_squeeb'); } return View::make('guest.home_squeeb'); }
/** * Initializer. * * @return void */ public function __construct() { $this->messageBag = new MessageBag(); //$countries can be accessed by any controller now view::share('countries', $this->countries); }
public function postMemberPosts() { //verify the user input and create account $validator = Validator::make(Input::all(), array('Typem' => 'required|in:Notice,Eventsq,Job,Offer', 'Title' => 'required|max:200', 'Description' => 'required', 'Pic' => 'image|max:3000')); if ($validator->fails()) { return Redirect::route('member-post-get')->withErrors($validator)->withInput()->with('global', 'Sorry!! Your Squeeb was not posted, please retry.'); } else { $type = Input::get('Typem'); $title = Input::get('Title'); $description = Input::get('Description'); $description = $this->MakeUrls($description); $squeeb = substr(strip_tags($description), 0, 300); $campusid = $this->getDevice(); $file = Input::file('Pic'); //get the current user id $user_id = Auth::user()->id; //get the model name $model = $type; $the_squeeb = Squeeb::create(array('model' => $model, 'views' => 0, 'branch_id' => $campusid, 'create_day' => date("Y-m-d"))); if ($the_squeeb) { //create the post details $squeeb_id = 0; $squeeb_id = $this->createSqueeb($model, $the_squeeb->id, $user_id, $title, $description, $squeeb); //finally post the squeebe photo if ($squeeb_id) { $this->postUploadPhoto($type, $squeeb_id, $file); } if ($squeeb_id) { $squeeb = Squeeb::where('id', '=', $the_squeeb->id)->first(); View::share('squeeb', $squeeb); view::share('model', $type); return View::make('member.squeeb_preview'); } } } return Redirect::route('member-post-get')->with('global', 'Some Error Occured, Please try again'); }
public function getCreateuser($id = 0) { $this->layout = View::make('layouts.admin'); $pageTitle = 'Manage User'; $frmBtn = 'Save'; $modelid = (int) $id; $viewDataObj = ''; if (isset($modelid) && $modelid != 0) { $viewDataObj = DB::table('users')->where('users.id', '=', $modelid)->first(); // Changing dob to d-m-y format before sending to view if (isset($viewDataObj->expired_date)) { if ($viewDataObj->expired_date == '0000-00-00') { $viewDataObj->expired_date = ''; } else { $viewDataObj->expired_date = $this->DB2Date($viewDataObj->expired_date); } } } $currentDat = date('Y-m-d'); $after15Days = date('m/d/Y', strtotime("+15 day {$currentDat}")); $designationArr = $this->getDesignatonList(); $layoutArr = array('pageTitle' => $pageTitle, 'frmBtn' => $frmBtn, 'modelid' => $modelid, 'designationArr' => $designationArr, 'viewDataObj' => $viewDataObj, 'after15Days' => $after15Days); $this->layout->content = View::make('users.createuser', array('layoutArr' => $layoutArr)); /* * Setting student object in edit case to view so that * we can itterate it in layout page in order to prefill * the form element value */ view::share(array('viewDataObj' => $viewDataObj)); }