当前位置: 首页>>代码示例>>PHP>>正文


PHP Countries类代码示例

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


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

示例1: __construct

 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     $users = new Users();
     $users_options = $users->getOptions();
     $countries = new Countries();
     $countries_options = $countries->getOptions();
     $counties = new OsCounties();
     $county_options = $counties->getCountiesID();
     $activities = new PrimaryActivities();
     $activities_options = $activities->getTerms();
     $organisations = new Organisations();
     $organisations_options = $organisations->getOrgs();
     parent::__construct($options);
     $this->setName('people');
     $title = new Zend_Form_Element_Select('title');
     $title->setLabel('Title: ')->addFilters(array('StripTags', 'StringTrim'))->setValue('Mr')->addErrorMessage('Choose title of person')->setAttrib('class', 'span2 selectpicker show-menu-arrow')->addMultiOptions(array('Mr' => 'Mr', 'Mrs' => 'Mrs', 'Miss' => 'Miss', 'Ms' => 'Ms', 'Dr' => 'Dr.', 'Prof' => 'Prof.', 'Sir' => 'Sir', 'Lord' => 'Lord', 'Lady' => 'Lady', 'Other' => 'Other', 'Captain' => 'Captain', 'Master' => 'Master', 'Dame' => 'Dame', 'Duke' => 'Duke', 'Admiral' => 'Admiral', 'Baron' => 'Baron', 'Baroness' => 'Baroness', 'Brigadier' => 'Brigadier', 'Captain' => 'Captain', 'Colonel' => 'Colonel', 'Colonel Sir' => 'Colonel Sir', 'Commander' => 'Commander', 'Commodore' => 'Commodore', 'Countess' => 'Countess', 'Earl' => 'Earl', 'Field Marshal Lord' => 'Field Marshal Lord', 'General' => 'General', 'Group Captain' => 'Group Captain', 'Lieutenant' => 'Lieutenant', 'Lieutenant Commander' => 'Lieutenant Commander', 'Lt-Col' => 'Lt-Col', 'Lt-Gen Sir' => 'Lt-Gen Sir', 'Maj-Gen' => 'Maj-Gen', 'Major' => 'Major', 'Prince' => 'Prince', 'Princesss' => 'Princess', 'Rear Admiral' => 'Rear Admiral', 'Squadron Leader' => 'Squadron Leader', 'The Baroness' => 'The Baroness', 'The Countess' => 'The Countess', 'The Countess of' => 'The Countess of', 'The Duchess of' => 'The Duchess of', 'The Duke of' => 'The Duke of', 'The Earl of' => 'The Earl of', 'The Hon' => 'The Hon', 'His Honour Judge' => 'His Honour Judge', 'The Hon Mrs' => 'The Hon Mrs', 'The Marchioness of' => 'The Marchioness of', 'The Marquess of' => 'The Marquess of', 'The Viscount' => 'The Viscount', 'The Viscountess' => 'The Viscountess', 'Wing Commander' => 'Wing Commander', 'The Reverend' => 'The Reverend', 'Archbishop' => 'Archbishop', 'Canon' => 'Canon', 'Bishop' => 'Bishop'));
     $forename = new Zend_Form_Element_Text('forename');
     $forename->setLabel('Forename: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter person\'s forename')->addFilter(new Zend_Filter_Callback(array('callback' => 'ucfirst')));
     $surname = new Zend_Form_Element_Text('surname');
     $surname->setLabel('Surname: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addFilter(new Zend_Filter_Callback(array('callback' => 'ucfirst')))->addErrorMessage('Please enter person\'s surname');
     $fullname = new Zend_Form_Element_Text('fullname');
     $fullname->setLabel('Fullname: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter person\'s fullname');
     $email = new Zend_Form_Element_Text('email');
     $email->SetLabel('Email address: ')->addFilters(array('StringTrim', 'StringToLower', 'StripTags'))->addValidator('StringLength', false, array(1, 200))->addValidator('EmailAddress', false, array('mx' => true))->setAttrib('size', '60');
     $dbaseID = new Zend_Form_Element_Select('dbaseID');
     $dbaseID->setLabel('User account: ')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addValidator('Int')->addValidator('InArray', false, array(array_keys($users_options), null))->addMultiOptions(array(null => 'Choose a user account', 'Existing accounts' => $users_options))->addErrorMessage('You must enter a database account.');
     $canRecord = $this->addElement('checkbox', 'canRecord', array('label' => 'Allowed to record: '))->canRecord;
     $address = new Zend_Form_Element_Text('address');
     $address->SetLabel('Address: ')->addFilters(array('StripTags', 'StringTrim', 'Purifier'))->addValidator('StringLength', false, array(1, 500));
     $town_city = new Zend_Form_Element_Text('town_city');
     $town_city->SetLabel('Town: ')->addFilters(array('StripTags', 'StringTrim', 'Purifier'))->addValidator('StringLength', false, array(1, 200));
     $countyID = new Zend_Form_Element_Select('countyID');
     $countyID->setLabel('County: ')->addFilters(array('StripTags', 'StringTrim', 'Purifier'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Please choose a county', 'Valid counties' => $county_options));
     $postcode = new Zend_Form_Element_Text('postcode');
     $postcode->SetLabel('Postcode: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim', 'StringToUpper', 'Purifier'))->addValidator('StringLength', false, array(1, 200))->addValidator('ValidPostCode');
     $country = new Zend_Form_Element_Select('country');
     $country->SetLabel('Country: ')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addValidator('StringLength', false, array(1, 4))->addValidator('InArray', false, array(array_keys($countries_options)))->addMultiOptions(array(null => 'Please choose a country of residence', 'Valid countries' => $countries_options))->setValue('GB');
     $hometel = new Zend_Form_Element_Text('hometel');
     $hometel->SetLabel('Home telephone number: ')->addFilters(array('StripTags', 'StringTrim', 'Purifier'))->addValidator('StringLength', false, array(1, 30));
     $worktel = new Zend_Form_Element_Text('worktel');
     $worktel->SetLabel('Work telephone number: ')->addFilters(array('StripTags', 'StringTrim', 'Purifier'))->addValidator('StringLength', false, array(1, 30));
     $fax = new Zend_Form_Element_Text('faxno');
     $fax->SetLabel('Fax number: ')->addFilters(array('StripTags', 'StringTrim', 'Purifier'))->addValidator('StringLength', false, array(1, 30));
     $comments = new Pas_Form_Element_CKEditor('comments');
     $comments->SetLabel('Comments: ')->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'));
     $organisationID = new Zend_Form_Element_Select('organisationID');
     $organisationID->SetLabel('Organisation attached to: ')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Please choose an organisation', 'Valid organisations' => $organisations_options))->addValidator('InArray', false, array(array_keys($organisations_options)));
     $primary_activity = new Zend_Form_Element_Select('primary_activity');
     $primary_activity->SetLabel('Person\'s primary activity: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addValidator('Int')->addValidator('InArray', false, array(array_keys($activities_options)))->addMultiOptions(array(null => 'Choose a primary activity', 'Valid activities' => $activities_options))->addErrorMessage('You must enter an activity for this person.');
     $submit = new Zend_Form_Element_Submit('submit');
     $this->addElements(array($title, $forename, $surname, $fullname, $email, $address, $town_city, $countyID, $postcode, $country, $dbaseID, $canRecord, $hometel, $worktel, $fax, $comments, $organisationID, $primary_activity, $submit));
     $this->addDisplayGroup(array('title', 'forename', 'surname', 'fullname', 'email', 'address', 'town_city', 'countyID', 'postcode', 'country', 'dbaseID', 'canRecord', 'hometel', 'worktel', 'faxno', 'comments', 'organisationID', 'primary_activity'), 'details');
     $this->details->setLegend('Person details: ');
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
 }
开发者ID:lesleyauk,项目名称:findsorguk,代码行数:61,代码来源:PeopleForm.php

示例2: buildCountries

 private function buildCountries($xml)
 {
     $countries = new Countries();
     $countryArray = array();
     foreach ($xml->Country as $country) {
         $tmpCountry = new Country();
         $tmpCountry->setCode((string) $country->Code);
         $tmpCountry->setGeoCoding((string) $country->Geocoding);
         $tmpCountry->setName((string) $country->Name);
         array_push($countryArray, $tmpCountry);
     }
     $countries->setCountry($countryArray);
     return $countries;
 }
开发者ID:vicenteguerra,项目名称:Flashbuy,代码行数:14,代码来源:CountriesLocalFavoritesService.php

示例3: __construct

 public function __construct($options = null)
 {
     $countries = new Countries();
     $countries_options = $countries->getOptions();
     $counties = new Counties();
     $counties_options = $counties->getCountyname2();
     $peoples = new Peoples();
     $people_options = $peoples->getNames2();
     parent::__construct($options);
     $this->setName('organisation');
     $decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'append', 'class' => 'error', 'tag' => 'li')), array('Label', array('separator' => ' ', 'requiredSuffix' => ' *')), array('HtmlTag', array('tag' => 'li')));
     $name = new Zend_Form_Element_Text('name');
     $name->setLabel('Organisation name: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 60)->addErrorMessage('Please enter an organisation name: ')->setDecorators($decorators)->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $website = new Zend_Form_Element_Text('website');
     $website->setLabel('Organisation website: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator(new Pas_Validate_Url())->addErrorMessage('Please enter a valid URL')->setAttrib('size', 60)->setDecorators($decorators);
     $address1 = new Zend_Form_Element_Text('address1');
     $address1->setLabel('Address line one: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 60)->setDecorators($decorators)->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $address2 = new Zend_Form_Element_Text('address2');
     $address2->setLabel('Address line two: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 60)->setDecorators($decorators)->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $address3 = new Zend_Form_Element_Text('address3');
     $address3->setLabel('Address line three: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 60)->setDecorators($decorators)->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $address = new Zend_Form_Element_Text('address');
     $address->setLabel('Full address: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 60)->setDecorators($decorators)->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $town_city = new Zend_Form_Element_Text('town_city');
     $town_city->setLabel('Town or city: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 60)->setDecorators($decorators)->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $county = new Zend_Form_Element_Select('county');
     $county->setLabel('County: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Please choose a county', 'Valid counties' => $counties_options))->addValidator('InArray', false, array(array_keys($counties_options)))->setDecorators($decorators);
     $country = new Zend_Form_Element_Select('country');
     $country->SetLabel('Country: ')->setRequired(true)->setValue('GB')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Please choose a country', 'Valid countries' => $countries_options))->addValidator('InArray', false, array(array_keys($countries_options)))->setDecorators($decorators);
     $postcode = new Zend_Form_Element_Text('postcode');
     $postcode->setLabel('Postcode: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('StringLength', false, array(1, 10))->addValidator('ValidPostCode')->addValidator('Alnum', false, array('allowWhiteSpace' => true))->addErrorMessage('Please enter a valid postcode')->setAttrib('size', 10)->setDecorators($decorators);
     $contactperson = new Zend_Form_Element_Text('contact');
     $contactperson->setLabel('Organisation\'s lead contact: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('StringLength', false, array(1, 200))->setAttrib('size', 50)->addValidator('Alnum', false, array('allowWhiteSpace' => true))->setDecorators($decorators);
     $contactpersonID = new Zend_Form_Element_Hidden('contactpersonID');
     $contactpersonID->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label');
     $submit = $this->addElement('submit', 'submit', array('label' => 'Login...'));
     $submit = $this->getElement('submit');
     $submit->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->setAttrib('class', 'large');
     $this->addElements(array($name, $website, $address1, $address2, $address3, $address, $town_city, $county, $country, $postcode, $contactperson, $contactpersonID));
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(4800);
     $this->addElement($hash);
     $this->addDisplayGroup(array('name', 'website', 'address1', 'address2', 'address3', 'address', 'town_city', 'county', 'country', 'postcode', 'contact', 'contactpersonID'), 'details');
     $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->removeDecorator('DtDdWrapper');
     $this->details->setLegend('Organisation details: ');
     $this->addDisplayGroup(array('submit'), 'submit');
 }
开发者ID:rwebley,项目名称:Beowulf---PAS,代码行数:48,代码来源:OrganisationForm.php

示例4: isValid

 public function isValid($value, $context = null)
 {
     if (!empty($value)) {
         $this->vat = $value;
         $countryid = intval($context['country_id']);
         if ($countryid == 0) {
             $this->_error(self::ISNOTCOUNTRYID);
             return false;
         }
         $country = Countries::find($context['country_id']);
         if (!empty($country->code)) {
             $this->countryCode = $country->code;
         } else {
             return false;
         }
         if (Countries::isITbyId($countryid)) {
             if (!is_numeric($value) || strlen($value) != 11) {
                 $this->_error(self::INVALIDVAT);
                 return false;
             }
         } elseif (Countries::isUEbyId($countryid)) {
             return $this->eu_check();
         }
     }
     return true;
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:26,代码来源:Vat.php

示例5: getTrack

 public static function getTrack($country)
 {
     $country = Countries::getEnglishName($country);
     $encodedJSON = file_get_contents("https://api.spotify.com/v1/search?type=track&q=" . urlencode($country));
     $tracks = json_decode($encodedJSON)->tracks;
     return $tracks->items[0]->preview_url;
 }
开发者ID:BastiaanGrisel,项目名称:dutchopenhackathon,代码行数:7,代码来源:spotify.php

示例6: init

 public function init()
 {
     // Set the custom decorator
     $this->addElementPrefixPath('Shineisp_Decorator', 'Shineisp/Decorator/', 'decorator');
     $translate = Shineisp_Registry::get('Zend_Translate');
     $this->addElement('text', 'firstname', array('filters' => array('StringTrim'), 'required' => true, 'label' => $translate->_('Firstname'), 'description' => $translate->_('Write here your firstname.'), 'decorators' => array('Bootstrap'), 'class' => 'form-control large-input'));
     $this->addElement('text', 'lastname', array('filters' => array('StringTrim'), 'required' => true, 'label' => $translate->_('Lastname'), 'description' => $translate->_('Write here your lastname.'), 'decorators' => array('Bootstrap'), 'class' => 'form-control large-input'));
     $this->addElement('select', 'company_type_id', array('label' => $translate->_('Company Type'), 'decorators' => array('Bootstrap'), 'description' => $translate->_('Select the company type'), 'class' => 'form-control large-input'));
     $this->getElement('company_type_id')->setAllowEmpty(false)->setMultiOptions(CompanyTypes::getList(true));
     $this->addElement('select', 'legalform', array('label' => $translate->_('Legal form'), 'required' => true, 'decorators' => array('Bootstrap'), 'description' => $translate->_('Select the type of company.'), 'class' => 'form-control large-input'));
     $this->getElement('legalform')->setAllowEmpty(false)->setMultiOptions(Legalforms::getList());
     $this->addElement('text', 'company', array('filters' => array('StringTrim'), 'label' => $translate->_('Company Name'), 'decorators' => array('Bootstrap'), 'description' => $translate->_('Write here your company name.'), 'class' => 'form-control large-input'));
     $this->addElement('text', 'vat', array('filters' => array('StringTrim'), 'label' => $translate->_('VAT'), 'decorators' => array('Bootstrap'), 'class' => 'form-control large-input', 'description' => $translate->_('Write here the VAT number.')));
     $this->addElement('text', 'area', array('filters' => array('StringTrim'), 'required' => true, 'label' => $translate->_('Area'), 'decorators' => array('Bootstrap'), 'class' => 'form-control medium-input', 'description' => $translate->_('Write the area code')));
     $this->addElement('text', 'taxpayernumber', array('filters' => array('StringTrim'), 'label' => $translate->_('Tax payer number'), 'decorators' => array('Bootstrap'), 'class' => 'form-control large-input', 'description' => $translate->_('Write the tax payer number.')));
     $this->addElement('text', 'address', array('filters' => array('StringTrim'), 'required' => true, 'label' => $translate->_('Address'), 'decorators' => array('Bootstrap'), 'description' => $translate->_('Write the address'), 'class' => 'form-control large-input'));
     $this->addElement('text', 'code', array('filters' => array('StringTrim'), 'required' => true, 'label' => $translate->_('Zip'), 'description' => $translate->_('Write the zip code'), 'decorators' => array('Bootstrap'), 'class' => 'form-control medium-input'));
     $this->addElement('text', 'city', array('filters' => array('StringTrim'), 'required' => true, 'label' => $translate->_('City'), 'description' => $translate->_('Write here your city name'), 'decorators' => array('Bootstrap'), 'class' => 'form-control large-input'));
     $this->addElement('select', 'country_id', array('label' => $translate->_('Country'), 'required' => true, 'description' => $translate->_('Select your own country'), 'decorators' => array('Bootstrap'), 'class' => "form-control"));
     $this->getElement('country_id')->setAllowEmpty(false)->setMultiOptions(Countries::getList())->setRequired(true);
     $this->addElement('text', 'email', array('filters' => array('StringTrim', 'StringToLower'), 'required' => true, 'decorators' => array('Bootstrap'), 'validators' => array('EmailAddress'), 'required' => true, 'label' => $translate->_('Email'), 'description' => $translate->_('Write here your email'), 'class' => 'form-control large-input'));
     $this->addElement('password', 'password', array('filters' => array('StringTrim'), 'required' => true, 'decorators' => array('Bootstrap'), 'validators' => array(array('regex', false, '/^[a-zA-Z0-9\\-\\_\\.\\%\\!\\$]{6,20}$/')), 'description' => $translate->_('Write here your password. (min.6 chars - max.20 chars)'), 'label' => $translate->_('Password'), 'class' => 'form-control large-input'));
     $this->addElement('submit', 'save', array('required' => false, 'label' => $translate->_('Save'), 'decorators' => array('Bootstrap'), 'class' => 'btn btn-primary'));
     $this->addElement('hidden', 'customer_id');
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:25,代码来源:CartsimpleprofileForm.php

示例7: getLogo

 /**
  * get img for team
  * @param object ranking row
  * @param int type = 1 for club small logo, 2 for country
  * @return html string
  */
 public static function getLogo($item, $type = 1)
 {
     if ($type == 1) {
         if (!empty($item->logo_small)) {
             return JHtml::image($item->logo_small, $item->short_name, 'class="teamlogo"');
         }
     } else {
         if ($type == 2 && !empty($item->country)) {
             return Countries::getCountryFlag($item->country, 'class="teamcountry"');
         } else {
             if ($type == 3) {
                 if (!empty($item->team_picture)) {
                     return JHtml::image($item->team_picture, $item->short_name, 'class="teamlogo"');
                 }
             } else {
                 if ($type == 4) {
                     if (!empty($item->projectteam_picture)) {
                         return JHtml::image($item->projecteam_picture, $item->short_name, 'class="teamlogo"');
                     }
                 }
             }
         }
     }
     return '';
 }
开发者ID:hfmprs,项目名称:JoomLeague,代码行数:31,代码来源:helper.php

示例8: init

 public function init()
 {
     // Set the custom decorator
     $this->addElementPrefixPath('Shineisp_Decorator', 'Shineisp/Decorator/', 'decorator');
     $translate = Shineisp_Registry::get('Zend_Translate');
     $this->addElement('text', 'firstname', array('filters' => array('StringTrim'), 'required' => true, 'label' => $translate->_('Firstname'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
     $this->addElement('text', 'lastname', array('filters' => array('StringTrim'), 'required' => true, 'label' => $translate->_('Lastname'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
     $this->addElement('select', 'gender', array('label' => $translate->_('Gender'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
     $this->getElement('gender')->setAllowEmpty(true)->setMultiOptions(array('M' => $translate->translate('Man'), 'F' => $translate->translate('Female')));
     $this->addElement('text', 'birthdate', array('filters' => array('StringTrim'), 'label' => $translate->_('Birth date'), 'decorators' => array('Bootstrap'), 'class' => 'form-control date'));
     $this->addElement('text', 'birthplace', array('filters' => array('StringTrim'), 'label' => $translate->_('Birth place'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
     $this->addElement('text', 'birthdistrict', array('filters' => array('StringTrim'), 'label' => $translate->_('Birth district'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
     $this->addElement('text', 'birthcountry', array('filters' => array('StringTrim'), 'label' => $translate->_('Birth country'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
     $this->addElement('text', 'birthnationality', array('filters' => array('StringTrim'), 'label' => $translate->_('Birth nationality'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
     $this->addElement('select', 'type_id', array('label' => $translate->_('Company Type'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
     $this->getElement('type_id')->setAllowEmpty(true)->setMultiOptions(CompanyTypes::getList(true));
     $this->addElement('select', 'legalform_id', array('label' => 'Legal form', 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
     $this->getElement('legalform_id')->setAllowEmpty(true)->setMultiOptions(Legalforms::getList());
     $this->addElement('text', 'company', array('filters' => array('StringTrim'), 'label' => $translate->_('Company Name'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
     $this->addElement('text', 'vat', array('filters' => array('StringTrim'), 'label' => $translate->_('VAT Number'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
     $this->addElement('text', 'taxpayernumber', array('filters' => array('StringTrim'), 'label' => $translate->_('Taxpayer Number'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
     $this->addElement('text', 'address', array('filters' => array('StringTrim'), 'label' => $translate->_('Address'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
     $this->addElement('text', 'zip', array('filters' => array('StringTrim'), 'label' => $translate->_('Zip code'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
     $this->addElement('text', 'area', array('filters' => array('StringTrim'), 'label' => $translate->_('Area'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
     $this->addElement('text', 'city', array('filters' => array('StringTrim'), 'label' => $translate->_('City'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
     $this->addElement('select', 'country_id', array('label' => $translate->_('Country'), 'decorators' => array('Bootstrap'), 'class' => 'form-control', 'onchange' => 'onChangeCountry( this );'));
     $this->getElement('country_id')->setAllowEmpty(false)->setMultiOptions(Countries::getList(true));
     $this->addElement('text', 'phone', array('filters' => array('StringTrim'), 'label' => $translate->_('Phone'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
     $this->addElement('text', 'fax', array('filters' => array('StringTrim'), 'label' => $translate->_('Fax'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
     $this->addElement('text', 'email', array('filters' => array('StringTrim', 'StringToLower'), 'decorators' => array('Bootstrap'), 'validators' => array('EmailAddress'), 'required' => true, 'label' => $translate->_('Email'), 'class' => 'form-control'));
     $this->addElement('select', 'status_id', array('label' => $translate->_('Status'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
     $this->getElement('status_id')->setAllowEmpty(false)->setMultiOptions(Statuses::getList('customers'));
     $this->addElement('submit', 'submit', array('label' => $translate->_('Save'), 'decorators' => array('Bootstrap'), 'class' => 'btn btn-primary btn-lg'));
     $this->addElement('hidden', 'profile_id');
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:35,代码来源:DomainsProfilesForm.php

示例9: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     //Empty the countries table
     DB::table('countries')->delete();
     if (DB::table('countries')->count() == 0) {
         //Get all of the countries
         $countries = Countries::getList();
         foreach ($countries as $countryId => $country) {
             DB::table('countries')->insert(array('id' => $countryId, 'capital' => isset($country['capital']) ? $country['capital'] : null, 'citizenship' => isset($country['citizenship']) ? $country['citizenship'] : null, 'country_code' => $country['country-code'], 'currency' => isset($country['currency']) ? $country['currency'] : null, 'currency_code' => isset($country['currency_code']) ? $country['currency_code'] : null, 'currency_sub_unit' => isset($country['currency_sub_unit']) ? $country['currency_sub_unit'] : null, 'full_name' => isset($country['full_name']) ? $country['full_name'] : null, 'iso_3166_2' => $country['iso_3166_2'], 'iso_3166_3' => $country['iso_3166_3'], 'name' => $country['name'], 'region_code' => $country['region-code'], 'sub_region_code' => $country['sub-region-code'], 'eea' => (bool) $country['eea']));
         }
     }
     // Source: http://www.bitboost.com/ref/international-address-formats.html
     // Source: https://en.wikipedia.org/wiki/Linguistic_issues_concerning_the_euro
     $countries = ['AR' => ['swap_postal_code' => true], 'AT' => ['swap_postal_code' => true, 'swap_currency_symbol' => true], 'BE' => ['swap_postal_code' => true], 'BG' => ['swap_currency_symbol' => true], 'CH' => ['swap_postal_code' => true], 'CZ' => ['swap_currency_symbol' => true], 'DE' => ['swap_postal_code' => true, 'swap_currency_symbol' => true], 'DK' => ['swap_postal_code' => true], 'EE' => ['swap_currency_symbol' => true], 'ES' => ['swap_postal_code' => true, 'swap_currency_symbol' => true], 'FI' => ['swap_postal_code' => true, 'swap_currency_symbol' => true], 'FR' => ['swap_postal_code' => true, 'swap_currency_symbol' => true], 'GR' => ['swap_currency_symbol' => true], 'HR' => ['swap_currency_symbol' => true], 'HU' => ['swap_currency_symbol' => true], 'GL' => ['swap_postal_code' => true], 'IE' => ['thousand_separator' => ',', 'decimal_separator' => '.'], 'IL' => ['swap_postal_code' => true], 'IS' => ['swap_postal_code' => true, 'swap_currency_symbol' => true], 'IT' => ['swap_postal_code' => true, 'swap_currency_symbol' => true], 'JP' => ['swap_postal_code' => true, 'swap_currency_symbol' => true], 'LT' => ['swap_currency_symbol' => true], 'LU' => ['swap_postal_code' => true], 'MY' => ['swap_postal_code' => true], 'MX' => ['swap_postal_code' => true], 'NL' => ['swap_postal_code' => true], 'PL' => ['swap_postal_code' => true, 'swap_currency_symbol' => true], 'PT' => ['swap_postal_code' => true, 'swap_currency_symbol' => true], 'RO' => ['swap_currency_symbol' => true], 'SE' => ['swap_postal_code' => true, 'swap_currency_symbol' => true], 'SI' => ['swap_currency_symbol' => true], 'SK' => ['swap_currency_symbol' => true], 'UY' => ['swap_postal_code' => true]];
     foreach ($countries as $code => $data) {
         $country = Country::where('iso_3166_2', '=', $code)->first();
         if (isset($data['swap_postal_code'])) {
             $country->swap_postal_code = true;
         }
         if (isset($data['swap_currency_symbol'])) {
             $country->swap_currency_symbol = true;
         }
         if (isset($data['thousand_separator'])) {
             $country->thousand_separator = $data['thousand_separator'];
         }
         if (isset($data['decimal_separator'])) {
             $country->decimal_separator = $data['decimal_separator'];
         }
         $country->save();
     }
 }
开发者ID:hannenijhuis,项目名称:invoiceninja,代码行数:36,代码来源:CountriesSeeder.php

示例10: init

 public function init()
 {
     // Set the custom decorator
     $this->addElementPrefixPath('Shineisp_Decorator', 'Shineisp/Decorator/', 'decorator');
     $this->addElement('text', 'firstname', array('filters' => array('StringTrim'), 'required' => true, 'label' => 'Firstname', 'description' => 'Write here your firstname.', 'decorators' => array('Composite'), 'class' => 'text-input large-input'));
     $this->addElement('text', 'lastname', array('filters' => array('StringTrim'), 'required' => true, 'label' => 'Lastname', 'description' => 'Write here your lastname.', 'decorators' => array('Composite'), 'class' => 'text-input large-input'));
     $this->addElement('text', 'birthdate', array('filters' => array('StringTrim'), 'required' => true, 'validators' => array(new Zend_Validate_Date('dd/mm/yyyy', 'it')), 'label' => 'Birthdate', 'description' => 'Write here your birthday (eg. dd/mm/yyyy)', 'decorators' => array('Composite'), 'class' => 'text-input medium-input'));
     $this->addElement('select', 'company_type_id', array('label' => 'Company Type', 'decorators' => array('Composite'), 'description' => 'Select the company type', 'class' => 'text-input large-input'));
     $this->getElement('company_type_id')->setAllowEmpty(false)->setMultiOptions(CompanyTypes::getList(true));
     $this->addElement('select', 'legalform', array('label' => 'Legalform', 'required' => true, 'decorators' => array('Composite'), 'description' => 'Select the type of company.', 'class' => 'text-input large-input'));
     $this->getElement('legalform')->setAllowEmpty(false)->setMultiOptions(Legalforms::getList(true))->addValidator(new Shineisp_Validate_Customer());
     $this->addElement('text', 'company', array('filters' => array('StringTrim'), 'label' => 'Company Name', 'decorators' => array('Composite'), 'description' => 'Write here your company name.', 'class' => 'text-input large-input'));
     $this->addElement('text', 'birthplace', array('filters' => array('StringTrim'), 'label' => 'Birthplace', 'decorators' => array('Composite'), 'class' => 'text-input large-input'));
     $this->addElement('text', 'birthdistrict', array('filters' => array('StringTrim'), 'label' => 'Birth District', 'decorators' => array('Composite'), 'class' => 'text-input medium-input', 'maxlength' => 2));
     $this->addElement('text', 'birthcountry', array('filters' => array('StringTrim'), 'label' => 'Country of Birth', 'decorators' => array('Composite'), 'class' => 'text-input large-input'));
     $this->addElement('text', 'birthnationality', array('filters' => array('StringTrim'), 'label' => 'Birth Nationality', 'decorators' => array('Composite'), 'class' => 'text-input large-input'));
     $vatValidator = new Shineisp_Validate_Vat();
     $this->addElement('text', 'vat', array('filters' => array('StringTrim'), 'label' => 'VAT Number', 'decorators' => array('Composite'), 'class' => 'text-input large-input', 'description' => 'Write here the VAT code. Eg: IT123456789'));
     $this->getElement('vat')->addValidator($vatValidator);
     $this->addElement('text', 'area', array('filters' => array('StringTrim'), 'label' => 'Area', 'decorators' => array('Composite'), 'class' => 'text-input medium-input', 'description' => 'Write the area code'));
     $fiscalcodeValidator = new Shineisp_Validate_Fiscalcode();
     $this->addElement('text', 'taxpayernumber', array('filters' => array('StringTrim'), 'label' => 'Tax payer number', 'decorators' => array('Composite'), 'class' => 'text-input large-input', 'description' => 'Write the tax payer number.'));
     $this->getElement('taxpayernumber')->addValidator($fiscalcodeValidator);
     $this->addElement('text', 'address', array('filters' => array('StringTrim'), 'required' => true, 'label' => 'Address', 'decorators' => array('Composite'), 'description' => 'Write the address', 'class' => 'text-input large-input'));
     $this->addElement('text', 'code', array('filters' => array('StringTrim'), 'required' => true, 'label' => 'Zip', 'description' => 'Write the zip code', 'decorators' => array('Composite'), 'class' => 'text-input medium-input'));
     $this->addElement('text', 'city', array('filters' => array('StringTrim'), 'required' => true, 'label' => 'City', 'description' => 'Write here your city name', 'decorators' => array('Composite'), 'class' => 'text-input large-input'));
     $this->addElement('select', 'country_id', array('label' => 'Country', 'decorators' => array('Composite'), 'class' => 'text-input large-input'));
     $this->getElement('country_id')->setAllowEmpty(false)->setMultiOptions(Countries::getList())->setRequired(true);
     $this->addElement('select', 'gender', array('label' => 'Gender', 'required' => true, 'decorators' => array('Composite'), 'class' => 'text-input medium-input'));
     $this->getElement('gender')->setAllowEmpty(false)->setMultiOptions(array('M' => 'M', 'F' => 'F'))->setRequired(true);
     $this->addElement('text', 'telephone', array('filters' => array('StringTrim'), 'label' => 'Telephone', 'required' => true, 'decorators' => array('Composite'), 'description' => 'Write here the contact (eg. +39.98368276)', 'class' => 'text-input medium-input'));
     $this->addElement('text', 'email', array('filters' => array('StringTrim', 'StringToLower'), 'required' => true, 'decorators' => array('Composite'), 'validators' => array('EmailAddress'), 'required' => true, 'label' => 'Email', 'description' => 'Write here your email', 'class' => 'text-input large-input'));
     $this->addElement('submit', 'submit', array('required' => false, 'label' => 'Save', 'decorators' => array('Composite'), 'class' => 'button'));
     $this->addElement('hidden', 'customer_id');
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:35,代码来源:CustomerForm.php

示例11: __construct

 public function __construct($options = null)
 {
     $countries = new Countries();
     $countries_options = $countries->getOptions();
     $counties = new Counties();
     $county_options = $counties->getCountyName2();
     parent::__construct($options);
     $this->setAttrib('accept-charset', 'UTF-8');
     $decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'append', 'class' => 'error', 'tag' => 'li')), array('Label'), array('HtmlTag', array('tag' => 'li')));
     $this->setName('coroner');
     $firstname = new Zend_Form_Element_Text('firstname');
     $firstname->setLabel('First name: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Come on it\'s not that hard, enter a firstname!')->setDecorators($decorators);
     $lastname = new Zend_Form_Element_Text('lastname');
     $lastname->setLabel('Last name: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('StringLength', false, array(1, 200))->setDecorators($decorators);
     $email = new Zend_Form_Element_Text('email');
     $email->SetLabel('Email address: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('StringLength', false, array(1, 200))->addValidator('EmailAddress', false)->setDecorators($decorators);
     $address_1 = new Zend_Form_Element_Text('address_1');
     $address_1->SetLabel('Address line one: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('StringLength', false, array(1, 200))->setDecorators($decorators);
     $address_2 = new Zend_Form_Element_Text('address_2');
     $address_2->SetLabel('Address line two: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('StringLength', false, array(1, 200))->setDecorators($decorators);
     $town = new Zend_Form_Element_Text('town');
     $town->SetLabel('Town: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('StringLength', false, array(1, 200))->setDecorators($decorators);
     $county = new Zend_Form_Element_Select('county');
     $county->setLabel('County: ')->addFilters(array('StripTags', 'StringTrim'))->addValidators(array('NotEmpty'))->addMultiOptions(array(NULL => 'Choose county', 'Valid county' => $county_options))->setDecorators($decorators);
     $region_name = new Zend_Form_Element_Text('region_name');
     $region_name->SetLabel('Administrative region: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('StringLength', false, array(1, 200))->setDecorators($decorators);
     $postcode = new Zend_Form_Element_Text('postcode');
     $postcode->SetLabel('Postcode: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('StringLength', false, array(1, 200))->addValidator('ValidPostCode')->setDecorators($decorators);
     $country = new Zend_Form_Element_Select('country');
     $country->SetLabel('Country: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('StringLength', false, array(1, 4))->addValidator('InArray', false, array(array_keys($countries_options)))->addMultiOptions($countries_options)->setValue('GB')->setDecorators($decorators);
     $telephone = new Zend_Form_Element_Text('telephone');
     $telephone->SetLabel('Telephone number: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('StringLength', false, array(1, 200))->setDecorators($decorators);
     $fax = new Zend_Form_Element_Text('fax');
     $fax->SetLabel('Fax number: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('StringLength', false, array(1, 200))->setDecorators($decorators);
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->removeDecorator('DtDdWrapper')->setAttrib('class', 'large');
     $this->addElements(array($firstname, $lastname, $email, $address_1, $address_2, $town, $postcode, $county, $country, $telephone, $fax, $region_name, $submit));
     $this->addDisplayGroup(array('firstname', 'lastname', 'region_name', 'email', 'address_1', 'address_2', 'town', 'postcode', 'county', 'country', 'telephone', 'fax'), 'details')->removeDecorator('HtmlTag');
     $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->removeDecorator('DtDdWrapper');
     $this->details->removeDecorator('HtmlTag');
     $this->addDisplayGroup(array('submit'), 'submit');
     $this->submit->removeDecorator('DtDdWrapper');
     $this->submit->removeDecorator('HtmlTag');
     $this->details->setLegend('Submit Coroner\'s details ');
 }
开发者ID:rwebley,项目名称:Beowulf---PAS,代码行数:47,代码来源:CoronerForm.php

示例12: loadModel

 public function loadModel($id)
 {
     $model = Countries::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
开发者ID:josemanuel3dx,项目名称:TestYii,代码行数:8,代码来源:CountriesController.php

示例13: countryCode

 /**
  * Get country code
  *
  * @param string $country
  * @return string
  */
 protected static function countryCode($country)
 {
     $country = (string) $country;
     if (strlen($country) != 2) {
         $country = Countries::getCode($country);
     }
     return $country;
 }
开发者ID:jasny,项目名称:iso,代码行数:14,代码来源:CountryNativeNames.php

示例14: getOptions

 /**
  * Method to get the field options.
  *
  * @return  array  The field option objects.
  */
 protected function getOptions()
 {
     // Initialize variables.
     $options = Countries::getCountryOptions();
     // Merge any additional options in the XML definition.
     $options = array_merge(parent::getOptions(), $options);
     return $options;
 }
开发者ID:Heart1010,项目名称:JoomLeague,代码行数:13,代码来源:country.php

示例15: ShowForm

 protected function ShowForm()
 {
     $this->set('extrafields', RegistrationData::GetCustomFields());
     $this->set('allairlines', OperationsData::GetAllAirlines(true));
     $this->set('allhubs', OperationsData::GetAllHubs());
     $this->set('countries', Countries::getAllCountries());
     $this->render('registration_mainform.tpl');
 }
开发者ID:ryanunderwood,项目名称:phpVMS,代码行数:8,代码来源:Registration.php


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