Ejemplo n.º 1
0
 public function init()
 {
     $this->setMethod("post");
     $title = new Zend_Form_Element_Text("title");
     $title->setAttrib("placeholder", "Title");
     $title->setAttrib("class", "form-control");
     $title->setLabel("Title: ");
     $title->setRequired();
     $body = new Zend_Form_Element_Textarea("body");
     $body->setAttrib("class", "form-control");
     $body->setAttrib("placeholder", "Write body here....");
     $body->setLabel("Body: ");
     $body->setAttrib("rows", "5");
     $body->setAttrib("cols", "55");
     $body->setRequired();
     $picture = new Zend_Form_Element_File('picture');
     $picture->setLabel("Picture:");
     $picture->setRequired();
     $picture->setDestination('/var/www/html/RNR/public/images/thread');
     $stick = new Zend_Form_Element_Radio("stick");
     $stick->setLabel("Sticky:");
     $stick->addMultiOption("on", "on");
     $stick->addMultiOption("off", "off");
     $stick->setRequired();
     $id = new Zend_Form_Element_Hidden("id");
     $submit = new Zend_Form_Element_Submit("Submit");
     $submit->setAttrib("class", "btn btn-primary");
     $submit->setLabel("Save");
     $rest = new Zend_Form_Element_Submit('Rest');
     $rest->setAttrib("class", "btn btn-info");
     $this->addElements(array($id, $title, $body, $picture, $stick, $submit, $rest));
 }
Ejemplo n.º 2
0
 public function init()
 {
     $this->setName(strtolower(get_class()));
     $this->setMethod("post");
     $oFormName = new Zend_Form_Element_Hidden("form_name");
     $oFormName->setValue(get_class());
     $oFormName->setIgnore(FALSE)->removeDecorator("Label");
     $this->addElement($oFormName);
     $oMessage = new Zend_Form_Element_Textarea("message");
     $oMessage->setFilters($this->_aFilters);
     $oMessage->setRequired(FALSE);
     $oMessage->removeDecorator("label");
     $this->addElement($oMessage);
     $oIsDing = new Zend_Form_Element_Checkbox("is_ding");
     $oIsDing->setLabel("Włącz dźwięk");
     $oIsDing->setValue(1);
     $this->addElement($oIsDing);
     $oSubmit = new Zend_Form_Element_Submit("send_message");
     $oSubmit->setLabel("Wyślij wiadomość");
     $this->addElement($oSubmit);
     $oViewScript = new Zend_Form_Decorator_ViewScript();
     $oViewScript->setViewModule("admin");
     $oViewScript->setViewScript("_forms/chat.phtml");
     $this->clearDecorators();
     $this->setDecorators(array(array($oViewScript)));
     $oElements = $this->getElements();
     foreach ($oElements as $oElement) {
         $oElement->setFilters($this->_aFilters);
         $oElement->removeDecorator("Errors");
     }
 }
Ejemplo n.º 3
0
 public function init($catId)
 {
     global $mySession;
     $db = new Db();
     $catname = "";
     $catdescription = "";
     if ($catId != "") {
         $Data = $db->runQuery("select * from " . CATEGORY . " where cat_id='" . $catId . "'");
         $catname = $Data[0]['cat_name'];
         $catdescription = $Data[0]['cat_description'];
     }
     $cat_name = new Zend_Form_Element_Text('cat_name');
     $cat_name->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Category name is required.'))->addDecorator('Errors', array('class' => 'errormsg'))->setAttrib("class", "mws-textinput required")->setValue($catname);
     $cat_description = new Zend_Form_Element_Textarea('cat_description');
     $cat_description->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Category description is required.'))->addDecorator('Errors', array('class' => 'errormsg'))->setAttrib("class", "mws-textinput required")->setValue($catdescription);
     /*	$pagepositionArr=array();
     		$pagepositionArr[0]['key']="0";
     		$pagepositionArr[0]['value']="Top";
     		$pagepositionArr[1]['key']="1";
     		$pagepositionArr[1]['value']="Bottom";
     		$pageposition= new Zend_Form_Element_Radio('pageposition');
     		$pageposition->addMultiOptions($pagepositionArr)
     		->setValue($pageposition_value);
     */
     $this->addElements(array($cat_name, $cat_description));
 }
Ejemplo n.º 4
0
 public function __construct($options = null)
 {
     parent::__construct($options);
     parent::__construct();
     $account_id = new Zend_Form_Element_Hidden('accountId');
     $product_id = new Zend_Form_Element_Hidden('productId');
     $newStatus = new Zend_Form_Element_Select('newStatus');
     $newStatus->setAttrib('class', 'NormalBtn');
     $newStatus->setRequired(true);
     $newStatus->addMultiOption('', 'Select...');
     $description = new Zend_Form_Element_Textarea('description');
     $description->setAttrib('class', 'textfield');
     $description->setAttrib('rows', '2');
     $description->setAttrib('cols', '20');
     $description->setRequired(true);
     $newStatus1 = new Zend_Form_Element_Hidden('newStatus1');
     $description1 = new Zend_Form_Element_Hidden('description1');
     $submit = new Zend_Form_Element_Submit('Submit');
     $submit->setLabel('submit');
     $submit->setAttrib('class', 'recurring');
     $Confirm = new Zend_Form_Element_Submit('Confirm');
     $Confirm->setLabel('Confirm');
     $Confirm->setAttrib('class', 'recurring');
     $this->addElements(array($submit, $description, $newStatus, $account_id, $product_id, $Confirm, $newStatus1, $description1));
 }
Ejemplo n.º 5
0
 public function init($pageId)
 {
     global $mySession;
     $db = new Db();
     $PageTitle = "";
     $PageContent = "";
     $PageMetaKeyword = "";
     $PageMetaDescription = "";
     if ($pageId != "") {
         $PageData = $db->runQuery("select * from " . PAGES1 . " where page_id='" . $pageId . "'");
         //                prd($PageData);
         $PageTitle = $PageData[0]['page_title'];
         $PageContent = $PageData[0]['page_content'];
         $PageMetaKeyword = $PageData[0]['meta_keywords'];
         $PageMetaDescription = $PageData[0]['meta_description'];
         $PageSynonyms = $PageData[0]['synonyms'];
     }
     $page_title = new Zend_Form_Element_Text('page_title');
     $page_title->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Page title is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "mws-textinput required")->setValue($PageTitle);
     $page_content = new Zend_Form_Element_Textarea('page_content');
     $page_content->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Page content is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("id", "elrte")->setAttrib("cols", "auto")->setAttrib("rows", "auto")->setValue($PageContent);
     $meta_keywords = new Zend_Form_Element_Text('meta_keywords');
     $meta_keywords->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Keywords are required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "mws-textinput required")->setValue($PageMetaKeyword);
     $meta_description = new Zend_Form_Element_Text('meta_description');
     $meta_description->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Description is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "mws-textinput required")->setValue($PageMetaDescription);
     $synonyms = new Zend_Form_Element_Text('synonyms');
     $synonyms->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'URL is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "mws-textinput required")->setValue($PageSynonyms);
     $this->addElements(array($page_title, $page_content, $meta_keywords, $meta_description, $synonyms));
 }
Ejemplo n.º 6
0
 public function __construct($options = null)
 {
     Zend_Dojo::enableForm($this);
     parent::__construct($options);
     $category_id = new Zend_Form_Element_Select('category_id');
     $category_id->addMultiOption('', 'Select...');
     $category_id->setAttrib('class', 'txt_put')->setLabel('Category  Name');
     $category_id->setRequired(true)->addValidators(array(array('NotEmpty')))->setDecorators(array('ViewHelper', array('Description', array('tag' => '', 'escape' => false)), 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
     $productname = new Zend_Form_Element_Text('productname');
     $productname->addValidator(new Zend_Validate_Db_NoRecordExists('ourbank_productdetails', 'productname'));
     $productname->setAttrib('class', 'txt_put')->setLabel('Product Name');
     $productname->setRequired(true)->addValidators(array(array('NotEmpty')))->setDecorators(array('ViewHelper', array('Description', array('tag' => '', 'escape' => false)), 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
     $product_id = new Zend_Form_Element_Hidden('product_id');
     $product_id->setAttrib('class', 'txt_put');
     $productshortname = new Zend_Form_Element_Text('productshortname');
     $productshortname->setAttrib('class', 'txt_put')->setLabel('Product Short Name');
     $productshortname->setRequired(true)->addValidators(array(array('NotEmpty')))->setDecorators(array('ViewHelper', array('Description', array('tag' => '', 'escape' => false)), 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
     $product_description = new Zend_Form_Element_Textarea('product_description', array('rows' => 3, 'cols' => 20));
     $product_description->setAttrib('class', '')->setLabel('Productdescription');
     $product_description->setRequired(true)->addValidators(array(array('NotEmpty')))->setDecorators(array('ViewHelper', array('Description', array('tag' => '', 'escape' => false)), 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
     $submit = new Zend_Form_Element_Submit('Submit');
     $submit->setAttrib('id', 'save')->setDecorators(array('ViewHelper', array('Description', array('tag' => '', 'escape' => false)), 'Errors', array(array('data' => 'HtmlTag'), array('colspan' => '8 ')), array(array('data' => 'HtmlTag'), array('tag' => 'td ', 'colspan' => '8')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
     $this->addElements(array($category_id, $productname, $productshortname, $product_description, $product_id, $submit));
     $this->setDecorators(array('FormElements', array(array('data' => 'HtmlTag'), array('tag' => 'table', 'id' => 'hor-minimalist-b')), 'Form'));
 }
Ejemplo n.º 7
0
 public function init()
 {
     $name = new Zend_Form_Element_Text('name');
     $name->setLabel('Name');
     $name->setRequired(true);
     $this->addElement($name);
     $enabled = new Zend_Form_Element_Checkbox('enabled');
     $enabled->setLabel('Is the action enabled ?');
     $this->addElement($enabled);
     $public = new Zend_Form_Element_Checkbox('public');
     $public->setLabel('Is the action public ?');
     $this->addElement($public);
     $use_custom_route = new Zend_Form_Element_Checkbox('use_custom_route');
     $use_custom_route->setLabel('Custom Route');
     $this->addElement($use_custom_route);
     $custom_route = new Zend_Form_Element_Text('route');
     //$custom_route->setLabel('Custom Route');
     $this->addElement($custom_route);
     $desc = new Zend_Form_Element_Textarea('description');
     $desc->cols = 40;
     $desc->rows = 15;
     $desc->setLabel('Description');
     $desc->setRequired(false);
     $this->addElement($desc);
     parent::init();
 }
Ejemplo n.º 8
0
 public function __construct($options = null)
 {
     Zend_Dojo::enableForm($this);
     parent::__construct($options);
     $app = APPLICATION_PATH;
     $accountHeader = new Zend_Form_Element_Text('accountHeader');
     $accountHeader->setAttrib('class', 'txt_put');
     $accountHeader->setAttrib('id', 'accountHeader');
     $accountHeader->setRequired(true)->addValidators(array(array('NotEmpty')));
     $glcodeDescription = new Zend_Form_Element_Textarea('glcodeDescription', array('rows' => 3, 'cols' => 25));
     $glcodeDescription->setAttrib('id', 'glcodeDescription');
     $glcodeDescription->setRequired(true)->addValidators(array(array('NotEmpty')));
     $product = new Zend_Form_Element_Select('product');
     $product->setAttrib('select', '-----');
     $product->setAttrib('class', 'txt_put');
     $product->setRequired(true)->addValidators(array(array('NotEmpty')));
     $offerproduct = new Zend_Form_Element_Select('offerproduct');
     $offerproduct->setAttrib('select', '-----');
     $offerproduct->setAttrib('class', 'txt_put');
     $subheader = new Zend_Form_Element_Text('subheader');
     $subheader->setAttrib('class', 'txt_put');
     $subheader->setAttrib('id', 'subheader');
     $glsubaccountdescription = new Zend_Form_Element_Textarea('glsubaccountdescription', array('rows' => 3, 'cols' => 25));
     $glsubaccountdescription->setAttrib('id', 'glsubaccountdescription');
     $submit = new Zend_Form_Element_Submit('Save');
     $submit->setAttrib('id', 'Save');
     $submit->setAttrib('class', 'holiday1');
     $this->addElements(array($submit, $accountHeader, $glcodeDescription, $subheader, $glsubaccountdescription, $product, $offerproduct));
     $glcodeUpdateId = new Zend_Form_Element_Hidden('glcodeUpdateId');
     $glsubcodeupdate_id = new Zend_Form_Element_Hidden('glsubcodeupdate_id');
     $submit = new Zend_Form_Element_Submit('Submit');
     $submit->setAttrib('class', 'holiday');
     $this->addElements(array($submit, $glcodeUpdateId, $glsubcodeupdate_id));
 }
Ejemplo n.º 9
0
 public function init()
 {
     $this->setMethod("POST");
     $category = new Zend_Form_Element_Text("name");
     $category->setRequired();
     $category->setLabel("category Name:");
     $category->setAttrib("placeholder", "Enter Category Name");
     $category->addValidator(new Zend_Validate_Alnum("true"));
     $category->setAttrib("class", "form-control");
     $category->getDecorator("Label")->setOption("class", "control-label");
     $category->getDecorator("Errors")->setOption("class", "alert alert-danger");
     $category->getDecorator("Errors")->setOption("role", "alert");
     $category->getDecorator("Errors")->setOption("style", " list-style-type:none");
     $description = new Zend_Form_Element_Textarea("description");
     $description->setLabel('Description:');
     $description->setRequired();
     $description->setAttrib("rows", "10");
     $description->setAttrib("class", "form-control");
     $description->getDecorator("Label")->setOption("class", "control-label");
     $description->getDecorator("Errors")->setOption("class", "alert alert-danger");
     $description->getDecorator("Errors")->setOption("style", " list-style-type:none");
     $submit = new Zend_Form_Element_Submit("submit");
     $submit->setAttrib("class", "btn btn-xl center-block");
     // $submit->setAttrib("class", "btn");
     $this->addElements(array($category, $description, $submit));
 }
Ejemplo n.º 10
0
 public function init()
 {
     $tr = Zend_Registry::get('tr');
     $http_code = new Zend_Form_Element_Text('http_code');
     $http_code->setLabel($tr->_('HTTP_CODE'));
     $http_code->setRequired(false);
     $this->addElement($http_code);
     $name = new Zend_Form_Element_Text('name');
     $name->setLabel($tr->_('NAME'));
     $name->setRequired(true);
     $this->addElement($name);
     $msg = new Zend_Form_Element_Textarea('message');
     $msg->setLabel($tr->_('ERROR_MESSAGE'));
     $msg->setAttribs(array('rows' => 10, 'cols' => 35));
     $msg->setRequired(true);
     $this->addElement($msg);
     /** Maybe next version will have it back.
         $action = new Default_Model_Action;
         $all    = $action->getList();
         $actions = new Zend_Form_Element_Multiselect('actions');
         $actions->setLabel('Associated Actions with this Error');
         $actions->setMultiOptions($all);
         $actions->setAttrib('size', 8);
         $this->addElement($actions);
         */
     $desc = new Zend_Form_Element_Textarea('description');
     $desc->cols = 35;
     $desc->rows = 15;
     $desc->setLabel($tr->_('DESCRIPTION'));
     $desc->setRequired(false);
     $this->addElement($desc);
     $this->addElement(new Zend_Form_Element_Submit($tr->_('SUBMIT')));
     parent::init();
 }
Ejemplo n.º 11
0
 public function myInit()
 {
     global $mySession;
     $db = new Db();
     $public_name = "";
     $emailid_val = "";
     $bio_value = '';
     $old_profile_image_value = '';
     $qur = $db->runquery("SELECT * FROM  " . USERS . " WHERE user_id='" . $mySession->TeeLoggedID . "' ");
     if ($qur != "" and count($qur) > 0) {
         $public_name = $qur[0]['public_name'];
         $emailid_val = $qur[0]['emailid'];
         $bio_value = $qur[0]['bio'];
         $old_profile_image_value = $qur[0]['profile_image'];
     }
     $publicname = new Zend_Form_Element_Text('publicname');
     $publicname->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Public name is required'))->addDecorator('Errors', array('class' => 'errmsg'))->setAttrib('class', 'changepasstextbox')->setValue($public_name);
     $bio = new Zend_Form_Element_Textarea('bio');
     $bio->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Bio is required.'))->addDecorator('Errors', array('class' => 'errmsg'))->setAttrib("class", "changepasstextarea")->setAttrib("style", "height:150px;width:354px;")->setAttrib("maxlength", "300")->setAttrib("placeholder", "Max 300 Characters")->setValue($bio_value);
     $profile_image = new Zend_Form_Element_File('profile_image');
     $profile_image->setDestination(SITE_ROOT . 'images/profileimages/')->addValidator('Extension', false, 'jpg,jpeg,png,gif')->addDecorator('Errors', array('class' => 'errmsg'))->setAttrib("class", "textInput")->setAttrib("style", "width:325px");
     $old_profile_image = new Zend_Form_Element_Hidden('old_profile_image');
     $old_profile_image->setValue($old_profile_image_value);
     $emailid = new Zend_Form_Element_Text('emailid');
     $emailid->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Email Id is required'))->addDecorator('Errors', array('class' => 'errmsg'))->setAttrib('class', 'changepasstextbox')->setValue($emailid_val);
     $this->addElements(array($publicname, $emailid, $bio, $profile_image, $old_profile_image));
 }
Ejemplo n.º 12
0
 public function init($campid)
 {
     global $mySession;
     $db = new Db();
     $title_val = "";
     $baseprice_val = "";
     $goal_val = "";
     $sold_val = "";
     $sellingprice_val = "";
     $description_val = "";
     $camplength_val = "";
     $url_val = "";
     $launchdate_val = "";
     if ($campid != "") {
         $qur = $db->runquery("SELECT * FROM  " . LAUNCHCAMPAIGN . " WHERE campaign_id='" . $campid . "'");
         if ($qur != "" and count($qur) > 0) {
             //prd($qur);
             $title_val = $qur[0]['title'];
             $baseprice_val = $qur[0]['base_price'];
             $goal_val = $qur[0]['goal'];
             $sold_val = $qur[0]['sold'];
             $sellingprice_val = $qur[0]['selling_price'];
             $description_val = $qur[0]['description'];
             $camplength_val = $qur[0]['campaign_length'];
             $url_val = $qur[0]['url'];
             $launchdate_val = $qur[0]['launch_date'];
         }
     }
     # FORM ELEMENT:no of tee
     # TYPE : text
     $baseprice = new Zend_Form_Element_Text('baseprice');
     $baseprice->setRequired(true)->setAttrib("class", "mws-textinput required")->setAttrib("readonly", "readonly")->setAttrib("style", "width:50px; height:20px;")->setvalue($baseprice_val);
     $sellingprice = new Zend_Form_Element_Text('sellingprice');
     $sellingprice->setRequired(true)->setAttrib("class", "mws-textinput required")->setAttrib("readonly", "readonly")->setAttrib("style", "width:50px; height:20px;")->setvalue($sellingprice_val);
     # FORM ELEMENT:camptitle
     # TYPE : text
     $camptitle = new Zend_Form_Element_Text('camptitle');
     $camptitle->setRequired(true)->setAttrib("class", "mws-textinput required")->setAttrib("readonly", "readonly")->setAttrib("style", "width:250px; height:30px;")->setvalue($title_val);
     # FORM ELEMENT:description
     # TYPE : text
     $description = new Zend_Form_Element_Textarea('description');
     $description->setRequired(true)->setAttrib("class", "mws-textinput required")->setAttrib("readonly", "readonly")->setAttrib("style", "width:450px; height:120px;")->setvalue($description_val);
     $goal = new Zend_Form_Element_Text('goal');
     $goal->setRequired(true)->setAttrib("class", "mws-textinput required")->setAttrib("readonly", "readonly")->setAttrib("style", "width:50px; height:20px;")->setvalue($goal_val);
     $sold = new Zend_Form_Element_Text('sold');
     $sold->setRequired(true)->setAttrib("class", "mws-textinput required")->setAttrib("readonly", "readonly")->setAttrib("style", "width:50px; height:20px;")->setvalue($sold_val);
     # FORM ELEMENT:url
     # TYPE : text
     $url = new Zend_Form_Element_Text('url');
     $url->setRequired(true)->setAttrib("class", "mws-textinput required")->setAttrib("readonly", "readonly")->setAttrib("style", "width:60px; height:20px;")->setvalue($url_val);
     # FORM ELEMENT:url
     # TYPE : text
     $camplength = new Zend_Form_Element_Text('camplength');
     $camplength->setRequired(true)->setAttrib("class", "mws-textinput required")->setAttrib("readonly", "readonly")->setAttrib("style", "width:50px; height:20px;")->setvalue($camplength_val);
     # FORM ELEMENT:url
     # TYPE : text
     $launchdate = new Zend_Form_Element_Text('launchdate');
     $launchdate->setRequired(true)->setAttrib("class", "mws-textinput required")->setAttrib("readonly", "readonly")->setAttrib("style", "width:70px; height:20px;")->setvalue($launchdate_val);
     $this->addElements(array($sellingprice, $baseprice, $camptitle, $camplength, $launchdate, $url, $description, $sold, $goal));
 }
Ejemplo n.º 13
0
		function setForm()
		{
			$form=new Zend_Form;
			 
			$form->setMethod('post')->setAction('');
			
			$image_name = new Zend_Form_Element_Text('image_name');
			$image_name->setRequired(true)->addValidator('NotEmpty',true,array('messages'=>'Tên ảnh không được để trống'));
			
			$image_link = new Zend_Form_Element_Textarea('image_link');
			$image_link->setRequired(true)->addValidator('NotEmpty',true,array('messages'=>'Hình ảnh không được để trống'));
			
			
			$is_active = new Zend_Form_Element_Radio('is_active');
			$is_active->setRequired(true)
					->setLabel('is_active')
					->setMultiOptions(array("1" => "Có","0" => "Không"));
																	  
			$image_name->removeDecorator('HtmlTag')->removeDecorator('Label');
			$image_link->removeDecorator('HtmlTag')->removeDecorator('Label');
			$is_active->removeDecorator('HtmlTag')->removeDecorator('Label');	
			
			$form->addElements(array($image_name,$image_link,$is_active));
			return $form;
		}
Ejemplo n.º 14
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));
 }
Ejemplo n.º 15
0
 public function init()
 {
     /**
      * projeto_id
      */
     $modelProjeto = new Model_DbTable_Projeto();
     $projeto_id = new Zend_Form_Element_Select("projeto_id");
     $projeto_id->setLabel("Projeto: ");
     $projeto_id->setAttribs(array('class' => 'form-control'));
     $projeto_id->setMultiOptions($modelProjeto->fetchPairs());
     $this->addElement($projeto_id);
     /**
      * tarefa_nome
      */
     $tarefa_nome = new Zend_Form_Element_Text("tarefa_nome");
     $tarefa_nome->setLabel("Título: ");
     $tarefa_nome->setAttribs(array('class' => 'form-control'));
     $tarefa_nome->setRequired();
     $this->addElement($tarefa_nome);
     /**
      * tarefa_descricao
      */
     $tarefa_descricao = new Zend_Form_Element_Textarea("tarefa_descricao");
     $tarefa_descricao->setLabel("Descrição: ");
     $tarefa_descricao->setAttribs(array('class' => 'form-control', 'rows' => 10));
     $tarefa_descricao->setRequired();
     $this->addElement($tarefa_descricao);
     parent::init();
 }
Ejemplo n.º 16
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));
 }
Ejemplo n.º 17
0
 public function init()
 {
     $tr = Zend_Registry::get('tr');
     $name = new Zend_Form_Element_Text('name');
     $name->setLabel($tr->_('NAME'));
     $name->setRequired(true);
     $this->addElement($name);
     $enabled = new Zend_Form_Element_Checkbox('enabled');
     $enabled->setLabel($tr->_('IS_ACTION_ENABLED'));
     $this->addElement($enabled);
     $public = new Zend_Form_Element_Checkbox('public');
     $public->setLabel($tr->_('IS_ACTION_PUBLIC'));
     $this->addElement($public);
     $route = new Zend_Form_Element_Text('route');
     $route->setLabel($tr->_('ROUTE'));
     $route->setRequired(true);
     $this->addElement($route);
     $desc = new Zend_Form_Element_Textarea('description');
     $desc->cols = 35;
     $desc->rows = 15;
     $desc->setLabel($tr->_('DESCRIPTION'));
     $desc->setRequired(false);
     $this->addElement($desc);
     parent::init();
 }
Ejemplo n.º 18
0
 public function init()
 {
     // contato_nome
     $contato_nome = new Zend_Form_Element_Text("contato_nome");
     $contato_nome->setLabel("Nome");
     $contato_nome->setRequired();
     $contato_nome->setAttribs(array('class' => 'form-control'));
     $contato_nome->setDecorators(App_Forms_Decorators::$simpleElementDecorators);
     // contato_email
     $contato_email = new Zend_Form_Element_Text("contato_email");
     $contato_email->setLabel("E-mail");
     $contato_email->setRequired();
     $contato_email->setAttribs(array('class' => 'form-control'));
     $contato_email->setDecorators(App_Forms_Decorators::$simpleElementDecorators);
     // contato_assunto
     $contato_assunto = new Zend_Form_Element_Select("contato_assunto");
     $contato_assunto->setLabel("Assunto");
     $contato_assunto->setRequired();
     $contato_assunto->setAttribs(array('class' => 'form-control'));
     $contato_assunto->setDecorators(App_Forms_Decorators::$simpleElementDecorators);
     $contato_assunto->setMultiOptions(array("" => "Selecione o assunto...", "Informação" => "Informação", "Elogio" => "Eologio", "Crítica" => "Crítica", "Sugestão" => "Sugestão", "Outros" => "Outros"));
     // contato_mensagem
     $contato_mensagem = new Zend_Form_Element_Textarea("contato_mensagem");
     $contato_mensagem->setLabel("mensagem");
     $contato_mensagem->setRequired();
     $contato_mensagem->setAttribs(array('class' => 'form-control', 'rows' => 5));
     $contato_mensagem->setDecorators(App_Forms_Decorators::$simpleElementDecorators);
     $this->addElements(array($contato_nome, $contato_email, $contato_assunto, $contato_mensagem));
     parent::init();
 }
Ejemplo n.º 19
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));
 }
Ejemplo n.º 20
0
 public function init()
 {
     $http_code = new Zend_Form_Element_Text('http_code');
     $http_code->setLabel('HTTP Code');
     $http_code->setRequired(false);
     $this->addElement($http_code);
     $name = new Zend_Form_Element_Text('name');
     $name->setLabel('Name');
     $name->setRequired(true);
     $this->addElement($name);
     $msg = new Zend_Form_Element_Textarea('message');
     $msg->setLabel('Error Message');
     $msg->setAttribs(array('rows' => 10, 'cols' => 40));
     $msg->setRequired(true);
     $this->addElement($msg);
     /** Maybe next version will have it back.
         $action = new Default_Model_Action;
         $all    = $action->getList();
         $actions = new Zend_Form_Element_Multiselect('actions');
         $actions->setLabel('Associated Actions with this Error');
         $actions->setMultiOptions($all);
         $actions->setAttrib('size', 8);
         $this->addElement($actions);
         */
     $desc = new Zend_Form_Element_Textarea('description');
     $desc->cols = 40;
     $desc->rows = 15;
     $desc->setLabel('Description');
     $desc->setRequired(false);
     $this->addElement($desc);
     $this->addElement(new Zend_Form_Element_Submit('submit'));
     parent::init();
 }
Ejemplo n.º 21
0
 public function init()
 {
     $this->setAction(URL_BASE . '/action');
     $tr = Zend_Registry::get('tr');
     $name = new Zend_Form_Element_Text('name');
     $name->setLabel($tr->_('NAME'));
     $name->setRequired(true);
     $name->addValidator('NotEmpty', true, array('messages' => $tr->_('GENERAL_MISSING_TEXT_VALUE')));
     $this->addElement($name);
     $enabled = new Zend_Form_Element_Checkbox('enabled');
     $enabled->setLabel($tr->_('IS_ACTION_ENABLED'));
     $this->addElement($enabled);
     $public = new Zend_Form_Element_Checkbox('public');
     $public->setLabel($tr->_('IS_ACTION_PUBLIC'));
     $this->addElement($public);
     $route = new Zend_Form_Element_Text('route');
     $route->setLabel($tr->_('CUSTOM_ROUTE'));
     $route->setRequired(true);
     $route->addValidator('NotEmpty', true, array('messages' => $tr->_('GENERAL_MISSING_TEXT_VALUE')));
     $this->addElement($route);
     $desc = new Zend_Form_Element_Textarea('description');
     $desc->cols = 35;
     $desc->rows = 15;
     $desc->setLabel($tr->_('DESCRIPTION'));
     $desc->setRequired(false);
     $this->addElement($desc);
     parent::init();
 }
Ejemplo n.º 22
0
 public function init()
 {
     /**
      * @todo Localize
      */
     $tr = Zend_Registry::get('tr');
     $name = new Zend_Form_Element_Text('mimetype');
     $name->setLabel($tr->_('MIMETYPE'));
     $name->setRequired(true);
     $name->addValidator('NotEmpty', true, array('messages' => $tr->_('GENERAL_MISSING_TEXT_VALUE')));
     $this->addElement($name);
     $name = new Zend_Form_Element_Text('output_format');
     $name->setLabel($tr->_('OUTPUT_FORMAT'));
     $name->setRequired(true);
     $name->addValidator('NotEmpty', true, array('messages' => $tr->_('GENERAL_MISSING_TEXT_VALUE')));
     $this->addElement($name);
     $desc = new Zend_Form_Element_Textarea('description');
     $desc->cols = 35;
     $desc->rows = 15;
     $desc->setLabel($tr->_('DESCRIPTION'));
     $desc->setRequired(false);
     $this->addElement($desc);
     $this->addElement(new Zend_Form_Element_Submit($tr->_('SUBMIT')));
     parent::init();
 }
Ejemplo n.º 23
0
 public function __construct($options = null)
 {
     parent::__construct($options);
     $accountId1 = new Zend_Form_Element_Hidden('accountId');
     $productId1 = new Zend_Form_Element_Hidden('productId');
     $memberId1 = new Zend_Form_Element_Hidden('memberId');
     $maturedamount = new Zend_Form_Element_Hidden('maturedinterestamount');
     $interestamountto = new Zend_Form_Element_Hidden('interestamountto');
     $capitalamount = new Zend_Form_Element_Hidden('capitalamount');
     $penalinterest = new Zend_Form_Element_Hidden('penalinterest');
     $paymenttype = new Zend_Form_Element_Select('paymenttype');
     $paymenttype->addMultiOption('', 'select..');
     $paymenttype->setAttrib('class', 'NormalBtn');
     $paymenttype->setAttrib('id', 'paymenttype');
     $paymenttype->setAttrib('onchange', 'toggleField();');
     $paymenttype->setRequired(true);
     $description = new Zend_Form_Element_Textarea('transactiondescription');
     $description->setAttrib('class', 'textfield');
     $description->setAttrib('rows', '2');
     $description->setAttrib('cols', '20');
     $no = new Zend_Form_Element_Textarea('paymenttype_details');
     $no->setAttrib('class', 'textfield');
     $no->setAttrib('rows', '1');
     $no->setAttrib('cols', '20');
     $no->setAttrib('id', 'paymenttype_details');
     $no->setAttrib('style', 'display:none;');
     $no->setRequired(true);
     $submit = new Zend_Form_Element_Submit('Finalize');
     $submit->setLabel('Finalize');
     $submit->setAttrib('class', 'recurring');
     $this->addElements(array($accountId1, $productId1, $memberId1, $maturedamount, $submit, $capitalamount, $interestamountto, $penalinterest, $paymenttype, $description, $no));
 }
Ejemplo n.º 24
0
 public function init($blogId)
 {
     //  echo "hello ".$blogId; exit();
     global $mySession;
     $db = new Db();
     $title_value = "";
     $description_value = "";
     $status_value = "1";
     if ($blogId != "") {
         $blogData = $db->runQuery("select * from " . BLOG_POST . " where blog_post_id='" . $blogId . "'");
         $title_value = $blogData[0]['title'];
         $description_value = $blogData[0]['description'];
         $status_value = $blogData[0]['status'];
     }
     $StatusArr = array();
     $StatusArr[0]['key'] = "1";
     $StatusArr[0]['value'] = "Enable";
     $status = new Zend_Form_Element_Select('status');
     $status->addMultiOptions($StatusArr)->setAttrib("class", "textInput")->setValue($status_value);
     $title = new Zend_Form_Element_Text('title');
     $title->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'blog title is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "textInput")->setValue($title_value);
     $description = new Zend_Form_Element_Textarea('description');
     $description->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'blog description is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "textInput")->setAttrib("rows", "3")->setAttrib("style", "height:100px;")->setValue($description_value);
     $this->addElements(array($status, $title, $description));
 }
Ejemplo n.º 25
0
 public function init()
 {
     $this->setName('send-tweet');
     $e = new Zend_Form_Element_Text('latitude');
     $e->setLabel('Latitude');
     $e->addFilter('StringTrim');
     $e->setAttrib('onblur', 'setMarkerFromForm()');
     $e->addValidator(new Zend_Validate_Regex('/[-+0-9.]/'));
     $e->setTranslator(new Zend_Translate_Adapter_Array(array('regexNotMatch' => 'Latitude is not valid'), 'en'));
     $this->addElement($e);
     $e = new Zend_Form_Element_Text('longitude');
     $e->setLabel('Longitude');
     $e->addFilter('StringTrim');
     $e->setAttrib('onblur', 'setMarkerFromForm()');
     $e->addValidator(new Zend_Validate_Regex('/[-+0-9.]/'));
     $e->setTranslator(new Zend_Translate_Adapter_Array(array('regexNotMatch' => 'Longitude is not valid'), 'en'));
     $this->addElement($e);
     $e = new Zend_Form_Element_Textarea('tweet');
     $e->setLabel('Tweet');
     $e->setRequired(true);
     $e->addFilter('StripTags');
     $e->addFilter('StringTrim');
     $e->addValidator(new Zend_Validate_StringLength(array('max' => 140)));
     $e->setTranslator(new Zend_Translate_Adapter_Array(array('isEmpty' => 'Please supply the message to be tweeted', 'stringLengthTooLong' => 'No more than 140 characters please!'), 'en'));
     $this->addElement($e);
     $e = new Zend_Form_Element_Submit('send');
     $e->setIgnore(true);
     $e->setLabel('Tweet!');
     $this->addElement($e);
 }
Ejemplo n.º 26
0
 public function init()
 {
     // attribs
     $this->setAttribs(array('id' => 'form-site-contato'));
     $this->setMethod('post');
     $this->setAction('contato/');
     // contato_nome
     $contato_nome = new Zend_Form_Element_Text('contato_nome');
     $contato_nome->setLabel("Nome:");
     $contato_nome->setRequired();
     $contato_nome->addErrorMessages(array(Zend_Validate_NotEmpty::IS_EMPTY => "Campo obrigatório!"));
     $contato_nome->setAttrib('class', 'form-control');
     $contato_nome->setAttrib('placeholder', 'Informe seu nome');
     $contato_nome->setDecorators(App_Forms_Decorators::$simpleElementDecorators);
     // contato_email
     $contato_email = new Zend_Form_Element_Text('contato_email');
     $contato_email->setLabel("E-mail:");
     $contato_email->setRequired();
     $contato_email->addErrorMessages(array(Zend_Validate_EmailAddress::INVALID => "Email inválido!"));
     $contato_email->addValidator('EmailAddress');
     $contato_email->setAttrib('class', 'form-control');
     $contato_email->setAttrib('placeholder', 'Informe seu email');
     $contato_email->setDecorators(App_Forms_Decorators::$simpleElementDecorators);
     // contato_mensagem
     $contato_mensagem = new Zend_Form_Element_Textarea('contato_mensagem');
     $contato_mensagem->setLabel("Mensagem:");
     $contato_mensagem->setRequired();
     $contato_mensagem->addErrorMessages(array(Zend_Validate_NotEmpty::IS_EMPTY => "Campo obrigatório!"));
     $contato_mensagem->setAttrib('class', 'form-control');
     $contato_mensagem->setAttrib('placeholder', 'Digite aqui sua mensagem');
     $contato_mensagem->setAttrib('rows', 5);
     $contato_mensagem->setDecorators(App_Forms_Decorators::$simpleElementDecorators);
     $this->addElements(array($contato_nome, $contato_email, $contato_mensagem));
     parent::init();
 }
Ejemplo n.º 27
0
 public function __construct($parent = null, $options = null)
 {
     parent::__construct($options);
     $parentId = 0;
     if ($parent != null) {
         $parentId = $parent;
     }
     $translate = Zend_Registry::get('Zend_Translate');
     $this->setName('comment_form');
     $this->addElementPrefixPath('Oibs_Decorators', 'Oibs/Decorators/', 'decorator');
     /*						
     $comment_subject = new Zend_Form_Element_Text('comment_subject');
     $comment_subject->setLabel($translate->_("content-view-comment-form-subject"))
     		->setRequired(true)
     		->setAttribs(array(
     			'class' => 'comment_subject'))
     		->addValidators(array(
     			array('NotEmpty', true, array('messages' => array('isEmpty' => 'Tyhjä')))
     		));
     */
     $comment_message = new Zend_Form_Element_Textarea('comment_message');
     $comment_message->setRequired(true)->setAttribs(array('rows' => 10, 'cols' => 58, 'class' => 'comment_textarea'))->addValidators(array(array('NotEmpty', true, array('messages' => array('isEmpty' => 'Tyhjä')))));
     $comment_parent = new Zend_Form_Element_Hidden('comment_parent');
     $comment_parent->setValue($parentId)->setAttribs(array('class' => 'comment_subject'));
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setLabel($translate->_("submit"));
     $parent_username = new Zend_Form_Element_Hidden('parent_username');
     $this->addElements(array($comment_message, $comment_parent, $submit, $parent_username));
 }
Ejemplo n.º 28
0
 public function __construct($path)
 {
     parent::__construct($path);
     $formfield = new App_Form_Field();
     $accountHeader = $formfield->field('Text', 'accountHeader', '', '', 'txt_put', '', true, '', '', '', '', '', '', '');
     $glcodeDescription = new Zend_Form_Element_Textarea('glcodeDescription', array('rows' => 3, 'cols' => 25));
     $glcodeDescription->setAttrib('id', 'glcodeDescription');
     $glcodeDescription->setRequired(true)->addValidators(array(array('NotEmpty')));
     $product = $formfield->field('Select', 'product', '', '', 'txt_put', '', true, '', '', '', '', '', '', '');
     $product->setAttrib('onchange', 'getGlcode("' . $path . '",this.value)');
     $offerproduct = $formfield->field('Select', 'offerproduct', '', '', 'txt_put', '', '', '', '', '', '', '', '', '');
     $officelevel = $formfield->field('Select', 'officelevel', '', '', '', '', '', '', '', '', '', '', 0, 0);
     $officelevel->setRegisterInArrayValidator(false);
     $officelevel->setAttrib('onchange', 'getoffice("' . $path . '",this.value)');
     $office = $formfield->field('Select', 'office', '', '', '', '', '', '', '', '', '', '', 0, 0);
     $office->setRegisterInArrayValidator(false);
     $subheader = $formfield->field('Text', 'subheader', '', '', 'txt_put', '', '', '', '', '', '', '', '', '');
     $glsubaccountdescription = new Zend_Form_Element_Textarea('glsubaccountdescription', array('rows' => 3, 'cols' => 25));
     $glsubaccountdescription->setAttrib('id', 'glsubaccountdescription');
     $submit = $formfield->field('Submit', 'Save', '', '', '', 'holiday1', '', '', '', '', '', '', '', '');
     $this->addElements(array($submit, $accountHeader, $glcodeDescription, $subheader, $glsubaccountdescription, $product, $offerproduct, $officelevel, $office));
     $glcodeHiddenId = new Zend_Form_Element_Hidden('hidden_glcodeid');
     $glsubcodeHiddenId = new Zend_Form_Element_Hidden('hidden_glsubcodeid');
     $submit = new Zend_Form_Element_Submit('Submit');
     $submit->setAttrib('class', 'holiday');
     $this->addElements(array($submit, $glcodeHiddenId, $glsubcodeHiddenId));
 }
Ejemplo n.º 29
0
		function setForm()
		{
			$form = new Zend_Form;
			$form->setMethod('post')->setAction('');
			//$this->setAttrib('enctype','multipart/form-data');
			
			$file = new Zend_Form_Element_File('video_file');
			//$file->setAttrib('class','file');
			$file->setLabel('video_file');
           	$file->setRequired(true);
           	
			$video_title = new Zend_Form_Element_Text('video_title');
			$video_title ->setRequired(true)->addValidator('NotEmpty',true,array('messages'=>'Tiêu đề không được để trống'));
			
			$video_thumbnail=new Zend_Form_Element_Textarea('video_thumbnail');
			$video_thumbnail->removeDecorator('HtmlTag')->removeDecorator('Label');
			
			$video_description = new Zend_Form_Element_Textarea('video_description');
			$video_description->setAttrib('rows','7');
			$video_description ->setRequired(true)->addValidator('NotEmpty',true,array('messages'=>'Mô tả không được để trống'));
			
			$is_active = new Zend_Form_Element_Radio('is_active');
			$is_active->setRequired(true)
					->setLabel('is_active')
					->setMultiOptions(array("1" => "Có","0" => "Không"));
			
			$file->removeDecorator('HtmlTag')->removeDecorator('Label');	
			$video_title->removeDecorator('HtmlTag')->removeDecorator('Label');	
			$video_description->removeDecorator('HtmlTag')->removeDecorator('Label');
			$is_active->removeDecorator('HtmlTag')->removeDecorator('Label');		
			
			$form->addElements(array($file,$video_title,$video_description,$is_active,$video_thumbnail));
			return $form;
		}
Ejemplo n.º 30
0
 public function __construct($options = null)
 {
     parent::__construct($options);
     parent::__construct();
     $accountCode = new Zend_Form_Element_Hidden('accountcode');
     $memberId = new Zend_Form_Element_Hidden('membercode');
     $categoryId = new Zend_Form_Element_Hidden('categoryId');
     $newStatus = new Zend_Form_Element_Select('newStatus');
     $newStatus->setAttrib('class', 'NormalBtn');
     $newStatus->setRequired(true);
     $newStatus->addMultiOption('', 'Select...');
     $description = new Zend_Form_Element_Textarea('description');
     $description->setAttrib('rows', '2');
     $description->setAttrib('cols', '20');
     $description->setRequired(true);
     $totalamount = new Zend_Form_Element_Text('totalamount');
     $totalamount->setAttrib('class', 'textfield');
     $totalamount->setAttrib('id', 'totalamount');
     $totalamount->setAttrib('readonly', 'true');
     $newStatus1 = new Zend_Form_Element_Hidden('newStatus1');
     $description1 = new Zend_Form_Element_Hidden('description1');
     $totalamount1 = new Zend_Form_Element_Hidden('totalamount1');
     $confirm = new Zend_Form_Element_Submit('confirm');
     $confirm->setAttrib('class', 'officesubmit');
     $submit = new Zend_Form_Element_Submit('Submit');
     $submit->setAttrib('class', 'officesubmit');
     $this->addElements(array($submit, $newStatus, $description, $accountCode, $memberId, $categoryId, $totalamount, $confirm, $newStatus1, $description1, $totalamount1));
 }