| Server IP : 103.234.187.230 / Your IP : 216.73.216.216 Web Server : Apache System : Linux lserver42043-ind.megavelocity.net 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64 User : apache ( 48) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/html/dcb/application/forms/ |
Upload File : |
<?php
class Application_Form_Campaigns extends Zend_Form
{
public function __construct($params = null)
{
$state = new Application_Model_Campaigns();
$allcountry = $state->getAllActiveCountryCodeList();
/************ First Name *****************/
$fname = $this->createElement('text','fname',
array(
'value' => trim($params['fname']),
'class' => 'text_field',
'id' => 'fname',
'placeholder' => 'Name*',
'tabindex' => '2',
'required'=>true,
'filters' => array('StringTrim'),
'validators' => array(array("Alpha", true, array("allowWhiteSpace" => true))),
))
->setErrorMessages(array('Enter first name'))
->removeDecorator('label')
->removeDecorator('HtmlTag')
->removeDecorator('DtDdWrapper');
/************ Email *****************/
$email = $this->createElement('text','email',
array(
'value' => trim($params['email']),
'class' => 'text_field',
'id' => 'email',
'placeholder' => 'Email Id*',
'tabindex' => '4',
'required'=>true,
'filters' => array('StringTrim'),
'validators' => array('EmailAddress',)
))
->setErrorMessages(array('Enter valid email id'))
->removeDecorator('label')
->removeDecorator('HtmlTag')
->removeDecorator('DtDdWrapper');
/************ Country List *****************/
$dataCountry = array();
$dataCountry[""]="--Select Country --";
$countrylist = $this->createElement('select', 'country_name');
foreach ($allcountry as $data) {
$country_code_list = ucwords(strtolower($data['Name'])).' (+'.$data['CountryCode'].')';
$dataCountry[$data['Name']] = $country_code_list;
}
$countrylist->setRequired(true);
$countrylist->setMultiOptions($dataCountry);
$countrylist->setErrorMessages(array('Select country name'));
$countrylist->removeDecorator('label');
$countrylist->removeDecorator('HtmlTag');
$countrylist->class = "styled";
$countrylist->style = "width:100px; border:none;";
$countrylist->tabindex = "5";
/************ City *****************/
$citylist = $this->createElement('text','city_name',
array(
'value' => trim($params['city_name']),
'class' => 'text_field',
'id' => 'city_name',
'placeholder' => 'City*',
'tabindex' => '6',
'required'=>true,
'filters' => array('StringTrim'),
'validators' => array(array("Alpha", true, array("allowWhiteSpace" => false))),
))
->setErrorMessages(array('Enter city'))
->removeDecorator('label')
->removeDecorator('HtmlTag')
->removeDecorator('DtDdWrapper');
/************ Mobil Number *****************/
$mobile_no = $this->createElement('text','mobile_no',
array(
'value' => trim($params['mobile_no']),
'class' => 'text_field',
'id' => 'mobile_no',
'maxlength' => '12',
'placeholder' => 'Mobile no.*',
'tabindex' => '7',
'required'=>false,
'filters' => array('StringTrim'),
'validators' => array('Digits'),
))
->setAttrib('onkeypress', 'return isNumber(event);')
->setErrorMessages(array('Enter mobile number'))
->removeDecorator('label')
->removeDecorator('HtmlTag')
->removeDecorator('DtDdWrapper');
/************ Area Code *****************/
/************ Landline Number *****************/
/************ Captcha Code *****************/
$captcha = $this->createElement('text','captcha',
array(
'value' => trim($params['captcha']),
'class' => 'text_field',
'style' => 'width:100px;',
'id' => 'captcha',
'placeholder' => 'Capcha code*',
'tabindex' => '10',
'autocomplete' => 'off',
'required'=>true,
'filters' => array('StringTrim'),
'validators' => array(array("Alnum", true, array("allowWhiteSpace" => false))),
))
->setErrorMessages(array('Enter captcha'))
->removeDecorator('label')
->removeDecorator('HtmlTag')
->removeDecorator('DtDdWrapper');
/************ Terms and Conditions *****************/
$utm_source = $this->createElement('hidden','utm_source')
->removeDecorator('label')
->removeDecorator('HtmlTag')
->removeDecorator('DtDdWrapper');
$utm_medium = $this->createElement('hidden','utm_medium')
->removeDecorator('label')
->removeDecorator('HtmlTag')
->removeDecorator('DtDdWrapper');
$utm_campaign = $this->createElement('hidden','utm_campaign')
->removeDecorator('label')
->removeDecorator('HtmlTag')
->removeDecorator('DtDdWrapper');
$utm_term = $this->createElement('hidden','utm_term')
->removeDecorator('label')
->removeDecorator('HtmlTag')
->removeDecorator('DtDdWrapper');
$utm_content = $this->createElement('hidden','utm_content')
->removeDecorator('label')
->removeDecorator('HtmlTag')
->removeDecorator('DtDdWrapper');
$this->addElements(array(
$fname,
$email,
$countrylist,
$citylist,
$mobile_no,
$captcha,
$utm_source,
$utm_medium,
$utm_campaign,
$utm_term,
$utm_content
));
}
}