本文整理汇总了PHP中Province::model方法的典型用法代码示例。如果您正苦于以下问题:PHP Province::model方法的具体用法?PHP Province::model怎么用?PHP Province::model使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Province
的用法示例。
在下文中一共展示了Province::model方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionEditmoreinfo
public function actionEditmoreinfo($user_id)
{
$user_more_info = UserInfoAR::model()->findByPk($user_id);
$this->assign('user_more', $user_more_info);
$maritalStatus = MaritalStatus::model()->findAll();
// 'MaritalStatus', 'marital_status_id'),
$hometown = Hometown::model()->findAll();
// 'Province', 'hometown_id'),
$nation = Nation::model()->findAll();
// 'Nation', 'nation_id'),
$bodyType = BodyType::model()->findAll();
// 'BodyType', 'body_type_id'),
$education = Education::model()->findAll();
// 'Education', 'education_id'),
$school = School::model()->findAll();
// 'School', 'school_id'),
$province = Province::model()->findAll();
// 'Province', 'province_id'),
$job = Job::model()->findAll();
// '$maritalSta,
$this->assign('maritalStatus', $maritalStatus);
$this->assign('hometown', $hometown);
$this->assign('nation', $nation);
$this->assign('bodyType', $bodyType);
$this->assign('education', $education);
$this->assign('school', $school);
$this->assign('province', $province);
$this->assign('job', $job);
}
示例2: getLocation
public static function getLocation($ward_id, $district_id, $province_id)
{
$ward_type = null;
$ward_name = null;
$district_type = null;
$district_name = null;
$province_type = null;
$province_name = null;
if (isset($ward_id)) {
$ward = Ward::model()->findByPk($ward_id);
if ($ward) {
$ward_type = $ward->type;
$ward_name = $ward->name;
}
}
if (isset($district_id)) {
$district = District::model()->findByPk($district_id);
if ($district) {
$district_type = $district->type;
$district_name = $district->name;
}
}
if (isset($province_id)) {
$province = Province::model()->findByPk($province_id);
if ($province) {
$province_type = $province->type;
$province_name = $province->name;
}
}
return $ward_type . " " . $ward_name . ", " . $district_type . " " . $district_name . ", " . $province_type . " " . $province_name;
}
示例3: getDropdown
public function getDropdown()
{
global $dataDropdown;
$dataDropdown = array();
$parents = Province::model()->findALl('t.status=1 ORDER BY t.name');
foreach ($parents as $parent) {
$dataDropdown[$parent->id] = $parent->name;
}
return $dataDropdown;
}
示例4: actionListCity
public function actionListCity()
{
// $data=::model()->findAll('referid=:referid',
if (isset($_POST['provinceId'])) {
$provinceId = $_POST['provinceId'];
}
$cities = Province::model()->findByPk($provinceId)->cities;
// $data=CHtml::listData($data,'id','name');
foreach ($cities as $city) {
echo CHtml::tag('option', array('value' => $city->id), CHtml::encode($city->name), true);
}
}
示例5: saveProAddress
public static function saveProAddress(UserProudctAddress $userprodaddress, $user_id)
{
$_POST['UserProudctAddress']['province'] = 'xx';
$_POST['UserProudctAddress']['city'] = 'xx';
$_POST['UserProudctAddress']['area'] = 'xx';
$_POST['UserProudctAddress']['sysaddress'] = 'xx';
if (isset($_POST['province'])) {
$_POST['UserProudctAddress']['province'] = $_POST['province'];
$provincename = Province::model()->find("provinceID=:proid", array(":proid" => $_POST['UserProudctAddress']['province']));
if ($provincename) {
$_POST['UserProudctAddress']['sysaddress'] = $provincename->province;
}
}
if (isset($_POST['city'])) {
$_POST['UserProudctAddress']['city'] = $_POST['city'];
$cityname = City::model()->find("cityID=:cityid", array(":cityid" => $_POST['UserProudctAddress']['city']));
if ($cityname) {
$_POST['UserProudctAddress']['sysaddress'] .= $cityname->city;
}
}
if (isset($_POST['area'])) {
$_POST['UserProudctAddress']['area'] = $_POST['area'];
$areaname = Area::model()->find("areaID=:areaid", array(":areaid" => $_POST['UserProudctAddress']['area']));
if ($areaname) {
$_POST['UserProudctAddress']['sysaddress'] .= $areaname->area;
}
}
$_POST['UserProudctAddress']['user_id'] = $user_id;
$userprodaddress->setAttributes($_POST['UserProudctAddress']);
foreach ((array) $_POST['UserProudctAddress'] as $key => $value) {
if (trim($value) == '') {
$userprodaddress->addError($key, "字段不能为空");
break;
}
}
if (!$userprodaddress->getErrors()) {
$userprodaddress->setAttribute('addtime', time());
$userprodaddress->setAttribute('addip', Yii::app()->request->userHostAddress);
if ($userprodaddress->validate()) {
if ($userprodaddress->isNewRecord) {
$result = $userprodaddress->save();
} else {
$result = $userprodaddress->update();
}
if (!$result) {
$userprodaddress->addError("realname", "更新失败");
}
} else {
$userprodaddress->addError("realname", "更新失败");
}
}
return $userprodaddress;
}
示例6: authenticate
/**
*用户有可能输入四种情况:
* 1.景点名
* 2.城市名
* 3.国家名
* 4.省的名字
* 5.一个数据库没有的名字
* 6.要从行政数据库里面查找名字
*/
public function authenticate($location)
{
//先判断这是否是一个景点名
if ($this->find('name=:name', array(':name' => $location))) {
return $this->_flag = self::SECENIC;
} else {
if (City::model()->loadModel($location)) {
return $this->_flag = self::CITY;
} else {
if (Province::model()->loadModel($location)) {
return $this->_flag = self::PROVINCE;
} else {
return $this->_flag = self::INVAILD;
}
}
}
}
示例7: actionUpdateDistricts
/**
* 地区联动
*/
public function actionUpdateDistricts()
{
$areastring = "area_";
$data = Yii::app()->cache->get($areastring . (int) $_POST['idCity']);
if (!$data) {
$dataArea = Area::model()->findAll('father=:idCity', array(':idCity' => (int) $_POST['idCity']));
if (!$dataArea) {
$dataArea = City::model()->findAll('cityID=:idCity', array(':idCity' => (int) $_POST['idCity']));
if (!$dataArea) {
$dataArea = Province::model()->findAll('provinceID=:idCity', array(':idCity' => (int) $_POST['idCity']));
$data = CHtml::listData($dataArea, 'provinceID', 'province');
} else {
$data = CHtml::listData($dataArea, 'cityID', 'city');
}
} else {
$data = CHtml::listData($dataArea, 'areaID', 'area');
}
Yii::app()->cache->set($areastring . (int) $_POST['idCity'], $data);
}
echo "<option value=''>选择区域</option>";
foreach ($data as $value => $name) {
echo CHtml::tag('option', array('value' => $value), CHtml::encode($name), true);
}
}
示例8: confirm
<div class="panel panel-default" style="color: black">
<div class="panel-header">
<a href="<?php
echo yii::app()->baseUrl;
?>
/city/export" class="btn btn-primary"><i class="fa fa fa-download"></i> Export</a>
<a href="<?php
echo yii::app()->baseUrl;
?>
/city/import" class="btn btn-primary"><i class="fa fa fa-upload"></i> Import</a>
<a href="<?php
echo yii::app()->baseUrl;
?>
/city/clear" onclick="return confirm('Yakin ingin menghapus semua data provinsi?')" class="btn btn-primary"><i class="fa fa fa-trash"></i>Bersihkan Data</a>
</div>
<div class="pael-body">
<?php
$this->widget('bootstrap.widgets.TbGridView', array('id' => 'city-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'columns' => array(array('header' => 'No', 'value' => '$this->grid->dataProvider->pagination->currentPage * $this->grid->dataProvider->pagination->pageSize + ($row+1)'), array('name' => 'province_code', 'value' => 'isset($data->province->name)?$data->province->name:""', 'filter' => Province::model()->getOptionsCodeName()), 'name', array('class' => 'bootstrap.widgets.TbButtonColumn'))));
?>
</div>
</div>
示例9: actionArticleOfArea
public function actionArticleOfArea()
{
$criteria = new CDbCriteria();
$criteria->addCondition("t.active=1");
$criteria->addCondition("t.delete=0");
$criteria->order = "t.order, t.id DESC";
if (isset($_POST['Province']) && isset($_POST['District'])) {
if ((int) $_POST['District'] > 0) {
$criteria->addCondition("t.scope=" . (int) $_POST['District']);
} else {
if ((int) $_POST['Province'] > 0) {
$province = Province::model()->findByPk((int) $_POST['Province']);
if ($province === null) {
throw new CHttpException(404, 'The requested page does not exist.');
}
$arrayIDs = array();
foreach ($province->districts as $district) {
$arrayIDs[] = $district->id;
}
$criteria->addInCondition("t.scope", $arrayIDs);
}
}
}
$count = ArticleOfArea::model()->count($criteria);
$pages = new CPagination($count);
// results per page
$pages->pageSize = Config::model()->getValueByKey('rowsperpagearticle');
$pages->applyLimit($criteria);
$models = ArticleOfArea::model()->findAll($criteria);
$pageTitle = Yii::t('site', 'Guitar các tỉnh');
$metaDescription = Config::model()->getValueByKey('metadescription');
$metaKeywords = Config::model()->getValueByKey('metakeywords');
$this->pageTitle = $pageTitle . ' - ' . Config::model()->getValueByKey('sitetitle');
$this->metaDescription = $metaDescription;
$this->metaKeywords = $metaKeywords;
// danh sach cac category
$criteria = new CDbCriteria();
$criteria->addCondition("t.active=1");
$criteria->addCondition("t.delete=0");
$criteria->addCondition("t.id!=1");
$criteria->order = "t.order, t.id DESC";
$categories = ArticleCategories::model()->findAll($criteria);
$this->render('articleOfArea', array('models' => $models, 'categories' => $categories, 'pages' => $pages));
}
示例10: foreach
</div>
<div class="form-group">
<label class="control-label col-lg-3 col-md-3 col-sm-4 col-xs-4">พระถูกสร้างที่จังหวัด<small> *</small></label>
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-8">
<select class="form-control input-lg" name="province" id="province" required>
<option value="" selected>-- กรุณาเลือก --</option>
<?php
foreach ($listRegion as $index => $region) {
?>
<optgroup label=" ภูมิภาค <?php
echo $region->reg_name;
?>
" style="font-weight: bold;">
<?php
$listProvince = Province::model()->findAll(array('condition' => 'reg_id = ' . $region->reg_id, 'order' => 'pro_name_th'));
?>
<?php
foreach ($listProvince as $index => $province) {
?>
<?php
if ($province->pro_id == $sacredObject->pro_id) {
?>
<option value="<?php
echo $province->pro_id;
?>
" selected><?php
echo $province->pro_name_th;
?>
</option>
<?php
示例11: array
<?php
$form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array('id' => 'city-form', 'enableAjaxValidation' => true, 'htmlOptions' => array('enctype' => 'multipart/form-data')));
?>
<?php
echo $form->errorSummary($model);
?>
<?php
echo $form->dropDownListRow($model, "province_code", Province::model()->getOptionsCodeName(), array("prompt" => "Pilih Provinsi", "class" => "autocomplete"));
?>
<?php
echo $form->textFieldRow($model, 'code', array('class' => 'span5', 'maxlength' => 256));
echo $form->textFieldRow($model, 'name', array('class' => 'span5', 'maxlength' => 256));
?>
<div class="form-actions">
<?php
$this->widget('bootstrap.widgets.TbButton', array('buttonType' => 'submit', 'type' => 'primary', 'label' => $model->isNewRecord ? 'Tambah' : 'Simpan'));
?>
<!--<a href="<?php
// echo yii::app()->baseUrl;
?>
/city/admin" class="btn btn-primary">Batal</a>-->
</div>
示例12: actionInputPharmacy
public function actionInputPharmacy()
{
$this->checkLogin();
$ward = Ward::model()->findAll();
$district = District::model()->findAll();
$province = Province::model()->findAll();
$this->render('inputPharmacy', array('ward' => $ward, 'district' => $district, 'province' => $province));
}
示例13: exportExcel
public function exportExcel($objPHPExcel, $models)
{
$sheet = $objPHPExcel->getActiveSheet();
$row = 1;
$referenceRow = 2;
$reference = Province::model()->findAll();
//Write main data that used on import to cell
if ($models) {
foreach ($models as $model) {
$provinceCode = $model->province_code;
$cityCode = str_replace($provinceCode . '.', '', $model->code);
$sheet->setCellValueExplicit('A' . ++$row, $provinceCode, PHPExcel_Cell_DataType::TYPE_STRING);
$sheet->setCellValueExplicit('B' . $row, $cityCode, PHPExcel_Cell_DataType::TYPE_STRING);
$sheet->setCellValue('C' . $row, isset($model->name) ? $model->name : NULL);
}
}
//Write reference data to cell
if ($reference) {
foreach ($reference as $data) {
$sheet->setCellValueExplicit('D' . ++$referenceRow, isset($data->code) ? $data->code : NULL, PHPExcel_Cell_DataType::TYPE_STRING);
$sheet->setCellValue('E' . $referenceRow, isset($data->name) ? $data->name : NULL);
}
}
$objPHPExcel->getActiveSheet()->setTitle('Daftar Kota');
}
示例14: actionSearchUser
public function actionSearchUser()
{
$model = new SearchUserForm();
if (Yii::app()->request->isAjaxRequest) {
if (isset($_POST['SearchUserForm'])) {
if ($_POST['SearchUserForm']['username'] !== '') {
$model->username = $_POST['SearchUserForm']['username'];
} else {
$model->attributes = $_POST['SearchUserForm'];
}
$criteria = $model->getCriteria();
//Page manager
$count = User::model()->count($criteria);
$pages = new CPagination($count);
$pages->pageSize = 16;
$pages->applyLimit($criteria);
$searchResult = User::model()->findAll($criteria);
$this->renderPartial('_searchUserResult', array('searchResult' => $searchResult, 'pages' => $pages));
}
} else {
$provinces = Province::model()->findAll();
$provinces = CHtml::listData($provinces, 'idProvince', 'name');
$criteria = $model->getCriteria();
//Page manager
$count = User::model()->count($criteria);
$pages = new CPagination($count);
$pages->pageSize = 16;
$pages->applyLimit($criteria);
$searchResult = User::model()->findAll($criteria);
$this->render('searchUser', array('searchResult' => $searchResult, 'pages' => $pages, 'model' => $model, 'provinces' => $provinces));
}
}
示例15: array
<?php
$this->widget('ext.jqrelcopy.JQRelcopy', array('id' => 'copylink', 'removeText' => '<i></i>', 'removeHtmlOptions' => array('class' => 'fa fa-fw fa-trash'), 'options' => array('copyClass' => 'newcopy', 'limit' => 5, 'clearInputs' => true, 'excludeSelector' => '.skipcopy')));
?>
<a id="copylink" href="#" rel=".copy">Copy</a>
<div class="copy">
<?php
echo CHtml::dropDownList('code[]', "string", Subcomponent::model()->getSubcomponentOptions(), array('prompt' => 'Pilih Paket Pekerjaan'));
?>
<?php
echo CHtml::dropDownList('ppk_code[]', "string", Ppk::model()->getPpkOptions(), array('prompt' => 'Pilih PPK'));
?>
</br>
<?php
echo CHtml::dropDownList('province_code[]', "string", Province::model()->getOptionsCodeName(), array('prompt' => 'Pilih Provinsi'));
?>
<?php
echo CHtml::dropDownList('city_code[]', "string", City::model()->getOptionsCodeName(), array('prompt' => 'Pilih Kab/Kota'));
?>
</div>
</br>
</br>
<div class="clearfix"></div>