function updateProvince($xmlStr) { if (!($domDoc = domxml_open_mem($xmlStr))) { return false; } $province = new Province(); $province->parseDomDocument($domDoc); $ret = $province->updateRecord(); return $ret; }
function getProvinceDetails($provinceID) { $province = new Province(); $province->selectRecord($provinceID); if (!($domDoc = $province->getDomDocument())) { return false; } else { $xmlStr = $domDoc->dump_mem(true); return $xmlStr; } }
/** * 录入 * */ 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)); }
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/"); }
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); }
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); }
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); }
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; }
/** * 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); } }
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); }
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; }
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); }
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; }
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); } }
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); }
public function view_list() { $year = $this->input->post("year"); $epiweek = $this->input->post("epiweek"); $dnr_districts = District::getDNRDistricts($year, $epiweek); $provinces = Province::getAll(); $data['provinces'] = $provinces; $data['dnr_districts'] = $dnr_districts; $data['report_view'] = "dnr_districts_v"; $data['small_title'] = "DNR Districts in " . $year . " Epiweek " . $epiweek; $this->base_params($data); }
public static function profile() { if (current_user_can('profile')) { $user_id = get_current_user_id(); $usermeta = \UserMeta::where('user_id', $user_id)->first(); $cities = self::idandname(\City::all(), "id", "name"); $provinces = self::idandname(\Province::all(), "id", "name"); $countries = self::idandname(\Country::all(), "id", "name"); View::make("site/user/profile", compact('cities', 'provinces', 'countries', 'usermeta')); die; } wp_redirect("/login"); exit; }
public function edit_weekly_data($epiweek, $reporting_year, $district) { $provinces = Province::getAll(); $districts = District::getAll(); $diseases = Disease::getAllObjects(); $data['provinces'] = $provinces; $data['districts'] = $districts; $data['diseases'] = $diseases; $data['prediction'] = Surveillance::getPrediction(); $data['surveillance_data'] = Surveillance::getSurveillanceData($epiweek, $reporting_year, $district); $data['lab_data'] = Lab_Weekly::getWeeklyDistrictLabData($epiweek, $reporting_year, $district); $data['editing'] = true; $data['scripts'] = array("special_date_picker.js", "validationEngine-en.js", "validator.js"); $data["styles"] = array("validator.css"); $this->base_params($data); }
/** *用户有可能输入四种情况: * 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; } } } }
public function add() { $provinces = Province::getAll(); $districts = District::getAll(); $facilities = Facilities::getAll(); $diseases = Disease::getAllObjects(); $data['provinces'] = $provinces; $data['districts'] = $districts; $data['facilities'] = $facilities; $data['diseases'] = $diseases; $data['scripts'] = array("jquery.ui.core.js", "jquery.ui.datepicker.js", "jquery.ui.widget.js"); $data['styles'] = array("jquery.ui.all.css"); $data['title'] = "Line List Data"; $data['content_view'] = "linelist_data_add_v"; $data['banner_text'] = "Linelist Data"; $data['link'] = "submissions_management"; $data['quick_link'] = "linelisted_data_management"; $this->base_params($data); //$this -> load -> view("template", $data); }
public function edit_duplicate($number_of_diseases, $first_surveillance_id, $malaria_data_id) { $last_surveillance_id = $first_surveillance_id + $number_of_diseases - 1; $provinces = Province::getAll(); $districts = District::getAll(); $diseases = Disease::getAllObjects(); $data['provinces'] = $provinces; $data['districts'] = $districts; $data['diseases'] = $diseases; $data['prediction'] = Surveillance::getPrediction(); $data['surveillance_data'] = Surveillance::getSurveillanceDataRange($first_surveillance_id, $last_surveillance_id); $data['lab_data'] = Lab_Weekly::getLabObjects($malaria_data_id); $data['editing'] = true; $data['scripts'] = array("special_date_picker.js", "validationEngine-en.js", "validator.js"); $data["styles"] = array("validator.css"); $data['title'] = "Duplicate Data Editing"; $data['content_view'] = "weekly_data_add_v"; $data['banner_text'] = "Weekly Data Correction"; $data['link'] = "data_quality_management"; $this->load->view("template", $data); }
/** * 地区联动 */ 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); } }
<?php return array('enctype' => 'multipart/form-data', 'class' => 'formdangkytaikhoan', 'elements' => array('<div class="row">', '<div class="col-xs-12">', 'ten_khach_hang' => array('type' => 'text', 'class' => 'form-input'), '</div>', '</div>', '<div class="row">', '<div class="col-xs-12">', 'ten_dang_nhap' => array('type' => 'text', 'class' => 'form-input'), '</div>', '</div>', '<div class="row">', '<div class="col-xs-12">', 'password' => array('type' => "password", 'class' => 'form-input'), '</div>', '</div>', '<div class="row">', '<div class="col-xs-12">', 'confirmPassword' => array('type' => "password", 'class' => 'form-input'), '</div>', '</div>', '<div class="row">', '<div class="col-xs-12">', 'so_dien_thoai' => array('type' => 'text', 'class' => 'form-input'), '</div>', '</div>', '<div class="row">', '<div class="col-xs-12">', 'email' => array('type' => 'text', 'class' => 'form-input'), '</div>', '</div>', '<div class="row">', '<div class="col-xs-12">', 'dia_chi' => array('type' => 'dropdownlist', 'items' => Province::listProvinces(), 'class' => 'form-input'), '</div>', '</div>', '<div class="row">', '<div class="col-xs-12">', 'anh_dai_dien' => array('type' => 'file', 'class' => 'anh'), '</div>', '</div>', '<div class="row">', '<div class="col-xs-12">', 'dieukhoan' => array('type' => 'checkbox', 'class' => 'checkb'), '</div>', '</div>'), 'buttons' => array('dangky' => array('type' => 'submit', 'label' => 'Đăng ký', 'class' => 'btndangki btn', 'action' => 'dangkitk')));
?> </td> </tr> <tr> <td> <p class="la">Địa chỉ nơi đến </p> </td> <td><?php echo $form->textField($khachTimXe, 'dia_chi_den', array('class' => 'form-control ma')); ?> </td> <td> <p class="la">Tỉnh/Thành phố</p> </td> <td><?php echo $form->dropDownList($khachTimXe, 'noi_den_tinh', Province::listProvinces(), array('class' => 'form-control ma')); ?> <?php echo $form->error($khachTimXe, 'noi_den_tinh'); ?> </td> </tr> <tr> <td> <p class="la">Loại xe ghép</p> </td> <td><?php echo $form->dropDownList($khachTimXe, 'ma_loai_xe_ghep', Loaixeghep::optionLoaiXeGhep(), array('class' => 'form-control ma')); ?> <?php echo $form->error($khachTimXe, 'ma_loai_xe_ghep');
<?php return array('enctype' => 'multipart/form-data', 'elements' => array('tinkhachhang' => array('type' => 'form', 'title' => 'Sửa tin rao vặt', 'elements' => array('<div class="col-xs-12 col-sm-6 col-md-6">', 'nguoi_lien_lac' => array('type' => 'text', 'class' => 'form-control'), '</div>' . '<div class="col-xs-12 col-sm-5 col-md-5 pull-right">', 'so_dien_thoai' => array('type' => 'text', 'class' => 'form-control'), '</div>' . '<div class="clearfix"></div>' . '<div class="col-xs-12 col-sm-6 col-md-6">', 'tieu_de_tin' => array('type' => 'text', 'class' => 'form-control'), '</div>' . '<div class="col-xs-12 col-sm-5 col-md-5 pull-right">', 'tinh_thanh' => array('type' => 'dropdownlist', 'items' => Province::listProvinces(), 'class' => 'form-control'), '</div>' . '<div class="clearfix"></div>' . '<div class="col-xs-12 col-sm-6 col-md-6">', 'trang_thai' => array('type' => 'dropdownlist', 'items' => Tinraovat::getStatusTinDang(), 'class' => 'form-control'), '</div>' . '<div class="col-md-12">', 'noi_dung_tin' => array('type' => 'textarea', 'rows' => '10', 'class' => 'form-control', 'id' => 'noi-dung-tin'), '</div>')), 'tinraovat' => array('type' => 'form', 'elements' => array('<div class="col-xs-12 col-sm-6 col-md-6">', 'ma_loai_tin_rv' => array('type' => 'dropdownlist', 'items' => Loaitinraovat::optionLoaiTinRV(), 'class' => 'form-control'), '</div>' . '<div class="col-xs-12 col-sm-5 col-md-5 pull-right">', 'gia_rao_vat' => array('type' => 'text', 'class' => 'form-control'), '</div>' . '<div class="col-xs-12 col-md-5">', 'anh' => array('type' => 'file'), '</div>'))), 'buttons' => array('<div class="col-md-12 text-center">', 'dangtin' => array('type' => 'submit', 'label' => 'Đăng tin', 'class' => 'btn-success'), '</div>'));
<?php echo $form->labelEx($model, 'email'); ?> <?php echo $form->textField($model, 'email', array('size' => 60, 'maxlength' => 80, 'class' => 'form-control')); ?> <?php echo $form->error($model, 'email'); ?> </div> <div class="col-md-6"> <?php echo $form->labelEx($model, 'dia_chi'); ?> <?php echo $form->dropDownList($model, 'dia_chi', Province::listProvinces(), array('class' => 'form-control')); ?> <?php echo $form->error($model, 'dia_chi'); ?> </div> <div class="clearfix"></div> <div class="col-md-6"> <?php echo $form->labelEx($model, 'so_dien_thoai'); ?> <?php echo $form->textField($model, 'so_dien_thoai', array('size' => 11, 'maxlength' => 11, 'class' => 'form-control')); ?> <?php echo $form->error($model, 'so_dien_thoai');
function displayPageHeading() { $BarangayList = new SoapObject(NCCBIZ . "BarangayList.php", "urn:Object"); if (!($this->formArray["noBgys"] = $BarangayList->getBarangayCount("WHERE " . BARANGAY_TABLE . ".status='active'"))) { $this->formArray["noBgys"] = 0; } $MunicipalityCityDetails = new SoapObject(NCCBIZ . "MunicipalityCityDetails.php", "urn:Object"); if (!($xmlStr = $MunicipalityCityDetails->getMunicipalityCityDetails($this->formArray["municipalityCityID"]))) { exit("no municipality/city selected"); } else { if (!($domDoc = domxml_open_mem($xmlStr))) { exit("no municipality/city selected"); } else { $municipalityCity = new MunicipalityCity(); $municipalityCity->parseDomDocument($domDoc); $this->formArray["municipalityCity"] = $municipalityCity->getDescription(); $this->formArray["provinceID"] = $municipalityCity->getProvinceID(); $ProvinceDetails = new SoapObject(NCCBIZ . "ProvinceDetails.php", "urn:Object"); if (!($xmlStr = $ProvinceDetails->getProvinceDetails($this->formArray["provinceID"]))) { exit("no province associated with selected municipality/city"); } else { if (!($domDoc = domxml_open_mem($xmlStr))) { exit("no province associated with selected municipality/city"); } else { $province = new Province(); $province->parseDomDocument($domDoc); $this->formArray["province"] = $province->getDescription(); } } } } $quarterEndingDateArray = array("Q1" => "March 31", "Q2" => "June 30", "Q3" => "September 30", "Q4" => "December 31"); $quarterBeginningDateArray = array("Q1" => "January 1", "Q2" => "April 1", "Q3" => "July 1", "Q4" => "October 1"); $this->formArray["quarterEndingDate"] = $quarterEndingDateArray[$this->formArray["quarter"]]; $this->formArray["quarterBeginningDate"] = $quarterBeginningDateArray[$this->formArray["quarter"]]; }
echo $form->labelEx($model, 'entry_address'); ?> <?php echo $form->textArea($model, 'entry_address', array('cols' => 43, 'rows' => 3)); ?> <?php echo $form->error($model, 'entry_address'); ?> </div> <div class="row"> <?php echo $form->labelEx($model, 'entry_province_id'); ?> <?php echo $form->dropDownList($model, 'entry_province_id', CHtml::listData(Province::model()->findAll(), 'province_id', 'province_name'), array('empty' => '--please select--')); ?> <?php echo $form->error($model, 'entry_province_id'); ?> </div> <div class="row"> <?php echo $form->labelEx($model, 'entry_city_id'); ?> <?php echo $form->dropDownList($model, 'entry_city_id', CHtml::listData(City::model()->findAll(), 'city_id', 'city_name'), array('empty' => '--please select--')); ?> <?php echo $form->error($model, 'entry_city_id');
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { $this->province->find($id)->delete(); return Redirect::route('provinces.index'); }
public function provincialDetails($epiweek, $diseaseId) { $currentyear = date('Y'); $submissions = Surveillance::getLastEpiweek($currentyear); $provinces = Province::getAll(); $years = Surveillance::getYears(); $data['selected_epiweek'] = $submissions->epiweek; $data['provinces'] = $provinces; $data['years'] = $years; $data['values'] = $this->getAllProvinces($epiweek, $diseaseId, $provinces); $name = Disease::getName($diseaseId); $data['diseaseName'] = $name->Name; $data['content_view'] = 'submissions_prov_v'; $this->base_params($data); }