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


PHP Country::select方法代碼示例

本文整理匯總了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());
     }
 }
開發者ID:strikles,項目名稱:php,代碼行數:13,代碼來源:CountriesController.php

示例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;
?>
">
開發者ID:redeyes1024,項目名稱:medlii_mlm_backend,代碼行數:31,代碼來源:country_masteradd.inc.php

示例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();
 }
開發者ID:EricBui0512,項目名稱:FYP,代碼行數:12,代碼來源:RetailersController.php

示例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;
開發者ID:nstungxd,項目名稱:F2CA5,代碼行數:31,代碼來源:addcountry_a.php


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