/**
  * Fungsi inisialisasi form
  */
 public function init()
 {
     parent::init();
     $langId = Zend_Registry::get('languageId');
     if ($langId == 2) {
         $textisland = 'Island';
         $textprov = 'Province';
         $textseeloc = 'See Location';
         $textselisl = 'Select Island';
     } else {
         $textisland = 'Pulau';
         $textprov = 'Provinsi';
         $textseeloc = 'Lihat Lokasi';
         $textselisl = 'Pilih Pulau';
     }
     // Form Attribute
     $this->setMethod('post');
     $this->addAttribs(array('id' => 'mapLocationForm', 'action' => '', 'accept-charset' => 'utf-8'));
     // -> Island
     $areaDb = new Model_DbTable_Area();
     $islandData = $areaDb->getAllAreaChildByParent(0, $textselisl);
     $island = $this->createElement('select', 'island');
     $island->setLabel($textisland)->setMultiOptions($islandData)->setDecorators($this->elementDecorators);
     $this->addElement($island);
     // -> Province
     $province = $this->createElement('select', 'province');
     $province->setLabel($textprov)->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'id' => 'subarea')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
     $this->addElement($province);
     // -> Submit
     $submit = $this->createElement('submit', 'submitarea');
     $submit->setLabel($textseeloc)->setDecorators($this->buttonDecorators);
     $submit->setAttrib('class', 'button button-grey');
     $this->addElement($submit);
 }
 /**
  * Fungsi inisialisasi form
  */
 public function init()
 {
     parent::init();
     $langId = Zend_Registry::get('languageId');
     if ($langId == 2) {
         $textisland = 'Category';
         $textseeloc = 'See Location';
         $textselisl = 'Select Category';
     } else {
         $textisland = 'Kategori';
         $textseeloc = 'Lihat Lokasi';
         $textselisl = 'Pilih Kategori';
     }
     // Form Attribute
     $this->setMethod('post');
     $this->addAttribs(array('id' => 'mapLocationForm', 'action' => '', 'accept-charset' => 'utf-8'));
     // -> Island
     $categoryDb = new Model_DbTable_Category();
     $data = $categoryDb->getAllCategoryIdNameByLangIdForSelect($this->_languageId, $textselisl);
     $category = $this->createElement('select', 'category');
     $category->setLabel($textisland)->setMultiOptions($data)->setDecorators($this->elementDecorators);
     $this->addElement($category);
     // -> Submit
     $submit = $this->createElement('submit', 'submitcategory');
     $submit->setLabel($textseeloc)->setDecorators($this->buttonDecorators);
     $submit->setAttrib('class', 'button button-grey');
     $this->addElement($submit);
 }
 /**
  * Fungsi inisialisasi form
  */
 public function init()
 {
     parent::init();
     // Form Attribute
     $this->setMethod('post');
     $this->addAttribs(array('id' => 'commentForm'));
     $this->setAttrib('accept-charset', 'utf-8');
     $langId = Zend_Registry::get('languageId');
     if ($langId == 1) {
         $textNameComment = 'Name:';
         $textWebsiteComment = 'Website (Optional):';
         $textComment = 'Comment:';
         $textSubmit = 'Submit';
     } else {
         $textNameComment = 'Nama:';
         $textWebsiteComment = 'Website (Tidak Wajib):';
         $textComment = 'Komentar:';
         $textSubmit = 'Kirim';
     }
     if (!$this->_sess->username and !$this->_sess->fbname) {
         // Element Form
         // -> Author
         $name = $this->createElement('text', 'author');
         $name->setLabel($textNameComment)->setRequired(true);
         $this->addElement($name);
         // -> Email
         $email = $this->createElement('text', 'email');
         $email->setLabel('Email:')->setRequired(true)->addValidator(new Zend_Validate_EmailAddress());
         $this->addElement($email);
         // -> Website
         //$urlValidator = new Zend_Validate_Regex('((http://|https://)?(([a-z0-9]([-a-z0-9]*[a-z0-9]+)?){1,63}\.)+[a-z]{2,6})');
         // $urlValidator->setMessages(
         // array('regexNotMatch' => 'Value is not valid URL'));
         $website = $this->createElement('text', 'website');
         $website->setLabel($textWebsiteComment)->addValidator(new Budpar_Form_Validator_Url());
         //->addValidator($urlValidator);
         $this->addElement($website);
     }
     // -> Message
     $comment = $this->createElement('textarea', 'comment');
     $comment->setLabel($textComment)->setRequired(true);
     $this->addElement($comment);
     if (!$this->_sess->username and !$this->_sess->fbname) {
         // -> Captcha
         $publicKey = Zend_Registry::get('recaptcha_public_key');
         $privateKey = Zend_Registry::get('recaptcha_private_key');
         $recaptcha = new Zend_Service_ReCaptcha($publicKey, $privateKey);
         $captcha = new Zend_Form_Element_Captcha('captcha', array('captcha' => 'ReCaptcha', 'captchaOptions' => array('captcha' => 'ReCaptcha', 'service' => $recaptcha)));
         $this->addElement($captcha);
     }
     // -> Submit
     $submit = $this->createElement('submit', 'submit');
     $submit->setLabel($textSubmit)->removeDecorator('Label');
     $this->addElement($submit);
 }
 public function init()
 {
     parent::init();
     // Form Attribute
     $this->setMethod('get');
     $this->addAttribs(array('id' => 'destSearchForm', 'action' => $this->_baseUrlHelper->baseUrl() . '/destination/search'));
     // Element Form
     // -> Name
     $this->name = $this->createElement('text', 'destName');
     $this->name->setAttrib('onkeypress', 'return onSearchKeyPress(event)')->setDecorators($this->elementDecorators);
     $this->addElement($this->name);
 }
 /**
  * Fungsi inisialisasi form
  */
 public function init()
 {
     parent::init();
     // Form Attribute
     $this->setMethod('get');
     $this->addAttribs(array('id' => 'activitySearchForm', 'action' => $this->_baseUrlHelper->baseUrl() . '/destination/search'));
     $this->setAttrib('accept-charset', 'utf-8');
     // -> Activities
     $categoryDb = new Model_DbTable_Category();
     $category = $categoryDb->getAllButNotMainCategoryForForm($this->_languageId);
     $activity = $this->createElement('select', 'destActivity');
     $activity->setLabel('Activity')->setMultiOptions($category)->setDecorators($this->elementDecorators);
     $this->addElement($activity);
 }
 /**
  * Fungsi inisialisasi form
  */
 public function init()
 {
     parent::init();
     // Form Attribute
     $this->setMethod('post');
     $this->addAttribs(array('id' => 'inputForm', 'action' => $this->_baseUrlHelper->baseUrl() . '/registration/forgot'));
     $this->setAttrib('accept-charset', 'utf-8');
     // Element Form
     // -> Email
     $email = $this->createElement('text', 'email');
     $email->setLabel('Email:')->setRequired(true)->addValidator(new Zend_Validate_EmailAddress())->addValidator(new Zend_Validate_Db_RecordExists('user', 'email'));
     $this->addElement($email);
     // -> Submit
     $submit = $this->createElement('submit', 'submit');
     $submit->setLabel('Send')->removeDecorator('Label');
     $this->addElement($submit);
 }
 /**
  * Fungsi inisialisasi form
  */
 public function init()
 {
     parent::init();
     // Form Attribute
     $this->setMethod('get');
     $this->addAttribs(array('id' => 'dirSearchForm', 'action' => $this->_baseUrlHelper->baseUrl() . '/directory/search'));
     $this->setAttrib('accept-charset', 'utf-8');
     // Element Form
     // -> Type
     $classDirectoryDb = new Model_DbTable_ClassificationDirectory();
     $classDirectory = $classDirectoryDb->getAllForMenu();
     $this->addElement('select', 'dirType', array('decorators' => $this->elementDecorators, 'label' => 'Type', 'multiOptions' => $classDirectory));
     // -> Name
     $this->addElement('text', 'dirName', array('decorators' => $this->elementDecorators, 'label' => 'Name'));
     // -> Location
     $this->addElement('text', 'dirLocation', array('decorators' => $this->elementDecorators, 'label' => 'Location'));
 }
 /**
  * Fungsi inisialisasi form
  */
 public function init()
 {
     parent::init();
     // Form Attribute
     $this->setMethod('post');
     $this->addAttribs(array('id' => 'loginForm', 'action' => $this->_baseUrlHelper->baseUrl() . '/login/index'));
     $this->setAttrib('accept-charset', 'utf-8');
     $username = $this->createElement('text', 'username');
     $username->setLabel('Username')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->setDecorators($this->elementDecorators);
     $this->addElement($username);
     // -> Password
     $password = $this->createElement('password', 'password');
     $password->setLabel('Password')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->setDecorators($this->elementDecorators);
     $this->addElement($password);
     // -> Remember me
     /*$remember = $this->createElement('checkbox', 'remember');
       $password->setLabel('')
                ->setDecorators($this->elementDecorators);
       $this->addElement($password);*/
 }
 /**
  * Fungsi inisialisasi form
  */
 public function init()
 {
     parent::init();
     $langId = Zend_Registry::get('languageId');
     if ($langId == 2) {
         $textsearch = 'See Location';
     } else {
         $textsearch = 'Lihat Lokasi';
     }
     // Form Attribute
     $this->setMethod('post');
     $this->addAttribs(array('id' => 'mapDestForm', 'action' => '', 'accept-charset' => 'utf-8'));
     // -> Name
     $province = $this->createElement('text', 'searchname');
     $province->setLabel('searchname')->setDecorators($this->buttonDecorators);
     $this->addElement($province);
     // -> Submit
     $submit = $this->createElement('submit', 'submittext');
     $submit->setLabel($textsearch)->setDecorators($this->buttonDecorators);
     $submit->setAttrib('class', 'button button-grey');
     $this->addElement($submit);
 }
 /**
  * Fungsi inisialisasi form
  */
 public function init()
 {
     parent::init();
     $langId = Zend_Registry::get('languageId');
     if ($langId != 2) {
         $yourrate = 'Your rating for this destination:';
         $yourrev = 'Your review:';
         $tit = 'Title';
     } else {
         $yourrate = 'Rating Anda untuk destinasi ini:';
         $yourrev = 'Tinjauan Anda:';
         $tit = 'Judul';
     }
     // Form Attribute
     $this->setMethod('post');
     $this->addAttribs(array('id' => 'reviewForm'));
     $this->setAttrib('accept-charset', 'utf-8');
     // Element Form
     // -> Rating
     $ratingValue = array(0, 1, 2, 3, 4, 5);
     $rating = $this->createElement('radio', 'rate');
     $rating->setLabel($yourrate)->setRequired(true)->setMultiOptions($ratingValue)->addValidator('NotEmpty')->setDecorators(array('ViewHelper', 'Description', 'Errors', array('HtmlTag', array('tag' => 'dd', 'id' => 'rating-element', 'class' => 'rating-enable')), array('Label', array('tag' => 'dt'))));
     $this->addElement($rating);
     // -> Title
     $title = $this->createElement('text', 'review_title');
     $title->setLabel($tit)->setRequired(true)->addValidator('NotEmpty')->setDecorators(array('ViewHelper', 'Description', 'Errors', array('HtmlTag', array('tag' => 'dd', 'id' => 'review-element')), array('Label', array('tag' => 'dt'))));
     $this->addElement($title);
     // -> Review
     $review = $this->createElement('textarea', 'review_content');
     $review->setLabel($yourrev)->setRequired(true)->setAttrib('rows', '20')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setDecorators(array('ViewHelper', 'Description', 'Errors', array('HtmlTag', array('tag' => 'dd', 'id' => 'review-element')), array('Label', array('tag' => 'dt'))));
     $this->addElement($review);
     // -> Submit
     $submit = $this->createElement('submit', 'submit');
     $submit->setLabel('Submit')->removeDecorator('Label');
     $this->addElement($submit);
 }
 /**
  * Fungsi inisialisasi form
  */
 public function init()
 {
     parent::init();
     // Form Attribute
     $this->setMethod('post');
     $this->addAttribs(array('id' => 'changePasswordForm', 'action' => $this->_baseUrlHelper->baseUrl() . '/registration/change-password'));
     $this->setAttrib('accept-charset', 'utf-8');
     // Form Element
     // -> Password
     $oldPassword = $this->createElement('password', 'oldPassword');
     $oldPassword->setLabel('Old Password')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->setDecorators($this->elementDecorators);
     $this->addElement($oldPassword);
     // -> Password
     $password = $this->createElement('password', 'newPassword');
     $password->setLabel('New Password')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->setDecorators($this->elementDecorators);
     $this->addElement($password);
     // -> Password Confirm
     // ---> Validator password
     $identValidator = new Zend_Validate_Identical($_POST['newPassword']);
     $identValidator->setMessages(array('notSame' => 'Value doesn\'t match!', 'missingToken' => 'Value doesn\'t match!'));
     $password2 = $this->createElement('password', 'newPassword2');
     $password2->setLabel('Confirm New password:'******'StripTags')->addFilter('StringTrim')->addValidator($identValidator)->setDecorators($this->elementDecorators);
     $this->addElement($password2);
 }
 /**
  * Fungsi inisialisasi form
  */
 public function init()
 {
     parent::init();
     $langId = Zend_Registry::get('languageId');
     if ($langId != 2) {
         $textrealnamereg = 'Real Name';
         $textconfpassreg = 'Confirm Password';
         $textcountryreg = 'Country';
         $textselectcountryreg = 'Choose Country';
         $textreg = 'Register';
     } else {
         $textrealnamereg = 'Nama Asli';
         $textconfpassreg = 'Konfirmasi Password';
         $textcountryreg = 'Negara';
         $textselectcountryreg = 'Pilih Negara Anda';
         $textreg = 'Daftar';
     }
     // Form Attribute
     $this->setMethod('post');
     $this->addAttribs(array('id' => 'inputForm', 'action' => $this->_baseUrlHelper->baseUrl() . '/registration/index'));
     $this->setAttrib('accept-charset', 'utf-8');
     // Element Form
     // -> Real Name
     $realName = $this->createElement('text', 'realname');
     $realName->setLabel($textrealnamereg)->setRequired(true)->addValidator(new Zend_Validate_StringLength(3, 20));
     $this->addElement($realName);
     // -> Username
     $username = $this->createElement('text', 'username');
     $username->setLabel('Username')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator(new Zend_Validate_StringLength(3, 20))->addValidator(new Zend_Validate_Db_NoRecordExists('user', 'username'));
     $this->addElement($username);
     // -> Password
     $password = $this->createElement('password', 'password');
     $password->setLabel('Password')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim');
     $this->addElement($password);
     // -> Password Confirm
     // ---> Validator password
     $identValidator = new Zend_Validate_Identical($_POST['password']);
     $identValidator->setMessages(array('notSame' => 'Value doesn\'t match!', 'missingToken' => 'Value doesn\'t match!'));
     $password2 = $this->createElement('password', 'password2');
     $password2->setLabel($textconfpassreg)->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator($identValidator);
     $this->addElement($password2);
     // -> Email
     $email = $this->createElement('text', 'email');
     $email->setLabel('Email:')->setRequired(true)->addValidator(new Zend_Validate_EmailAddress())->addValidator(new Zend_Validate_Db_NoRecordExists('user', 'email'));
     $this->addElement($email);
     // -> Country
     // ----> Model Country
     $countryModel = new Model_Country();
     $countryData = $countryModel->getNameCountry();
     $countryData[""] = $textselectcountryreg;
     $country = $this->createElement('select', 'country');
     $country->setLabel($textcountryreg)->setRequired(true)->setMultiOptions($countryData);
     $this->addElement($country);
     // -> Captcha
     $publicKey = Zend_Registry::get('recaptcha_public_key');
     $privateKey = Zend_Registry::get('recaptcha_private_key');
     $recaptcha = new Zend_Service_ReCaptcha($publicKey, $privateKey);
     $captcha = new Zend_Form_Element_Captcha('captcha', array('captcha' => 'ReCaptcha', 'captchaOptions' => array('captcha' => 'ReCaptcha', 'service' => $recaptcha)));
     $this->addElement($captcha);
     // -> Submit
     $submit = $this->createElement('submit', 'submit');
     $submit->setLabel($textreg)->removeDecorator('Label');
     $this->addElement($submit);
 }
 /**
  * Fungsi inisialisasi form
  */
 public function init()
 {
     parent::init();
     $langId = Zend_Registry::get('languageId');
     if ($langId == 2) {
         // English
         $textrealnamereg = 'Name';
         $textwebs = 'Website (Optional):';
         $textcountryreg = 'Country';
         $textselectcountryreg = 'Choose Country';
         $textreg = 'Submit';
         $textsubj = 'Subject:';
         $textsubjcolm = 'Choose Country';
         $textmsg = 'Message:';
     } else {
         $textrealnamereg = 'Nama';
         $textwebs = 'Website (Tidak Wajib):';
         $textcountryreg = 'Negara';
         $textselectcountryreg = 'Pilih Negara Anda';
         $textreg = 'Kirim';
         $textsubj = 'Subyek:';
         $textsubjcolm = 'Choose Country';
         $textmsg = 'Pesan:';
     }
     // Form Attribute
     $this->setMethod('post');
     $this->addAttribs(array('id' => 'inputForm', 'action' => $this->_baseUrlHelper->baseUrl() . '/contact-us/index'));
     $this->setAttrib('accept-charset', 'utf-8');
     // Element Form
     // -> Name
     $name = $this->createElement('text', 'name');
     $name->setLabel($textrealnamereg)->setRequired(true);
     $this->addElement($name);
     // -> Email
     $email = $this->createElement('text', 'email');
     $email->setLabel('Email:')->setRequired(true)->addValidator(new Zend_Validate_EmailAddress());
     $this->addElement($email);
     // -> Website
     $website = $this->createElement('text', 'website');
     $website->setLabel($textwebs)->addValidator(new Budpar_Form_Validator_Url());
     $this->addElement($website);
     // -> Country
     // ----> Model Country
     //        $country = $this->createElement('select', 'country');
     //        $country->setLabel($textcountryreg)
     //                ->setRequired(true)
     //                ->setMultiOptions($countryData);
     //        $this->addElement($country);
     // -> Subject
     $contactSubjectDb = new Model_DbTable_ContactSubject();
     $subjectData = $contactSubjectDb->getAllForForm($langId);
     $subject = $this->createElement('select', 'subject');
     $subject->setLabel($textsubj)->setRequired(true)->setMultiOptions($subjectData);
     $this->addElement($subject);
     // -> Message
     $message = $this->createElement('textarea', 'comment');
     $message->setLabel($textmsg)->setRequired(true);
     $message->setAttrib('rows', 15);
     $this->addElement($message);
     // -> Captcha
     $publicKey = Zend_Registry::get('recaptcha_public_key');
     $privateKey = Zend_Registry::get('recaptcha_private_key');
     $recaptcha = new Zend_Service_ReCaptcha($publicKey, $privateKey);
     $captcha = new Zend_Form_Element_Captcha('captcha', array('captcha' => 'ReCaptcha', 'captchaOptions' => array('captcha' => 'ReCaptcha', 'service' => $recaptcha)));
     $this->addElement($captcha);
     // -> Submit
     $submit = $this->createElement('submit', 'submit');
     $submit->setLabel($textreg)->removeDecorator('Label')->setOptions(array('class' => 'button button-grey'));
     $this->addElement($submit);
 }