當前位置: 首頁>>代碼示例>>PHP>>正文


PHP BaseController::getCountryName方法代碼示例

本文整理匯總了PHP中BaseController::getCountryName方法的典型用法代碼示例。如果您正苦於以下問題:PHP BaseController::getCountryName方法的具體用法?PHP BaseController::getCountryName怎麽用?PHP BaseController::getCountryName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在BaseController的用法示例。


在下文中一共展示了BaseController::getCountryName方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getPostPage

 public function getPostPage()
 {
     $obj = new BaseController();
     $campusid = $this->getDevice();
     if ($campusid == 0) {
         $countryname = $obj->getCountryName();
         if ($countryname == 'NONE') {
             return Redirect::route('selectcampus-get');
         } else {
             //check whether the country name exists inthe db
             $locationcountry = Country::where('name', '=', $countryname);
             if ($locationcountry->count()) {
                 $locationcountrycode = $locationcountry->first()->code;
                 $locationcountrycode = strtolower($locationcountrycode);
                 return Redirect::route('selectcountryid', $locationcountrycode);
             } else {
                 return Redirect::route('selectcampus-get');
             }
         }
     }
     $college = Institution::whereHas('Branch', function ($query) use($campusid) {
         $query->where('id', '=', $campusid);
     })->first();
     View::share('college', $college);
     $mycampus = Branch::where('id', '=', $campusid)->first();
     View::share('mycampus', $mycampus);
     if (Auth::user()) {
         return View::make('member.post');
     }
     return View::make('guest.post');
 }
開發者ID:franqq,項目名稱:squeeber,代碼行數:31,代碼來源:PostController.php

示例2: postSelectPackage

 public function postSelectPackage()
 {
     //verify the user input and create account
     $validator = Validator::make(Input::all(), array('Package' => 'required'));
     if ($validator->fails()) {
         return Redirect::route('advanced_squeeb-get')->withInput()->with('global', 'Please select a package.');
     } else {
         $package = Input::get('Package');
         View::share('package', $package);
         //check for the world package
         if ($package == 'pkg1') {
             $countries = Country::all();
             View::share('countries', $countries);
             $obj = new BaseController();
             $countryid = 0;
             $countryname = $obj->getCountryName();
             if ($countryname != 'NONE') {
                 $locationcountry = Country::where('name', '=', $countryname);
                 if ($locationcountry->count()) {
                     $countryid = $locationcountry->first()->id;
                     $colleges = Institution::where('country_id', '=', $countryid)->get();
                     View::share('colleges', $colleges);
                 }
             }
             View::share('countryid', $countryid);
             return View::make('guest.advancedselectcollege');
         } else {
             if ($package == 'pkg2') {
                 $countries = Country::all();
                 View::share('countries', $countries);
                 $obj = new BaseController();
                 $countryid = 0;
                 $countryname = $obj->getCountryName();
                 if ($countryname != 'NONE') {
                     $locationcountry = Country::where('name', '=', $countryname);
                     if ($locationcountry->count()) {
                         $countryid = $locationcountry->first()->id;
                     }
                 }
                 View::share('countryid', $countryid);
                 return View::make('guest.advancedpostcountry')->with('msg', 'Country Squeeb Package');
             }
         }
         if ($package == 'pkg3') {
             return View::make('guest.advancedpost')->with('msg', 'World Squeeb Package');
         }
     }
 }
開發者ID:franqq,項目名稱:squeeber,代碼行數:48,代碼來源:AdvancedPostController.php

示例3: getChangeCampus

 public function getChangeCampus()
 {
     $obj = new BaseController();
     $countryname = $obj->getCountryName();
     if ($countryname == 'NONE') {
         return Redirect::route('selectcampus-get');
     } else {
         //check whether the country name exists inthe db
         $locationcountry = Country::where('name', '=', $countryname);
         if ($locationcountry->count()) {
             $locationcountrycode = $locationcountry->first()->code;
             $locationcountrycode = strtolower($locationcountrycode);
             return Redirect::route('selectcountryid', $locationcountrycode);
         } else {
             return Redirect::route('selectcampus-get');
         }
     }
 }
開發者ID:franqq,項目名稱:squeeber,代碼行數:18,代碼來源:GeneralController.php

示例4: getMoreHomePageSqueeb

 public function getMoreHomePageSqueeb($lastid)
 {
     $campusid = $this->getDevice();
     $obj = new BaseController();
     $campusid = $this->getDevice();
     if ($campusid == 0) {
         $countryname = $obj->getCountryName();
         if ($countryname == 'NONE') {
             return Redirect::route('selectcampus-get');
         } else {
             //check whether the country name exists inthe db
             $locationcountry = Country::where('name', '=', $countryname);
             if ($locationcountry->count()) {
                 $locationcountrycode = $locationcountry->first()->code;
                 $locationcountrycode = strtolower($locationcountrycode);
                 return Redirect::route('selectcountryid', $locationcountrycode);
             } else {
                 return Redirect::route('selectcampus-get');
             }
         }
     }
     $more = true;
     $college = Institution::whereHas('Branch', function ($query) use($campusid) {
         $query->where('id', '=', $campusid);
     })->first();
     $collegeid = $college->id;
     $countryid = Country::where('id', '=', $college->country_id)->first()->id;
     //get the top squeeb to display
     $newsqueebs = Squeeb::where('active', '=', TRUE)->where('branch_id', '=', $campusid)->orderBy('id', 'DESC')->take(self::TOP_SQUEEB_LIMIT)->get();
     View::share('newsqueebs', $newsqueebs);
     $squeebs = Notice::whereHas('Squeeb', function ($query) use($campusid, $lastid) {
         $query->where('branch_id', '=', $campusid)->where('id', '<', $lastid)->where('active', '=', TRUE);
     })->orwhereHas('Squeeb', function ($query) use($lastid) {
         $query->where('branch_id', '=', 0)->where('world', '=', TRUE)->where('id', '<', $lastid)->where('active', '=', TRUE);
     })->orwhereHas('Squeeb', function ($query) use($lastid, $countryid) {
         $query->where('branch_id', '=', 0)->where('country', '=', $countryid)->where('id', '<', $lastid)->where('active', '=', TRUE);
     })->orwhereHas('Squeeb', function ($query) use($lastid, $collegeid) {
         $query->where('branch_id', '=', 0)->where('college', '=', $collegeid)->where('id', '<', $lastid)->where('active', '=', TRUE);
     });
     $last = $squeebs;
     $squeebs = $squeebs->orderBy('id', 'DESC')->take(self::SQUEEB_LIMIT)->get();
     if ($squeebs->count()) {
         $last_id = $last->orderBy('id', 'DESC')->take(self::SQUEEB_LIMIT)->get()->last()->Squeeb()->first()->id;
     }
     View::share('last_id', $last_id);
     View::share('squeebs', $squeebs);
     //get the top squeeb to display
     $topsqueebs = Squeeb::where('active', '=', TRUE)->where('model', '=', 'Notice')->where('branch_id', '=', $campusid)->orderBy('views', 'DESC')->take(self::TOP_SQUEEB_LIMIT)->get();
     View::share('topsqueebs', $topsqueebs);
     if ($lastid <= 0 or $squeebs->count() != self::SQUEEB_LIMIT) {
         $more = false;
     }
     $college = Institution::whereHas('Branch', function ($query) use($campusid) {
         $query->where('id', '=', $campusid);
     })->first();
     View::share('college', $college);
     View::share('more', $more);
     $mycampus = Branch::where('id', '=', $campusid)->first();
     View::share('mycampus', $mycampus);
     return View::make('guest.home');
 }
開發者ID:franqq,項目名稱:squeeber,代碼行數:61,代碼來源:GuestController.php


注:本文中的BaseController::getCountryName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。