本文整理汇总了PHP中Country::select方法的典型用法代码示例。如果您正苦于以下问题:PHP Country::select方法的具体用法?PHP Country::select怎么用?PHP Country::select使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Country
的用法示例。
在下文中一共展示了Country::select方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
public function index()
{
if (Input::get('q')) {
$datums = Country::select('name AS value', 'id', 'abbreviation')->where('name', 'like', '%' . Input::get('q') . '%')->take(50)->get();
foreach ($datums as $datum) {
//print_r($datum->toArray());
$datum->tokens = explode(' ', $datum->value);
}
return Response::json($datums);
} else {
return Response::json(Country::select('name AS value', 'id', 'abbreviation')->orderBy('name', 'ASC')->get());
}
}
示例2: Country
<?php
include_once $CFG->dirroot . "/lib/classes/" . "application/Country.Class.php5";
$CountryObj = new Country();
$GeneralObj->getRequestVars();
$section = 'Country';
if ($mode == "Update") {
$CountryObj->select($iCountryId);
$CountryObj->getAllVar();
} else {
$mode = "Add";
}
if ($file != '') {
$link = "index.php?file=" . $file . "&mode=" . $mode . "&listfile=" . $listfile;
}
$TOP_HEADER = $mode . ' ' . $section;
if ($mode == 'Update') {
$TOP_HEADER = $mode . ' ' . $section;
}
if ($mode == 'Update') {
$TOP_HEADER .= ' [' . $vCountry . ']';
}
if ($eType != '') {
$ExtraVal = "&eType=" . $eType;
}
?>
<form name="frmadd" method="post" action="index.php?file=t-country_masteradd_a" enctype="multipart/form-data" onSubmit="return validate_new(this);">
<input type="hidden" name="mode" value="<?php
echo $mode;
?>
">
示例3: getCountries
/**
* Show a list of all the countries formatted for Datatables.
*
* @return Datatables JSON
*/
public function getCountries()
{
$countries = Country::select(array('id', 'country', 'created_at', 'updated_at'));
return Datatables::of($countries)->add_column('actions', '<a href="{{{ URL::to(\'admin/countries/\' . $id . \'/edit\' ) }}}" class="iframe btn btn-xs btn-default">{{{ Lang::get(\'button.edit\') }}}</a>
<a href="{{{ URL::to(\'admin/countries/\' . $id . \'/delete\' ) }}}" class="iframe btn btn-xs btn-danger">{{{ Lang::get(\'button.delete\') }}}</a>
')->remove_column('id')->make();
}
示例4: PostVar
$iCountryId = PostVar("iCountryId");
$actionfile = GetVar("file");
/** This is for Check Duplicate Record-------------------------------------------*/
$generalobj->getRequestVars();
$redirect_file = "index.php?file={$file}&view={$view}&iCountryId={$iCountryId}";
$generalobj->checkDuplicate('iCountryId', PRJ_DB_PREFIX . "_country_master", array('vCountry' => $Data['vCountry']), $redirect_file, COUNTRY_ALREADY_EXISTS, $iCountryId);
if ($view == "add") {
//prints($Data);exit;
$countryObj->setAllVar($Data);
$id = $countryObj->insert();
if ($id) {
$var_msg = "Record Added Successfully.";
} else {
$var_msg = "Eror-in Add.";
}
} else {
if ($view == "edit") {
$arr = $countryObj->select($iCountryId);
$countryObj->setAllVar($arr);
$countryObj->setAllVar($Data);
$where = " iCountryId = '" . $iCountryId . "'";
$id = $countryObj->update($where);
if ($id) {
$var_msg = "Record Updated Successfully.";
} else {
$var_msg = "Eror-in Update.";
}
}
}
header("Location:index.php?file=" . $actionfile . "&view=index&AX=Yes&var_msg={$var_msg}");
exit;