• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP City类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中City的典型用法代码示例。如果您正苦于以下问题:PHP City类的具体用法?PHP City怎么用?PHP City使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了City类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: displayData

 function displayData()
 {
     $cityTemp = CityManager::getSingleCity('id', $this->church->getIdCity());
     if ($cityTemp === NULL) {
         $cityTemp = new City();
     }
     $stateTemp = CityManager::getSingleState('id', $cityTemp->getIdState());
     $cityString = "*************************";
     if ($stateTemp === NULL) {
         $stateTemp = new State();
     } else {
         $cityString = $cityTemp->getName() . ", " . $stateTemp->getShortName();
     }
     $this->SetFont('Arial', 'B', 10);
     $cellSizeY = 5;
     for ($i = 0; $i < 3; $i++) {
         //Get the data necesary of create the document
         $this->SetXY($x + 100, $i * 60 + $y + 40 - $cellSizeY);
         $this->Cell(80, $cellSizeY, iconv('utf-8', 'cp1252', $this->church->getName()), 0, 0, 'C');
         $this->SetXY($x + 100, $i * 60 + $y + 47 - $cellSizeY);
         $this->Cell(80, $cellSizeY, iconv('utf-8', 'cp1252', $this->church->getAddress()), 0, 0, 'C');
         $this->SetXY($x + 100, $i * 60 + $y + 54 - $cellSizeY);
         $this->Cell(80, $cellSizeY, iconv('utf-8', 'cp1252', 'CP. ' . $this->church->getPostalCode()), 0, 0, 'C');
         $this->SetXY($x + 100, $i * 60 + $y + 61 - $cellSizeY);
         $this->Cell(80, $cellSizeY, iconv('utf-8', 'cp1252', $cityString), 0, 0, 'C');
     }
 }
开发者ID:jonatalamantes,项目名称:NotariusAdOmnes,代码行数:27,代码来源:EnvelopeChurch.php


示例2: init

 public function init()
 {
     $nameProject = new Zend_Form_Element_Text('nameProject');
     $nameProject->setLabel('nom Projet')->setRequired(false)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
     $dateBegin = new Zend_Form_Element_Text('dateBegin');
     $dateBegin->setLabel('à partir de :')->setRequired(false)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
     $dateEnd = new Zend_Form_Element_Text('dateEnd');
     $dateEnd->setLabel('jusqu\'à le :')->setRequired(false)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
     $budget = new Zend_Form_Element_Text('budget');
     $budget->setLabel('Budget :')->setRequired(false)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
     $localisation = new Zend_Form_Element_Select('localisation');
     $localisation->setLabel('Localisation :')->setRequired(false)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
     $cityModel = new City();
     $selectReferenceForCity = $cityModel->select()->setIntegrityCheck(false)->from('city');
     $localisation->addMultiOption(0, '-');
     foreach ($cityModel->fetchAll($selectReferenceForCity) as $row) {
         $localisation->addMultiOption($row->city_id, $row->city_description);
     }
     $domaine = new Zend_Form_Element_Select('domaine');
     $domaine->setLabel('Domaine :')->setRequired(false)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
     $reference = new ReferenceValue();
     $selectReferenceForDomain = $reference->select()->setIntegrityCheck(false)->from('reference_values')->where('reference_values.reference_Id=5');
     $domaine->addMultiOption(0, '-');
     foreach ($reference->fetchAll($selectReferenceForDomain) as $row) {
         $domaine->addMultiOption($row->value_id, $row->name);
     }
     $statut = new Zend_Form_Element_Select('statut');
     $statut->setLabel('statut :')->setRequired(false)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
     $statut->addMultiOptions(array('1' => 'encours', '2' => 'valide', '3' => 'suspendu'));
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setOptions(array('label' => $this->t('Filter'), 'required' => true));
     $this->setCancelLink(false);
     $this->addElements(array($nameProject, $dateBegin, $dateEnd, $budget, $localisation, $domaine, $statut, $submit));
 }
开发者ID:omusico,项目名称:logica,代码行数:34,代码来源:MarketFilterForm.php


示例3: actionAdmin

 public function actionAdmin()
 {
     $this->rememberPage();
     $model = new City('search');
     $model->setRememberScenario('city_remember');
     $this->render('admin', array_merge(array('model' => $model), $this->params));
 }
开发者ID:barricade86,项目名称:raui,代码行数:7,代码来源:CityController.php


示例4: encoder_redirect_success

function encoder_redirect_success(City $new_city)
{
    $new_city_name = $new_city->getCity();
    $dir = "VIEW/html/Encoder/Add_Place/Add_Place_City_inc.php?success_edit=1";
    $url = BASE_URL . $dir;
    header("Location:{$url}");
    exit;
}
开发者ID:rogermule,项目名称:afalagi-web,代码行数:8,代码来源:Edit_City.php


示例5: actionAdmin

 public function actionAdmin()
 {
     $model = new City('search');
     $model->unsetAttributes();
     if (isset($_GET['City'])) {
         $model->setAttributes($_GET['City']);
     }
     $this->render('admin', array('model' => $model));
 }
开发者ID:schmunk42,项目名称:yii-sakila-crud,代码行数:9,代码来源:CityController.php


示例6: testVisitor

 public function testVisitor()
 {
     $expect = "Buy sushi...Buy pizza...Buy burger...";
     $city = new City();
     $city->add(new SushiBar());
     $city->add(new Pizzeria());
     $city->add(new BurgerBar());
     $result = $city->accept(new People());
     $this->assertEquals($result, $expect);
 }
开发者ID:AlexanderGrom,项目名称:php-patterns,代码行数:10,代码来源:visitor_test.php


示例7: getCityList

 function getCityList($stateCode)
 {
     App::import("Model", "City");
     $model = new City();
     $con2 = $model->find('list', array('fields' => array('City.id', 'City.city'), 'conditions' => array('City.stateid' => $stateCode)));
     if (empty($con2)) {
         return 0;
     } else {
         return $con2;
     }
 }
开发者ID:abhilashjaiswal,项目名称:hrportal,代码行数:11,代码来源:CommonComponent.php


示例8: interpret

 public function interpret()
 {
     $resultingCity = new City("Nowhere", -999.9, -999.9);
     foreach ($this->expressions as $currentExpression) {
         $currentCity = $currentExpression->interpret();
         if ($currentCity->getLongitude() > $resultingCity->getLongitude()) {
             $resultingCity = $currentCity;
         }
     }
     return $resultingCity;
 }
开发者ID:phoenixproject,项目名称:phpdpe,代码行数:11,代码来源:most_easterly_expression.php


示例9: __construct

 public function __construct($user_id = 0)
 {
     parent::__construct('user', $user_id);
     if ($user_id) {
         $sql = sprintf("SELECT region_id FROM user_region WHERE user_id=%d AND region_type=%d ORDER BY updated_date DESC LIMIT 1", $user_id, REGION_CITY);
         $city_id = db()->Get_Cell($sql);
         $city = new City($city_id);
         $this->city_id = $city_id;
         $this->county_id = $city->county_id();
         $this->state_id = $city->state_id();
     }
 }
开发者ID:rtoews,项目名称:meocracy,代码行数:12,代码来源:class.user.php


示例10: Add_City

 /**
  * @param City $city
  * @return bool
  * this function takes city as a parameter and add the city to the data base
  * if the city is added to the database it will return true
  * else it will return false
  */
 function Add_City(City $city)
 {
     $City_Name = $city->getCity();
     $City_Name_Amharic = $city->getCityAmharic();
     $query = "INSERT INTO city (Name,Name_Amharic) VALUES('{$City_Name}','{$City_Name_Amharic}')";
     $result = mysqli_query($this->getDbc(), $query);
     if ($result) {
         return TRUE;
     } else {
         return FALSE;
     }
 }
开发者ID:rogermule,项目名称:afalagi-web,代码行数:19,代码来源:Sub_Encoder_Controller.php


示例11: run

 public function run()
 {
     $faker = Faker::create();
     foreach (range(1, 50) as $index) {
         $city = new City();
         $city->link = $faker->url;
         $city->img_src = $faker->imageUrl($width = 640, $height = 480);
         $city->name_en = $faker->city;
         $city->latitude = $faker->latitude;
         $city->longitude = $faker->longitude;
         $city->save();
     }
 }
开发者ID:C-a-p-s-t-o-n-e,项目名称:capstone.dev,代码行数:13,代码来源:CityTableSeeder.php


示例12: check

 public static function check($_cpt, $_cntry)
 {
     $city = City::model()->find('country_id=:cntry AND caption=:cpt', array(':cntry' => $_cntry, ':cpt' => $_cpt));
     if ($city !== null) {
         return $city->getPrimaryKey();
     }
     $city = new City();
     $city->attributes = array('caption' => $_cpt, 'country_id' => $_cntry);
     if ($city->save()) {
         return $city->getPrimaryKey();
     }
     return false;
 }
开发者ID:righ22,项目名称:Xata,代码行数:13,代码来源:City.php


示例13: ifCityUndefined

 private function ifCityUndefined($userStep, $cityName)
 {
     if (City::model()->cityNotExist($cityName)) {
         if (!WikiUtils::checkCityByWiki($cityName) && !WikiUtils::checkCityByWiki($cityName . "_(город)")) {
             $userStep->error = GameUtils::ERROR_CITY_UNDEFINED;
             return true;
         }
         $city = new City();
         $city->name = $cityName;
         $city->save();
         return false;
     }
 }
开发者ID:tatyanayavkina,项目名称:yii_city_game,代码行数:13,代码来源:GamestepController.php


示例14: Delete

 public function Delete()
 {
     global $obj, $model, $param1;
     include_once 'Model/city.php';
     $model = new City();
     $model->Id = $param1;
     if ($model->Delete()) {
         print '<span class="success">City Updated</span>';
     } else {
         print '<span class="error">' . $model->Error . '</span>';
     }
     include_once 'View/City/index.php';
 }
开发者ID:csebubt,项目名称:news,代码行数:13,代码来源:cityController.php


示例15: actionCreate

 /**
  * 录入
  *
  */
 public function actionCreate()
 {
     parent::_acl('city_create');
     $model = new City();
     if (isset($_POST['City'])) {
         $model->attributes = $_POST['City'];
         if ($model->save()) {
             AdminLogger::_create(array('catalog' => 'create', 'intro' => '录入城市,ID:' . $model->id));
             $this->redirect(array('index'));
         }
     }
     $this->render('create', array('model' => $model));
 }
开发者ID:zywh,项目名称:maplecity,代码行数:17,代码来源:CityController.php


示例16: actionCreateOrg

 public function actionCreateOrg()
 {
     $org = Organization::model()->count();
     if ($org == 0) {
         $this->layout = 'installation_layout';
         $model = new Organization();
         $user = new User();
         $auth_assign = new AuthAssignment();
         // Uncomment the following line if AJAX validation is needed
         $this->performAjaxValidation($model);
         if (isset($_POST['Organization']['organization_name']) && !empty($_POST['Organization']['phone']) && !empty($_POST['Organization']['email'])) {
             $country_model = new Country();
             $country_model->name = $_POST['Organization']['country'];
             $country_model->save();
             $state_model = new State();
             $state_model->state_name = $_POST['Organization']['state'];
             $state_model->country_id = $country_model->id;
             $state_model->save();
             $city_model = new City();
             $city_model->city_name = $_POST['Organization']['city'];
             $city_model->country_id = $country_model->id;
             $city_model->state_id = $state_model->state_id;
             $city_model->save();
             $model->attributes = $_POST['Organization'];
             $model->organization_created_by = 1;
             $model->organization_creation_date = new CDbExpression('NOW()');
             $model->city = $city_model->city_id;
             $model->state = $state_model->state_id;
             $model->country = $country_model->id;
             if ($model->save(false)) {
                 $user->user_organization_email_id = $model->email;
                 $user->user_password = md5($model->email . $model->email);
                 $user->user_type = 'admin';
                 $user->user_created_by = 1;
                 $user->user_creation_date = new CDbExpression('NOW()');
                 $user->user_organization_id = $model->organization_id;
                 $user->save();
                 $auth_assign->itemname = 'SuperAdmin';
                 $auth_assign->userid = $user->user_id;
                 $auth_assign->save(false);
                 $this->redirect(array('redirectLogin'));
             }
         }
         $this->render('create_org', array('model' => $model));
     } else {
         Yii::app()->user->logout();
         $this->redirect(array('login'));
     }
 }
开发者ID:sharmarakesh,项目名称:EduSec2.0.0,代码行数:49,代码来源:SiteController.php


示例17: get_town

 public static function get_town()
 {
     $title = array("Балаклея", "Первомайск", "Богодухов", "Змиев", "Чугуев", "Валки");
     $year = rand(1750, 1950);
     $lat = rand(49923, 50062) / 1000;
     //координаты
     $lon = rand(36142, 36390) / 1000;
     $nstreets = rand(1, 20);
     //количество улиц
     $town = new City($title, $year, $lat, $lon, $nstreets);
     for ($i = 0; $i < $nstreets; $i++) {
         $town->add_street(self::get_street());
     }
     return $town;
 }
开发者ID:Olya-hahatushka,项目名称:City,代码行数:15,代码来源:classGenerate.php


示例18: __construct

 public function __construct()
 {
     $this->beforeFilter(function () {
         if (Request::format() == 'html') {
             if (!Auth::check()) {
                 return Redirect::to('/login');
             } else {
                 $this->user_id = Auth::user()->id;
                 $this->zipcode = Session::get('zipcode');
                 $this->store_id = Session::get('store_id');
                 $this->cart_id = Session::get('cart_id');
                 $lists = Lists::where('owner_id', $this->user_id)->get();
                 Session::put('lists', $lists);
                 $this->city = City::where('zipcode', $this->zipcode)->first();
                 $this->stores = DB::table('stores')->leftJoin('store_locations', 'stores.id', '=', 'store_locations.store_id')->where('store_locations.zipcode', $this->zipcode)->select('stores.*')->get();
                 $this->departments = Department::where('store_id', $this->store_id)->get();
                 $this->store = Store::find($this->store_id);
             }
         } else {
             $this->user_id = Input::get('user_id');
             $token = Input::get('token');
             if ($user = User::where('token', '=', $token)->where('id', '=', $this->user_id)->first()) {
                 $this->zipcode = $user->zipcode;
             } else {
                 $response_array = array('success' => 'false', 'error_code' => '400', 'error' => 'Invalid Token');
                 $response_code = 200;
                 $response = Response::json($response_array, $response_code);
                 return $response;
             }
         }
     }, array('except' => array()));
 }
开发者ID:sohelrana820,项目名称:mario-gomez,代码行数:32,代码来源:StoreController.php


示例19: 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);
     }
 }
开发者ID:jnicolasbc,项目名称:admin_swp_com,代码行数:36,代码来源:ClinicController.php


示例20: prepareInfoForTab

 public static function prepareInfoForTab(HotelTripElement $hotel)
 {
     /** @var $hotel HotelTripElement */
     $from = City::getCityByPk($hotel->city);
     $tab = array();
     $tab['label'] = '<b>Отель в городе ' . $from->localRu . '</b><br>' . $hotel->checkIn . " &mdash; " . $hotel->checkOut;
     $tab['id'] = $hotel->id . '_tab';
     $tab['info'] = array('type' => 'hotel', 'cityId' => $hotel->city, 'checkIn' => $hotel->checkIn, 'checkOut' => $hotel->checkOut, 'duration' => $hotel->getDuration());
     foreach ($hotel->rooms as $i => $room) {
         $tab['info']['room'][$i]['adultCount'] = $room->adultCount;
         $tab['info']['room'][$i]['childCount'] = $room->childCount;
         $tab['info']['room'][$i]['cots'] = $room->cots;
         $tab['info']['room'][$i]['childAge'] = $room->childAge;
     }
     if ($hotel->hotel) {
         $controller = Yii::app()->getController();
         $tab['content'] = $controller->renderPartial('//tour/constructor/_chosen_hotel_precompiled', array('hotel' => $hotel->hotel), true);
         $tab['itemOptions']['class'] = 'hotel fill';
         $tab['fill'] = true;
     } else {
         $tab['content'] = 'loading...';
         $tab['itemOptions']['class'] = 'hotel unfill';
         $tab['fill'] = false;
     }
     return $tab;
 }
开发者ID:niranjan2m,项目名称:Voyanga,代码行数:26,代码来源:HotelTripElementFrontendProcessor.php



注:本文中的City类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP CityApi类代码示例发布时间:2022-05-20
下一篇:
PHP CitruscartSelect类代码示例发布时间:2022-05-20
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap