예제 #1
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'));
 }
 public function __construct($options = null)
 {
     parent::__construct();
     $this->setMethod('post');
     $this->setEnctype('multipart/form-data');
     //$this->setAction('');
     $this->setName('custom_layout_advanced_form');
     $this->addElementPrefixPath('Oibs_Form_Decorator', 'Oibs/Form/Decorator/', 'decorator');
     $clearall = new Oibs_Form_Element_Note('clearall');
     $clearall->setValue('<div style="clear:both;"></div>');
     $csstextarea = new Zend_Form_Element_Textarea('csscontent');
     $csstextarea->setLabel('Editable custom layout css for advanced users')->setAttrib('id', 'css_textarea')->setAttrib('style', 'width: 575px; height: 660px; margin-left: -5px; margin-right: 10px; margin-bottom: 10px;')->setValue($options['cssContent'])->addDecorator('Label', array('tag' => 'div', 'style' => '/*font-weight:bold;*/ float:left; margin-top:6px'))->addValidators(array(array('StringLength', false)));
     $savecssbutton = new Zend_Form_Element_Submit('save_css_button');
     $savecssbutton->setLabel('Save')->setAttrib('style', 'width:60px; float:right;')->removeDecorator('DefaultDecorator')->removeDecorator('DtDdWrapper');
     $cancelcssbutton = new Zend_Form_Element_Button('cancel_css_button');
     $cancelcssbutton->setLabel('Cancel')->setAttrib('style', 'width:60px; float:right; margin-right:10px')->removeDecorator('DefaultDecorator')->removeDecorator('DtDdWrapper');
     $defaultcssbutton = new Zend_Form_Element_Button('default_css_button');
     $defaultcssbutton->setLabel('Default')->setAttrib('style', 'width:80px; float:left; margin-left: 10px; margin-top:-17px;')->removeDecorator('DefaultDecorator')->removeDecorator('DtDdWrapper');
     $restorecssbutton = new Zend_Form_Element_Button('restore_css_button');
     $restorecssbutton->setLabel('Restore')->setAttrib('style', 'width:80px; float:left; margin-left: -5px; margin-top:-17px;')->removeDecorator('DefaultDecorator')->removeDecorator('DtDdWrapper');
     $defaultcsshidden = new Zend_Form_Element_Hidden('default_css');
     $defaultcsshidden->setAttrib('id', 'default_css')->setValue($options['default_css']);
     $originalcsshidden = new Zend_Form_Element_Hidden('original_css');
     $originalcsshidden->setAttrib('id', 'original_css')->setValue($options['cssContent']);
     $advancedhelp = new Oibs_Form_Element_Note('help_link_advanced');
     $advancedhelp->setValue('<a href="#" onClick="return false;">Help</a>');
     $this->addElements(array($csstextarea, $savecssbutton, $cancelcssbutton, $advancedhelp, $restorecssbutton, $defaultcssbutton, $defaultcsshidden, $originalcsshidden));
     // Add decorators
     $this->setDecorators(array('FormElements', 'Form'));
 }
예제 #3
0
 public function __construct($recurringBeginDate, $recurringClosedDate, $recurringMinAmount, $recurringMaxAmount, $app)
 {
     parent::__construct($recurringBeginDate, $recurringClosedDate, $recurringMinAmount, $recurringMaxAmount, $app);
     $startdate = new ZendX_JQuery_Form_Element_DatePicker('startdate');
     $startdate->setAttrib('id', 'startdate');
     $startdate->setAttrib('size', '8');
     $startdate->setAttrib('class', '');
     $startdate->setRequired(true)->addValidators(array(array('Date', true), array('Between', false, array($recurringBeginDate, $recurringClosedDate, 'messages' => array('notBetween' => 'date should be between ' . $recurringBeginDate . ' to (Closed date) ' . $recurringClosedDate)))));
     $recurringamount = new Zend_Form_Element_Text('recurringamount');
     $recurringamount->setRequired(true)->addValidators(array(array('Digits'), array('GreaterThan', false, array($recurringMinAmount)), array('LessThan', false, array($recurringMaxAmount)), array('NotEmpty')));
     $recurringamount->setAttrib('size', '8');
     $recurringperiod = new Zend_Form_Element_Text('recurringperiod');
     $recurringperiod->setAttrib('id', 'recurringperiod');
     $recurringperiod->setAttrib('class', 'NormalBtn');
     $memberfirstname = new Zend_Form_Element_MultiCheckbox('memberfirstname');
     $memberfirstname->setAttrib('class', 'textfield');
     $freequencyofdeposit = new Zend_Form_Element_Select('frequencyofdeposit');
     $freequencyofdeposit->addMultiOption('', 'Select...');
     $freequencyofdeposit->setAttrib('class', 'NormalBtn');
     $freequencyofdeposit->setAttrib('id', 'freequencyofdeposit');
     $perioddescription = new Zend_Form_Element_Select('perioddescription');
     $perioddescription->addMultiOption('', 'Select..');
     $perioddescription->setAttrib('class', 'NormalBtn');
     $perioddescription->setAttrib('id', 'perioddescription');
     $perioddescription->setRequired(true);
     $perioddescription->setAttrib('onchange', 'getInterests(this.value,"' . $app . '")');
     $periodinterest = new Zend_Form_Element_Select('periodinterest');
     $periodinterest->addMultiOption('', 'Select...');
     $periodinterest->setAttrib('class', 'NormalBtn');
     $periodinterest->setAttrib('id', 'periodinterest');
     $periodinterest->setAttrib('size', '5');
     $accountId = new Zend_Form_Element_Hidden('accountId');
     $productIdss = new Zend_Form_Element_Hidden('productId');
     $recurringindex = new Zend_Form_Element_Text('recurringinterest');
     $recurringindex->setAttrib('id', 'recurringinterest');
     $recurringindex->setAttrib('size', '8');
     $recurringindex->setAttrib('class', 'NormalBtn');
     $recurringindex->setAttrib('readonly', 'true');
     $recurringindex->setAttrib('class', 'NormalBtn');
     $recurringindex->setAttrib('readonly', 'true');
     $memberTypeId = new Zend_Form_Element_Hidden('memberTypeId');
     $memberId = new Zend_Form_Element_Hidden('member_id');
     $productId = new Zend_Form_Element_Hidden('product_id');
     $offerproductId = new Zend_Form_Element_Hidden('offerproduct_id');
     $groupId = new Zend_Form_Element_Hidden('groupId');
     $this->addElements(array($memberfirstname, $recurringindex, $freequencyofdeposit, $recurringperiod, $recurringamount, $startdate, $perioddescription, $periodinterest, $memberId, $productId, $offerproductId, $groupId, $memberTypeId, $accountId, $productIdss));
     $period_id = new Zend_Form_Element_Hidden('period_id');
     $period_id->setAttrib('id', 'period_id');
     $startdate1 = new Zend_Form_Element_Hidden('startdate1');
     $recurringamount1 = new Zend_Form_Element_Hidden('recurringamount1');
     $perioddescription1 = new Zend_Form_Element_Hidden('perioddescription1');
     $interest1 = new Zend_Form_Element_Hidden('interest1');
     $Confirm = new Zend_Form_Element_Submit('Confirm');
     $Confirm->setLabel('Confirm');
     $Confirm->setAttrib('class', 'recurring');
     $submit = new Zend_Form_Element_Submit('Submit');
     $submit->setLabel('submit');
     $submit->setAttrib('class', 'recurring');
     $this->addElements(array($submit, $period_id, $Confirm, $startdate1, $recurringamount1, $perioddescription1, $interest1));
 }
예제 #4
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'))));
 }
예제 #5
0
 public function __construct($currencysymbol)
 {
     Zend_Dojo::enableForm($this);
     parent::__construct($options);
     $feename = new Zend_Form_Element_Text('feename');
     $feename->addValidator(new Zend_Validate_Db_NoRecordExists('ourbank_feedetails', 'feename'));
     $feename->setAttrib('class', 'txt_put')->setLabel('Fee Name');
     $feename->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'))));
     $feedescription = new Zend_Form_Element_Textarea('feedescription', array('rows' => 3, 'cols' => 20));
     $feedescription->setAttrib('class', '')->setLabel('Description');
     $feedescription->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'))));
     $feeappliesto_id = new Zend_Form_Element_Select('feeappliesto_id');
     $feeappliesto_id->addMultiOption('', 'Select...');
     $feeappliesto_id->setAttrib('class', 'txt_put')->setLabel('Member Type');
     $feeappliesto_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'))));
     $feefrequency_id = new Zend_Form_Element_Select('feefrequency_id');
     $feefrequency_id->addMultiOption('', 'Select...');
     $feefrequency_id->setAttrib('class', 'txt_put')->setLabel('Fee for');
     $feefrequency_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'))));
     $feevalue = new Zend_Form_Element_Text('feevalue');
     $feevalue->setAttrib('class', 'txt_put')->setLabel('Fee Amount');
     $feevalue->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'))));
     $fee_id = new Zend_Form_Element_Hidden('fee_id');
     $fee_id->setAttrib('class', 'txt_put');
     $submit = new Zend_Form_Element_Submit('Submit');
     $submit->setAttrib('id', 'Submit')->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($fee_id, $feename, $feevalue, $feedescription, $feeappliesto_id, $feefrequency_id, $product_id, $submit));
     $this->setDecorators(array('FormElements', array(array('data' => 'HtmlTag'), array('tag' => 'table', 'id' => 'hor-minimalist-b')), 'Form'));
 }
예제 #6
0
 public function init($ppty_id)
 {
     global $mySession;
     $db = new Db();
     $airport1_value = "";
     $airport2_value = "";
     $distance2_value = "";
     $distance1_value = "";
     $latitude_value = "41.659";
     $longitude_value = "-4.714";
     $address_value = "";
     if ($ppty_id != "") {
         $locationValue = $db->runQuery("select * from " . PROPERTY . " where id = '" . $ppty_id . "' ");
         if ($locationValue != "" && count($locationValue) > 0 && $locationValue[0]['cletitude'] != "") {
             $latitude_value = $locationValue[0]['cletitude'];
             $longitude_value = $locationValue[0]['clongitude'];
             $address_value = $locationValue[0]['address'];
         }
     }
     $latitude = new Zend_Form_Element_Hidden('latitude');
     $latitude->setAttrib("class", "textInput")->setAttrib("readonly", "readonly")->setValue($latitude_value);
     $longitude = new Zend_Form_Element_Hidden('longitude');
     $longitude->setAttrib("class", "textInput")->setAttrib("readonly", "readonly")->setValue($longitude_value);
     $address = new Zend_Form_Element_Text('address');
     $address->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Enter Your location is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "mws-textinput required")->setValue($address_value);
     /*$airport1 = new Zend_Form_Element_Text('airport1');
     		$airport1->setRequired(true)
     		->addValidator('NotEmpty',true,array('messages' =>'Enter Name of airport.'))
     		->addDecorator('Errors', array('class'=>'error'))
     		->setAttrib("class","mws-textinput required")
     		->setValue($airport1_value);
     		
     		$distance1 = new Zend_Form_Element_Text('distance1');
     		$distance1->setRequired(true)
     		->addValidator('NotEmpty',true,array('messages' =>'Enter Airport distance from Property location'))
     		->addDecorator('Errors', array('class'=>'error'))
     		->setAttrib("class","mws-textinput required number")
     		->setValue($distance1_value);
     		
     		$airport2 = new Zend_Form_Element_Text('airport2');
     		$airport2->setRequired(true)
     		->addValidator('NotEmpty',true,array('messages' =>'Enter Name of airport.'))
     		->addDecorator('Errors', array('class'=>'error'))
     		->setAttrib("class","mws-textinput required")
     		->setValue($airport2_value);		
     		
     		$distance2 = new Zend_Form_Element_Text('distance2');
     		$distance2->setRequired(true)
     		->addValidator('NotEmpty',true,array('messages' =>'Enter Airport distance from Property location'))
     		->addDecorator('Errors', array('class'=>'error'))
     		->setAttrib("class","mws-textinput required number")
     		->setValue($distance2_value);*/
     $step = new Zend_Form_Element_Hidden("step");
     $step->setValue("4");
     $this->addElements(array($latitude, $longitude, $address, $step));
 }
예제 #7
0
 public function __construct($options = null)
 {
     Zend_Dojo::enableForm($this);
     parent::__construct($options);
     $categoryname = new Zend_Form_Element_Text('categoryname');
     $categoryname->addValidator(new Zend_Validate_Db_NoRecordExists('ourbank_categorydetails', 'categoryname'));
     $categoryname->setAttrib('class', 'txt_put');
     $categoryname->setAttrib('id', 'hName')->setLabel('Category  Name');
     $categoryname->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', 'requiredSuffix' => ' *')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
     $category_id = new Zend_Form_Element_Hidden('category_id');
     $category_id->setAttrib('class', 'txt_put');
     $category_id->setAttrib('id', 'hName')->setLabel('');
     $categorydescription = new Zend_Form_Element_Textarea('categorydescription', array('rows' => 3, 'cols' => 20));
     $categorydescription->setAttrib('id', 'glcodeDescription')->setLabel('Category  Description');
     $categorydescription->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($categoryname, $categorydescription, $category_id, $submit));
 }
예제 #8
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));
 }
예제 #9
0
 public function __construct($options = null)
 {
     parent::__construct($options);
     $accountId = new Zend_Form_Element_Hidden('accountcode');
     $memberId = new Zend_Form_Element_Hidden('membercode');
     $Date = new ZendX_JQuery_Form_Element_DatePicker('date');
     $Date->setAttrib('class', 'txt_put');
     $Date->setJQueryParam('dateFormat', 'yy-mm-dd');
     $Date->setRequired(true)->addValidator(new Zend_Validate_Date('YYYY-MM-DD'), true, array('messages' => array(Zend_Validate_Date::FALSEFORMAT => 'Enter the valid date')));
     $Amount = new Zend_Form_Element_Text('amount');
     $Amount->setRequired(true)->addValidators(array(array('NotEmpty'), array('Float'), array('GreaterThan', false, array('0'))));
     $Amount->setAttrib('class', 'textfield');
     $Amount->setAttrib('id', 'amount');
     $Amount->setAttrib('size', '8');
     $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');
     $description->setRequired(true);
     $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);
     $categoryId = new Zend_Form_Element_Hidden('categoryId');
     $categoryId->setAttrib('class', 'textfield');
     $date1 = new Zend_Form_Element_Hidden('date1');
     $amount1 = new Zend_Form_Element_Hidden('amounts');
     $transactiondescription1 = new Zend_Form_Element_Hidden('transactiondescription1');
     $paymenttype_details1 = new Zend_Form_Element_Hidden('paymenttype_details1');
     $paymenttype1 = new Zend_Form_Element_Hidden('paymenttype1');
     $confirm = new Zend_Form_Element_Submit('confirm');
     $confirm->setAttrib('class', 'NormalBtn');
     $submit = new Zend_Form_Element_Submit('Submit');
     $submit->setAttrib('class', 'NormalBtn');
     $submit->setLabel('submit');
     $this->addElements(array($Date, $Amount, $paymenttype, $submit, $accountId, $memberId, $description, $no, $categoryId, $confirm, $date1, $amount1, $transactiondescription1, $paymenttype_details1, $paymenttype1));
 }
예제 #10
0
 public function __construct($path)
 {
     Zend_Dojo::enableForm($this);
     parent::__construct($options);
     $attendanceupdates_id = new Zend_Form_Element_Hidden('attendanceupdates_id');
     $attendance_id = new Zend_Form_Element_Hidden('attendance_id');
     $attendance_id->setAttrib('class', 'txt_put');
     $officetype_id = new Zend_Form_Element_Select('officetype_id');
     $officetype_id->setRequired(true);
     $officetype_id->addMultiOption('', 'select' . '...');
     $officetype_id->setAttrib('class', 'selectbutton');
     $officetype_id->setAttrib('onchange', 'getGroups(this.value,"' . $path . '")');
     $submit = new Zend_Form_Element_Submit('Submit');
     $submit->setAttrib('class', 'officesubmit');
     $submit->setLabel('Submit');
     $this->addElements(array($officetype_id, $submit, $attendanceupdates_id, $attendance_id));
 }
예제 #11
0
 public function preGenerate()
 {
     $f = new Zend_Form_Element_Hidden(array('disableTranslator' => true, 'name' => Translation_Traits_Model_DbTable::ORIGINAL_FIELD));
     $f->setAttrib('hidden', true);
     $this->addElement($f, Translation_Traits_Model_DbTable::ORIGINAL_FIELD);
     $this->addElement($this->_generateInfoField(Translation_Traits_Model_DbTable::ORIGINAL_FIELD, $this->getView()->translate('Translated from'), ''));
     $this->addElement($this->_generateInfoField(Translation_Traits_Model_DbTable::LANGUAGE_FIELD, $this->getView()->translate('Language'), (string) Translation_Traits_Common::getDefaultLanguage()->name));
     if ($this->getModel()->isOriginalForcedToDefaultLanguage()) {
         $f = new Zend_Form_Element_Hidden(array('disableTranslator' => true, 'name' => Translation_Traits_Model_DbTable::LANGUAGE_FIELD, 'value' => Translation_Traits_Common::getDefaultLanguage()->id));
         $f->setAttrib('hidden', true);
         $this->addElement($f, Translation_Traits_Model_DbTable::LANGUAGE_FIELD);
     } else {
         $langues = Centurion_Db::getSingleton('translation/language')->fetchAll();
         foreach ($langues as $lang) {
             $languages[$lang->id] = $lang->name;
         }
         $f = new Zend_Form_Element_Select(array('disableTranslator' => true, 'name' => Translation_Traits_Model_DbTable::LANGUAGE_FIELD, 'value' => Translation_Traits_Common::getDefaultLanguage()->id, 'multiOptions' => $languages, 'label' => $this->getView()->translate('Select a language: ')));
         $this->addElement($f, Translation_Traits_Model_DbTable::LANGUAGE_FIELD);
     }
 }
예제 #12
0
 public function __construct($options = null)
 {
     parent::__construct($options);
     $date = new ZendX_JQuery_Form_Element_DatePicker('Date1');
     $date->setAttrib('class', '');
     $date->setJQueryParam('dateFormat', 'yy-mm-dd');
     $date->setRequired(true)->addValidator(new Zend_Validate_Date('YYYY-MM-DD'), true, array('messages' => array(Zend_Validate_Date::FALSEFORMAT => 'Enter the valid date')));
     $accountCode = new Zend_Form_Element_Hidden('accountcode');
     $memberId = new Zend_Form_Element_Hidden('membercode');
     $categoryId = new Zend_Form_Element_Hidden('categoryId');
     $loanAmount = new Zend_Form_Element_Hidden('loan_amount');
     $typeId = new Zend_Form_Element_Hidden('typeId');
     $creditlinebalance = new Zend_Form_Element_Text('creditlinebalance');
     $creditlinebalance->setAttrib('readonly', 'true');
     $transactionType = new Zend_Form_Element_Select('transaction_type');
     $transactionType->setAttrib('class', 'NormalBtn');
     $transactionType->setAttrib('id', 'transaction_type');
     $transactionType->addMultiOption('3', '-Loan Disbursement-');
     $Amount = new Zend_Form_Element_Text('Amount');
     $Amount->setRequired(true)->addValidators(array(array('NotEmpty'), array('Digits'), array('GreaterThan', false, array('0'))));
     $Amount->setAttrib('class', 'textfield');
     $Amount->setAttrib('id', 'Amount');
     $description = new Zend_Form_Element_Textarea('description');
     $description->setAttrib('rows', '2');
     $description->setAttrib('cols', '20');
     $description->setRequired(true);
     $fee = new Zend_Form_Element_Text('fee');
     $fee->setAttrib('class', 'textfield');
     $fee->setAttrib('readonly', 'true');
     $Save = new Zend_Form_Element_Submit('Save');
     $Save->setAttrib('class', 'officesubmit');
     $submit = new Zend_Form_Element_Submit('Submit');
     $submit->setAttrib('class', 'officesubmit');
     $transactionTypeId = new Zend_Form_Element_Hidden('transactionType_id');
     $transactionTypeId->setAttrib('class', 'textfield');
     $disburseddate = new Zend_Form_Element_Hidden('disburseddate');
     $description1 = new Zend_Form_Element_Hidden('description1');
     $Amount1 = new Zend_Form_Element_Hidden('Amount1');
     $fee1 = new Zend_Form_Element_Hidden('fee1');
     $this->addElements(array($Amount, $date, $transactionType, $description, $categoryId, $memberId, $typeId, $fee, $submit, $loanAmount, $accountCode, $transactionTypeId, $creditlinebalance, $Save, $disburseddate, $description1, $Amount1, $fee1));
 }
예제 #13
0
 public function __construct($path)
 {
     Zend_Dojo::enableForm($this);
     parent::__construct($options);
     $meetingupdates_id = new Zend_Form_Element_Hidden('meetingupdates_id');
     $meeting_id = new Zend_Form_Element_Hidden('meeting_id');
     $meeting_id->setAttrib('class', 'txt_put');
     $meeting_name = new Zend_Form_Element_Text('meeting_name');
     $meeting_name->setRequired(true)->addValidators(array(array('NotEmpty')));
     $meeting_name->setAttrib('class', 'txt_put');
     $meeting_name->addValidator(new Zend_Validate_Db_NoRecordExists('ourbank_meetingdetails', 'meeting_name'));
     $meeting_days = new Zend_Form_Element_Select('meeting_days');
     $meeting_days->addMultiOption('', 'SelectTheDay' . '...');
     $meeting_days->setAttrib('class', 'selectbutton');
     $meeting_place = new Zend_Form_Element_Text('meeting_place');
     $meeting_place->setRequired(true)->addValidators(array(array('NotEmpty')));
     $meeting_place->setAttrib('class', 'txt_put');
     $meeting_time = new Zend_Form_Element_Text('meeting_time');
     $meeting_time->setRequired(true)->addValidators(array(array('NotEmpty')));
     $meeting_time->setAttrib('class', 'txt_put');
     $timeg = new Zend_Form_Element_Select('timeg');
     $timeg->setRequired(true)->addValidators(array(array('NotEmpty')));
     $timeg->setAttrib('class', 'txt_put');
     $group_head = new Zend_Form_Element_Select('group_head');
     $group_head->addMultiOption('', 'select' . '...');
     $group_head->setAttrib('class', 'selectbutton');
     $officetype_id = new Zend_Form_Element_Select('officetype_id');
     $officetype_id->setRequired(true);
     $officetype_id->addMultiOption('', 'select' . '...');
     $officetype_id->setAttrib('class', 'selectbutton');
     $officetype_id->setAttrib('onchange', 'getGroups(this.value,"' . $path . '")');
     $group = new Zend_Form_Element_Select('group');
     $group->addMultiOption('', 'select' . '...');
     $group->setAttrib('class', 'selectbutton');
     $group->setRegisterInArrayValidator(false);
     //         $group->setAttrib('onchange', 'getGroupHead(this.value,"'.$path.'")');
     $submit = new Zend_Form_Element_Submit('Submit');
     $submit->setAttrib('class', 'officesubmit');
     $submit->setLabel('Submit');
     $this->addElements(array($meetingupdates_id, $meeting_id, $meeting_name, $meeting_days, $meeting_place, $timeg, $group_head, $officetype_id, $group, $submit, $meeting_time));
 }
예제 #14
0
 public function __construct($options = null)
 {
     parent::__construct($options);
     $this->setName('class');
     $this->setIsArray(true);
     $classname = new Zend_Form_Element_Text(Model_ClassGenerator_FormToClass::$nameKey);
     $classname->setLabel('Class name')->setRequired(true)->addValidator('NotEmpty', true);
     $classComment = new Zend_Form_Element_Textarea(Model_ClassGenerator_FormToClass::$commentKey);
     $classComment->setLabel('Class comment/description');
     $classComment->setAttrib('cols', '50')->setAttrib('rows', '4');
     $persistenceOn = new Zend_Form_Element_Checkbox(Model_ClassGenerator_FormToClass::$withPersistenceKey);
     $persistenceOn->setLabel('Persistence ON');
     $table = new Zend_Form_Element_Text(Model_ClassGenerator_FormToClass::$tableKey);
     $table->setLabel('Database Table');
     $addFieldDynId = new Zend_Form_Element_Hidden('addFieldDynId');
     $addFieldDynId->setAttrib('id', 'addFieldDynId');
     $addFieldDynId->setValue(1);
     $attributesSf = self::getAttributeSubform();
     $this->addSubForm($attributesSf, 'attributes', 1);
     /*Use table decorator!
             require_once('../application/forms/Decorators/Table.php');
             $this->setDecorators(array(
     			'FormElements',
     			array('Table', array('doNotSetDecorators' => false)),
     			'Form'
     		));
             */
     $add = new Zend_Form_Element_Button('addAttribute');
     $add->setAttrib('id', 'addAttribute');
     $add->setLabel('Add Attribute');
     $remove = new Zend_Form_Element_Button('removeAttribute');
     $remove->setAttrib('id', 'removeAttribute');
     $remove->setLabel('Remove Attribute');
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setLabel('Play!')->setOrder(5);
     $this->addElements(array($classname, $classComment, $persistenceOn, $table));
     $this->addDisplayGroup(array($classname->getName(), $classComment->getName(), $persistenceOn->getName(), $table->getName()), 'Class properties')->setOrder(0);
     $this->addElements(array($add, $remove, $submit, $addFieldDynId));
     $this->addElement('hash', 'no_csrf_foo', array('salt' => 'unique'));
 }
예제 #15
0
 public function init()
 {
     $institution_id = new Zend_Form_Element_Hidden('institution_id');
     $institution_id->setAttrib('class', 'txt_put');
     $institutionname = new Zend_Form_Element_Text('institutionname');
     $institutionname->addValidator(new Zend_Validate_Db_NoRecordExists('ourbank_institutionaddress', 'institutionname'));
     $institutionname->setAttrib('class', 'txt_put')->setLabel('Institution Name');
     $institutionname->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', 'requiredSuffix' => ' *')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
     $institutionshortname = new Zend_Form_Element_Text('institutionshortname');
     $institutionshortname->setAttrib('class', 'txt_put')->setLabel('Short Name');
     $institutionshortname->setRequired(true)->addValidators(array(array('NotEmpty'), array('stringLength', false, array(1, 3))))->setDecorators(array('ViewHelper', array('Description', array('tag' => '', 'escape' => false)), 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td', 'requiredSuffix' => ' *')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
     $address1 = new Zend_Form_Element_Text('address1');
     $address1->setAttrib('class', 'txt_put')->setLabel('Address1');
     $address1->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', 'requiredSuffix' => ' *')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
     $address2 = new Zend_Form_Element_Text('address2');
     $address2->setAttrib('class', 'txt_put')->setLabel('Address2');
     $address2->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', 'requiredSuffix' => ' *')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
     $address3 = new Zend_Form_Element_Text('address3');
     $address3->setAttrib('class', 'txt_put')->setLabel('Address3');
     $address3->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', 'requiredSuffix' => ' *')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
     $city = new Zend_Form_Element_Text('city');
     $city->setAttrib('class', 'txt_put')->setLabel('city');
     $city->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', 'requiredSuffix' => ' *')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
     $state = new Zend_Form_Element_Text('state');
     $state->setAttrib('class', 'txt_put')->setLabel('state');
     $state->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', 'requiredSuffix' => ' *')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
     $country = new Zend_Form_Element_Text('country');
     $country->setAttrib('class', 'txt_put')->setLabel('country');
     $country->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', 'requiredSuffix' => ' *')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
     $pincode = new Zend_Form_Element_Text('pincode');
     $pincode->setAttrib('class', 'txt_put')->setLabel('pincode');
     $pincode->setRequired(true)->addValidators(array(array('Digits')))->setDecorators(array('ViewHelper', array('Description', array('tag' => '', 'escape' => false)), 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td', 'requiredSuffix' => ' *')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
     $phone = new Zend_Form_Element_Text('phone');
     $phone->setAttrib('class', 'txt_put')->setLabel('phone');
     $phone->setRequired(true)->addValidators(array(array('Digits')))->setDecorators(array('ViewHelper', array('Description', array('tag' => '', 'escape' => false)), 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td', 'requiredSuffix' => ' *')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
     $fax = new Zend_Form_Element_Text('fax');
     $fax->setAttrib('class', 'txt_put')->setLabel('fax');
     $fax->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', 'requiredSuffix' => ' *')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
     $email_Id = new Zend_Form_Element_Text('email_Id');
     $email_Id->setAttrib('class', 'txt_put')->setLabel('Email_Id');
     $email_Id->setRequired(true)->addValidators(array(array('EmailAddress')))->setDecorators(array('ViewHelper', array('Description', array('tag' => '', 'escape' => false)), 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td', 'requiredSuffix' => ' *')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
     $institutiondescription = new Zend_Form_Element_Textarea('institutiondescription', array('rows' => 3, 'cols' => 20));
     $institutiondescription->setAttrib('class', '')->setLabel('Description');
     $institutiondescription->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', 'requiredSuffix' => ' *')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
     $contactperson = new Zend_Form_Element_Text('contactperson');
     $contactperson->setAttrib('class', 'txt_put')->setLabel('contact person');
     $contactperson->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', 'requiredSuffix' => ' *')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
     $contactperson_phone1 = new Zend_Form_Element_Text('contactperson_phone1');
     $contactperson_phone1->setAttrib('class', 'txt_put')->setLabel('Contactperson phone1');
     $contactperson_phone1->setRequired(true)->addValidators(array(array('Digits')))->setDecorators(array('ViewHelper', array('Description', array('tag' => '', 'escape' => false)), 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td', 'requiredSuffix' => ' *')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
     $contactperson_phone2 = new Zend_Form_Element_Text('contactperson_phone2');
     $contactperson_phone2->setAttrib('class', 'txt_put')->setLabel('Contactperson_phone2');
     $contactperson_phone2->setRequired(true)->addValidators(array(array('Digits')))->setDecorators(array('ViewHelper', array('Description', array('tag' => '', 'escape' => false)), 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td', 'requiredSuffix' => ' *')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
     $contactperson_email = new Zend_Form_Element_Text('contactperson_email');
     $contactperson_email->setAttrib('class', 'txt_put')->setLabel('Contactperson_email');
     $contactperson_email->setRequired(true)->addValidators(array(array('EmailAddress')))->setDecorators(array('ViewHelper', array('Description', array('tag' => '', 'escape' => false)), 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td', 'requiredSuffix' => ' *')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
     $this->addElements(array($institution_id, $institutionname, $institutionshortname, $address1, $address2, $address3, $city, $state, $country, $pincode, $phone, $fax, $email_Id, $institutiondescription, $contactperson, $contactperson_phone1, $contactperson_phone2, $contactperson_email));
     $submit = new Zend_Form_Element_Submit('Submit');
     $submit->setAttrib('id', 'Submit')->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($submit));
 }
예제 #16
0
 public static function formElement()
 {
     $request = Zend_Controller_Front::getInstance()->getRequest();
     $config = self::$_registry->get("config");
     $hidden = new Zend_Form_Element_Hidden(self::hash_name, array("required" => true, 'filters' => array('MagicCookies'), 'validators' => array(array('validator' => 'MagicCookies', 'options' => array("allowed_referer_hosts" => array($config['webhost']))))));
     $hidden->clearDecorators();
     //see bug http://framework.zend.com/issues/browse/ZF-8449
     $hidden->setAttrib("id", "hash" . self::$_hashQuantity);
     self::$_hashQuantity += 1;
     $hidden->setValue(self::getLast(true));
     $hidden->setDecorators(array('ViewHelper', 'Errors', array('HtmlTag', array('tag' => 'dd'))));
     return $hidden;
 }
예제 #17
0
 public function __construct($options, $levelno)
 {
     parent::__construct($options);
     $this->setName('updateloanscheme');
     //set drop down and validate
     if ($options == 0) {
         $OFFICE_NO = new Zend_Form_Element_Select('officeNo');
         $OFFICE_NO->setRequired(true);
         $OFFICE_NO->addMultiOption('', 'Select...');
         $OFFICE_NO->addMultiOption('3', ' 3');
         $OFFICE_NO->addMultiOption('4', ' 4');
         $OFFICE_NO->addMultiOption('5', ' 5');
         $OFFICE_NO->addMultiOption('6', ' 6');
         $OFFICE_NO->addMultiOption('7', ' 7');
         $OFFICE_NO->addMultiOption('8', ' 8');
         $OFFICE_NO->addMultiOption('9', ' 9');
         $OFFICE_NO->addMultiOption('10', ' 10');
         $OFFICE_NO->setAttrib('class', 'selectbutton');
         $OFFICE_NO->setAttrib('onchange', 'reload(this.value)');
         $officetype = new Zend_Form_Element_Hidden('officeType1');
         $officetype->setRequired(true)->addValidators(array(array('NotEmpty')));
         $officetype->setAttrib('class', 'txt_put');
         $officetype->setAttrib('id', 'officeType1');
         $officecode = new Zend_Form_Element_Hidden('officeCode1');
         $officecode->setRequired(true)->addValidators(array(array('NotEmpty')));
         $officecode->setAttrib('class', 'txt_put');
         $officecode->setAttrib('id', 'officeCode1')->setAttrib('size', '2');
         $this->addElements(array($officetype, $officecode));
         //set office levels
         for ($i = 2; $i <= $levelno; $i++) {
             $id = new Zend_Form_Element_Hidden('id' . $i);
             $officetype = new Zend_Form_Element_Hidden('officeType' . $i);
             $officetype->setRequired(true)->addValidators(array(array('NotEmpty')));
             $officetype->setAttrib('class', 'txt_put');
             $officetype->setAttrib('id', 'officeType' . $i);
             $officecode = new Zend_Form_Element_Hidden('officeCode' . $i);
             $officecode->setRequired(true)->addValidators(array(array('NotEmpty')));
             $officecode->setAttrib('class', 'txt_put');
             $officecode->setAttrib('id', 'officeCode' . $i)->setAttrib('size', '2');
             $this->addElements(array($id, $officetype, $officecode));
         }
         $submit = new Zend_Form_Element_Submit('Edit');
         $submit->setAttrib('class', 'officesubmit');
         $submit->setLabel('edit');
         $this->addElements(array($submit));
         $this->addElements(array($OFFICE_NO));
     } else {
         for ($i = 1; $i <= $options; $i++) {
             $id = new Zend_Form_Element_Hidden('id' . $i);
             $hierarchy_level = new Zend_Form_Element_Hidden('hierarchyLevel' . $i);
             $officetype = new Zend_Form_Element_Hidden('officeType' . $i);
             $officetype->setRequired(true)->addValidators(array(array('NotEmpty'), array('stringLength', false, array(4, 50))));
             $officetype->setAttrib('class', 'txt_put');
             $officetype->setAttrib('id', 'officeType' . $i);
             $officecode = new Zend_Form_Element_Hidden('officeCode' . $i);
             //add validation and fix length
             $officecode->setRequired(true)->addValidators(array(array('NotEmpty'), array('stringLength', false, array(2, 2))));
             $officecode->setAttrib('class', 'txt_put');
             $officecode->setAttrib('id', 'officeCode' . $i)->setAttrib('size', '2');
             $this->addElements(array($id, $officetype, $officecode, $hierarchy_level));
         }
         $OFFICE_NO = new Zend_Form_Element_Hidden('officeNo');
         $Office_level = new Zend_Form_Element_Text('officeLevel');
         //add validation and fix length
         $Office_level->setAttrib('size', '2');
         $Office_level->setAttrib('id', 'officeLevel');
         $Office_level->setAttrib('class', 'txt_put');
         $Office_level->addDecorators(array('ViewHelper', 'Errors', array('HtmlTag', array('tag' => 'h')), array('Label', array('tag' => 'h'))));
         $submit = new Zend_Form_Element_Submit('Edit');
         $submit->setLabel('edit');
         $Next = new Zend_Form_Element_Submit('Next');
         //add submit button
         $submit->setAttrib('class', 'officebutton');
         $Next->setAttrib('class', 'officesubmit');
         $Next->setLabel('Next');
         $this->addElements(array($submit, $OFFICE_NO, $Office_level, $Next));
     }
 }
예제 #18
0
 public function inittopic($topic_id)
 {
     global $mySession;
     $db = new Db();
     $CategoryName = "";
     if ($topic_id != "") {
         $PageData = $db->runQuery("select * from " . GROUP_TPOIC . " where topic_id='" . $topic_id . "'");
         $topicname = $PageData[0]['topic_name'];
         $topicdescription = $PageData[0]['topic_description'];
         $topicaccess_type = $PageData[0]['topic_access_type'];
         $created_by = $PageData[0]['created_by'];
         $topicstatus = $PageData[0]['topic_status'];
         $topiccrdate = $PageData[0]['topic_cr_date'];
         $topic_id = $PageData[0]['topic_id'];
         $catvalueArray = array();
         $PageData = $db->runQuery("select category_id from " . GROUP_TPOIC_CATEGORIES . " where topic_id='" . $topic_id . "'");
         foreach ($PageData as $key => $value) {
             $catvalueArray[] = $value['category_id'];
         }
         $groupmember = array();
         $PageData = $db->runQuery("select member_id from " . GROUP_MEMBER . " where topic_id='" . $topic_id . "'");
         foreach ($PageData as $key => $value) {
             $groupmember[] = $value['member_id'];
         }
     }
     /*$CatArray=array();
     		$PageData=$db->runQuery("select group_id,group_name from ".GROUP_CATEGORIES." where group_status=1 order by group_name");
     		foreach($PageData as $key=> $value)
     		{
     			$CatArray[$value['group_id']]=$value['group_name'];
     		}
     		
     		$topic_group= new Zend_Form_Element_Checkbox('topic_group');
     		$topic_group->setMultiOptions($CatArray)
     		->setAttrib("multiple","multiple")
     		->setValue($catvalueArray);*/
     $groupArr = array();
     $PageData = $db->runQuery("select group_id,group_name from " . GROUP_CATEGORIES . " where group_id > 0 and group_status=1 order by group_name");
     if ($PageData != "" and count($PageData) > 0) {
         $i = 0;
         foreach ($PageData as $key => $pageDataValues) {
             $groupArr[$i]['key'] = $pageDataValues['group_id'];
             $groupArr[$i]['value'] = $pageDataValues['group_name'];
             $i++;
         }
     }
     $topic_group = new Zend_Form_Element_Multicheckbox('topic_group');
     $topic_group->setSeparator("<br>")->setMultiOptions($groupArr)->setValue($catvalueArray);
     unset($groupArr);
     $groupArr = array();
     $PageData = $db->runQuery("select user_id,username from " . USERS . " where user_status='1' order by username");
     if ($PageData != "" and count($PageData) > 0) {
         $i = 0;
         foreach ($PageData as $key => $pageDataValues) {
             $groupArr[$i]['key'] = $pageDataValues['user_id'];
             $groupArr[$i]['value'] = $pageDataValues['username'];
             $i++;
         }
     }
     $group_member = new Zend_Form_Element_Multicheckbox('group_member');
     $group_member->setSeparator("<br>")->setMultiOptions($groupArr)->setValue($groupmember);
     $topic_name = new Zend_Form_Element_Text('topic_name');
     $topic_name->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Topic Name is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "textInput")->setValue($topicname);
     $topic_description = new Zend_Form_Element_Textarea('topic_description');
     $topic_description->setRequired(true)->setAttrib("rows", 5)->addValidator('NotEmpty', true, array('messages' => 'Topic description is required.'))->addDecorator('Errors', array('class' => 'error'))->setValue($topicdescription);
     $topic_status = new Zend_Form_Element_Hidden('topic_status');
     $topic_status->setAttrib("value", 1);
     $topic_access_type = new Zend_Form_Element_Select('topic_access_type');
     $topic_access_type->setRequired(true)->setMultiOptions(array('0' => 'Public', '1' => 'Private', '2' => 'Protected'))->addValidator('NotEmpty', true, array('messages' => 'Topic access type is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("onchange", "showhide(this.value)")->setValue($topicaccess_type);
     $created_by = new Zend_Form_Element_Hidden('created_by');
     $created_by->setAttrib("value", $created_by);
     $topic_cr_date = new Zend_Form_Element_Hidden('topic_cr_date');
     $topic_cr_date->setAttrib("value", $topic_cr_date);
     $this->addElements(array($topic_name, $topic_description, $topic_status, $topic_access_type, $created_by, $topic_cr_date, $topic_group, $group_member));
 }
예제 #19
0
 public function __construct($path)
 {
     //   Zend_Dojo::enableForm($this);
     //  parent::__construct($options);
     $officeupdates_id = new Zend_Form_Element_Hidden('officeupdates_id');
     $office_id = new Zend_Form_Element_Hidden('office_id');
     $office_id->setAttrib('class', 'txt_put');
     $office_name = new Zend_Form_Element_Text('office_name');
     $office_name->setRequired(true)->addValidators(array(array('NotEmpty')));
     $office_name->setAttrib('class', 'txt_put');
     $office_name->addValidator(new Zend_Validate_Db_NoRecordExists('ourbank_officenames', 'office_name'));
     $officeshort_name = new Zend_Form_Element_Text('officeshort_name');
     $officeshort_name->setAttrib('class', 'txt_put');
     $officeshort_name->setRequired(true)->addValidators(array(array('NotEmpty'), array('stringLength', false, array(3, 3))));
     $officeaddress1 = new Zend_Form_Element_Text('officeaddress1');
     $officeaddress1->setRequired(true)->addValidators(array(array('NotEmpty')));
     $officeaddress1->setAttrib('class', 'txt_put');
     $officeaddress2 = new Zend_Form_Element_Text('officeaddress2');
     $officeaddress2->setAttrib('class', 'txt_put');
     $officeaddress3 = new Zend_Form_Element_Text('officeaddress3');
     $officeaddress3->setAttrib('class', 'txt_put');
     $officecity = new Zend_Form_Element_Text('officecity');
     $officecity->setRequired(true)->addValidators(array(array('NotEmpty'), array('alpha')));
     $officecity->setAttrib('class', 'txt_put');
     $officestate = new Zend_Form_Element_Text('officestate');
     $officestate->setRequired(true)->addValidators(array(array('NotEmpty'), array('alpha')));
     $officestate->setAttrib('class', 'txt_put');
     $officecountry = new Zend_Form_Element_Text('officecountry');
     $officecountry->setRequired(true)->addValidators(array(array('NotEmpty'), array('alpha')));
     $officecountry->setAttrib('class', 'txt_put');
     $officepincode = new Zend_Form_Element_Text('officepincode');
     $officepincode->setRequired(true)->addValidators(array(array('Digits'), array('stringLength', false, array(6, 6))));
     $officepincode->setAttrib('class', 'txt_put');
     $officephone = new Zend_Form_Element_Text('officephone');
     $officephone->setRequired(true)->addValidators(array(array('Digits'), array('stringLength', false, array(10, 11))));
     $officephone->setAttrib('class', 'txt_put');
     $office_fax = new Zend_Form_Element_Text('office_fax');
     $office_fax->setAttrib('class', 'txt_put');
     $office_email_Id = new Zend_Form_Element_Text('office_email_Id');
     $office_email_Id->setAttrib('class', 'txt_put');
     $contactperson = new Zend_Form_Element_Text('contactperson');
     $contactperson->setAttrib('class', 'txt_put');
     $contactperson_phone1 = new Zend_Form_Element_Text('contactperson_phone1');
     $contactperson_phone1->setAttrib('class', 'txt_put');
     $contactperson_phone2 = new Zend_Form_Element_Text('contactperson_phone2');
     $contactperson_phone2->setAttrib('class', 'txt_put');
     $contactperson_email = new Zend_Form_Element_Text('contactperson_email');
     $contactperson_email->setAttrib('class', 'txt_put');
     $officedescription = new Zend_Form_Element_Text('officedescription');
     $officedescription->setAttrib('class', 'txt_put');
     $officetype_id = new Zend_Form_Element_Select('officetype_id');
     $officetype_id->setRequired(true);
     $officetype_id->addMultiOption('', 'select' . '...');
     $officetype_id->setAttrib('class', 'selectbutton');
     $officetype_id->setAttrib('onchange', 'getInterests(this.value,"' . $path . '")');
     $parentoffice_id = new Zend_Form_Element_Select('parentoffice_id');
     $parentoffice_id->addMultiOption('', 'firstSelectOfficeType' . '...');
     $parentoffice_id->setAttrib('class', 'selectbutton');
     $submit = new Zend_Form_Element_Submit('Submit');
     $submit->setAttrib('class', 'officesubmit');
     $submit->setLabel('Submit');
     $this->addElements(array($officeupdates_id, $office_name, $officeshort_name, $officeaddress1, $officeaddress2, $officeaddress3, $officecity, $officestate, $officecountry, $officepincode, $officephone, $office_fax, $office_email_Id, $contactperson, $contactperson_phone1, $contactperson_phone2, $contactperson_email, $submit, $office_id, $officetype_id, $officedescription, $parentoffice_id));
 }
예제 #20
0
 public function __construct($options = null)
 {
     Zend_Dojo::enableForm($this);
     parent::__construct($options);
     $categoryname = new Zend_Form_Element_Text('categoryname');
     $categoryname->addValidator(new Zend_Validate_Db_NoRecordExists('ourbank_categorydetails', 'categoryname'));
     $categoryname->setAttrib('class', 'txt_put');
     $categoryname->setAttrib('id', 'categoryname')->setLabel('Category  Name');
     $categoryname->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', 'requiredSuffix' => ' *')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
     $category_id = new Zend_Form_Element_Hidden('category_id');
     $category_id->setAttrib('class', 'txt_put');
     $category_id->setAttrib('id', 'category_id')->setLabel('');
     $categorydescription = new Zend_Form_Element_Textarea('categorydescription', array('rows' => 3, 'cols' => 20));
     $categorydescription->setAttrib('id', 'categorydescription')->setLabel('Category  Description');
     $categorydescription->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'))));
     $this->addElements(array($categoryname, $categorydescription, $category_id));
     // 			$cust = new settings_Model_Customization();
     // 			$sample = $cust->fetchcustomized("ourbank_customizingform",1);
     // 			foreach($sample as $cust1) {
     // 				switch($cust1['feild_type']) {
     // 					case "text" : $Instance = new Zend_Form_Element_Text($cust1['feild_name']);
     // 						$Instance->setLabel($cust1['display_name']);
     // 						$Instance->setAttrib('size','8');
     // 						if ($cust1['feild_name'])
     // 							$Instance->setRequired(true)
     // 									->setDecorators(array('ViewHelper',
     // 									array('Description',array('tag'=>'','escape'=>false)),'Errors',
     // 									array(array('data'=>'HtmlTag'), array('tag' => 'td')),
     // 									array('Label', array('tag' => 'td','requiredSuffix' => ' *',)),
     // 									array(array('row'=>'HtmlTag'),array('tag'=>'tr'))));
     // 					break;
     //
     // 					case "radio" :  $Instance = new Zend_Form_Element_Radio($cust1['feild_name']);
     // 						$Instance->setLabel($cust1['display_name']);
     // 						$appliesTo = $cust->getTableInfo($cust1['table_name']);
     // 						foreach ($appliesTo as $gracePeriodRow) {
     // 							$radioValues[current($gracePeriodRow)] = end($gracePeriodRow);
     // 						}
     // 						$Instance->setMultiOptions($radioValues);
     // 						unset($radioValues);
     // 						if ($cust1['feild_name'])
     // 							$Instance->setRequired(true)
     // 									->setDecorators(array('ViewHelper',
     // 									array('Description',array('tag'=>'','escape'=>false)),'Errors',
     // 									array(array('data'=>'HtmlTag'), array('tag' => 'td')),
     // 									array('Label', array('tag' => 'td','requiredSuffix' => ' *',)),
     // 									array(array('row'=>'HtmlTag'),array('tag'=>'tr'))));
     // 					break;
     //
     // 					case "select" : $Instance = new Zend_Form_Element_Select($cust1['feild_name']);
     // 						$Instance->setLabel($cust1['display_name']);
     // 						$appliesTo = $cust->getTableInfo($cust1['table_name']);
     // 						foreach ($appliesTo as $gracePeriodRow) {
     // 							$radioValues[current($gracePeriodRow)] = end($gracePeriodRow);
     // 						}
     // 						$Instance->setMultiOptions($radioValues);
     // 						unset($radioValues);
     // 						if ($cust1['feild_name'])
     // 							$Instance->setRequired(true)
     // 									->setDecorators(array('ViewHelper',
     // 									array('Description',array('tag'=>'','escape'=>false)),'Errors',
     // 									array(array('data'=>'HtmlTag'), array('tag' => 'td')),
     // 									array('Label', array('tag' => 'td','requiredSuffix' => ' *',)),
     // 									array(array('row'=>'HtmlTag'),array('tag'=>'tr'))));
     // 					break;
     //
     // 					case "description" : $Instance = new Zend_Form_Element_Textarea($cust1['feild_name'], array('rows' => 3,'cols' => 20,));
     // 						$Instance->setLabel($cust1['display_name']);
     // 						if ($cust1['feild_name'])
     // 							$Instance->setRequired(true)
     // 									->setDecorators(array('ViewHelper',
     // 									array('Description',array('tag'=>'','escape'=>false)),'Errors',
     // 									array(array('data'=>'HtmlTag'), array('tag' => 'td')),
     // 									array('Label', array('tag' => 'td','requiredSuffix' => ' *',)),
     // 									array(array('row'=>'HtmlTag'),array('tag'=>'tr'))));
     // 					break;
     //
     // 					case "checkbox" : $Instance = new Zend_Form_Element_MultiCheckbox($cust1['feild_name']);
     // 						$Instance->setLabel($cust1['display_name']);
     // 						$appliesTo = $cust->getTableInfo($cust1['table_name']);
     // 						foreach ($appliesTo as $gracePeriodRow) {
     // 							$radioValues[current($gracePeriodRow)] = end($gracePeriodRow);
     // 						}
     // 						$Instance->setMultiOptions($radioValues);
     // 						unset($radioValues);
     // 						if($cust1['feild_name'])
     // 							$Instance->setRequired(true)
     // 									->setDecorators(array('ViewHelper',
     // 									array('Description',array('tag'=>'','escape'=>false)),'Errors',
     // 									array(array('data'=>'HtmlTag'), array('tag' => 'td')),
     // 									array('Label', array('tag' => 'td','requiredSuffix' => ' *',)),
     // 									array(array('row'=>'HtmlTag'),array('tag'=>'tr'))));
     // 					break;
     // 				}
     // 				$this->addElements(array($Instance));
     // 			}
     $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($submit));
 }