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


PHP Institution::where方法代碼示例

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


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

示例1: 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

示例2: Company

 function get_logged_company()
 {
     if (!$this->is_signed_in()) {
         return NULL;
     } else {
         if ($this->CI->session->userdata('company_id') || $this->CI->session->userdata('institution_id')) {
             $c = new Company();
             $c->where('id', $this->CI->session->userdata('company_id'))->get();
             if ($c->exists()) {
                 return $c;
             } else {
                 $c = new Institution();
                 $c->where('id', $this->CI->session->userdata('institution_id'))->get();
                 if ($c->exists()) {
                     return $c;
                 }
             }
         }
         return NULL;
     }
 }
開發者ID:thomasgroch,項目名稱:quiz,代碼行數:21,代碼來源:authentication.php

示例3: getSelectCountry

 public function getSelectCountry($code)
 {
     $code = strtoupper($code);
     $countryid = Country::where('code', '=', $code)->first()->id;
     //get the country name
     $countryname = Country::where('id', '=', $countryid)->first()->name;
     //query the database for colleges in that country
     $colleges = Institution::where('country_id', '=', $countryid)->orderBy('name', 'ASC')->get();
     if ($colleges->count()) {
         $countries = Country::where('id', '>', 0)->get();
         View::share('countries', $countries);
         View::share('colleges', $colleges);
         View::share('countryid', $countryid);
         View::share('countryname', $countryname);
         return View::make('guest.selectcampus1');
     } else {
         $countries = Country::where('id', '>', 0)->get();
         View::share('countries', $countries);
         return Redirect::route('selectcampus-get')->withInput()->with('global', 'No Colleges were found in ' . $countryname . '!<br>Please <a href="http://www.squeeber.com/signup">add your college</a> and invite friends');
     }
     return Redirect::route('selectcampus-get')->withInput()->with('global', 'Sorry!! Campus details were not loaded, please retry.');
 }
開發者ID:franqq,項目名稱:squeeber,代碼行數:22,代碼來源:GeneralController.php

示例4: postNewCampus

 public function postNewCampus()
 {
     //verify the user input and create account
     $validator = Validator::make(Input::all(), array('Country' => 'required|exists:countrys,id'));
     if ($validator->fails()) {
         return Redirect::route('newcampus-get')->withErrors($validator)->withInput()->with('global', 'Sorry!! College details were not posted, please retry.');
     } else {
         $countryid = Input::get('Country');
         //query the database for colleges in that country
         $colleges = Institution::where('country_id', '=', $countryid)->get();
         if ($colleges->count()) {
             $countries = Country::where('id', '>', 0)->get();
             View::share('countries', $countries);
             View::share('colleges', $colleges);
             View::share('countryid', $countryid);
             return View::make('member.addcampus2');
         } else {
             $countries = Country::where('id', '>', 0)->get();
             View::share('countries', $countries);
             return Redirect::route('newcampus-get')->withInput()->with('global', 'No Colleges were found in this country!');
         }
         return Redirect::route('newcampus-get')->withInput()->with('global', 'Sorry!! Campus details were not posted, please retry.');
     }
 }
開發者ID:franqq,項目名稱:squeeber,代碼行數:24,代碼來源:CollegeController.php


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