当前位置: 首页>>代码示例>>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;未经允许,请勿转载。