本文整理汇总了PHP中Province类的典型用法代码示例。如果您正苦于以下问题:PHP Province类的具体用法?PHP Province怎么用?PHP Province使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Province类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: updateProvince
function updateProvince($xmlStr)
{
if (!($domDoc = domxml_open_mem($xmlStr))) {
return false;
}
$province = new Province();
$province->parseDomDocument($domDoc);
$ret = $province->updateRecord();
return $ret;
}
示例2: getProvinceDetails
function getProvinceDetails($provinceID)
{
$province = new Province();
$province->selectRecord($provinceID);
if (!($domDoc = $province->getDomDocument())) {
return false;
} else {
$xmlStr = $domDoc->dump_mem(true);
return $xmlStr;
}
}
示例3: actionCreate
/**
* 录入
*
*/
public function actionCreate()
{
parent::_acl('province_create');
$model = new Province();
if (isset($_POST['Province'])) {
$model->attributes = $_POST['Province'];
if ($model->save()) {
AdminLogger::_create(array('catalog' => 'create', 'intro' => '录入省份,ID:' . $model->id));
$this->redirect(array('index'));
}
}
$this->render('create', array('model' => $model));
}
示例4: updatePosition
function updatePosition()
{
$positionList = $this->input->post('positionList');
$idList = $this->input->post('idList');
$locations = new Province();
for ($i = 0; $i < count($idList); $i++) {
$locations->where("id", $idList[$i]);
$locations->get();
$locations->position = $positionList[$i];
$locations->save();
$locations->clear();
}
redirect("admin/locations/listAll/");
}
示例5: save
function save($object = '', $related_field = '')
{
if (!$this->exists()) {
$o = new Province();
$o->select_max('position');
$o->get();
if (count($o->all) != 0) {
$max = $o->position + 1;
$this->position = $max;
} else {
$this->postion = 1;
}
}
return parent::save($object, $related_field);
}
示例6: 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);
}
示例7: getMyprofile
public function getMyprofile()
{
$id = Auth::user()->id;
$alumni_id = null;
$sql = "SELECT * FROM alumni WHERE account_id = ?";
$prof = DB::select($sql, array($id));
if ($prof != null) {
$alumni_id = $prof[0]->id;
}
$sql2 = "SELECT * FROM degree WHERE alumni_id = ?";
$deg = DB::select($sql2, array($alumni_id));
$sql3 = "SELECT * FROM work_experience WHERE alumni_id = ?";
$wrk_exp = DB::select($sql3, array($alumni_id));
$sql4 = "SELECT * FROM certificate WHERE alumni_id = ?";
$certificate = DB::select($sql4, array($alumni_id));
// $sql5 = "SELECT * FROM alumni_tracer WHERE alumni_id = ?";
$sql5 = "SELECT at.*, sq.question, sc.choice\n\t\t\t\tFROM alumni_tracer AS at\n\t\t\t\tINNER JOIN survey_questions AS sq\n\t\t\t\tON sq.id = at.question_id\n\t\t\t\tINNER JOIN survey_choices AS sc\n\t\t\t\tON sc.id = at.choice_id\n\t\t\t\tWHERE at.alumni_id = ?\n\t\t\t\tORDER BY at.question_id";
$a_tracer = DB::select($sql5, array($alumni_id));
$dept = Department::all();
$region = Region::all();
$province = Province::all();
$occupation = Occupation::all();
$company = Company::all();
$deg_title = DegreeTitle::all();
$school = School::all();
$jobs = Job::all();
$field = Field::all();
$questions = DB::select("SELECT * FROM survey_questions");
$civil_status = DB::select("SELECT * FROM civil_status");
return View::make('user.profile')->with('company', $company)->with('field', $field)->with('occupation', $occupation)->with('work_exp', $wrk_exp)->with('degree', $deg)->with('a_tracer', $a_tracer)->with('certificate', $certificate)->with('school', $school)->with('deg_title', $deg_title)->with('profile', $prof)->with('dept', $dept)->with('region', $region)->with('province', $province)->with('civil_status', $civil_status)->with('questions', $questions)->with('jobs', $jobs);
}
示例8: 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;
}
示例9: getConfig
/**
* Display a listing of the resource.
*
* @return Response
*/
public function getConfig()
{
if (Payment::VeryPayment() == false) {
return View::make('clinic.payment.renews-payment');
}
$user = Sentry::getUser();
$clinic = Clinic::where('user_id', $user->id)->first();
$adress = Address::find($clinic->address_id);
$province_id = City::find($adress->city_id)->province_id;
$country_id = Province::find($province_id)->country_id;
$option = $clinic->insurances;
#$option = Option::where('name', $clinic->id.'-clinic-insurance')->first();
$array = array();
if ($option) {
$segs = explode(',', $option);
$segok = '';
foreach ($segs as $seg) {
$very = Insurance::where('id', $seg)->first();
if ($very) {
$array[] = array('value' => $very->id, 'text' => $very->name);
}
}
}
/**/
$optionLang = Option::where('name', $clinic->id . '-clinic-lang')->first();
if (!$option) {
return View::make('clinic.config.config')->with('country_id', $country_id)->with('clinic', $clinic)->with('adress', $adress);
} else {
return View::make('clinic.config.config')->with('clinic', $clinic)->with('option', $array)->with('adress', $adress)->with('country_id', $country_id)->with('optionLang', $optionLang);
}
}
示例10: province
public function province()
{
$result = Province::where('PAK_ID', Input::get('id'))->select('PROVINCE_ID', 'PROVINCE_NAME')->get();
$dropdown = '<option value=""></option>';
foreach ($result as $result) {
$dropdown .= '<option value="' . $result->PROVINCE_ID . '">' . $result->PROVINCE_NAME . '</option>';
}
return Response::make($dropdown);
}
示例11: 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;
}
示例12: edit_district
public function edit_district($code)
{
$district = District::getDistrict($code);
$data['district'] = $district[0];
$data['title'] = "District Management::Edit " . $district->name . " District";
$data['module_view'] = "add_district_view";
$data['quick_link'] = "new_district";
$data['provinces'] = Province::getAll();
$this->base_params($data);
}
示例13: 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;
}
示例14: 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);
}
}
示例15: edit_user
public function edit_user($id)
{
$user = Users::getUser($id);
$data['user'] = $user;
$data['title'] = "User Management::Edit " . $user->Name . "'s Details";
$data['title'] = "User Management::Add New User";
$data['module_view'] = "add_user_view";
$data['levels'] = Access_Level::getAll();
$data['districts'] = District::getAll();
$data['provinces'] = Province::getAll();
$this->base_params($data);
}