Esempio n. 1
1
 public function init()
 {
     $this->setMethod('post');
     $this->setAttrib('id', 'agencylistreport');
     $this->setAttrib('name', 'agencylistreport');
     $this->setAttrib('action', DOMAIN . 'reports/agencylistreport');
     $agencyname = new Zend_Form_Element_Text('agencynamef');
     $agencyname->setLabel('Agency');
     $agencyname->setAttrib('onblur', 'clearagencyname(this)');
     $agencyname->setAttrib('maxLength', 50);
     $primaryphone = new Zend_Form_Element_Text('primaryphonef');
     $primaryphone->setLabel('Primary Phone');
     $primaryphone->setAttrib('onblur', 'blurelement(this)');
     $primaryphone->setAttrib('maxLength', 15);
     $primaryphone->addFilter(new Zend_Filter_StringTrim());
     $primaryphone->addValidators(array(array('StringLength', false, array('min' => 10, 'max' => 15, 'messages' => array(Zend_Validate_StringLength::TOO_LONG => 'Primary phone number must contain at most %max% characters', Zend_Validate_StringLength::TOO_SHORT => 'Primary phone number must contain at least %min% characters.')))));
     $primaryphone->addValidator("regex", true, array('pattern' => '/^(?!0{10})[0-9]+$/', 'messages' => array('regexNotMatch' => 'Please enter valid phone number.')));
     $checktype = new Zend_Form_Element_Multiselect('bg_checktypef');
     $checktype->setLabel('Screening Type');
     $checktypeModal = new Default_Model_Bgscreeningtype();
     $typesData = $checktypeModal->fetchAll('isactive=1', 'type');
     foreach ($typesData->toArray() as $data) {
         $checktype->addMultiOption($data['id'], $data['type']);
     }
     $checktype->setRegisterInArrayValidator(false);
     $checktype->setAttrib('onchange', 'changeelement(this)');
     $website = new Zend_Form_Element_Text('website_urlf');
     $website->setLabel('Website Url');
     $website->setAttrib('maxLength', 50);
     $website->addFilter(new Zend_Filter_StringTrim());
     $website->setAttrib('onblur', 'clearagencyname(this)');
     $this->addElements(array($agencyname, $primaryphone, $checktype, $website));
     $this->setElementDecorators(array('ViewHelper'));
 }
Esempio n. 2
1
 public function init()
 {
     $this->setMethod('post');
     $this->setAttrib('id', 'formid');
     $this->setAttrib('name', 'empscreeningreport');
     $this->setAttrib('action', BASE_URL . 'reports/empscreening');
     $specimen = new Zend_Form_Element_Select('specimen');
     $specimen->setLabel('Select Employee/Candidate');
     $specimen->addMultiOption('', 'Select Employee/Candidate');
     $specimen->addMultiOption('1', 'Employee');
     $specimen->addMultiOption('2', 'Candidate');
     $empname = new Zend_Form_Element_Text('empname');
     $empname->setLabel('Employee / Candidate Name');
     $empname->addValidator("regex", true, array('pattern' => '/^([a-zA-Z.\\-]+ ?)+$/', 'messages' => array('regexNotMatch' => 'Please enter only alphabets.')));
     $empname->setAttrib('onblur', 'clearEmpScreeningAutoCompleteNames(this)');
     $agencyname = new Zend_Form_Element_Text('agencyname');
     $agencyname->setLabel('Agency Name');
     $agencyname->setAttrib('class', 'selectoption');
     $agencyname->addValidator("regex", true, array('pattern' => '/^([a-zA-Z.\\-]+ ?)+$/', 'messages' => array('regexNotMatch' => 'Please enter only alphabets.')));
     $agencyname->setAttrib('onblur', 'clearEmpScreeningAutoCompleteNames(this)');
     $screeningtype = new Zend_Form_Element_Multiselect('screeningtype');
     $screeningtype->setLabel('Screening Type');
     $checktypeModal = new Default_Model_Bgscreeningtype();
     $typesData = $checktypeModal->fetchAll('isactive=1', 'type');
     foreach ($typesData->toArray() as $data) {
         $screeningtype->addMultiOption($data['id'], $data['type']);
     }
     $screeningtype->setRegisterInArrayValidator(false);
     $process_status = new Zend_Form_Element_Select('process_status');
     $process_status->setLabel('Select Status');
     $process_status->addMultiOption('', 'Select Status');
     $process_status->addMultiOption('In process', 'In process');
     $process_status->addMultiOption('Complete', 'Complete');
     $process_status->addMultiOption('On hold', 'On hold');
     $month = new Zend_Form_Element_Select('month');
     $month->setLabel('Select Month');
     $month->addMultiOption('', 'Select Month');
     $monthnamesarray = array('1' => 'January', '2' => 'February', '3' => 'March', '4' => 'April', '5' => 'May', '6' => 'June', '7' => 'July', '8' => 'August', '9' => 'September', '10' => 'October', '11' => 'November', '12' => 'December');
     for ($i = 1; $i <= sizeof($monthnamesarray); $i++) {
         $month->addMultiOption($i, $monthnamesarray[$i]);
     }
     $year = new Zend_Form_Element_Select('year');
     $year->setLabel('Select Year');
     $curYear = date("Y");
     $preYear = $curYear - 10;
     $year->addMultiOption('', 'Select Year');
     for ($i = $preYear; $i <= $curYear; $i++) {
         $year->addMultiOption($i, $i);
     }
     $this->addElements(array($specimen, $empname, $agencyname, $screeningtype, $process_status, $month, $year));
     $this->setElementDecorators(array('ViewHelper'));
 }
Esempio n. 3
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();
 }
Esempio n. 4
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));
 }
Esempio n. 5
0
 public function init()
 {
     $this->setMethod('post');
     $this->setAttrib('id', 'formid');
     $this->setAttrib('name', 'businessunitsreport');
     $this->setAttrib('action', BASE_URL . 'reports/businessunits');
     $bunitname = new Zend_Form_Element_Text('bunitname');
     $bunitname->setLabel('Business Unit');
     $bunitname->setAttrib('onblur', 'clearbuname(this)');
     $bunitcode = new Zend_Form_Element_Text('bunitcode');
     $bunitcode->setLabel('Code');
     $bunitcode->setAttrib('onblur', 'clearbuname(this)');
     $bunitcode->setAttrib('class', 'selectoption');
     $startdate = new ZendX_JQuery_Form_Element_DatePicker('startdate');
     $startdate->setLabel('Started On');
     $startdate->setAttrib('readonly', 'true');
     $startdate->setOptions(array('class' => 'brdr_none'));
     $start_date = new ZendX_JQuery_Form_Element_DatePicker('start_date');
     $start_date->setAttrib('readonly', 'true');
     $start_date->setAttrib('onfocus', 'this.blur()');
     $start_date->setOptions(array('class' => 'brdr_none'));
     $country = new Zend_Form_Element_Select('country');
     $country->setLabel('Country');
     $this->addElements(array($bunitname, $bunitcode, $startdate, $country));
     $this->setElementDecorators(array('ViewHelper'));
     $this->setElementDecorators(array('UiWidgetElement'), array('startdate'));
 }
Esempio n. 6
0
 public function init()
 {
     $this->setMethod('post');
     $this->setAttrib('id', 'formid');
     $this->setAttrib('name', 'empleaves');
     $id = new Zend_Form_Element_Hidden('id');
     $userid = new Zend_Form_Element_Hidden('user_id');
     $emp_leave_limit = new Zend_Form_Element_Text('leave_limit');
     $emp_leave_limit->setAttrib('maxLength', 3);
     $emp_leave_limit->addFilter(new Zend_Filter_StringTrim());
     $emp_leave_limit->setRequired(true);
     $emp_leave_limit->addValidator('NotEmpty', false, array('messages' => 'Please enter leave limit for current year.'));
     $emp_leave_limit->addValidator("regex", true, array('pattern' => '/^(\\-?[1-9]|\\-?[1-9][0-9])$/', 'messages' => array('regexNotMatch' => 'Leave limit must be in the range of 0 to 100.')));
     $used_leaves = new Zend_Form_Element_Text('used_leaves');
     $used_leaves->setAttrib('maxLength', 3);
     $used_leaves->setAttrib('readonly', 'true');
     $used_leaves->setAttrib('onfocus', 'this.blur()');
     $alloted_year = new Zend_Form_Element_Text('alloted_year');
     $alloted_year->setAttrib('maxLength', 4);
     $alloted_year->setAttrib('readonly', 'true');
     $alloted_year->setAttrib('onfocus', 'this.blur()');
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton');
     $submit->setLabel('Save');
     $submitbutton = new Zend_Form_Element_Button('submitbutton');
     $submitbutton->setAttrib('id', 'submitbuttons');
     $submitbutton->setLabel('Save');
     $this->addElements(array($id, $userid, $emp_leave_limit, $used_leaves, $alloted_year, $submit, $submitbutton));
     $this->setElementDecorators(array('ViewHelper'));
 }
Esempio n. 7
0
 public function init()
 {
     $this->setMethod('post');
     $this->setAttrib('id', 'formid');
     $this->setAttrib('name', 'frm_interview_rpt');
     $interview_date = new Zend_Form_Element_Text("interview_date");
     $interview_date->setLabel("Interview Date");
     $interview_date->setAttrib('readonly', 'readonly');
     $req_id = new Zend_Form_Element_Select("req_id");
     $req_id->setRegisterInArrayValidator(false);
     $req_id->setLabel("Requisition Code")->addMultiOptions(array('' => 'Select Requisition Code'));
     $department_id = new Zend_Form_Element_Select("department_id");
     $department_id->setLabel("Department");
     $department_id->setRegisterInArrayValidator(false);
     $department_id->addMultiOptions(array('' => 'Select Department'));
     $interviewer_id = new Zend_Form_Element_Text("interviewer_id");
     $interviewer_id->setLabel("Interviewer");
     $interviewer_id->setAttrib('name', '');
     $interviewer_id->setAttrib('id', 'idinterviewer_id');
     $createdby = new Zend_Form_Element_Text("createdby");
     $createdby->setLabel("Interview Planned By");
     $createdby->setAttrib('name', '');
     $createdby->setAttrib('id', 'idcreatedby');
     $submit = new Zend_Form_Element_Button('submit');
     $submit->setAttrib('id', 'idsubmitbutton');
     $submit->setLabel('Report');
     $this->addElements(array($submit, $interview_date, $req_id, $department_id, $interviewer_id, $createdby));
     $this->setElementDecorators(array('ViewHelper'));
 }
 public function init()
 {
     $this->setMethod('post');
     $this->setAttrib('id', 'formid');
     $this->setAttrib('name', 'frm_requisition_report');
     $raised_by = new Zend_Form_Element_Text("raised_by");
     $raised_by->setLabel("Raised By");
     $raised_by->setAttrib('name', '');
     $raised_by->setAttrib('id', 'idraised_by');
     $raised_by->setAttrib('title', 'Raised By');
     $requisition_status = new Zend_Form_Element_Select("req_status");
     $requisition_status->setLabel("Requisition Status");
     $requisition_status->addMultiOptions(array('' => 'Select Requisition Status', 'Initiated' => 'Initiated', 'Approved' => 'Approved', 'Rejected' => 'Rejected', 'Closed' => 'Closed', 'On hold' => 'On hold', 'Complete' => 'Complete', 'In process' => 'In process'));
     $requisition_status->setAttrib('title', 'Requisition Status');
     $raised_in = new Zend_Form_Element_Select('createdon');
     $raised_in->setLabel('Raised In');
     $raised_in->setAttrib('id', 'createdon');
     $reporting_manager = new Zend_Form_Element_Text("reporting_manager");
     $reporting_manager->setLabel("Reporting Manager");
     $reporting_manager->setAttrib('name', '');
     $reporting_manager->setAttrib('id', 'idreporting_manager');
     $job_title = new Zend_Form_Element_Select("jobtitle");
     $job_title->setLabel("Job Title");
     $job_title->setAttrib("onchange", "getpositions_req('department','business_unit','position_id','jobtitle');");
     $job_title->setAttrib('title', 'Job Title.');
     $submit = new Zend_Form_Element_Button('submit');
     $submit->setAttrib('id', 'idsubmitbutton');
     $submit->setLabel('Report');
     $this->addElements(array($raised_by, $requisition_status, $raised_in, $reporting_manager, $job_title, $submit));
     $this->setElementDecorators(array('ViewHelper'));
 }
Esempio n. 9
0
 public function init()
 {
     $this->setMethod('post');
     $this->setAttrib('id', 'pdcategories');
     $this->setAttrib('name', 'pdcategories');
     $categoryName = new Zend_Form_Element_Text('category');
     $categoryName->setAttrib('id', 'category');
     $categoryName->setAttrib('name', 'category');
     $categoryName->setAttrib('maxlength', '30');
     $categoryName->setAttrib('onblur', 'chkCategory()');
     $categoryName->setAttrib('onkeypress', 'chkCategory()');
     $categoryName->addFilter(new Zend_Filter_StringTrim());
     $categoryName->setRequired(true);
     $categoryName->addValidator('NotEmpty', false, array("messages" => 'Please enter category'));
     $categoryName->addValidator('regex', true, array('pattern' => '/^[a-zA-Z0-9][\\s+[a-zA-Z0-9]+]*$/', 'messages' => array('regexNotMatch' => 'Please enter valid category')));
     $categoryName->addValidator(new Zend_Validate_Db_NoRecordExists(array('table' => 'main_pd_categories', 'field' => 'category', 'exclude' => 'id!="' . Zend_Controller_Front::getInstance()->getRequest()->getParam('id') . '" and isactive = 1')));
     $categoryName->getValidator('Db_NoRecordExists')->setMessage('Category already exists');
     $categoryDesc = new Zend_Form_Element_Textarea('description');
     $categoryDesc->setAttrib('id', 'description');
     $categoryDesc->setAttrib('name', 'description');
     $categoryDesc->setAttrib('rows', 10);
     $categoryDesc->setAttrib('cols', 50);
     $categoryDesc->setAttrib('maxlength', 250);
     $submitBtn = new Zend_Form_Element_Submit('submit');
     $submitBtn->setAttrib('id', 'submitBtn');
     $submitBtn->setLabel('Add');
     $this->addElements(array($categoryName, $categoryDesc, $submitBtn));
     $this->setElementDecorators(array('ViewHelper'));
 }
Esempio n. 10
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'))));
 }
Esempio n. 11
0
 public function __construct($app, $value)
 {
     Zend_Dojo::enableForm($this);
     parent::__construct($app);
     parent::__construct($value);
     $membertitle = new Zend_Form_Element_Select('membertitle');
     $membertitle->setAttrib('class', 'txt_put');
     $membertitle->setAttrib('id', 'membertitle');
     $membertitle->setAttrib('tabindex', '3');
     $membertitle->setAttrib($value, 'true');
     $memberfirstname = new Zend_Form_Element_Text('memberfirstname');
     $memberfirstname->setAttrib('class', '');
     $memberfirstname->setAttrib('size', '10');
     $memberfirstname->setAttrib('id', 'memberfirstname');
     $memberaddressline1 = new Zend_Form_Element_Text('memberaddressline1');
     $memberaddressline1->setAttrib('class', 'txt_put');
     $memberaddressline1->setAttrib('id', 'memberaddressline1');
     $memberaddressline1->setAttrib('tabindex', '13');
     $memberaddressline1->setAttrib($value, 'true');
     $memberaddressline2 = new Zend_Form_Element_Text('memberaddressline2');
     $memberaddressline2->setAttrib('class', 'txt_put');
     $memberaddressline2->setAttrib('id', 'memberaddressline2');
     $memberaddressline2->setAttrib('tabindex', '14');
     $memberaddressline2->setAttrib($value, 'true');
     $memberaddressline3 = new Zend_Form_Element_Text('memberaddressline3');
     $memberaddressline3->setAttrib('class', 'txt_put');
     $memberaddressline3->setAttrib('id', 'memberaddressline3');
     $memberaddressline3->setAttrib('tabindex', '15');
     $memberaddressline3->setAttrib($value, 'true');
     $membercity = new Zend_Form_Element_Text('membercity');
     $membercity->setAttrib('class', 'txt_put');
     $membercity->setAttrib('id', 'membercity');
     $membercity->setAttrib('tabindex', '16');
     $membercity->setAttrib($value, 'true');
     $familymembername = new Zend_Form_Element_Text('familymembername');
     $familymembername->setAttrib('class', 'txt_put');
     $familymembername->setAttrib('size', '10');
     $familymembername->setAttrib('id', 'familymembername');
     $memberId = new Zend_Form_Element_Text('member_id');
     $memberId->setAttrib('class', 'txt_put');
     $memberId->setAttrib('readonly', 'true');
     $memberId->setAttrib('size', '10');
     $OFFICE_TYPE = new Zend_Form_Element_Select('officeType');
     $OFFICE_TYPE->addMultiOption('', 'Select');
     $OFFICE_TYPE->setAttrib('class', 'txt_put');
     $OFFICE_TYPE->setAttrib('onchange', 'getBranch(this.value,"' . $app . '")');
     $OFFICE_TYPE->setAttrib('tabindex', '1');
     $OFFICE_TYPE->setAttrib($value, 'true');
     $SUB_OFFICE = new Zend_Form_Element_Select('subOffice');
     $SUB_OFFICE->setAttrib('class', 'txt_put');
     $SUB_OFFICE->setAttrib('tabindex', '2');
     $SUB_OFFICE->setAttrib($value, 'true');
     $submit = new Zend_Form_Element_Submit('Save');
     $submit->setAttrib('id', 'save');
     $this->addElements(array($OFFICE_TYPE, $SUB_OFFICE, $memberfirstname, $familymembername, $membertitle, $memberaddressline1, $memberaddressline2, $memberaddressline3, $membercity, $submit, $memberId));
     $memberId = new Zend_Form_Element_Hidden('memberId');
     $submit = new Zend_Form_Element_Submit('Submit');
     $submit->setAttrib('class', 'officesubmit');
     $this->addElements(array($submit, $memberId));
 }
Esempio n. 12
0
 public function __construct($currencysymbol)
 {
     Zend_Dojo::enableForm($this);
     parent::__construct($options);
     $finename = new Zend_Form_Element_Text('finename');
     $finename->setRequired(true)->addValidators(array(array('NotEmpty')));
     $finename->setAttrib('class', 'txt_put');
     $finename->setAttrib('id', 'finename');
     $membertype = new Zend_Form_Element_Select('membertype');
     $membertype->setAttrib('class', 'selectbutton');
     $membertype->setAttrib('id', 'membertype');
     $membertype->setRequired(true)->addValidators(array(array('NotEmpty')));
     $finedescription = new Zend_Form_Element_Text('finedescription');
     $finedescription->setAttrib('class', 'txt_put');
     $finedescription->setAttrib('id', 'finedescription');
     $finedescription->setRequired(true)->addValidators(array(array('NotEmpty')));
     $finevalue = new Zend_Form_Element_Text('finevalue');
     $finevalue->setAttrib('class', 'txt_put');
     $finevalue->setAttrib('id', 'finevalue');
     $finevalue->setAttrib('size', '6');
     $finevalue->setRequired(true)->addValidators(array(array('NotEmpty')));
     $submit = new Zend_Form_Element_Submit('Save');
     $submit->setAttrib('id', 'save');
     $this->addElements(array($finename, $finedescription, $membertype, $finevalue));
     $fineId = new Zend_Form_Element_Hidden('fineId');
     $submit = new Zend_Form_Element_Submit('Submit');
     $submit->setAttrib('class', 'finesubmit');
     $submit->setLabel('submit');
     $this->addElements(array($submit, $fineId));
 }
Esempio n. 13
0
 public function init()
 {
     $this->setMethod('post');
     //        $this->setAction('/index/login');
     $this->setAttrib('id', 'msform');
     $email = new Zend_Form_Element_Text('email');
     $email->setAttrib('placeholder', 'E-mail');
     $email->setAttrib('autocomplete', 'off');
     $email->addFilter('StripTags');
     $email->addFilter('HtmlEntities');
     $email->addFilter('StringTrim');
     $email->setRequired(true)->addErrorMessage('Username Required');
     $email->addValidator('EmailAddress')->addErrorMessage('Invalid Email used');
     $email->addValidator('StringLength', true, array(0, 255))->addErrorMessage('Required Field');
     $password = new Zend_Form_Element_Password('password');
     $password->setAttrib('placeholder', 'Password');
     $password->setAttrib('autocomplete', 'off');
     $password->addFilter('StripTags');
     $password->addFilter('HtmlEntities');
     $password->addFilter('StringTrim');
     $password->setRequired(true)->addErrorMessage('Password Required');
     $password->addValidator('StringLength', true, array(0, 255))->addErrorMessage('Required Field');
     $link = new Zend_Form_Element_Note('forgot_password', array('value' => '<a href="#" id="link">Forgot your password ?</a>'));
     $submit = new Zend_Form_Element_Submit('SignIn');
     $submit->setLabel('Sign In');
     $submit->setAttrib('class', 'btn btn-info');
     $register = new Zend_Form_Element_Button('register');
     $register->setLabel('Register');
     $register->setAttrib('class', 'btn btn-warning');
     $this->addElements(array($email, $password, $submit, $register, $link));
     $this->setElementDecorators(array('ViewHelper'));
     $submit->setDecorators(array('ViewHelper'));
     $register->setDecorators(array('ViewHelper'));
     $this->setDecorators(array('FormElements', 'Form'));
 }
Esempio n. 14
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));
 }
Esempio n. 15
0
 private function getFormLogin()
 {
     $form = new Zend_Form(array('disableLoadDefaultDecorators' => true));
     $email = new Zend_Form_Element_Text('login', array('disableLoadDefaultDecorators' => true));
     $email->addDecorator('ViewHelper');
     $email->addDecorator('Errors');
     $email->setRequired(true);
     $email->setAttrib('class', 'form-control');
     $email->setAttrib('placeholder', 'Login');
     $email->setAttrib('required', 'required');
     $email->setAttrib('autofocus', 'autofocus');
     $password = new Zend_Form_Element_Password('password', array('disableLoadDefaultDecorators' => true));
     $password->addDecorator('ViewHelper');
     $password->addDecorator('Errors');
     $password->setRequired(true);
     $password->setAttrib('class', 'form-control');
     $password->setAttrib('placeholder', 'Hasło');
     $password->setAttrib('required', 'required');
     $password->setAttrib('autofocus', 'autofocus');
     $submit = new Zend_Form_Element_Submit('submit', array('disableLoadDefaultDecorators' => true));
     $submit->setAttrib('class', 'btn btn-lg btn-primary btn-block');
     $submit->setOptions(array('label' => 'Zaloguj'));
     $submit->addDecorator('ViewHelper')->addDecorator('Errors');
     $form->addElement($email)->addElement($password)->addElement($submit);
     return $form;
 }
 public function init()
 {
     parent::init();
     $this->setDecorators(array('PrepareElements', array('ViewScript', array('viewScript' => 'form/edit-history-item.phtml'))));
     /*
     $instance = new Zend_Form_Element_Select("instance_id");
     $instance->setLabel(_("Choose Show Instance"));
     $instance->setMultiOptions(array("0" => "-----------"));
     $instance->setValue(0);
     $instance->setDecorators(array('ViewHelper'));
     $this->addElement($instance);
     */
     $starts = new Zend_Form_Element_Text(self::ID_PREFIX . 'starts');
     $starts->setValidators(array(new Zend_Validate_Date(self::VALIDATE_DATETIME_FORMAT)));
     $starts->setAttrib('class', self::TEXT_INPUT_CLASS . " datepicker");
     $starts->setAttrib('data-format', self::TIMEPICKER_DATETIME_FORMAT);
     $starts->addFilter('StringTrim');
     $starts->setLabel(_('Start Time'));
     $starts->setDecorators(array('ViewHelper'));
     $starts->setRequired(true);
     $this->addElement($starts);
     $ends = new Zend_Form_Element_Text(self::ID_PREFIX . 'ends');
     $ends->setValidators(array(new Zend_Validate_Date(self::VALIDATE_DATETIME_FORMAT)));
     $ends->setAttrib('class', self::TEXT_INPUT_CLASS . " datepicker");
     $ends->setAttrib('data-format', self::TIMEPICKER_DATETIME_FORMAT);
     $ends->addFilter('StringTrim');
     $ends->setLabel(_('End Time'));
     $ends->setDecorators(array('ViewHelper'));
     //$ends->setRequired(true);
     $this->addElement($ends);
 }
Esempio n. 17
0
 public function __construct($options = null)
 {
     parent::__construct($options);
     $id = new Zend_Form_Element_Hidden('id');
     $hierarchyLevel = new Zend_Form_Element_Hidden('hierarchyLevel');
     $officeType = new Zend_Form_Element_Text('officeType');
     $officeType->setRequired(true)->addValidators(array(array('NotEmpty'), array('stringLength', false, array(4, 50))));
     // $officeType->addValidator($db_lookup_validator);
     $officeType->setAttrib('class', 'txt_put');
     $officeType->setAttrib('id', 'officeType');
     $officeCode = new Zend_Form_Element_Text('officeCode');
     //add validation
     $officeCode->setRequired(true)->addValidators(array(array('NotEmpty'), array('stringLength', false, array(2, 2))));
     $officeCode->setAttrib('class', 'txt_put');
     $officeCode->setAttrib('id', 'officeCode')->setAttrib('size', '2');
     $this->addElements(array($id, $officeType, $officeCode, $hierarchyLevel));
     $submit = new Zend_Form_Element_Submit('Edit');
     $submit->setAttrib('class', 'officebutton');
     $submit->setLabel('edit');
     $submit->removeDecorator('DtDdWrapper');
     $next = new Zend_Form_Element_Submit('Next');
     $next->setAttrib('class', 'officesubmit');
     $next->setLabel('Next');
     //add form element to form
     $this->addElements(array($submit, $next));
 }
Esempio n. 18
0
 public function __construct($minimumDeposit)
 {
     parent::__construct($minimumDeposit);
     $savings_amount = new Zend_Form_Element_Text('savings_amount');
     $savings_amount->addValidators(array(array('Float'), array('GreaterThan', false, array($minimumDeposit - 0.0001, 'messages' => array('notGreaterThan' => 'Minimum 
                                          Amount To open a savings account =' . $minimumDeposit)))));
     $savings_amount->setAttrib('class', 'txt_put');
     $savings_amount->setAttrib('id', 'amount');
     $savings_amount->setRequired(true);
     $savings_amount->setAttrib('onchange', 'calculateTotalAmount(this.value)');
     $memberfirstname = new Zend_Form_Element_MultiCheckbox('memberfirstname');
     $memberfirstname->setAttrib('class', 'textfield');
     $memberfirstname->setAttrib('id', 'selector');
     //         $memberfirstname->setRequired(true);
     $date1 = new ZendX_JQuery_Form_Element_DatePicker('date1', array('label' => 'Date:'));
     $date1->setAttrib('class', 'txt_put');
     $date1->setJQueryParam('dateFormat', 'yy-mm-dd');
     $date1->setRequired(true);
     $memberId = new Zend_Form_Element_Hidden('memberId');
     $Type = new Zend_Form_Element_Hidden('Type');
     $productId = new Zend_Form_Element_Hidden('productId');
     $typeId = new Zend_Form_Element_Hidden('typeId');
     $memberTypeIdv = new Zend_Form_Element_Hidden('memberTypeIdv');
     $submit = new Zend_Form_Element_Submit('Submit');
     $Yes = new Zend_Form_Element_Submit('Yes');
     $back = new Zend_Form_Element_Submit('Back');
     $this->addElements(array($submit, $savings_amount, $memberfirstname, $memberId, $date1, $productId, $typeId, $Type, $memberTypeIdv, $back, $Yes));
 }
Esempio n. 19
0
 public function init()
 {
     $obj = new Application_Model_DbTable_Admin();
     $primaryKey = $obj->getPrimaryKey();
     $this->setMethod('post');
     $this->setEnctype('multipart/form-data');
     $this->setAttrib('id', $primaryKey);
     $this->setAction('/admin/save');
     //        $e = new Zend_Form_Element_Hidden($primaryKey);
     //        $e = new Zend_Form_Element_Hidden('admin');
     //        $this->addElement($e);
     $e = new Zend_Form_Element_Hidden('picture');
     $this->addElement($e);
     $e = new Zend_Form_Element_Text('name');
     $e->setAttrib('class', 'form-control input-sm');
     $this->addElement($e);
     $e = new Zend_Form_Element_Text('lastnamepaternal');
     $e->setAttrib('class', 'form-control input-sm');
     $this->addElement($e);
     $e = new Zend_Form_Element_Text('lastnamematernal');
     $e->setAttrib('class', 'form-control input-sm');
     $this->addElement($e);
     $e = new Zend_Form_Element_Text('phone');
     $e->setAttrib('class', 'form-control input-sm');
     $this->addElement($e);
     $e = new Zend_Form_Element_Text('email');
     $e->setAttrib('readonly', 'true');
     $e->setAttrib('class', 'form-control input-sm');
     $this->addElement($e);
     foreach ($this->getElements() as $element) {
         $element->removeDecorator('Label');
         $element->removeDecorator('DtDdWrapper');
         $element->removeDecorator('HtmlTag');
     }
 }
Esempio n. 20
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));
 }
Esempio n. 21
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));
 }
Esempio n. 22
0
 public function init()
 {
     $this->setMethod('post');
     $this->setAttrib('id', 'formid');
     $this->setAttrib('name', 'emppersonaldetails');
     $id = new Zend_Form_Element_Hidden('id');
     $userid = new Zend_Form_Element_Hidden('user_id');
     $genderid = new Zend_Form_Element_Select('genderid');
     $genderid->addMultiOption('', 'Select Gender');
     $genderid->setRegisterInArrayValidator(false);
     $genderid->setRequired(true);
     $genderid->addValidator('NotEmpty', false, array('messages' => 'Please select gender.'));
     $maritalstatusid = new Zend_Form_Element_Select('maritalstatusid');
     $maritalstatusid->addMultiOption('', 'Select Marital Status');
     $maritalstatusid->setRegisterInArrayValidator(false);
     $maritalstatusid->setRequired(true);
     $maritalstatusid->addValidator('NotEmpty', false, array('messages' => 'Please select marital status.'));
     $ethniccodeid = new Zend_Form_Element_Select('ethniccodeid');
     $ethniccodeid->addMultiOption('', 'Select Ethnic Code');
     $ethniccodeid->setLabel('Ethnic Code');
     $ethniccodeid->setRegisterInArrayValidator(false);
     $racecodeid = new Zend_Form_Element_Select('racecodeid');
     $racecodeid->addMultiOption('', 'Select Race Code');
     $racecodeid->setLabel('Race Code');
     $racecodeid->setRegisterInArrayValidator(false);
     $languageid = new Zend_Form_Element_Select('languageid');
     $languageid->addMultiOption('', 'Select Language');
     $languageid->setLabel('Language');
     $languageid->setRegisterInArrayValidator(false);
     $nationalityid = new Zend_Form_Element_Select('nationalityid');
     $nationalityid->addMultiOption('', 'Select Nationality');
     $nationalityid->setRegisterInArrayValidator(false);
     $nationalityid->setRequired(true);
     $nationalityid->addValidator('NotEmpty', false, array('messages' => 'Please select nationality.'));
     $dob = new ZendX_JQuery_Form_Element_DatePicker('dob');
     $dob->setOptions(array('class' => 'brdr_none'));
     $dob->setRequired(true);
     $dob->setAttrib('readonly', 'true');
     $dob->setAttrib('onfocus', 'this.blur()');
     $dob->addValidator('NotEmpty', false, array('messages' => 'Please select date of birth.'));
     //DOB should not be current date....
     $celebrated_dob = new ZendX_JQuery_Form_Element_DatePicker('celebrated_dob');
     $celebrated_dob->setOptions(array('class' => 'brdr_none'));
     $celebrated_dob->setAttrib('readonly', 'true');
     $celebrated_dob->setAttrib('onfocus', 'this.blur()');
     $bloodgroup = new Zend_Form_Element_Text('bloodgroup');
     $bloodgroup->setAttrib('size', 5);
     $bloodgroup->setAttrib('maxlength', 10);
     /*$submit = new Zend_Form_Element_Submit('submit');
     		$submit->setAttrib('id', 'submitbutton');
     		$submit->setLabel('Save');*/
     $submitadd = new Zend_Form_Element_Button('submitbutton');
     $submitadd->setAttrib('id', 'submitbuttons');
     $submitadd->setAttrib('onclick', 'validatedocumentonsubmit(this)');
     $submitadd->setLabel('Save');
     $this->addElements(array($id, $userid, $genderid, $maritalstatusid, $nationalityid, $ethniccodeid, $racecodeid, $languageid, $dob, $celebrated_dob, $bloodgroup, $submitadd));
     $this->setElementDecorators(array('ViewHelper'));
     $this->setElementDecorators(array('UiWidgetElement'), array('dob', 'celebrated_dob'));
 }
Esempio n. 23
0
 public function __construct($options = null)
 {
     Zend_Dojo::enableForm($this);
     parent::__construct($options);
     $creditline_id = new Zend_Form_Element_Text('creditline_id');
     $institution_id = new Zend_Form_Element_Text('institution_id');
     $institutionName = new Zend_Form_Element_Select('institutionname');
     $institutionName->setAttrib('class', 'txt_put');
     $institutionName->setAttrib('id', 'institutionname');
     $institutionName->setLabel('institutionname')->setRequired(true);
     $institutionName->addMultiOption('', 'Select...');
     $institutionName->setAttrib('onchange', 'getState(this.value)');
     $institutionNames = new Zend_Form_Element_Text('institutionnames');
     $institutionNames->setAttrib('class', 'txt_put');
     $institutionNames->setAttrib('readonly', 'true');
     $instituteamount = new Zend_Form_Element_Text('instituteamount');
     $instituteamount->setAttrib('class', 'txt_put');
     $instituteamount->setAttrib('readonly', 'true');
     $institutionamount = new Zend_Form_Element_Text('institutionamount');
     $institutionamount->setAttrib('class', 'txt_put');
     $institutionamount->setAttrib('readonly', 'true');
     $maxcreditlinelimit = new Zend_Form_Element_Text('maxcreditlinelimit');
     $maxcreditlinelimit->setAttrib('class', 'txt_put');
     $maxcreditlinelimit->setAttrib('readonly', 'true');
     $creditlinename = new Zend_Form_Element_Text('creditlinename');
     $creditlinename->addValidator(new Zend_Validate_Db_NoRecordExists('ourbank_creditlineinformation', 'creditlinename'));
     $creditlinename->setAttrib('class', 'txt_put');
     $creditlinename->setAttrib('id', 'creditlinename');
     $creditlinename->setLabel('creditlinename')->setRequired(true)->addValidators(array(array('NotEmpty')));
     $creditlineshortname = new Zend_Form_Element_Text('creditline_shortname');
     $creditlineshortname->setAttrib('class', 'txt_put');
     $creditlineshortname->setAttrib('id', 'creditline_shortname');
     $creditlineshortname->setLabel('creditline_shortname')->setRequired(true)->addValidators(array('NotEmpty'));
     $creditlineamount = new Zend_Form_Element_Text('creditlineamount');
     $creditlineamount->setAttrib('class', 'txt_put');
     $creditlineamount->setAttrib('id', 'creditlineamount');
     $creditlineamount->setRequired(true)->addValidators(array(array('NotEmpty'), array('Float')));
     $creditlineinterest = new Zend_Form_Element_Text('creditlineinterest');
     $creditlineinterest->setAttrib('class', 'txt_put');
     $creditlineinterest->setAttrib('id', 'creditlineinterest');
     $creditlineinterest->setRequired(true)->addValidators(array(array('NotEmpty'), array('stringLength', false, array(1, 3)), array('Digits')));
     $creditlinefrom = new ZendX_JQuery_Form_Element_DatePicker('creditline_beginingdate');
     $creditlinefrom->setJQueryParam('dateFormat', 'yy-mm-dd');
     $creditlinefrom->setRequired(true)->addValidators(array(array('Date')));
     $creditlinefrom->setAttrib('class', 'txt_put');
     $creditlinefrom->setAttrib('id', 'creditline_beginingdate');
     $creditlineto = new ZendX_JQuery_Form_Element_DatePicker('creditline_closingdate');
     $creditlineto->setJQueryParam('dateFormat', 'yy-mm-dd');
     $creditlineto->setRequired(true)->addValidators(array(array('Date')));
     $creditlineto->setAttrib('class', 'txt_put');
     $creditlineto->setAttrib('id', 'creditline_closingdate');
     $submit = new Zend_Form_Element_Submit('Submit');
     $submit->setAttrib('class', 'officesubmit');
     $submit->setlabel('Submit');
     $this->addElements(array($creditline_id, $institutionName, $creditlinename, $creditlineshortname, $creditlineamount, $creditlineinterest, $creditlinefrom, $creditlineto, $submit, $institutionamount, $instituteamount, $institutionNames, $institution_id, $maxcreditlinelimit));
 }
Esempio n. 24
0
 public function init()
 {
     $obj = new Application_Model_DbTable_User();
     $primaryKey = $obj->getPrimaryKey();
     $this->setMethod('post');
     $this->setEnctype('multipart/form-data');
     $this->setAttrib('iduser', $primaryKey);
     $this->setAction('/admin/usuarios/edit');
     $e = new Zend_Form_Element_Hidden($primaryKey);
     $this->addElement($e);
     $objType = new Admin_Model_Role();
     $e = new Zend_Form_Element_Select('idrol');
     $e->setMultiOptions($objType->getRoleAll());
     $this->addElement($e);
     $e = new Zend_Form_Element_Text('email');
     $e->setAttrib('class', 'inpt-medium');
     $e->setAttrib('placeholder', 'Correo');
     $this->addElement($e);
     $e = new Zend_Form_Element_Text('login');
     $e->setAttrib('class', 'inpt-medium');
     $e->setAttrib('placeholder', 'usuario');
     $this->addElement($e);
     $e = new Zend_Form_Element_Text('name');
     $e->setAttrib('class', 'inpt-medium');
     $e->setAttrib('placeholder', 'nombre');
     $this->addElement($e);
     $e = new Zend_Form_Element_Text('apepat');
     $e->setAttrib('class', 'inpt-medium');
     $e->setAttrib('placeholder', 'Apellido Paterno');
     $this->addElement($e);
     $e = new Zend_Form_Element_Text('apemat');
     $e->setAttrib('class', 'inpt-medium');
     $e->setAttrib('placeholder', 'Apellido Materno');
     $this->addElement($e);
     $e = new Zend_Form_Element_Submit('Guardar');
     $this->addElement($e);
     $e = new Zend_Form_Element_Checkbox('state');
     $e->setValue(true);
     $this->addElement($e);
     $e = new Zend_Form_Element_Password('confirmone');
     $e->setRequired(false);
     $e->setAttrib('class', 'inpt-medium');
     $e->setAttrib('placeholder', 'Contraseña');
     $this->addElement($e);
     $e = new Zend_Form_Element_Password('confirmtwo');
     $e->setRequired(false);
     $e->setAttrib('class', 'inpt-medium');
     $e->setAttrib('placeholder', 'Repetir Contraseña');
     $this->addElement($e);
     foreach ($this->getElements() as $element) {
         $element->removeDecorator('Label');
         $element->removeDecorator('DtDdWrapper');
         $element->removeDecorator('HtmlTag');
     }
 }
Esempio n. 25
0
 public function __construct($options = null)
 {
     Zend_Dojo::enableForm($this);
     parent::__construct($options);
     $product_id = new Zend_Form_Element_Select('product_id');
     $product_id->addMultiOption('', 'Select...');
     $product_id->setAttrib('class', 'txt_put');
     $product_id->setRequired(true)->addValidators(array(array('NotEmpty')));
     $offerproductname = new Zend_Form_Element_Text('offerproductname');
     $offerproductname->addValidator(new Zend_Validate_Db_NoRecordExists('ourbank_productsofferdetails', 'offerproductname'));
     $offerproductname->setAttrib('class', 'txt_put');
     $offerproductname->setRequired(true)->addValidators(array(array('NotEmpty')));
     $offerproductshortname = new Zend_Form_Element_Text('offerproductshortname');
     $offerproductshortname->setAttrib('class', 'txt_put');
     $offerproductshortname->setRequired(true)->addValidators(array(array('NotEmpty')));
     $offerproduct_description = new Zend_Form_Element_Textarea('offerproduct_description', array('rows' => 3, 'cols' => 20));
     $offerproduct_description->setAttrib('class', '');
     $offerproduct_description->setRequired(true)->addValidators(array(array('NotEmpty')));
     $begindate = new Zend_Form_Element_Text('begindate');
     $begindate->setAttrib('class', 'txt_put');
     $begindate->setRequired(true)->addValidator(new Zend_Validate_Date('YYYY-MM-DD'), true);
     $closedate = new Zend_Form_Element_Text('closedate');
     $closedate->setAttrib('class', 'txt_put');
     $closedate->setRequired(true)->addValidator(new Zend_Validate_Date('YYYY-MM-DD'), true);
     $applicableto = new Zend_Form_Element_Select('applicableto');
     $applicableto->addMultiOption('', 'Select...');
     $applicableto->setAttrib('class', 'txt_put');
     $applicableto->setRequired(true)->addValidators(array(array('NotEmpty')));
     $minmumloanamount = new Zend_Form_Element_Text('minmumloanamount');
     $minmumloanamount->setAttrib('class', 'txt_put');
     $maximunloanamount = new Zend_Form_Element_Text('maximunloanamount');
     $maximunloanamount->setAttrib('class', 'txt_put');
     $minimumfrequency = new Zend_Form_Element_Text('minimumfrequency');
     $minimumfrequency->setAttrib('class', 'txt_put');
     $minimumfrequency->setRequired(true)->addValidators(array(array('NotEmpty')));
     $maximumfrequency = new Zend_Form_Element_Text('maximumfrequency');
     $maximumfrequency->setAttrib('class', 'txt_put');
     $maximumfrequency->setRequired(true)->addValidators(array(array('NotEmpty')));
     $graceperiodnumber = new Zend_Form_Element_Text('graceperiodnumber');
     $graceperiodnumber->setAttrib('class', 'txt_put');
     $graceperiodnumber->setRequired(true)->addValidators(array(array('NotEmpty')));
     $penal_Interest = new Zend_Form_Element_Text('penal_Interest');
     $penal_Interest->setAttrib('class', 'txt_put');
     $period_ofrange_monthfrom = new Zend_Form_Element_Text('period_ofrange_monthfrom');
     $period_ofrange_monthfrom->setAttrib('class', 'txt_put');
     $period_ofrange_monthfrom->setAttrib('size', '5');
     $period_ofrange_monthto = new Zend_Form_Element_Text('period_ofrange_monthto');
     $period_ofrange_monthto->setAttrib('class', 'txt_put');
     $period_ofrange_monthto->setAttrib('size', '5');
     $Interest = new Zend_Form_Element_Text('Interest');
     $Interest->setAttrib('class', 'txt_put');
     $Interest->setAttrib('size', '5');
     $submit = new Zend_Form_Element_Submit('Submit');
     $this->addElements(array($offerproductname, $offerproductshortname, $offerproduct_description, $begindate, $closedate, $penal_Interest, $applicableto, $minmumloanamount, $maximunloanamount, $minimumfrequency, $maximumfrequency, $graceperiodnumber, $fund_id, $product_id, $submit, $period_ofrange_monthfrom, $period_ofrange_monthto, $Interest));
 }
Esempio n. 26
0
 public function init()
 {
     $this->setMethod('post');
     $this->setAttrib('id', 'formid');
     $this->setAttrib('name', 'roles');
     $id = new Zend_Form_Element_Hidden('id');
     $rolename = new Zend_Form_Element_Text('rolename');
     $rolename->setAttrib('maxLength', 50);
     $rolename->setAttrib('title', 'Role name');
     $rolename->addFilter(new Zend_Filter_StringTrim());
     $rolename->setRequired(true);
     $rolename->addValidator('NotEmpty', false, array('messages' => 'Please enter role name.'));
     $rolename->addValidator("regex", true, array('pattern' => '/^[a-zA-Z0-9 ?]+$/', 'messages' => array('regexNotMatch' => 'Please enter valid role name.')));
     $rolename->addValidator(new Zend_Validate_Db_NoRecordExists(array('table' => 'main_roles', 'field' => 'rolename', 'exclude' => 'id!="' . Zend_Controller_Front::getInstance()->getRequest()->getParam('id') . '" and isactive!=0')));
     $rolename->getValidator('Db_NoRecordExists')->setMessage('Role name already exists.');
     $rolename->addValidators(array(array('StringLength', false, array('min' => 3, 'max' => 50, 'messages' => array(Zend_Validate_StringLength::TOO_LONG => 'Role name must contain at most %max% characters.', Zend_Validate_StringLength::TOO_SHORT => 'Role name must contain at least %min% characters.')))));
     $roletype = new Zend_Form_Element_Text('roletype');
     $roletype->setRequired(true);
     $roletype->setAttrib('maxLength', 25);
     $roletype->setAttrib('title', 'Role type');
     $roletype->addFilter(new Zend_Filter_StringTrim());
     $roletype->addValidator('NotEmpty', false, array('messages' => 'Please enter role type.'));
     $roletype->addValidator("regex", true, array('pattern' => '/^[a-zA-Z]+?$/', 'messages' => array('regexNotMatch' => 'Please enter only alphabets.')));
     $roletype->addValidator(new Zend_Validate_Db_NoRecordExists(array('table' => 'main_roles', 'field' => 'roletype', 'exclude' => 'id != "' . Zend_Controller_Front::getInstance()->getRequest()->getParam('id') . '" and isactive != 0')));
     $roletype->getValidator('Db_NoRecordExists')->setMessage('Role type already exists.');
     $roletype->addValidators(array(array('StringLength', false, array('min' => 3, 'max' => 25, 'messages' => array(Zend_Validate_StringLength::TOO_LONG => 'Role type must contain at most %max% characters.', Zend_Validate_StringLength::TOO_SHORT => 'Role type must contain at least %min% characters.')))));
     $roledescription = new Zend_Form_Element_Textarea('roledescription');
     $roledescription->setAttrib('rows', 10);
     $roledescription->setAttrib('cols', 50);
     $roledescription->setAttrib('maxlength', '100');
     $roledescription->setAttrib('title', 'Role description');
     $levelid = new Zend_Form_Element_Hidden('levelid');
     $levelid->addFilter(new Zend_Filter_StringTrim());
     $levelid->setRequired(true);
     $levelid->addValidator('NotEmpty', false, array('messages' => 'Please select level.'));
     $istimeActive = Zend_Controller_Front::getInstance()->getRequest()->getParam('istimeactive');
     $prev_cnt = new Zend_Form_Element_Hidden('prev_cnt');
     $prev_cnt->setRequired(true);
     if ($istimeActive) {
         $prev_cnt->addValidator('NotEmpty', false, array('messages' => 'Please select privileges other than time management.'));
     } else {
         $prev_cnt->addValidator('NotEmpty', false, array('messages' => 'Please select privileges.'));
     }
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton');
     $submit->setLabel('Save');
     $url = "'roles/saveupdate/format/json'";
     $dialogMsg = "''";
     $toggleDivId = "''";
     $jsFunction = "'redirecttocontroller(\\'roles\\');'";
     $submit->setOptions(array('onclick' => "saveDetails({$url},{$dialogMsg},{$toggleDivId},{$jsFunction});"));
     $this->addElements(array($id, $rolename, $roletype, $roledescription, $levelid, $submit, $prev_cnt));
     $this->setElementDecorators(array('ViewHelper'));
 }
Esempio n. 27
0
 public function init()
 {
     $this->setMethod('post');
     $this->setAttrib('id', 'formid');
     $this->setAttrib('name', 'managerleaverequest');
     $id = new Zend_Form_Element_Hidden('id');
     $appliedleavesdaycount = new Zend_Form_Element_Text('appliedleavesdaycount');
     $appliedleavesdaycount->setAttrib('readonly', 'true');
     $appliedleavesdaycount->setAttrib('onfocus', 'this.blur()');
     $employeename = new Zend_Form_Element_Text('employeename');
     $employeename->setAttrib('readonly', 'true');
     $employeename->setAttrib('onfocus', 'this.blur()');
     $managerstatus = new Zend_Form_Element_Select('managerstatus');
     $managerstatus->setRegisterInArrayValidator(false);
     $managerstatus->setMultiOptions(array('1' => 'Approve', '2' => 'Reject'));
     $comments = new Zend_Form_Element_Textarea('comments');
     $comments->setLabel("Comments");
     $comments->setAttrib('rows', 10);
     $comments->setAttrib('cols', 50);
     $comments->setAttrib('maxlength', '200');
     $leavetypeid = new Zend_Form_Element_Select('leavetypeid');
     $leavetypeid->setAttrib('class', 'selectoption');
     $leavetypeid->setRegisterInArrayValidator(false);
     $leavetypeid->setAttrib('readonly', 'true');
     $leavetypeid->setAttrib('onfocus', 'this.blur()');
     $leaveday = new Zend_Form_Element_Select('leaveday');
     $leaveday->setRegisterInArrayValidator(false);
     $leaveday->setMultiOptions(array('1' => 'Full Day', '2' => 'Half Day'));
     $leaveday->setAttrib('readonly', 'true');
     $leaveday->setAttrib('onfocus', 'this.blur()');
     $from_date = new Zend_Form_Element_Text('from_date');
     $from_date->setAttrib('readonly', 'true');
     $from_date->setAttrib('onfocus', 'this.blur()');
     $to_date = new Zend_Form_Element_Text('to_date');
     $to_date->setAttrib('readonly', 'true');
     $to_date->setAttrib('onfocus', 'this.blur()');
     $reason = new Zend_Form_Element_Textarea('reason');
     $reason->setAttrib('rows', 10);
     $reason->setAttrib('cols', 50);
     $reason->setAttrib('maxlength', '400');
     $reason->setAttrib('readonly', 'true');
     $reason->setAttrib('onfocus', 'this.blur()');
     $leavestatus = new Zend_Form_Element_Text('leavestatus');
     $leavestatus->setAttrib('readonly', 'true');
     $leavestatus->setAttrib('onfocus', 'this.blur()');
     $createddate = new Zend_Form_Element_Text('createddate');
     $createddate->setAttrib('readonly', 'true');
     $createddate->setAttrib('onfocus', 'this.blur()');
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton');
     $submit->setLabel('Save');
     $this->addElements(array($id, $employeename, $managerstatus, $comments, $reason, $leaveday, $from_date, $to_date, $leavetypeid, $appliedleavesdaycount, $leavestatus, $createddate, $submit));
     $this->setElementDecorators(array('ViewHelper'));
 }
Esempio n. 28
0
 public function init()
 {
     $this->setMethod('post');
     $this->setAttrib('id', 'formid');
     $this->setAttrib('name', 'emailsettings');
     $id = new Zend_Form_Element_Hidden("id");
     $id_val = Zend_Controller_Front::getInstance()->getRequest()->getParam('id', null);
     $username = new Zend_Form_Element_Text("username");
     $username->setLabel("User name");
     $username->setAttrib("class", "formDataElement");
     // $username->setRequired("true");
     $username->setAttrib('maxlength', '100');
     //$username->addValidator('NotEmpty', false, array('messages' => 'Please enter username.'));
     $tls = new Zend_Form_Element_Text("tls");
     $tls->setLabel("Secure Transport Layer");
     $tls->setAttrib("class", "formDataElement");
     // $tls->setRequired("true");
     $tls->setAttrib('maxlength', '40');
     //  $tls->addValidator('NotEmpty', false, array('messages' => 'Please enter secure transport layer.'));
     $auth = new Zend_Form_Element_Select("auth");
     $auth->setLabel("Authentication Type");
     $auth->setMultiOptions(array('true' => 'True', 'false' => 'False'));
     $auth->setAttrib("class", "formDataElement");
     $auth->setAttrib("onChange", "toggleAuth()");
     $auth->setRequired("true");
     $auth->setAttrib('maxlength', '50');
     $auth->addValidator('NotEmpty', false, array('messages' => 'Please enter authentication type.'));
     $port = new Zend_Form_Element_Text("port");
     $port->setLabel("Port");
     $port->setAttrib("class", "formDataElement");
     $port->setRequired("true");
     $port->setAttrib('maxlength', '50');
     $port->addValidator('NotEmpty', false, array('messages' => 'Please enter port.'));
     $password = new Zend_Form_Element_Text("password");
     $password->setLabel("Password");
     $password->setAttrib("class", "formDataElement");
     // $password->setRequired("true");
     $password->setAttrib('maxlength', '100');
     // $password->addValidator('NotEmpty', false, array('messages' => 'Please enter password.'));
     $server_name = new Zend_Form_Element_Text("server_name");
     $server_name->setLabel("SMTP Server");
     $server_name->setAttrib("class", "formDataElement");
     $server_name->setRequired("true");
     $server_name->setAttrib('maxlength', '100');
     $server_name->addValidator('NotEmpty', false, array('messages' => 'Please enter SMTP Server.'));
     $submit = new Zend_Form_Element_Submit("submit");
     $submit->setLabel("Save");
     $submit->setAttrib('id', 'submitbutton');
     $submit->setAttrib("class", "formSubmitButton");
     $this->addElements(array($id, $submit, $username, $tls, $auth, $port, $password, $server_name));
     $this->setElementDecorators(array('ViewHelper'));
 }
Esempio n. 29
0
 public function __construct($options = null, $memberOfGroups = array(), $modeEdit = false)
 {
     parent::__construct($options);
     // get request
     $request = UsersFormOp::getParams('request');
     $this->setAttrib('accept-charset', 'UTF-8');
     $this->setName('users');
     $this->setAction('/publicms/profile/processuser/format/json');
     $id = new Zend_Form_Element_Hidden('id');
     $module = new Zend_Form_Element_Hidden('module');
     $module->setValue($request->module);
     $controller = new Zend_Form_Element_Hidden('controller');
     $controller->setValue($request->controller);
     $login = new Zend_Form_Element_Text('login');
     $login->setLabel('E-mail');
     $login->addValidator(new Zend_Validate_EmailAddress());
     //$login->setDescription('Must be a valid e-mail address');
     if ($modeEdit) {
         $login->setAttrib('disabled', true);
         $login->setAttrib('readonly', true);
     } else {
         $login->setRequired();
     }
     /**
      * Password field
      * @var void
      */
     $password = new Zend_Form_Element_Password('password');
     $password->setLabel('password');
     $password->addValidator(new Zend_Validate_StringLength(array('min' => 6, 'max' => 12)));
     $password2 = new Zend_Form_Element_Password('password2');
     $password2->setLabel('password2');
     $this->password = $password;
     $this->password2 = $password2;
     if (!$modeEdit) {
         $password->setRequired();
         $password2->setRequired();
     }
     $fileName = new Zend_Form_Element_Text('fname');
     $fileName->setLabel('fname');
     $fileName->setRequired();
     $lastName = new Zend_Form_Element_Text('lname');
     $lastName->setLabel('lname');
     $lastName->setRequired();
     $submit = new Zend_Form_Element_Submit('submit', 'Save user');
     $submit->setAttrib('id', 'submitbuttonuser');
     // Init list of elements
     $elementsList[0] = array($login, $password, $password2);
     $elementsList[1] = array($fileName, $lastName, $submit, $id, $module, $controller);
     $this->addElements($elementsList[0]);
     $this->addElements($elementsList[1]);
 }
Esempio n. 30
0
 public function __construct($app, $value)
 {
     Zend_Dojo::enableForm($this);
     parent::__construct($app);
     parent::__construct($value);
     $memberfirstname = new Zend_Form_Element_Text('memberfirstname');
     $memberfirstname->setAttrib('class', '');
     $memberfirstname->setAttrib('size', '10');
     $memberfirstname->setAttrib('id', 'memberfirstname');
     $memberfirstname->setAttrib($value, 'true');
     $submit = new Zend_Form_Element_Submit('Submit');
     $this->addElements(array($submit, $memberfirstname));
 }