本文整理汇总了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');
}
}
}
示例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;
}
}
示例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.');
}
示例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.');
}
}