示例#1
0
 public function init()
 {
     $this->setName('add_new_post');
     $this->setMethod('Post');
     $this->setAttrib('encrypt', 'multipart/form-data');
     $heading = new Zend_Form_Element_Text('heading', array('disableLoadDefaultDecorators' => true));
     $heading->setRequired(true)->setLabel('* Blog Post Title:')->setAttrib('id', 'heading')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib("class", "form-control")->removeDecorator('htmlTag');
     $url = new Zend_Form_Element_Text('url');
     $url->setRequired(true)->setAttrib('id', 'url')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib("class", "form-control set-txt")->removeDecorator('htmlTag');
     $description = new Zend_Form_Element_Textarea('description', array('disableLoadDefaultDecorators' => true));
     $description->setRequired(true)->setLabel('* Description:')->setAttrib('id', 'description')->setAttrib('contenteditable', 'true')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib("class", "form-control")->removeDecorator('htmlTag');
     /*$categories = new Zend_Form_Element_Text('categories',array('disableLoadDefaultDecorators' =>true));
     		$categories->setLabel(' Category:')
     			->setAttrib('id', 'categories')
     			->addFilter('StripTags')
     			->addFilter('StringTrim')
     			->addValidator('NotEmpty')
     			->setAttrib("class", "form-control")
     			->removeDecorator('htmlTag');*/
     $is_comment = new Zend_Form_Element_Checkbox('is_comment', array('disableLoadDefaultDecorators' => true));
     $is_comment->setAttrib("id", "is_comment")->setLabel('Mark as No Comments:')->setAttrib("class", "form-control")->addFilter('StripTags')->addFilter('StringTrim');
     $tags = new Zend_Form_Element_Text('tags', array('disableLoadDefaultDecorators' => true));
     $tags->setLabel('Tags:')->setAttrib('id', 'tags')->setAttrib('placeholder', 'Separate tags with comma,')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib("class", "form-control")->removeDecorator('htmlTag');
     $image = new Zend_Form_Element_File('image');
     $image->addValidator('Count', false, 1)->addValidator('ImageSize', false, array('minwidth' => 700, 'maxwidth' => 1000, 'minheight' => 500))->addValidator('Size', false, 1000240000)->setErrorMessages(array("Upload an image:"))->addValidator('Extension', false, 'jpg,png,gif,jpeg,jpg');
     // only JPEG, PNG, and GIFs
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submit-btn');
     $submit->setAttrib('class', 'btn btn-lg btn-primary float-right')->removeDecorator('HtmlTag')->removeDecorator('Label')->setLabel("Publish");
     $this->setElementDecorators(array('Errors', 'ViewHelper', array('decorator' => array('td' => 'HtmlTag'), 'options' => array('tag' => 'td')), array('Label', array('tag' => 'td')), array('decorator' => array('tr' => 'HtmlTag'), 'options' => array('tag' => 'tr'))), array('heading', 'is_comment', 'url', 'image', 'description', 'tags'));
     $this->addElements(array($heading, $url, $is_comment, $image, $description, $tags, $submit));
 }
示例#2
0
 public function init()
 {
     $this->setName('social_link');
     //$this->setAction('socialMedia');
     $this->setMethod('Post');
     $facebook = new Zend_Form_Element_Text('facebook', array('disableLoadDefaultDecorators' => true));
     $facebook->setLabel(' Facebook:')->setAttrib('id', 'facebook')->addFilter('StripTags')->addFilter('StringTrim')->setAttrib("class", "form-control")->removeDecorator('htmlTag');
     $twitter = new Zend_Form_Element_Text('twitter', array('disableLoadDefaultDecorators' => true));
     $twitter->setLabel(' Twitter:')->setAttrib('id', 'twitter')->addFilter('StripTags')->addFilter('StringTrim')->setAttrib("class", "form-control")->removeDecorator('htmlTag');
     $youtube = new Zend_Form_Element_Text('youtube', array('disableLoadDefaultDecorators' => true));
     $youtube->setLabel(' Youtube:')->setAttrib('id', 'youtube')->addFilter('StripTags')->addFilter('StringTrim')->setAttrib("class", "form-control")->removeDecorator('htmlTag');
     $instagram = new Zend_Form_Element_Text('instagram', array('disableLoadDefaultDecorators' => true));
     $instagram->setLabel(' Instagram:')->setAttrib('id', 'instagram')->addFilter('StripTags')->addFilter('StringTrim')->setAttrib("class", "form-control")->removeDecorator('htmlTag');
     $tumblr = new Zend_Form_Element_Text('tumblr', array('disableLoadDefaultDecorators' => true));
     $tumblr->setLabel(' Tumblr:')->setAttrib('id', 'tumblr')->addFilter('StripTags')->addFilter('StringTrim')->setAttrib("class", "form-control")->removeDecorator('htmlTag');
     $google_plus = new Zend_Form_Element_Text('google_plus', array('disableLoadDefaultDecorators' => true));
     $google_plus->setLabel(' Google Plus:')->setAttrib('id', 'google_plus')->addFilter('StripTags')->addFilter('StringTrim')->setAttrib("class", "form-control")->removeDecorator('htmlTag');
     $linkedin = new Zend_Form_Element_Text('linkedin', array('disableLoadDefaultDecorators' => true));
     $linkedin->setLabel(' LinkedIn:')->setAttrib('id', 'linkedIn')->addFilter('StripTags')->addFilter('StringTrim')->setAttrib("class", "form-control")->removeDecorator('htmlTag');
     $pinterest = new Zend_Form_Element_Text('pinterest', array('disableLoadDefaultDecorators' => true));
     $pinterest->setLabel(' Pinterest:')->setAttrib('id', 'pinterest')->addFilter('StripTags')->addFilter('StringTrim')->setAttrib("class", "form-control")->removeDecorator('htmlTag');
     $dailymotion = new Zend_Form_Element_Text('dailymotion', array('disableLoadDefaultDecorators' => true));
     $dailymotion->setLabel(' Dailymotion:')->setAttrib('id', 'dailymotion')->addFilter('StripTags')->addFilter('StringTrim')->setAttrib("class", "form-control")->removeDecorator('htmlTag');
     $vimeo = new Zend_Form_Element_Text('vimeo', array('disableLoadDefaultDecorators' => true));
     $vimeo->setLabel(' Vimeo:')->setAttrib('id', 'vimeo')->addFilter('StripTags')->addFilter('StringTrim')->setAttrib("class", "form-control")->removeDecorator('htmlTag');
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton');
     $submit->setAttrib('class', 'btn btn-lg btn-primary float-right')->removeDecorator('HtmlTag')->removeDecorator('Label')->setLabel("Update");
     $this->setElementDecorators(array('Errors', 'ViewHelper', array('decorator' => array('td' => 'HtmlTag'), 'options' => array('tag' => 'td')), array('Label', array('tag' => 'td')), array('decorator' => array('tr' => 'HtmlTag'), 'options' => array('tag' => 'tr'))), array('twitter', 'vimeo', 'dailytmotion', 'pinterest', 'facebook', 'tumblr', 'google_plus', 'youtube', 'linkedin', 'instagram'));
     ///$this->addElement('hash', 'csrf', array('ignore' => true,));
     $this->addElements(array($twitter, $vimeo, $dailymotion, $pinterest, $google_plus, $tumblr, $facebook, $youtube, $instagram, $linkedin, $submit));
 }
示例#3
0
 public function init()
 {
     $this->setName('param');
     $this->setAttrib('class', 'form-inline');
     $host1 = new Zend_Form_Element_Text('host1');
     $host1->setAttrib('class', 'form-control')->setLabel('host1')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->addValidator('Hostname');
     $host1->setDecorators(array('ViewHelper', 'Description', 'Errors', 'Label', array(array('data' => 'HtmlTag'), array('tag' => 'div', 'class' => 'col-md-4')), array(array('row' => 'HtmlTag'), array('tag' => 'div', 'class' => 'row form-inline', 'openOnly' => true))));
     $user1 = new Zend_Form_Element_Text('user1');
     $user1->setLabel('user1')->setAttrib('class', 'form-control')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->addValidator('EmailAddress');
     $user1->setDecorators(array('ViewHelper', 'Description', 'Errors', 'Label', array(array('data' => 'HtmlTag'), array('tag' => 'div', 'class' => 'col-md-4'))));
     $password1 = new Zend_Form_Element_Text('password1');
     $password1->setLabel('pass1')->setAttrib('class', 'form-control')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
     $password1->setDecorators(array('ViewHelper', 'Description', 'Errors', 'Label', array(array('data' => 'HtmlTag'), array('tag' => 'div', 'class' => 'col-md-4')), array(array('row' => 'HtmlTag'), array('tag' => 'div', 'closeOnly' => 'true'))));
     $host2 = new Zend_Form_Element_Text('host2');
     $host2->setAttrib('class', 'form-control')->setLabel('host2')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->addValidator('Hostname');
     $host2->setDecorators(array('ViewHelper', 'Description', 'Errors', 'Label', array(array('data' => 'HtmlTag'), array('tag' => 'div', 'class' => 'col-md-4')), array(array('row' => 'HtmlTag'), array('tag' => 'div', 'class' => 'row', 'openOnly' => true))));
     $user2 = new Zend_Form_Element_Text('user2');
     $user2->setLabel('user2')->setAttrib('class', 'form-control')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->addValidator('EmailAddress');
     $user2->setDecorators(array('ViewHelper', 'Description', 'Errors', 'Label', array(array('data' => 'HtmlTag'), array('tag' => 'div', 'class' => 'col-md-4'))));
     $password2 = new Zend_Form_Element_Text('password2');
     $password2->setLabel('pass2')->setAttrib('class', 'form-control')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
     $password2->setDecorators(array('ViewHelper', 'Description', 'Errors', 'Label', array(array('data' => 'HtmlTag'), array('tag' => 'div', 'class' => 'col-md-4')), array(array('row' => 'HtmlTag'), array('tag' => 'div', 'closeOnly' => 'true'))));
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setLabel('Submit');
     $submit->setAttrib('class', 'btn btn-default');
     $submit->setAttrib('value', 'transfer_source');
     $submit->setDecorators(array('ViewHelper', 'Description', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'div', 'class' => 'col-md-4 col-md-offset-4 text-center'))));
     $this->addElements(array($host1, $user1, $password1, $host2, $user2, $password2, $submit));
     $this->setDecorators(array('FormElements', array(array('data' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-inline')), 'Form'));
 }
示例#4
0
 public function init()
 {
     $this->setName('add_testimonial');
     //$this->setAction('newExpert');
     $this->setMethod('Post');
     $this->setAttrib('enctype', 'multipart/form-data');
     $first_name = new Zend_Form_Element_Text('first_name', array('disableLoadDefaultDecorators' => true));
     $first_name->setRequired(true)->setLabel('* First Name:')->setAttrib('id', 'video_title')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib("class", "form-control")->removeDecorator('htmlTag');
     $last_name = new Zend_Form_Element_Text('last_name', array('disableLoadDefaultDecorators' => true));
     $last_name->setRequired(true)->setLabel('* Last Name:')->setAttrib('id', 'url_video')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib("class", "form-control")->removeDecorator('htmlTag');
     $email = new Zend_Form_Element_Text('email', array('disableLoadDefaultDecorators' => true));
     $email->setRequired(true)->setLabel('* Email:')->setAttrib('id', 'email')->setAttrib('size', '30')->addFilter('StripTags')->addFilter('StringTrim')->setErrorMessages(array("Write Email"))->addValidator('EmailAddress', true)->setAttrib("class", "form-control")->removeDecorator('htmlTag');
     $short_description = new Zend_Form_Element_Textarea('short_description', array('disableLoadDefaultDecorators' => true));
     $short_description->setRequired(true)->setAttrib("id", "short_description")->setLabel(' *Testimonial:')->setAttrib("class", "form-control")->setAttrib('ROWS', '5')->setAttrib('COLS', '3')->setErrorMessages(array("Write Description for Testimonial"))->addFilter('StringTrim');
     $image1 = new Zend_Form_Element_File('image1');
     //$image1->setRequired(true)
     $image1->addValidator('Count', false, 1)->addValidator('ImageSize', false, array('minwidth' => 100, 'maxwidth' => 400, 'minheight' => 100, 'maxheight' => 400))->addValidator('Size', false, 1000240000)->setErrorMessages(array("*Upload an image:"))->addValidator('Extension', false, 'jpg,png,gif');
     // only JPEG, PNG, and GIFs
     $is_featured = new Zend_Form_Element_Checkbox('is_featured', array('disableLoadDefaultDecorators' => true));
     $is_featured->setAttrib("id", "is_featured")->setLabel('Featured:')->setAttrib("class", "form-control")->addFilter('StripTags')->addFilter('StringTrim');
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton');
     $submit->setAttrib('class', 'btn btn-lg btn-primary float-right')->removeDecorator('HtmlTag')->removeDecorator('Label')->setLabel("Save");
     $this->setElementDecorators(array('Errors', 'ViewHelper', array('decorator' => array('td' => 'HtmlTag'), 'options' => array('tag' => 'td')), array('Label', array('tag' => 'td')), array('decorator' => array('tr' => 'HtmlTag'), 'options' => array('tag' => 'tr'))), array('first_name', 'last_name', 'email', 'short_description', 'image1', 'is_featured'));
     //$this->addElement('hash', 'csrf', array('ignore' => true,));
     $this->addElements(array($first_name, $last_name, $image1, $email, $is_featured, $short_description, $submit));
 }
示例#5
0
 public function init()
 {
     $this->setName('transfer_source');
     $this->setAttrib('class', 'form-inline');
     $host1 = new Zend_Form_Element_Text('host1');
     $host1->setAttrib('class', 'form-control')->setLabel('host1')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->addValidator('Hostname');
     $edit = new Zend_Form_Element_Hidden('edit');
     //$edit->setLabel('Edition Mode');
     //$edit->clearDecorators();
     $host1->setDecorators(array('ViewHelper', 'Description', 'Errors', 'Label', array(array('row' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group col-md-3'))));
     $user1 = new Zend_Form_Element_Text('user1');
     $user1->setLabel('user1')->setAttrib('class', 'form-control')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->addValidator('EmailAddress');
     $user1->setDecorators(array('ViewHelper', 'Description', 'Errors', 'Label', array(array('row' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group col-md-3'))));
     $password1 = new Zend_Form_Element_Text('password1');
     $password1->setLabel('pass1')->setAttrib('class', 'form-control')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
     $password1->setDecorators(array('ViewHelper', 'Description', 'Errors', 'Label', array(array('row' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group col-md-3'))));
     $action = new Zend_Form_Element_Select('action');
     $action->setOptions(array('1' => 'source', '2' => 'target'));
     $action->setAttrib('class', 'form-control');
     $action->options = array('1' => 'source', '2' => 'target');
     $action->setDecorators(array('ViewHelper', 'Description', 'Errors', 'Label', array(array('row' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group col-md-2'))));
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setLabel('Submit');
     $submit->setAttrib('class', 'btn btn-default');
     $submit->setAttrib('value', 'transfer_source');
     $submit->setDecorators(array('ViewHelper', 'Description', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'div', 'colspan' => 2, 'align' => 'center')), array(array('row' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group'))));
     $this->addElements(array($edit, $host1, $user1, $password1, $action, $submit));
     $this->setDecorators(array('FormElements', 'Form'));
 }
示例#6
0
 public function __construct()
 {
     $transactionType = new Zend_Form_Element_Select('transactionType');
     $transactionType->setAttrib('class', 'NormalBtn');
     $transactionType->setRequired(true)->addValidators(array(array('NotEmpty')));
     $transactionMode = new Zend_Form_Element_Select('transactionMode');
     $transactionMode->setAttrib('class', 'NormalBtn');
     $transactionMode->setRequired(true);
     //                                 ->addValidators(array(array('NotEmpty')));
     $transactionMode->setAttrib('onchange', 'display(this.value);');
     $transaction_interest_amount = new Zend_Form_Element_Text('transaction_interest_amount');
     $transaction_interest_amount->setAttrib('class', 'NormalBtn');
     $transaction_fine_amount = new Zend_Form_Element_Text('transaction_fine_amount');
     $transaction_fine_amount->setAttrib('class', 'NormalBtn');
     $account_id = new Zend_Form_Element_Text('account_id');
     $account_id->setAttrib('class', 'NormalBtn');
     $transaction_date = new Zend_Form_Element_Text('transaction_date');
     $transaction_date->setAttrib('class', 'NormalBtn');
     $transaction_date->setRequired(true)->addValidators(array(array('NotEmpty')));
     $transaction_date->setRequired(true)->addValidator(new Zend_Validate_Date('YYYY-MM-DD'), true, array('messages' => array(Zend_Validate_Date::FALSEFORMAT => 'Enter the valid date')));
     $transaction_amount = new Zend_Form_Element_Text('transaction_amount');
     $transaction_amount->setAttrib('class', 'NormalBtn');
     $transaction_remarks = new Zend_Form_Element_Textarea('transaction_remarks', array('rows' => 3, 'cols' => 15));
     $transaction_remarks->setAttrib('class', 'NormalBtn');
     $transaction_remarks->setRequired(true)->addValidators(array(array('NotEmpty')));
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submit');
     $submit->setAttrib('class', 'NormalBtn');
     $submit->setLabel('submit');
     $this->addElements(array($transactionType, $transactionMode, $transaction_interest_amount, $transaction_fine_amount, $account_id, $transaction_date, $transaction_amount, $transaction_remarks, $submit));
 }
示例#7
0
 public function init()
 {
     $this->setMethod('post');
     $this->setAction('/main/new');
     $this->setAttrib('id', 'newRoute');
     $note = new Zend_Form_Element_Note('title', array('value' => '<h2 id="titleProductDetails">Create a New Route</h2>'));
     $intermed = new Zend_Form_Element_Hidden('intermed');
     $intermed->setAttrib('readonly', 'readonly');
     $intermed->addFilter('StripTags');
     $intermed->addFilter('HtmlEntities');
     $intermed->addFilter('StringTrim');
     $start = new Zend_Form_Element_Text('startForm');
     $start->setLabel('Starting Point*');
     $start->setAttrib('autocomplete', 'off');
     $start->addFilter('StripTags');
     $start->addFilter('HtmlEntities');
     $start->setAttrib('class', 'form-control');
     $start->addFilter('StringTrim');
     $start->setRequired(true)->addErrorMessage('Start Location Required');
     //        $start->addValidator('Regex', true, array('/^[a-zA-Z0-9.,:-\s]*$/'))->addErrorMessage('Invalid characters used');
     //        $start->addValidator('StringLength', true, array(0, 255))->addErrorMessage('Required Field');
     $end = new Zend_Form_Element_Text('endForm');
     $end->setLabel('Destination*');
     $end->setAttrib('autocomplete', 'off');
     $end->addFilter('StripTags');
     $end->setAttrib('class', 'form-control');
     $end->addFilter('HtmlEntities');
     $end->addFilter('StringTrim');
     $end->setRequired(true)->addErrorMessage('Destination Required');
     //        $end->addValidator('StringLength', true, array(0, 255))->addErrorMessage('Required Field');
     $routeDate = new Zend_Form_Element_Text('routeDate');
     $routeDate->setAttrib('autocomplete', 'off');
     $routeDate->setAttrib('readonly', 'readonly');
     $routeDate->setAttrib('maxlength', '10');
     $routeDate->setAttrib('class', 'form-control');
     $routeDate->setLabel('Date of Journey' . '*');
     $routeDate->addFilter('StripTags');
     $routeDate->addFilter('HtmlEntities');
     $routeDate->addFilter('StringTrim');
     $routeDate->setRequired(true)->addErrorMessage('Date Required');
     $routeDate->addValidator('Regex', true, array('/^[0-9.\\s]*$/'))->addErrorMessage('Invalid characters used');
     $routeDate->addValidator('StringLength', true, array(10, 10))->addErrorMessage('Required Field');
     $passangers = new Zend_Form_Element_Select('passangers');
     $passangers->setLabel('No of Passangers*');
     $passangers->setAttrib('autocomplete', 'off');
     $passangers->setAttrib('class', 'form-control');
     $passangers->addFilter('StripTags');
     $passangers->addFilter('HtmlEntities');
     $passangers->addFilter('StringTrim');
     $passangers->setRequired(true)->addErrorMessage('Password Required');
     $passangers->setMultiOptions(array('1' => '1 Passanger', '2' => '2 Passangers', '3' => '3 Passangers', '4' => '4 Passangers', '5' => '5 Passangers', '6' => '6 Passangers'));
     $submit = new Zend_Form_Element_Submit('newRoute');
     $submit->setLabel('New Route');
     $submit->setAttrib('class', 'btn btn-info');
     $submit->setAttrib('style', 'margin-top:20px');
     $this->addElements(array($note, $intermed, $start, $end, $passangers, $routeDate, $submit));
     $this->setElementDecorators(array('ViewHelper', 'Label', 'Errors'));
     $submit->setDecorators(array('ViewHelper'));
     $this->setDecorators(array('FormElements', 'Form', array('HtmlTag', array('tag' => 'div', 'id' => 'newRouteFormContainer'))));
 }
示例#8
0
 public function init()
 {
     $this->setName('add_video_link');
     //$this->setAction('newExpert');
     $this->setMethod('Post');
     $this->setAttrib('enctype', 'multipart/form-data');
     $title = new Zend_Form_Element_Text('title', array('disableLoadDefaultDecorators' => true));
     $title->setRequired(true)->setLabel('* Video Title:')->setAttrib('id', 'video_title')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib("class", "form-control")->removeDecorator('htmlTag');
     $url_video = new Zend_Form_Element_Text('url_video', array('disableLoadDefaultDecorators' => true));
     $url_video->setRequired(true)->setLabel('* Video URL:')->setAttrib('id', 'url_video')->addValidator('NotEmpty')->setAttrib("class", "form-control")->addFilter('StripTags')->addFilter('StringTrim')->removeDecorator('htmlTag');
     $short_description = new Zend_Form_Element_Textarea('short_description', array('disableLoadDefaultDecorators' => true));
     $short_description->setRequired(true)->setAttrib("id", "short_description")->setLabel(' *Short Description:')->setAttrib("class", "form-control")->setAttrib('ROWS', '5')->setAttrib('COLS', '3')->addFilter('StringTrim');
     $video_img = new Zend_Form_Element_File('video_img');
     //$video_img->setRequired(true)
     $video_img->addValidator('Count', false, 1)->addValidator('ImageSize', false, array('minwidth' => 100, 'maxwidth' => 1000, 'minheight' => 100, 'maxheight' => 1000))->addValidator('Size', false, 1000240000)->setErrorMessages(array("Upload an image:"))->addValidator('Extension', false, 'jpg,png,gif,jpeg');
     // only JPEG, PNG, and GIFs
     $is_featured = new Zend_Form_Element_Checkbox('is_featured', array('disableLoadDefaultDecorators' => true));
     $is_featured->setAttrib("id", "is_featured")->setLabel('Featured:')->setAttrib("class", "form-control")->addFilter('StripTags')->addFilter('StringTrim');
     $is_main = new Zend_Form_Element_Checkbox('is_main', array('disableLoadDefaultDecorators' => true));
     $is_main->setAttrib("id", "is_main")->setLabel('Mark main video:')->setAttrib("class", "form-control")->addFilter('StripTags')->addFilter('StringTrim');
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submit-btn');
     $submit->setAttrib('class', 'btn btn-lg btn-primary float-right')->removeDecorator('HtmlTag')->removeDecorator('Label')->setLabel("Save");
     $this->setElementDecorators(array('Errors', 'ViewHelper', array('decorator' => array('td' => 'HtmlTag'), 'options' => array('tag' => 'td')), array('Label', array('tag' => 'td')), array('decorator' => array('tr' => 'HtmlTag'), 'options' => array('tag' => 'tr'))), array('title', 'short_description', 'url_video', 'video_img', 'is_featured', 'is_main'));
     //$this->addElement('hash', 'csrf', array('ignore' => true,));
     $this->addElements(array($title, $short_description, $video_img, $url_video, $is_featured, $is_main, $submit));
 }
示例#9
0
 public function init()
 {
     $this->setName('photo_gallery');
     $photo_name = new Zend_Form_Element_File('photo_name');
     $photo_name->setRequired(true)->addValidator('Count', false, 1)->addValidator('FilesSize', false, array('min' => '1kB', 'max' => '5MB'))->addValidator('ImageSize', false, array('minwidth' => 10, 'minheight' => 10))->addFilter('StringTrim')->setErrorMessages(array("Upload an image"))->addValidator('Extension', false, 'jpeg,jpg,png,gif');
     // only JPEG, PNG, and GIFs
     $caption = new Zend_Form_Element_Text('caption', array('disableLoadDefaultDecorators' => true));
     $caption->setAttrib('id', 'caption')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib("class", "form-control")->removeDecorator('htmlTag');
     $link = new Zend_Form_Element_Text('link', array('disableLoadDefaultDecorators' => true));
     $link->setAttrib('id', 'link')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib("class", "form-control")->removeDecorator('htmlTag');
     $description = new Zend_Form_Element_Textarea('description', array('disableLoadDefaultDecorators' => true));
     $description->setAttrib('id', 'editor1')->setAttrib('name', 'description')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib("class", "form-control")->removeDecorator('htmlTag');
     $category = new Zend_Form_Element_Select('category', array('disableLoadDefaultDecorators' => true));
     $category->setAttrib("id", "category")->setAttrib("class", "dropdown form-control")->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
     $data = new Application_Model_PGCategory();
     $results = $data->getAllCategoriesNames()->toArray();
     foreach ($results as $result) {
         $category->addMultiOption($result['pg_cat_id'], $value = $result['category_name']);
     }
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submit-btn');
     $submit->setAttrib('class', 'btn btn-md btn-primary float-right')->removeDecorator('HtmlTag')->removeDecorator('Label')->setLabel("Save");
     $this->setElementDecorators(array('Errors', 'ViewHelper', array('decorator' => array('td' => 'HtmlTag'), 'options' => array('tag' => 'td')), array('decorator' => array('tr' => 'HtmlTag'), 'options' => array('tag' => 'tr'))), array('photo_name', 'category', 'caption', 'description', 'link'));
     $this->addElements(array($photo_name, $category, $caption, $description, $link, $submit));
 }
示例#10
0
 public function __construct()
 {
     parent::__construct();
     // 	$fieldtype,$fieldname,$table,$columnname,$cssname,$labelname,$required,$validationtype,$min,$max,$rows,$cols,$decorator,$value
     // create instance to call common field
     $formfield = new App_Form_Field();
     // send parameters to get form fields (first parameter is a form field type)
     $offerproduct_id = $formfield->field('Hidden', 'offerproduct_id', '', '', '', 'offerproduct_id', false, '', '', '', '', '', '', '');
     $productshortname = $formfield->field('Text', 'productshortname', '', '', '', 'productshortname', false, '', '', '', '', '', '', '');
     $currentdates = $formfield->field('Hidden', 'currentdates', '', '', '', 'currentdates', false, '', '', '', '', '', '', '');
     $productType = $formfield->field('Select', 'productType', '', '', '', 'productType', false, '', '', '', '', '', '', '');
     $productType->setRegisterInArrayValidator(false);
     $productType->setAttrib('onchange', 'getSavingAccount(this.value)');
     $savingproducttype = $formfield->field('Text', 'savingproductname', '', '', '', 'savingproductname', false, '', '', '', '', '', '', '');
     $savingproducttype->setAttrib('readonly', 'true');
     $offerproductname = $formfield->field('Text', 'offerproductname', '', '', 'mand', 'offerproductname', true, '', '', '', '', '', '', '');
     $offerproductname->addValidator(new Zend_Validate_Db_NoRecordExists('ourbank_productsoffer', 'name'));
     $offerproductshortname = $formfield->field('Text', 'offerproductshortname', '', '', 'mand', 'offerproductshortname', true, '', '', '', '', '', '', '');
     $offerproductshortname->addValidators(array(array('NotEmpty'), array('stringLength', false, array(1, 3))));
     $offerproduct_description = $formfield->field('Textarea', 'offerproduct_description', '', '', 'mand', 'offerproduct_description', true, '', '', '', 2, 23, '', '');
     $begindate = $formfield->field('Text', 'begindate', '', '', '', 'begindate', false, '', '', '', '', '', 0, '');
     $begindate->setAttrib('class', 'd');
     $closedate = $formfield->field('Text', 'closedate', '', '', 'mand', 'closedate', true, '', '', '', '', '', '', '');
     $closedate->setAttrib('class', 'd');
     $closedate->addValidator(new Zend_Validate_Date('DD-MM-YYYY'), true, array('messages' => array(Zend_Validate_Date::FALSEFORMAT => 'Enter the valid date')));
     //         $feeglcode = $formfield->field('Select','feeglcode','','','mand','feeglcode',true,'','','','','','','');
     $applicableto = $formfield->field('Select', 'applicableto', '', '', 'mand', 'applicableto', true, '', '', '', '', '', '', '');
     //         $glsubcode = $formfield->field('Select','glsubcode_id','','','mand','glsubcode_id',true,'','','','','','','');
     $minmumdeposit = $formfield->field('Text', 'minmumdeposit', '', '', 'mand', 'minmumdeposit', true, '', '', '', '', '', '', '');
     $graterthan = new Zend_Validate_GreaterThan(0);
     $minmumdeposit->setRequired(true)->addValidators(array(array('stringLength', false, array(1, 8))))->addValidators(array(array('NotEmpty'), array('Float'), array($graterthan, true)));
     $frequencyofdeposit = $formfield->field('Select', 'frequencyofdeposit', '', '', 'mand', 'frequencyofdeposit', true, '', '', '', '', '', '', '');
     $Int_timefrequency_id = $formfield->field('Select', 'Int_timefrequency_id', '', '', 'mand', 'Int_timefrequency_id', true, '', '', '', '', '', '', '');
     $frequencyofinterestupdating = $formfield->field('Select', 'frequencyofinterestupdating', '', '', 'mand', 'frequencyofinterestupdating', true, '', '', '', '', '', '', '');
     $frequencyofinterestupdating->addMultiOption('MinBalance', 'MinBalance');
     $frequencyofinterestupdating->addMultiOption('AvgBalance', 'AvgBalance');
     $minimumbalanceforinterest = $formfield->field('Text', 'minimumbalanceforinterest', '', '', 'mand', 'minimumbalanceforinterest', true, '', '', '', '', '', '', '');
     $graterthan = new Zend_Validate_GreaterThan(0);
     $minimumbalanceforinterest->setRequired(true)->addValidators(array(array('stringLength', false, array(2, 8))))->addValidators(array(array('NotEmpty'), array('Float'), array($graterthan, true)));
     $minimum_deposit_amount = $formfield->field('Text', 'minimum_deposit_amount', '', '', 'mand', 'minimum_deposit_amount', true, '', '', '', '', '', '', '');
     $graterthan = new Zend_Validate_GreaterThan(0);
     $minimum_deposit_amount->setRequired(true)->addValidators(array(array('stringLength', false, array(1, 10))))->addValidators(array(array('NotEmpty'), array('Float'), array($graterthan, true)));
     $maximum_deposit_amount = $formfield->field('Text', 'maximum_deposit_amount', '', '', 'mand', 'maximum_deposit_amount', true, '', '', '', '', '', '', '');
     $graterthan = new Zend_Validate_GreaterThan(0);
     $maximum_deposit_amount->setRequired(true)->addValidators(array(array('stringLength', false, array(1, 10))))->addValidators(array(array('NotEmpty'), array('Float'), array($graterthan, true)));
     $frequency_of_deposit = $formfield->field('Select', 'frequency_of_deposit', '', '', '', 'frequency_of_deposit', true, '', '', '', '', '', '', '');
     $penal_Interest = $formfield->field('Text', 'penal_Interest', '', '', 'mand', 'penal_Interest', true, '', '', '', '', '', '', '');
     $graterthan = new Zend_Validate_GreaterThan(0);
     $penal_Interest->setRequired(true)->addValidators(array(array('stringLength', false, array(1, 4))))->addValidators(array(array('NotEmpty'), array('Digits'), array($graterthan, true)));
     $submit = new Zend_Form_Element_Submit('Submit');
     $submit->setAttrib('class', 'savings');
     $submit->setAttrib('id', 'savings');
     $this->addElements(array($productType, $offerproductname, $offerproductshortname, $offerproduct_description, $begindate, $closedate, $applicableto, $minmumdeposit, $frequencyofdeposit, $Int_timefrequency_id, $frequencyofinterestupdating, $minimumbalanceforinterest, $minimum_deposit_amount, $maximum_deposit_amount, $frequency_of_deposit, $penal_Interest, $savingproducttype, $submit, $offerproduct_id, $productshortname, $currentdates));
 }
示例#11
0
 public function init()
 {
     $url_video = new Zend_Form_Element_Textarea('url_video', array('disableLoadDefaultDecorators' => true));
     $url_video->setRequired(true)->setLabel('* Video URL:')->addValidator('NotEmpty')->setAttrib("class", "form-control")->addFilter('StringTrim')->removeDecorator('htmlTag');
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton');
     $submit->setAttrib('class', 'btn btn-lg btn-primary float-right')->removeDecorator('HtmlTag')->removeDecorator('Label')->setLabel("Save");
     $this->setElementDecorators(array('Errors', 'ViewHelper', array('decorator' => array('td' => 'HtmlTag'), 'options' => array('tag' => 'td')), array('Label', array('tag' => 'td')), array('decorator' => array('tr' => 'HtmlTag'), 'options' => array('tag' => 'tr'))), array('title', 'short_description', 'video_img', 'is_featured'));
     //$this->addElement('hash', 'csrf', array('ignore' => true,));
     //				$this->addElements(array($title,$short_description,$video_img,$url_video,$is_featured,$submit));
     $this->addElements(array($url_video, $submit));
 }
示例#12
0
 public function init()
 {
     $this->setMethod('post');
     $this->setAttrib('id', 'formid');
     $this->setAttrib('name', 'emailsettings');
     $id = new Zend_Form_Element_Hidden("id");
     $id_val = Zend_Controller_Front::getInstance()->getRequest()->getParam('id', null);
     $username = new Zend_Form_Element_Text("username");
     $username->setLabel("User name");
     $username->setAttrib("class", "formDataElement");
     // $username->setRequired("true");
     $username->setAttrib('maxlength', '100');
     //$username->addValidator('NotEmpty', false, array('messages' => 'Please enter username.'));
     $tls = new Zend_Form_Element_Text("tls");
     $tls->setLabel("Secure Transport Layer");
     $tls->setAttrib("class", "formDataElement");
     // $tls->setRequired("true");
     $tls->setAttrib('maxlength', '40');
     //  $tls->addValidator('NotEmpty', false, array('messages' => 'Please enter secure transport layer.'));
     $auth = new Zend_Form_Element_Select("auth");
     $auth->setLabel("Authentication Type");
     $auth->setMultiOptions(array('true' => 'True', 'false' => 'False'));
     $auth->setAttrib("class", "formDataElement");
     $auth->setAttrib("onChange", "toggleAuth()");
     $auth->setRequired("true");
     $auth->setAttrib('maxlength', '50');
     $auth->addValidator('NotEmpty', false, array('messages' => 'Please enter authentication type.'));
     $port = new Zend_Form_Element_Text("port");
     $port->setLabel("Port");
     $port->setAttrib("class", "formDataElement");
     $port->setRequired("true");
     $port->setAttrib('maxlength', '50');
     $port->addValidator('NotEmpty', false, array('messages' => 'Please enter port.'));
     $password = new Zend_Form_Element_Text("password");
     $password->setLabel("Password");
     $password->setAttrib("class", "formDataElement");
     // $password->setRequired("true");
     $password->setAttrib('maxlength', '100');
     // $password->addValidator('NotEmpty', false, array('messages' => 'Please enter password.'));
     $server_name = new Zend_Form_Element_Text("server_name");
     $server_name->setLabel("SMTP Server");
     $server_name->setAttrib("class", "formDataElement");
     $server_name->setRequired("true");
     $server_name->setAttrib('maxlength', '100');
     $server_name->addValidator('NotEmpty', false, array('messages' => 'Please enter SMTP Server.'));
     $submit = new Zend_Form_Element_Submit("submit");
     $submit->setLabel("Save");
     $submit->setAttrib('id', 'submitbutton');
     $submit->setAttrib("class", "formSubmitButton");
     $this->addElements(array($id, $submit, $username, $tls, $auth, $port, $password, $server_name));
     $this->setElementDecorators(array('ViewHelper'));
 }
示例#13
0
 public function init()
 {
     $this->setName('category');
     $this->setMethod('Post');
     $category = new Zend_Form_Element_Text('category', array('disableLoadDefaultDecorators' => true));
     $category->setRequired(true)->setLabel(' *Category Name:')->setAttrib('id', 'category')->addFilter('StripTags')->addFilter('StringTrim')->setAttrib("class", "form-control")->removeDecorator('htmlTag');
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton');
     $submit->setAttrib('class', 'btn btn-lg btn-primary float-right')->removeDecorator('HtmlTag')->removeDecorator('Label')->setLabel("Save");
     $this->setElementDecorators(array('Errors', 'ViewHelper', array('decorator' => array('td' => 'HtmlTag'), 'options' => array('tag' => 'td')), array('Label', array('tag' => 'td')), array('decorator' => array('tr' => 'HtmlTag'), 'options' => array('tag' => 'tr'))), array('category'));
     ///$this->addElement('hash', 'csrf', array('ignore' => true,));
     $this->addElements(array($category, $submit));
 }
示例#14
0
 public function init()
 {
     $this->setMethod('post');
     $this->setName('recover-password');
     // Add an email element
     $email = new Zend_Form_Element_Text('email');
     $email->setRequired(true)->setAttrib('size', '30')->setLabel('* Your Email Address:')->addFilter('StripTags')->addFilter('StringTrim')->setAttrib('class', 'email1')->setErrorMessages(array("Write your email"))->addValidator('EmailAddress', true)->setAttrib('class', 'form-control')->setAttrib('place-holder', 'Email Address as ID');
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton');
     $submit->setAttrib('class', 'btn btn-md btn-primary')->removeDecorator('Label')->setLabel("Recover Now");
     $this->setElementDecorators(array('Errors', 'ViewHelper', array('Description', array('tag' => 'td' + '&nbsp;&nbsp;')), array('decorator' => array('td' => 'HtmlTag'), 'options' => array('tag' => 'td')), array('Label', array('tag' => 'td')), array('decorator' => array('tr' => 'HtmlTag'), 'options' => array('tag' => 'tr'))), array('email'));
     $this->addElements(array($email, $submit));
 }
示例#15
0
 public function __construct($haveToPay, $currentdate, $fromDate)
 {
     parent::__construct($haveToPay, $currentdate, $fromDate);
     $accountId = new Zend_Form_Element_Hidden('accountcode');
     $installment_status = new Zend_Form_Element_Hidden('installment_status');
     $memberId = new Zend_Form_Element_Hidden('membercode');
     $amount = new Zend_Form_Element_Text('amount');
     $amount->setRequired(true)->addValidators(array(array('Float'), array('GreaterThan', false, array($haveToPay - 0.0001, 'messages' => array('notGreaterThan' => 'Min=' . $haveToPay)))));
     $amount->setAttrib('class', 'txt_put');
     $amount->setAttrib('id', 'amount');
     $loanInterestAmountPaied = new Zend_Form_Element_Text('loanInterestAmountPaied');
     $loanInterestAmountPaied->setAttrib('class', 'textfieldreadonly');
     $loanInterestAmountPaied->setAttrib('readonly', 'true');
     $loanInterestAmountPaied->setAttrib('id', 'loanInterestAmountPaied');
     $loanRepaymentDate = new Zend_Form_Element_Text('loanRepaymentDate');
     $loanRepaymentDate->setAttrib('id', 'loanRepaymentDate');
     $loanRepaymentDate->setAttrib('size', '8');
     $loanRepaymentDate->setAttrib('class', 'txt_put');
     $loanRepaymentDate->setRequired(true)->addValidators(array(array('Date', true), array('Between', false, array($fromDate, $currentdate, 'messages' => array('notBetween' => 'date should be between ' . $fromDate . ' to (today date) ' . $currentdate)))));
     $transactionMode = new Zend_Form_Element_Select('transactionMode');
     $transactionMode->addMultiOption('', 'select');
     $transactionMode->setAttrib('class', 'selectbutton');
     $transactionMode->setAttrib('onchange', 'toggleField();');
     $transactionMode->setAttrib('id', 'paymenttype');
     $transactionMode->setRequired(true);
     $transactionModeDetails = new Zend_Form_Element_Textarea('paymenttype_details');
     $transactionModeDetails->setAttrib('class', 'txt_put');
     $transactionModeDetails->setAttrib('id', 'paymenttype_details');
     $transactionModeDetails->setAttrib('style', 'display:none');
     $transactionModeDetails->setAttrib('rows', '1');
     $transactionModeDetails->setAttrib('cols', '20');
     $transactionModeDetails->setRequired(true);
     $pay = new Zend_Form_Element_Submit('pay');
     $pay->setAttrib('class', 'officesubmit');
     $pay->setAttrib('onclick', 'getState(this.value)');
     $pay->setLabel('pay');
     $back = new Zend_Form_Element_Submit('back');
     $back->setAttrib('class', 'officesubmit');
     $confirm = new Zend_Form_Element_Submit('confirm');
     $confirm->setAttrib('class', 'officesubmit');
     $confirm->setAttrib('onclick', 'getState(this.value)');
     $confirm->setLabel('confirm');
     $categoryId = new Zend_Form_Element_Hidden('categoryId');
     $categoryId->setAttrib('class', 'txt_put');
     $amount1 = new Zend_Form_Element_Hidden('repayableamounts1');
     $loanRepaymentDate1 = new Zend_Form_Element_Hidden('loanRepaymentDate1');
     $transactionMode1 = new Zend_Form_Element_Hidden('transactionMode1');
     $paymenttype_details1 = new Zend_Form_Element_Hidden('paymenttype_details1');
     $fine1 = new Zend_Form_Element_Hidden('fine1');
     $this->addElements(array($accountId, $amount, $loanRepaymentDate, $pay, $memberId, $loanInterestAmountPaied, $transactionMode, $transactionModeDetails, $categoryId, $installment_status, $confirm, $amount1, $loanRepaymentDate1, $transactionMode1, $paymenttype_details1, $fine1, $back));
 }
示例#16
0
 public function init()
 {
     $this->setName('photo-category');
     $category_name = new Zend_Form_Element_Text('category_name', array('disableLoadDefaultDecorators' => true));
     $category_name->setRequired(true)->setAttrib('id', 'category')->addFilter('StripTags')->addFilter('StringTrim')->setAttrib("class", "form-control")->removeDecorator('htmlTag');
     $banner = new Zend_Form_Element_File('banner');
     $banner->addValidator('Count', false, 1)->addValidator('FilesSize', false, array('min' => '1kB', 'max' => '5MB'))->addValidator('ImageSize', false, array('minwidth' => 10, 'minheight' => 10))->addFilter('StringTrim')->setErrorMessages(array("Upload an image"))->addValidator('Extension', false, 'jpeg,jpg,png,gif');
     // only JPEG, PNG, and GIFs
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton');
     $submit->setAttrib('class', 'btn btn-md btn-primary float-right')->removeDecorator('HtmlTag')->removeDecorator('Label')->setLabel("Save");
     $this->setElementDecorators(array('Errors', 'ViewHelper', array('decorator' => array('td' => 'HtmlTag'), 'options' => array('tag' => 'td')), array('decorator' => array('tr' => 'HtmlTag'), 'options' => array('tag' => 'tr'))), array('category_name', 'banner'));
     $this->addElements(array($category_name, $banner, $submit));
 }
示例#17
0
 public function init()
 {
     $this->setName('photo_gallery');
     $this->setMethod('Post');
     $this->setAttrib('enctype', 'multipart/form-data');
     $photo_name = new Zend_Form_Element_File('photo_name');
     $photo_name->addValidator('Count', false, 1)->addValidator('FilesSize', false, array('min' => '10kB', 'max' => '3MB'))->setErrorMessages(array("Upload an image"))->addValidator('Extension', false, 'jpg,png,gif');
     // only JPEG, PNG, and GIFs
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submit-btn');
     $submit->setAttrib('class', 'btn btn-lg btn-primary float-right')->removeDecorator('HtmlTag')->removeDecorator('Label')->setLabel("Save");
     $this->setElementDecorators(array('Errors', 'ViewHelper', array('decorator' => array('td' => 'HtmlTag'), 'options' => array('tag' => 'td')), array('Label', array('tag' => 'td')), array('decorator' => array('tr' => 'HtmlTag'), 'options' => array('tag' => 'tr'))), array('photo_name'));
     $this->addElements(array($photo_name, $submit));
 }
示例#18
0
 public function init()
 {
     $this->setName('text_block');
     $this->setMethod('Post');
     $this->setAttrib('enctype', 'multipart/form-data');
     $tb_name = new Zend_Form_Element_Text('tb_name', array('disableLoadDefaultDecorators' => true));
     $tb_name->setAttrib('id', 'text_block')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib("class", "form-control")->removeDecorator('htmlTag')->setRequired(true);
     $tb_text = new Zend_Form_Element_Textarea('tb_text', array('disableLoadDefaultDecorators' => true));
     $tb_text->setAttrib('id', 'editor1')->setAttrib('name', 'tb_text')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib("class", "form-control")->removeDecorator('htmlTag');
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submit-btn');
     $submit->setAttrib('class', 'btn btn-middium btn-primary pull-right')->removeDecorator('HtmlTag')->removeDecorator('Label')->setLabel("Update");
     $this->setElementDecorators(array('Errors', 'ViewHelper', array('decorator' => array('td' => 'HtmlTag'), 'options' => array('tag' => 'td')), array('decorator' => array('tr' => 'HtmlTag'), 'options' => array('tag' => 'tr'))), array('tb_name', 'tb_text'));
     $this->addElements(array($tb_name, $tb_text, $submit));
 }
示例#19
0
 public function init()
 {
     $this->setName('accountsetings');
     $this->setAttrib('id', 'accountsetings');
     $pageId = new Zend_Form_Element_Hidden('pageId');
     $pageId->setValue('accountsetings');
     //'d.first_name','d.middle_name','d.last_name',
     // Add First middle last name
     $fName = new Zend_Form_Element_Text('fName');
     $fName->setLabel('First Name :')->addFilters(array('StripTags', 'StringTrim'))->setRequired(true)->addValidator('NotEmpty')->addValidator(new Zend_Validate_Alnum(array('allowWhiteSpace' => true)))->addValidator(new Zend_Validate_StringLength(array('max' => 100)));
     //Midle Name
     $mName = new Zend_Form_Element_Text('mName');
     $mName->setLabel('Middle Name :')->addFilters(array('StripTags', 'StringTrim'))->addValidator(new Zend_Validate_StringLength(array('max' => 100)));
     //Last Name
     $lName = new Zend_Form_Element_Text('lName');
     $lName->setLabel('Last Name :')->addFilters(array('StripTags', 'StringTrim'))->setRequired(true)->addValidator('NotEmpty')->addValidator(new Zend_Validate_Alnum(array('allowWhiteSpace' => true)))->addValidator(new Zend_Validate_StringLength(array('max' => 100)));
     $userName = new Zend_Form_Element_Text('userName');
     $userName->setLabel('User Id :')->addFilters(array('StripTags', 'StringTrim', 'StringToLower'))->setRequired(true)->addValidator('NotEmpty')->addValidator(new Zend_Validate_Alnum(array('allowWhiteSpace' => false)))->addValidator(new Zend_Validate_StringLength(array('min' => 8, 'max' => 100)));
     $email = new Zend_Form_Element_Text('email');
     $email->setLabel('Email :')->addFilters(array('StripTags', 'StringTrim', 'StringToLower'))->setRequired(true)->addValidator('NotEmpty')->addValidator(new Zend_Validate_EmailAddress());
     //Add Country
     $mstcountry = new Application_Model_DbTable_MstCountry();
     $country = new Zend_Form_Element_Select('country');
     $country->setLabel('Country Code :')->addMultiOption('0', 'Select Country')->addMultiOptions($mstcountry->getPairWithTelCode());
     $mobile = new Zend_Form_Element_Text('mobile');
     $mobile->setLabel('Mobile :')->addFilters(array('StripTags', 'StringTrim', 'StringToLower'))->setRequired(true)->addValidator('NotEmpty')->addValidator(new Rgm_Validate_MobileNumber());
     $this->addElements(array($pageId, $fName, $mName, $lName, $userName, $email, $country, $mobile));
     $this->addDisplayGroup(array('fName', 'mName', 'lName'), 'legalname');
     $this->getDisplayGroup('legalname')->setLegend('Legal Name')->setAttrib('style', 'border:1px solid grey;padding:10px;');
     $this->addDisplayGroup(array('userName', 'email', 'country', 'mobile'), 'user');
     $this->getDisplayGroup('user')->setLegend('User Info')->setAttrib('style', 'border:1px solid grey;padding:10px;');
     $mstSecQ = new Application_Model_DbTable_MstUserSecurityQuestions();
     $securityQ01 = new Zend_Form_Element_Select('securityQ01');
     $securityQ01->setLabel('Question 01 :')->addMultiOption('0', 'Select One')->addMultiOptions($mstSecQ->getPair());
     $securityA01 = new Zend_Form_Element_Text('securityA01');
     $securityA01->setLabel('Answer :')->addFilters(array('StripTags', 'StringTrim'))->setRequired(true)->addValidator('NotEmpty')->addValidator(new Zend_Validate_Alnum())->addValidator(new Zend_Validate_StringLength(array('max' => 100)));
     $securityQ02 = new Zend_Form_Element_Select('securityQ02');
     $securityQ02->setLabel('Question 02 :')->addMultiOption('0', 'Select One')->addMultiOptions($mstSecQ->getPair());
     $securityA02 = new Zend_Form_Element_Text('securityA02');
     $securityA02->setLabel('Answer :')->addFilters(array('StripTags', 'StringTrim'))->setRequired(true)->addValidator('NotEmpty')->addValidator(new Zend_Validate_Alnum())->addValidator(new Zend_Validate_StringLength(array('max' => 100)));
     $this->addElements(array($securityQ01, $securityA01, $securityQ02, $securityA02));
     $this->addDisplayGroup(array('securityQ01', 'securityA01', 'securityQ02', 'securityA02'), 'securityQuestions');
     $this->getDisplayGroup('securityQuestions')->setLegend('Security Questions')->setAttrib('style', 'border:1px solid grey;padding:10px;');
     $submit = new Zend_Form_Element_Submit('save');
     $submit->setAttrib('id', 'submitbutton');
     $submit->setAttrib('class', 'form-submit-button');
     $this->addElements(array($submit));
 }
示例#20
0
 public function __construct($options = null)
 {
     parent::__construct($options);
     $id = new Zend_Form_Element_Hidden('id');
     $hierarchyLevel = new Zend_Form_Element_Hidden('hierarchyLevel');
     $officeType = new Zend_Form_Element_Text('officeType');
     $officeType->setRequired(true)->addValidators(array(array('NotEmpty'), array('stringLength', false, array(4, 50))));
     // $officeType->addValidator($db_lookup_validator);
     $officeType->setAttrib('class', 'txt_put');
     $officeType->setAttrib('id', 'officeType');
     $officeCode = new Zend_Form_Element_Text('officeCode');
     //add validation
     $officeCode->setRequired(true)->addValidators(array(array('NotEmpty'), array('stringLength', false, array(2, 2))));
     $officeCode->setAttrib('class', 'txt_put');
     $officeCode->setAttrib('id', 'officeCode')->setAttrib('size', '2');
     $this->addElements(array($id, $officeType, $officeCode, $hierarchyLevel));
     $submit = new Zend_Form_Element_Submit('Edit');
     $submit->setAttrib('class', 'officebutton');
     $submit->setLabel('edit');
     $submit->removeDecorator('DtDdWrapper');
     $next = new Zend_Form_Element_Submit('Next');
     $next->setAttrib('class', 'officesubmit');
     $next->setLabel('Next');
     //add form element to form
     $this->addElements(array($submit, $next));
 }
示例#21
0
 public function init()
 {
     $this->setMethod('post');
     $this->setAttrib('id', 'pdcategories');
     $this->setAttrib('name', 'pdcategories');
     $categoryName = new Zend_Form_Element_Text('category');
     $categoryName->setAttrib('id', 'category');
     $categoryName->setAttrib('name', 'category');
     $categoryName->setAttrib('maxlength', '30');
     $categoryName->setAttrib('onblur', 'chkCategory()');
     $categoryName->setAttrib('onkeypress', 'chkCategory()');
     $categoryName->addFilter(new Zend_Filter_StringTrim());
     $categoryName->setRequired(true);
     $categoryName->addValidator('NotEmpty', false, array("messages" => 'Please enter category'));
     $categoryName->addValidator('regex', true, array('pattern' => '/^[a-zA-Z0-9][\\s+[a-zA-Z0-9]+]*$/', 'messages' => array('regexNotMatch' => 'Please enter valid category')));
     $categoryName->addValidator(new Zend_Validate_Db_NoRecordExists(array('table' => 'main_pd_categories', 'field' => 'category', 'exclude' => 'id!="' . Zend_Controller_Front::getInstance()->getRequest()->getParam('id') . '" and isactive = 1')));
     $categoryName->getValidator('Db_NoRecordExists')->setMessage('Category already exists');
     $categoryDesc = new Zend_Form_Element_Textarea('description');
     $categoryDesc->setAttrib('id', 'description');
     $categoryDesc->setAttrib('name', 'description');
     $categoryDesc->setAttrib('rows', 10);
     $categoryDesc->setAttrib('cols', 50);
     $categoryDesc->setAttrib('maxlength', 250);
     $submitBtn = new Zend_Form_Element_Submit('submit');
     $submitBtn->setAttrib('id', 'submitBtn');
     $submitBtn->setLabel('Add');
     $this->addElements(array($categoryName, $categoryDesc, $submitBtn));
     $this->setElementDecorators(array('ViewHelper'));
 }
示例#22
0
 public function init()
 {
     $this->setMethod('post');
     $this->setAttrib('id', 'formid');
     $this->setAttrib('name', 'emailcontacts');
     $this->setAttrib('action', BASE_URL . 'emailcontacts/add/');
     $id = new Zend_Form_Element_Hidden('id');
     $group_id = new Zend_Form_Element_Select("group_id");
     $group_id->setRegisterInArrayValidator(false);
     $group_id->setRequired(true);
     $group_id->addValidator('NotEmpty', false, array('messages' => 'Please select group.'));
     $business_unit_id = new Zend_Form_Element_Select("business_unit_id");
     $business_unit_id->setRegisterInArrayValidator(false);
     $business_unit_id->setRequired(true);
     $business_unit_id->addValidator('NotEmpty', false, array('messages' => 'Please select business unit.'));
     $business_unit_id->setAttrib('onchange', "bunit_emailcontacts('business_unit_id');");
     //Group Email....
     $grpEmail = new Zend_Form_Element_Text('groupEmail');
     $grpEmail->addFilters(array('StringTrim', 'StripTags'));
     $grpEmail->setRequired(true);
     $grpEmail->addValidator('NotEmpty', false, array('messages' => 'Please enter group email.'));
     $grpEmail->addValidator("regex", true, array('pattern' => '/^(?!.*\\.{2})[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\.[a-zA-Z0-9-.]+$/', 'messages' => array('regexNotMatch' => 'Please enter valid email.')));
     $grpEmail->addValidator(new Zend_Validate_Db_NoRecordExists(array('table' => 'main_emailcontacts', 'field' => 'groupEmail', 'exclude' => 'id!="' . Zend_Controller_Front::getInstance()->getRequest()->getParam('id') . '" and isactive = 1')));
     $grpEmail->getValidator('Db_NoRecordExists')->setMessage('Group email already exists.');
     // Form Submit .........
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton');
     $submit->setLabel('Save');
     $this->addElements(array($id, $group_id, $grpEmail, $submit, $business_unit_id));
     $this->setElementDecorators(array('ViewHelper'));
 }
示例#23
0
 public function __construct($options = null)
 {
     $projecttypes = new ProjectTypes();
     $projectype_list = $projecttypes->getTypes();
     $periods = new Periods();
     $period_options = $periods->getPeriodFrom();
     parent::__construct($options);
     $this->setName('suggested');
     $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')));
     $level = new Zend_Form_Element_Select('level');
     $level->setLabel('Level of research: ')->setRequired(true)->addMultiOptions(array('Please choose a level' => NULL, 'Research levels' => $projectype_list))->addValidator('InArray', false, array(array_keys($projectype_list)))->addFilters(array('StringTrim', 'StripTags'))->setDecorators($decorators);
     $period = new Zend_Form_Element_Select('period');
     $period->setLabel('Broad research period: ')->setRequired(true)->addMultiOptions(array('Please choose a period' => NULL, 'Periods available' => $period_options))->addValidator('InArray', false, array(array_keys($period_options)))->addFilters(array('StringTrim', 'StripTags'))->setDecorators($decorators);
     $title = new Zend_Form_Element_Text('title');
     $title->setLabel('Project title: ')->setRequired(true)->setAttrib('size', 60)->addFilters(array('StringTrim', 'StripTags'))->addErrorMessage('Choose title for the project.')->setDecorators($decorators);
     $description = $this->addElement('Textarea', 'description', array('label' => 'Short description of project: '));
     $description = $this->getElement('description')->setRequired(false)->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'))->setAttribs(array('cols' => 80, 'rows' => 10))->addDecorator('HtmlTag', array('tag' => 'li'));
     $valid = new Zend_Form_Element_Checkbox('taken');
     $valid->setLabel('Is the topic taken: ')->setRequired(true)->setDecorators($decorators)->addValidator('Int');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(4800);
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submit')->removeDecorator('label')->removeDecorator('HtmlTag')->setAttrib('class', 'large')->removeDecorator('DtDdWrapper');
     $this->addElements(array($title, $level, $period, $description, $valid, $submit, $hash));
     $this->addDisplayGroup(array('title', 'level', 'period', 'description', 'taken'), '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');
 }
示例#24
0
 public function __construct($options = null)
 {
     parent::__construct($options);
     $this->setAttrib('accept-charset', 'UTF-8');
     $this->setName('safcontrollers');
     $id = new Zend_Form_Element_Hidden('id');
     $hash = new Zend_Form_Element_Hash('no_csrf_foo', array('salt' => '4s564evzaSD64sf'));
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton');
     $label = new Zend_Form_Element_Text('label');
     $label->setLabel('label');
     $name = new Zend_Form_Element_Text('name');
     $name->setLabel('name');
     $image = new Zend_Form_Element_Textarea('image');
     $image->setLabel('image');
     $description = new Zend_Form_Element_Textarea('description');
     $description->setLabel('description');
     $safmodulesId = new Zend_Form_Element_Select('safmodules_id');
     $options = new Safmodules();
     $safmodulesId->addMultiOption('', '----------');
     foreach ($options->fetchAlltoFlatArray() as $k => $v) {
         $safmodulesId->addMultiOption($k, $v['mlabel']);
     }
     $safmodulesId->setLabel('safmodules_id');
     $this->addElements(array($id, $hash, $label, $name, $image, $description, $safmodulesId));
     $this->addElements(array($submit));
 }
示例#25
0
 public function init()
 {
     $this->setMethod('post');
     $this->setAttrib('action', DOMAIN . 'employmentstatus/edit');
     $this->setAttrib('id', 'formid');
     $this->setAttrib('name', 'employmentstatus');
     $id = new Zend_Form_Element_Hidden('id');
     $workcode = new Zend_Form_Element_Text('workcode');
     $workcode->setAttrib('maxLength', 20);
     $workcode->setRequired(true);
     $workcode->addValidator('NotEmpty', false, array('messages' => 'Please enter work short code.'));
     $workcode->addValidator("regex", true, array('pattern' => '/^(?=.*[a-zA-Z])([^ ][a-zA-Z0-9 ]*)$/', 'messages' => array('regexNotMatch' => 'Please enter valid work short code.')));
     $workcodename = new Zend_Form_Element_Select('workcodename');
     $workcodename->setAttrib('class', 'selectoption');
     $workcodename->setRegisterInArrayValidator(false);
     $workcodename->setRequired(true);
     $workcodename->addValidator('NotEmpty', false, array('messages' => 'Please select work code.'));
     $description = new Zend_Form_Element_Textarea('description');
     $description->setAttrib('rows', 10);
     $description->setAttrib('cols', 50);
     $description->setAttrib('maxlength', '200');
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton');
     $submit->setLabel('Save');
     $this->addElements(array($id, $workcode, $workcodename, $description, $submit));
     $this->setElementDecorators(array('ViewHelper'));
 }
示例#26
0
 public function init()
 {
     $this->setMethod('post');
     $this->setAttrib('action', BASE_URL . 'veteranstatus/edit');
     $this->setAttrib('id', 'formid');
     $this->setAttrib('name', 'veteranstatus');
     $id = new Zend_Form_Element_Hidden('id');
     $veteranstatus = new Zend_Form_Element_Text('veteranstatus');
     $veteranstatus->setAttrib('maxLength', 20);
     $veteranstatus->setRequired(true);
     $veteranstatus->addValidator('NotEmpty', false, array('messages' => 'Please enter veteran status.'));
     $veteranstatus->addValidators(array(array('validator' => 'Regex', 'breakChainOnFailure' => true, 'options' => array('pattern' => '/^(?=.*[a-zA-Z])([^ ][a-zA-Z\\s]*)$/', 'messages' => array('regexNotMatch' => 'Please enter valid veteran status.')))));
     $veteranstatus->addValidator(new Zend_Validate_Db_NoRecordExists(array('table' => 'main_veteranstatus', 'field' => 'veteranstatus', 'exclude' => 'id!="' . Zend_Controller_Front::getInstance()->getRequest()->getParam('id') . '" and isactive=1')));
     $veteranstatus->getValidator('Db_NoRecordExists')->setMessage('Veteran status already exists.');
     $description = new Zend_Form_Element_Textarea('description');
     $description->setAttrib('rows', 10);
     $description->setAttrib('cols', 50);
     $description->setAttrib('maxlength', '200');
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton');
     $submit->setLabel('Save');
     $url = "'gender/saveupdate/format/json'";
     $dialogMsg = "''";
     $toggleDivId = "''";
     $jsFunction = "'redirecttocontroller(\\'gender\\');'";
     $this->addElements(array($id, $veteranstatus, $description, $submit));
     $this->setElementDecorators(array('ViewHelper'));
 }
示例#27
0
 public function init()
 {
     $this->setMethod('post');
     $this->setAttrib('action', BASE_URL . 'timeformat/edit');
     $this->setAttrib('id', 'formid');
     $this->setAttrib('name', 'timeformat');
     $id = new Zend_Form_Element_Hidden('id');
     $timeformat = new Zend_Form_Element_Text('timeformat');
     $timeformat->setAttrib('maxLength', 20);
     $timeformat->addFilter(new Zend_Filter_StringTrim());
     $timeformat->setRequired(true);
     $timeformat->addValidator('NotEmpty', false, array('messages' => 'Please enter time format.'));
     $description = new Zend_Form_Element_Textarea('description');
     $description->setAttrib('rows', 10);
     $description->setAttrib('cols', 50);
     $description->setAttrib('maxlength', '200');
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton');
     $submit->setLabel('Save');
     $url = "'timeformat/saveupdate/format/json'";
     $dialogMsg = "''";
     $toggleDivId = "''";
     $jsFunction = "'redirecttocontroller(\\'timeformat\\');'";
     $this->addElements(array($id, $timeformat, $description, $submit));
     $this->setElementDecorators(array('ViewHelper'));
 }
示例#28
0
 public function init()
 {
     $this->setMethod('post');
     //$this->setAttrib('action',DOMAIN.'language/edit');
     $this->setAttrib('id', 'formid');
     $this->setAttrib('name', 'servicedeskdepartment');
     $id = new Zend_Form_Element_Hidden('id');
     $servicedeskdepartment = new Zend_Form_Element_Text("service_desk_name");
     $servicedeskdepartment->setLabel("Category");
     $servicedeskdepartment->setAttrib('maxLength', 30);
     $servicedeskdepartment->addFilter(new Zend_Filter_StringTrim());
     $servicedeskdepartment->setRequired(true);
     $servicedeskdepartment->addValidator('NotEmpty', false, array('messages' => 'Please enter category.'));
     $servicedeskdepartment->addValidator("regex", true, array('pattern' => '/^[a-zA-Z0-9\\- ]+$/', 'messages' => array('regexNotMatch' => 'Please enter valid category.')));
     $servicedeskdepartment->addValidator(new Zend_Validate_Db_NoRecordExists(array('table' => 'main_sd_depts', 'field' => 'service_desk_name', 'exclude' => 'id!="' . Zend_Controller_Front::getInstance()->getRequest()->getParam('id') . '" AND isactive=1')));
     $servicedeskdepartment->getValidator('Db_NoRecordExists')->setMessage('Category name already exists.');
     $description = new Zend_Form_Element_Textarea('description');
     $description->setLabel("Description");
     $description->setAttrib('rows', 10);
     $description->setAttrib('cols', 50);
     $description->setAttrib('maxlength', '200');
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton');
     $submit->setLabel('Save');
     $this->addElements(array($id, $servicedeskdepartment, $description, $submit));
     $this->setElementDecorators(array('ViewHelper'));
 }
示例#29
0
 public function init()
 {
     $country_code = new Zend_Form_Element_Text('country_code');
     $country_code->setLabel('Country code');
     $country_code->setDescription('List of codes you can see here: http://framework.zend.com/manual/1.12/en/zend.locale.appendix.html');
     $country_code->setRequired(true);
     $this->addElement($country_code);
     $name = new Zend_Form_Element_Text('name');
     $name->setLabel('Name');
     $name->setRequired(true);
     $this->addElement($name);
     $is_active = new Zend_Form_Element_Checkbox('is_active');
     $is_active->setLabel('Active');
     $is_active->setRequired(true);
     $this->addElement($is_active);
     $cancel = new Zend_Form_Element_Button('cancel');
     $cancel->setLabel('Cancel');
     $cancel->setAttrib('class', 'btn btn-gold')->setAttrib('style', 'color:black');
     $cancel->setAttrib("onClick", "window.location = window.location.origin+'/locale/languages/'");
     $this->addElement($cancel);
     $submit = new Zend_Form_Element_Submit('save');
     $submit->setAttrib('class', 'btn btn-primary');
     $submit->setLabel('Confirm');
     $this->setAction('')->setMethod('post')->addElement($submit);
 }
示例#30
0
 public function __construct($options = null)
 {
     parent::__construct($options);
     $this->setAttrib('accept-charset', 'UTF-8');
     $this->setName('applog');
     $id = new Zend_Form_Element_Hidden('id');
     $hash = new Zend_Form_Element_Hash('no_csrf_foo', array('salt' => '4s564evzaSD64sf'));
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton');
     $timestamp = new Zend_Form_Element_Text('timestamp');
     $timestamp->setLabel('timestamp');
     $priorityName = new Zend_Form_Element_Text('priorityName');
     $priorityName->setLabel('priorityName');
     $priority = new Zend_Form_Element_Text('priority');
     $priority->setLabel('priority');
     $className = new Zend_Form_Element_Text('className');
     $className->setLabel('className');
     $message = new Zend_Form_Element_Textarea('message');
     $message->setLabel('message');
     $identity = new Zend_Form_Element_Text('identity');
     $identity->setLabel('identity');
     $httpReferer = new Zend_Form_Element_Textarea('HTTP_REFERER');
     $httpReferer->setLabel('HTTP_REFERER');
     $remoteAddr = new Zend_Form_Element_Text('REMOTE_ADDR');
     $remoteAddr->setLabel('REMOTE_ADDR');
     $requestMethod = new Zend_Form_Element_Text('REQUEST_METHOD');
     $requestMethod->setLabel('REQUEST_METHOD');
     $requestTime = new Zend_Form_Element_Text('REQUEST_TIME');
     $requestTime->setLabel('REQUEST_TIME');
     $mysqltimestamp = new Zend_Form_Element_Text('mysqltimestamp');
     $mysqltimestamp->setLabel('mysqltimestamp');
     $elements = array($id, $hash, $timestamp, $priorityName, $priority, $className, $message, $identity, $httpReferer, $remoteAddr, $requestMethod, $requestTime, $mysqltimestamp);
     $this->addElements($elements);
     $this->addElements(array($submit));
 }