public function index(Request $request, $controller)
 {
     $controller = $this->getControllerName($controller);
     try {
         $namespace = $request->segment(2);
         $integration = new Integrate($controller);
         $integration->sendData($request->all());
         $html = $integration->getHtml();
         $packageName = Package::where('namespace', $namespace)->first();
         $packageName = $packageName->name;
         return view('package.index', compact('html', 'packageName'));
     } catch (\Exception $e) {
         return response($e->getMessage(), 404);
     }
 }
 /**
  * Function to post customer info and present confirmation view
  * User Confirms appointment details to continue
  **/
 public function anyConfirm()
 {
     $input = Input::all();
     $package = Package::find(Session::get('packageID'));
     $appointmentInfo = ["package_id" => Session::get('packageID'), "package_name" => $package->package_name, "package_time" => $package->package_time, "datetime" => Session::get('selection'), "fname" => $input['fname'], "lname" => $input['lname'], "number" => $input['number'], "email" => $input['email'], "updates" => isset($input['newsletterBox']) ? 'Yes' : 'No'];
     Session::put('appointmentInfo', $appointmentInfo);
     //Check if newsletterbox is checked, then add shit to database
     if (isset($input['newsletterBox'])) {
         Session::put('updates', '1');
     } else {
         Session::put('updates', '0');
     }
     $packageName = Package::where('id', $input['pid'])->pluck('package_name');
     return View::make('confirm')->with('appointmentInfo', $appointmentInfo);
 }
예제 #3
0
파일: Book.php 프로젝트: phanngoc/elearnpub
 /**
  * [getPackageBelongBook description]
  * @param  [type] $book_id [description]
  * @return [type]          [description]
  */
 public static function getPackageBelongBook($book_id)
 {
     $packages = Package::where('book_id', '=', $book_id)->get();
     return $packages;
 }