Example #1
0
 public function __construct($options = null)
 {
     parent::__construct($options);
     $resendemail = new Zend_Form_Element_Text('resendemail');
     $resendemail->setLabel($this->getView()->translate('To'))->addFilter('StripTags')->addFilter('StringTrim')->addValidator('EmailAddress');
     $max_amount = isset($options['max_amount']) ? $options['max_amount'] : 50;
     for ($i = 1; $i <= $max_amount; $i++) {
         $varName = 'email' . $i;
         ${$varName} = new Zend_Form_Element_Text('email' . $i);
         ${$varName}->addFilter('StripTags')->addFilter('StringTrim')->addValidator('EmailAddress');
         if ($i == $max_amount) {
             ${$varName}->setAttrib("style", "width:75%");
         }
     }
     $subject = new Zend_Form_Element_Text('subject');
     $subject->setAttribs(array("disabled" => 'disabled'))->addFilter('StringTrim');
     $subject->setAttrib("style", "width:75%");
     $message = new Zend_Form_Element_Textarea('message');
     $message->setAttribs(array('rows' => 5, 'cols' => 100))->addFilter('StripTags')->addFilter('StringTrim')->addValidators(array(array('StringLength', false, array(0, 500))));
     $message->setAttrib("style", "width:75%");
     $sentMailAmount = new Zend_Form_Element_Hidden('sentMailAmount');
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setLabel($this->getView()->translate('INVITATION_MAIL_SEND'));
     $this->addElements(array($resendemail, $sentMailAmount, $subject, $message, $submit));
     for ($i = 1; $i <= $max_amount; $i++) {
         $varName = 'email' . $i;
         $this->addElement(${$varName});
     }
 }
Example #2
0
 public function init()
 {
     // contato_nome
     $contato_nome = new Zend_Form_Element_Text("contato_nome");
     $contato_nome->setLabel("Nome");
     $contato_nome->setRequired();
     $contato_nome->setAttribs(array('class' => 'form-control'));
     $contato_nome->setDecorators(App_Forms_Decorators::$simpleElementDecorators);
     // contato_email
     $contato_email = new Zend_Form_Element_Text("contato_email");
     $contato_email->setLabel("E-mail");
     $contato_email->setRequired();
     $contato_email->setAttribs(array('class' => 'form-control'));
     $contato_email->setDecorators(App_Forms_Decorators::$simpleElementDecorators);
     // contato_assunto
     $contato_assunto = new Zend_Form_Element_Select("contato_assunto");
     $contato_assunto->setLabel("Assunto");
     $contato_assunto->setRequired();
     $contato_assunto->setAttribs(array('class' => 'form-control'));
     $contato_assunto->setDecorators(App_Forms_Decorators::$simpleElementDecorators);
     $contato_assunto->setMultiOptions(array("" => "Selecione o assunto...", "Informação" => "Informação", "Elogio" => "Eologio", "Crítica" => "Crítica", "Sugestão" => "Sugestão", "Outros" => "Outros"));
     // contato_mensagem
     $contato_mensagem = new Zend_Form_Element_Textarea("contato_mensagem");
     $contato_mensagem->setLabel("mensagem");
     $contato_mensagem->setRequired();
     $contato_mensagem->setAttribs(array('class' => 'form-control', 'rows' => 5));
     $contato_mensagem->setDecorators(App_Forms_Decorators::$simpleElementDecorators);
     $this->addElements(array($contato_nome, $contato_email, $contato_assunto, $contato_mensagem));
     parent::init();
 }
Example #3
0
 public function init()
 {
     // profissional_beleza_id
     $profissional_beleza_id = new Zend_Form_Element_Radio("profissional_beleza_id");
     $profissional_beleza_id->setLabel("Selecione o profissional desejado: ");
     $profissional_beleza_id->setRegisterInArrayValidator(false);
     $profissional_beleza_id->setRequired();
     $profissional_beleza_id->setDecorators(App_Forms_Decorators::$checkboxElementDecorators);
     // agenda_data
     $agenda_data = new Zend_Form_Element_Text("agenda_data");
     $agenda_data->setLabel("Selecione a data: ");
     $agenda_data->setAttribs(array('class' => 'form-control', 'autocomplete' => 'off'));
     $agenda_data->setRequired();
     $agenda_data->setDecorators(App_Forms_Decorators::$simpleElementDecorators);
     // agenda_hora
     $agenda_hora = new Zend_Form_Element_Select("agenda_hora");
     $agenda_hora->setLabel('Selecione a hora: ');
     $agenda_hora->setAttribs(array('class' => 'form-control'));
     $agenda_hora->setMultiOptions(array('' => 'Horários'));
     $agenda_hora->setRequired();
     $agenda_hora->setDecorators(App_Forms_Decorators::$simpleElementDecorators);
     $agenda_hora->setRegisterInArrayValidator(false);
     // agenda_observacao
     $agenda_observacao = new Zend_Form_Element_Textarea("agenda_observacao");
     $agenda_observacao->setLabel("Observações: ");
     $agenda_observacao->setAttribs(array('class' => 'form-control', 'rows' => 7, 'placeholder' => 'Informe alguma observação, por exemplo, alguma preferência de produto, etc.'));
     // salao_id
     $salao_id = new Zend_Form_Element_Hidden('salao_id');
     // especialidade_id
     $especialidade_id = new Zend_Form_Element_Hidden("especialidade_id");
     // usuario_id
     $usuario_id = new Zend_Form_Element_Hidden("usuario_id");
     $this->addElements(array($profissional_beleza_id, $agenda_data, $agenda_hora, $agenda_observacao, $salao_id, $especialidade_id, $usuario_id));
     parent::init();
 }
 public function init()
 {
     /**
      * projeto_id
      */
     $modelProjeto = new Model_DbTable_Projeto();
     $projeto_id = new Zend_Form_Element_Select("projeto_id");
     $projeto_id->setLabel("Projeto: ");
     $projeto_id->setAttribs(array('class' => 'form-control'));
     $projeto_id->setMultiOptions($modelProjeto->fetchPairs());
     $this->addElement($projeto_id);
     /**
      * tarefa_nome
      */
     $tarefa_nome = new Zend_Form_Element_Text("tarefa_nome");
     $tarefa_nome->setLabel("Título: ");
     $tarefa_nome->setAttribs(array('class' => 'form-control'));
     $tarefa_nome->setRequired();
     $this->addElement($tarefa_nome);
     /**
      * tarefa_descricao
      */
     $tarefa_descricao = new Zend_Form_Element_Textarea("tarefa_descricao");
     $tarefa_descricao->setLabel("Descrição: ");
     $tarefa_descricao->setAttribs(array('class' => 'form-control', 'rows' => 10));
     $tarefa_descricao->setRequired();
     $this->addElement($tarefa_descricao);
     parent::init();
 }
 public function FrmPicturColor($data = null)
 {
     $color_discription = new Zend_Form_Element_Text('color_discription');
     $color_discription->setAttribs(array('class' => 'form-control'));
     $item_size = new Zend_Form_Element_Text('item_size');
     $item_size->setAttribs(array('class' => 'form-control'));
     $item_weight = new Zend_Form_Element_Text('item_weight');
     $item_weight->setAttribs(array('class' => 'form-control'));
     $item_volume = new Zend_Form_Element_Text('item_volume');
     $item_volume->setAttribs(array('class' => 'form-control'));
     $itme_width = new Zend_Form_Element_Text('itme_width');
     $itme_width->setAttribs(array('class' => 'form-control'));
     $itme_height = new Zend_Form_Element_Text('itme_height');
     $itme_height->setAttribs(array('class' => 'form-control'));
     $itme_length = new Zend_Form_Element_Text('itme_length');
     $itme_length->setAttribs(array('class' => 'form-control'));
     $item_color = new Zend_Form_Element_Text('item_color');
     $item_color->setAttribs(array('class' => 'form-control color-picker-rgba'));
     $font_color = new Zend_Form_Element_Text('font_color');
     $font_color->setAttribs(array('class' => 'form-control', 'id' => "selected-color1"));
     $dual_image = new Zend_Form_Element_Textarea('dual_image');
     $dual_image->setAttribs(array('class' => 'form-control'));
     $this->addElements(array($color_discription, $item_size, $item_weight, $item_volume, $itme_width, $itme_height, $itme_length, $item_color, $dual_image));
     return $this;
 }
 public function __construct($options = null)
 {
     parent::__construct($options);
     $emailCategoryOptionList = array('Invite non-sparks to join campaign' => $this->getView()->translate('Admin_Non-Sparks_Invitation'), 'Invite sparks to join campaign' => $this->getView()->translate('Admin_Sparks_Invitation'), 'Send mail to sparks' => $this->getView()->translate('Admin_Send_Mail_To_Sparks'));
     $emailCategory = new Zend_Form_Element_Select('emailCategory');
     $emailCategory->setMultiOptions($emailCategoryOptionList);
     $emailList = new Zend_Form_Element_Textarea('emailList');
     $emailList->setAttribs(array('rows' => 5, 'cols' => 150, 'onChange' => 'datetable()'))->addFilter('StripTags')->addFilter('StringTrim')->addValidators(array(array('StringLength', false, array(0, 65535))));
     $subject = new Zend_Form_Element_Text('subject');
     $subject->setAttribs(array('size' => 150))->addFilter('StringTrim');
     $message = new Zend_Form_Element_Textarea('message');
     $message->setAttribs(array('rows' => 30, 'cols' => 150))->addFilter('StripTags')->addFilter('StringTrim')->addValidators(array(array('StringLength', false, array(0, 65535))));
     $optionList = array();
     $campaign = new Campaign();
     $campaigns = $campaign->fetchAll(null, "id desc", null, null);
     foreach ($campaigns as $campaign) {
         $optionList[$campaign->id] = $campaign->name;
     }
     $optionList['0'] = $this->getView()->translate('ADMIN_NOT_AUTO_INVITATION');
     $campaignId = new Zend_Form_Element_Select('campaignId');
     $campaignId->setMultiOptions($optionList);
     $code_source = new Zend_Form_Element_Text('code_source');
     $code_source->addFilter('StringTrim');
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setLabel($this->getView()->translate('INVITATION_MAIL_SEND'));
     $this->addElements(array($emailCategory, $emailList, $subject, $message, $campaignId, $code_source, $submit));
 }
Example #7
0
 public function FrmProCate($frm = null)
 {
     $vendor_name = new Zend_Form_Element_Text("vendor_name");
     $vendor_name->setAttribs(array('class' => 'validate[required]', 'placeholder' => 'ឈ្មោះអ្នផ្ឌត់ផ្ឌង់'));
     $phone = new Zend_Form_Element_Text("phone");
     $phone->setAttribs(array('class' => 'validate[required]', 'placeholder' => ''));
     $contact = new Zend_Form_Element_Text("contact");
     $contact->setAttribs(array('class' => 'validate[required]', 'placeholder' => ''));
     $email = new Zend_Form_Element_Text("email");
     $email->setAttribs(array('class' => 'validate[required]', 'placeholder' => ''));
     $address = new Zend_Form_Element_Textarea("address");
     $address->setAttribs(array('class' => '', 'placeholder' => ''));
     $status = new Zend_Form_Element_Select('status');
     $_arr_status = array(1 => $this->tr->translate("ACTIVE"), 0 => $this->tr->translate("DACTIVE"));
     $status->setMultiOptions($_arr_status);
     $status->setAttribs(array('class' => 'form-control validate[required]'));
     $this->addElements(array($vendor_name, $phone, $contact, $email, $address, $status));
     if ($frm != "") {
         $vendor_name->setValue($frm["v_name"]);
         $phone->setValue($frm["phone"]);
         $contact->setValue($frm["contact_name"]);
         $email->setValue($frm["email"]);
         $address->setValue($frm["vendor_remark"]);
         $status->setValue($frm["is_active"]);
     }
     return $this;
 }
Example #8
0
 public function init()
 {
     $tr = Zend_Registry::get('tr');
     $http_code = new Zend_Form_Element_Text('http_code');
     $http_code->setLabel($tr->_('HTTP_CODE'));
     $http_code->setRequired(false);
     $this->addElement($http_code);
     $name = new Zend_Form_Element_Text('name');
     $name->setLabel($tr->_('NAME'));
     $name->setRequired(true);
     $this->addElement($name);
     $msg = new Zend_Form_Element_Textarea('message');
     $msg->setLabel($tr->_('ERROR_MESSAGE'));
     $msg->setAttribs(array('rows' => 10, 'cols' => 35));
     $msg->setRequired(true);
     $this->addElement($msg);
     /** Maybe next version will have it back.
         $action = new Default_Model_Action;
         $all    = $action->getList();
         $actions = new Zend_Form_Element_Multiselect('actions');
         $actions->setLabel('Associated Actions with this Error');
         $actions->setMultiOptions($all);
         $actions->setAttrib('size', 8);
         $this->addElement($actions);
         */
     $desc = new Zend_Form_Element_Textarea('description');
     $desc->cols = 35;
     $desc->rows = 15;
     $desc->setLabel($tr->_('DESCRIPTION'));
     $desc->setRequired(false);
     $this->addElement($desc);
     $this->addElement(new Zend_Form_Element_Submit($tr->_('SUBMIT')));
     parent::init();
 }
Example #9
0
 public function init()
 {
     $http_code = new Zend_Form_Element_Text('http_code');
     $http_code->setLabel('HTTP Code');
     $http_code->setRequired(false);
     $this->addElement($http_code);
     $name = new Zend_Form_Element_Text('name');
     $name->setLabel('Name');
     $name->setRequired(true);
     $this->addElement($name);
     $msg = new Zend_Form_Element_Textarea('message');
     $msg->setLabel('Error Message');
     $msg->setAttribs(array('rows' => 10, 'cols' => 40));
     $msg->setRequired(true);
     $this->addElement($msg);
     /** Maybe next version will have it back.
         $action = new Default_Model_Action;
         $all    = $action->getList();
         $actions = new Zend_Form_Element_Multiselect('actions');
         $actions->setLabel('Associated Actions with this Error');
         $actions->setMultiOptions($all);
         $actions->setAttrib('size', 8);
         $this->addElement($actions);
         */
     $desc = new Zend_Form_Element_Textarea('description');
     $desc->cols = 40;
     $desc->rows = 15;
     $desc->setLabel('Description');
     $desc->setRequired(false);
     $this->addElement($desc);
     $this->addElement(new Zend_Form_Element_Submit('submit'));
     parent::init();
 }
 public function Frm_table_type($data = null)
 {
     $menu_code = new Zend_Form_Element_Text('type_code');
     $menu_code->setAttribs(array('class' => 'form-control', 'required' => true));
     $description = new Zend_Form_Element_Text('description');
     $description->setAttribs(array('class' => 'form-control'));
     $lang_1 = new Zend_Form_Element_Text('lang_1');
     $lang_1->setAttribs(array('class' => 'form-control'));
     $lang_2 = new Zend_Form_Element_Text('lang_2');
     $lang_2->setAttribs(array('checked' => 'checked', 'class' => 'form-control'));
     $lang_3 = new Zend_Form_Element_Text('lang_3');
     $lang_3->setAttribs(array('checked' => 'checked', 'class' => 'form-control'));
     if ($data != null) {
         // 			print_r($data);
     }
     $show_description = new Zend_Form_Element_Select('show_description');
     $show_description->setAttribs(array('class' => 'form-control'));
     $description_opt = array("" => $this->tr->translate("SELECT_DESCRIPTION"));
     $show_description->setMultiOptions($description_opt);
     $photo = new Zend_Form_Element_File('photo');
     $background = new Zend_Form_Element_Text('background');
     $background->setAttribs(array('class' => 'form-control color-picker-rgba'));
     $font_color = new Zend_Form_Element_Text('font_color');
     $font_color->setAttribs(array('class' => 'form-control', 'id' => "selected-color1"));
     $font_size = new Zend_Form_Element_Text('demo3');
     $font_size->setAttribs(array('class' => 'form-control', 'id' => "demo3", 'value' => 12, 'placeholder' => '12'));
     $apply = new Zend_Form_Element_Select('apply');
     $apply->setAttribs(array('class' => 'form-control'));
     $apply_opt = array("" => $this->tr->translate("SELECT_APPLY_TO_COMPANY"));
     $apply->setMultiOptions($apply_opt);
     $combo = new Zend_Form_Element_Checkbox('combo');
     $combo->setAttribs(array('class' => 'red'));
     $active = new Zend_Form_Element_Checkbox('active');
     $active->setAttribs(array('class' => 'red'));
     $format = new Zend_Form_Element_Text('demo4');
     $format->setAttribs(array('class' => 'form-control', 'id' => "demo4", 'value' => 12, 'placeholder' => '12'));
     $setting = new Zend_Form_Element_Select('setting');
     $setting->setAttribs(array('class' => 'form-control'));
     $setting_opt = array("" => $this->tr->translate("SELECT_SETTING"));
     $setting->setMultiOptions($setting_opt);
     $arrange = new Zend_Form_Element_Text('arrange');
     $arrange->setAttribs(array('class' => 'form-control'));
     $resize = new Zend_Form_Element_Text('resize');
     $resize->setAttribs(array('class' => 'form-control', 'id' => "resize", 'value' => 12, 'placeholder' => '12'));
     $note = new Zend_Form_Element_Textarea('note');
     $note->setAttribs(array('class' => 'form-control', 'style' => "margin-top: 0px; margin-bottom: 0px; height: 100px;"));
     $id = new Zend_Form_Element_Hidden('id');
     if ($data != null) {
         $id->setValue($data['id']);
         $menu_code->setValue($data['code']);
         $description->setValue($data['description']);
         $lang_1->setValue($data['lang1']);
         $lang_2->setValue($data['lang2']);
         $note->setValue($data['note']);
     }
     $this->addElements(array($id, $apply, $active, $combo, $menu_code, $description, $lang_1, $lang_2, $lang_3, $show_description, $background, $font_color, $font_size, $format, $setting, $arrange, $resize, $note));
     return $this;
 }
 public function frm_table_time_charge($data = null)
 {
     $menu_code = new Zend_Form_Element_Text('menu_code');
     $menu_code->setAttribs(array('class' => 'form-control'));
     $description = new Zend_Form_Element_Text('description');
     $description->setAttribs(array('class' => 'form-control', 'required' => true));
     $amount_to_charge = new Zend_Form_Element_Text('amount_to_charge');
     $amount_to_charge->setAttribs(array('class' => 'form-control'));
     $free_amt = new Zend_Form_Element_Text('free_amt');
     $free_amt->setAttribs(array('class' => 'form-control'));
     $child = new Zend_Form_Element_Text('child');
     $child->setAttribs(array('checked' => 'checked', 'class' => 'form-control'));
     $show_description = new Zend_Form_Element_Text('show_description');
     $show_description->setAttribs(array('class' => 'form-control'));
     $photo = new Zend_Form_Element_File('photo');
     $background = new Zend_Form_Element_Text('background');
     $background->setAttribs(array('class' => 'form-control color-picker-rgba'));
     $font_color = new Zend_Form_Element_Text('font_color');
     $font_color->setAttribs(array('class' => 'form-control', 'id' => "selected-color1"));
     $interval_time = new Zend_Form_Element_Text('interval_time');
     $interval_time->setAttribs(array('class' => 'form-control'));
     $apply = new Zend_Form_Element_Select('apply');
     $apply->setAttribs(array('class' => 'form-control'));
     $apply_opt = array("" => $this->tr->translate("SELECT_APPLY_TO_COMPANY"));
     $apply->setMultiOptions($apply_opt);
     $combo = new Zend_Form_Element_Checkbox('combo');
     $combo->setAttribs(array('class' => 'red'));
     $active = new Zend_Form_Element_Checkbox('active');
     $active->setAttribs(array('class' => 'form-control'));
     $execute_number = new Zend_Form_Element_Text('execute_number');
     $execute_number->setAttribs(array('class' => 'form-control'));
     $setting = new Zend_Form_Element_Select('setting');
     $setting->setAttribs(array('class' => 'form-control'));
     $setting_opt = array("" => $this->tr->translate("SELECT_SETTING"));
     $setting->setMultiOptions($setting_opt);
     $arrange = new Zend_Form_Element_Text('arrange');
     $arrange->setAttribs(array('class' => 'form-control'));
     $resize = new Zend_Form_Element_Text('resize');
     $resize->setAttribs(array('class' => 'form-control', 'id' => "resize", 'value' => 12, 'placeholder' => '12'));
     $note = new Zend_Form_Element_Textarea('note');
     $note->setAttribs(array('class' => 'form-control', 'style' => "margin-top: 0px; margin-bottom: 0px; height: 100px;"));
     $id = new Zend_Form_Element_Hidden('id');
     if ($data != null) {
         // 			print_r($data);
         $id->setValue($data['id']);
         $description->setValue($data['description']);
         $interval_time->setValue($data['time_interval']);
         $execute_number->setValue($data['execute_amount']);
         $amount_to_charge->setValue($data['fee_charge']);
         $free_amt->setValue($data['free_amount']);
         $child->setValue($data['chil_per']);
         $active->setValue($data['nul_mul']);
     }
     $this->addElements(array($id, $apply, $active, $combo, $menu_code, $description, $amount_to_charge, $free_amt, $child, $show_description, $background, $font_color, $interval_time, $execute_number, $setting, $arrange, $resize, $note));
     return $this;
 }
Example #12
0
 public function __construct($options = null)
 {
     $subject = new Zend_Form_Element_Text('subject');
     $subject->setAttribs(array('size' => 50))->addFilter('StringTrim');
     $message = new Zend_Form_Element_Textarea('message');
     $message->setAttribs(array('rows' => 3, 'cols' => 50))->addFilter('StripTags')->addFilter('StringTrim')->addValidators(array(array('StringLength', false, array(0, 140))));
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setLabel($this->getView()->translate('Save'));
     $this->addElements(array($subject, $message, $submit));
 }
 public function FrmMenu($data = null)
 {
     //$db = new menu_Model_DbTable_DbMenuGroup();
     $menu_code = new Zend_Form_Element_Text('menu_code');
     $menu_code->setAttribs(array('class' => 'form-control', "data-required" => "1", 'aria-describedby' => 'name-error name-error', 'aria-invalid' => 'true'));
     $description = new Zend_Form_Element_Text('description');
     $description->setAttribs(array('class' => 'form-control', "data-required" => "1"));
     $lang_1 = new Zend_Form_Element_Text('lang_1');
     $lang_1->setAttribs(array('class' => 'form-control', "data-required" => "1"));
     $lang_2 = new Zend_Form_Element_Text('lang_2');
     $lang_2->setAttribs(array('checked' => 'checked', 'class' => 'form-control'));
     if ($data != null) {
         // 			print_r($data);
     }
     $show_description = new Zend_Form_Element_Select('show_description');
     $show_description->setAttribs(array('class' => 'form-control'));
     $description_opt = array(0 => $this->tr->translate("SELECT_DESCRIPTION"), 1 => $this->tr->translate("CODE"), 2 => $this->tr->translate("DESCRIPTION"), 3 => $this->tr->translate("LANG_ONE"), 4 => $this->tr->translate("LANG_TWO"));
     $show_description->setMultiOptions($description_opt);
     $photo = new Zend_Form_Element_File('photo');
     $background = new Zend_Form_Element_Text('background');
     $background->setAttribs(array('class' => 'form-control color-picker-rgba'));
     $font_color = new Zend_Form_Element_Text('font_color');
     $font_color->setAttribs(array('class' => 'form-control', 'id' => "selected-color1"));
     $font_size = new Zend_Form_Element_Text('demo3');
     $font_size->setAttribs(array('class' => 'form-control', 'id' => "demo3", 'value' => 12, 'placeholder' => '12'));
     $apply = new Zend_Form_Element_Select('apply');
     $apply->setAttribs(array('class' => 'form-control'));
     $apply_opt = array("" => $this->tr->translate("SELECT_APPLY_TO_COMPANY"));
     $apply->setMultiOptions($apply_opt);
     $combo = new Zend_Form_Element_Checkbox('combo');
     $combo->setAttribs(array('class' => 'red'));
     $active = new Zend_Form_Element_Checkbox('active');
     $active->setAttribs(array('class' => 'red'));
     $format = new Zend_Form_Element_Text('demo4');
     $format->setAttribs(array('class' => 'form-control', 'id' => "demo4", 'value' => 12, 'placeholder' => '12'));
     $setting = new Zend_Form_Element_Select('setting');
     $setting->setAttribs(array('class' => 'form-control'));
     $setting_opt = array("" => $this->tr->translate("SELECT_SETTING"));
     $setting->setMultiOptions($setting_opt);
     $arrange = new Zend_Form_Element_Text('arrange');
     $arrange->setAttribs(array('class' => 'form-control'));
     $resize = new Zend_Form_Element_Text('resize');
     $resize->setAttribs(array('class' => 'form-control', 'id' => "resize", 'value' => 12, 'placeholder' => '12'));
     $note = new Zend_Form_Element_Textarea('note');
     $note->setAttribs(array('class' => 'form-control', 'style' => "margin-top: 0px; margin-bottom: 0px; height: 100px;"));
     $this->addElements(array($apply, $active, $combo, $menu_code, $description, $lang_1, $lang_2, $show_description, $background, $font_color, $font_size, $format, $setting, $arrange, $resize, $note));
     if ($data != "") {
         $menu_code->setValue($data['menu_group_code']);
         $description->setValue($data['menu_group']);
         $lang_1->setValue($data['menu_group2']);
         $lang_2->setValue($data['menu_group3']);
         $show_description->setValue($data['show_group']);
     }
     return $this;
 }
 public function init()
 {
     // agenda_cancelado_motivo
     $agenda_cancelado_motivo = new Zend_Form_Element_Textarea("agenda_cancelado_motivo");
     $agenda_cancelado_motivo->setLabel("Motivo cancelamento: ");
     $agenda_cancelado_motivo->setRequired();
     $agenda_cancelado_motivo->setDecorators(App_Forms_Decorators::$simpleElementDecorators);
     $agenda_cancelado_motivo->setAttribs(array('class' => 'form-control', 'placeholder' => 'Informe o motivo do cancelamento', 'rows' => 10));
     $this->addElements(array($agenda_cancelado_motivo));
     parent::init();
 }
Example #15
0
 public function init()
 {
     $this->name = new Zend_Form_Element_Text('name');
     $this->new_password = new Zend_Form_Element_Password('new_password');
     $this->confirm_password = new Zend_Form_Element_Password('confirm_password');
     $this->email = new Zend_Form_Element_Text('email');
     $this->biography = new Zend_Form_Element_Textarea('biography');
     $this->submit = new Zend_Form_Element_Submit('submit');
     $email_validator = new Zend_Validate_EmailAddress();
     $email_validator->setDeepMxCheck(false);
     $email_validator->setDomainCheck(false);
     $email_validator->setMessages(array(Zend_Validate_EmailAddress::INVALID_FORMAT => "Format Email Salah"));
     $confirm_password_validator = new Zend_Validate_Identical();
     $confirm_password_validator->setMessage("Kata sandi tidak cocok.");
     $this->biography->setAttribs(array('style' => 'width:100%;height:240px'));
     $this->name->setAttribs(array('class' => 'span6', 'placeholder' => 'Nama lengkap anda'));
     $this->email->addValidator($email_validator)->setAttribs(array('class' => 'span4', 'placeholder' => '*****@*****.**'));
     $this->submit->setAttribs(array('class' => 'btn btn-success'))->setLabel('Simpan');
     $this->confirm_password->addValidator($confirm_password_validator);
     $this->addElements(array($this->name, $this->new_password, $this->confirm_password, $this->email, $this->biography, $this->submit));
     $this->setElementDecorators(array('ViewHelper', 'Errors'));
 }
Example #16
0
 public function FrmCurrency($data = null)
 {
     $currency_code = new Zend_Form_Element_Text('currency_code');
     $currency_code->setAttribs(array('class' => 'form-control', 'required' => true));
     $currency_text = new Zend_Form_Element_Text('currency_text');
     $currency_text->setAttribs(array('class' => 'form-control'));
     $currency_sy = new Zend_Form_Element_Text('currency_sy');
     $currency_sy->setAttribs(array('class' => 'form-control'));
     $decimal = new Zend_Form_Element_Text('decimal ');
     $decimal->setAttribs(array('class' => 'form-control'));
     $exchange = new Zend_Form_Element_Text('exchange');
     $exchange->setAttribs(array('class' => 'form-control'));
     $combo = new Zend_Form_Element_Checkbox('combo');
     $combo->setAttribs(array('class' => 'red'));
     $active = new Zend_Form_Element_Checkbox('active');
     $active->setAttribs(array('class' => 'yellow'));
     $photo = new Zend_Form_Element_File('photo');
     $background = new Zend_Form_Element_Text('background');
     $background->setAttribs(array('class' => 'form-control color-picker-rgba'));
     $phone_2 = new Zend_Form_Element_Text('$phone_2');
     $phone_2->setAttribs(array('class' => 'form-control'));
     $radio1 = new Zend_Form_Element_Checkbox('radio1');
     $radio1->setAttribs(array());
     $base = new Zend_Form_Element_Checkbox('base');
     $base->setAttribs(array('class' => 'red'));
     $format = new Zend_Form_Element_Text('demo4');
     $format->setAttribs(array('class' => 'form-control', 'id' => "demo4", 'value' => 12, 'placeholder' => '12'));
     $setting = new Zend_Form_Element_Select('setting');
     $setting->setAttribs(array('class' => 'form-control'));
     $setting_opt = array("" => $this->tr->translate("SELECT_SETTING"));
     $setting->setMultiOptions($setting_opt);
     $arrange = new Zend_Form_Element_Text('arrange');
     $arrange->setAttribs(array('class' => 'form-control'));
     $resize = new Zend_Form_Element_Text('resize');
     $resize->setAttribs(array('class' => 'form-control', 'id' => "resize", 'value' => 12, 'placeholder' => '12'));
     $note = new Zend_Form_Element_Textarea('note');
     $note->setAttribs(array('class' => 'form-control', 'style' => "margin-top: 0px; margin-bottom: 0px; height: 100px;"));
     $id = new Zend_Form_Element_Hidden('id');
     if ($data != null) {
         $id->setValue($data['id']);
         $currency_code->setValue($data['curr_code']);
         $currency_text->setValue($data['curr_title']);
         $currency_sy->setValue($data['symbol']);
         $decimal->setValue($data['decimal_place']);
         $exchange->setValue($data['exchange_rate']);
     }
     $this->addElements(array($id, $radio1, $currency_code, $currency_text, $currency_sy, $decimal, $exchange, $base, $format, $setting, $arrange, $resize, $note));
     return $this;
 }
Example #17
0
 function init()
 {
     $this->setMethod('post');
     $this->addAttribs(array('id' => 'comments_form', 'class' => ''));
     $description = new Zend_Form_Element_Textarea('description');
     $description->setLabel('Comment text');
     $description->setAttribs(array('class' => 'mess_textarea validate[required]', 'placeholder' => trim(Zend_Registry::get('translate')->_('Comment text')), 'data-prompt-position' => 'topLeft:6'));
     $description->setRequired(true);
     $this->addElement($description);
     $button = new Zend_Form_Element_Submit('button');
     $button->setValue(trim(Zend_Registry::get('translate')->_('Send Comment')));
     $button->setAttribs(array('class' => 'comments_submit'));
     $button->setIgnore(true);
     $this->addElement($button);
 }
Example #18
0
 /** create edit folder form */
 public function createEditForm()
 {
     $form = new Zend_Form();
     $form->setAction($this->webroot . '/folder/edit')->setMethod('post');
     $name = new Zend_Form_Element_Text('name');
     $name->setAttribs(array('placeholder' => $this->t('Name of the folder'), 'autofocus' => 'autofocus', 'required' => 'required'))->setRequired(true)->addValidator('NotEmpty', true);
     $description = new Zend_Form_Element_Textarea('description');
     $description->setAttribs(array('placeholder' => $this->t('Optional')));
     $teaser = new Zend_Form_Element_Text('teaser');
     $teaser->setAttribs(array('placeholder' => $this->t('Optional')));
     $teaser->setAttrib('MAXLENGTH', '250');
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setLabel($this->t('Save'));
     $form->addElements(array($name, $description, $submit, $teaser));
     return $form;
 }
Example #19
0
 public function showSaleAgentForm($data = null, $stockID = null)
 {
     $db = new Application_Model_DbTable_DbGlobal();
     $nameElement = new Zend_Form_Element_Text('name');
     $nameElement->setAttribs(array('class' => 'validate[required]', 'placeholder' => 'Enter Agent Name'));
     $this->addElement($nameElement);
     $phoneElement = new Zend_Form_Element_Text('phone');
     $phoneElement->setAttribs(array('class' => 'validate[required]', 'placeholder' => 'Enter Phone Number'));
     $this->addElement($phoneElement);
     $emailElement = new Zend_Form_Element_Text('email');
     $emailElement->setAttribs(array('class' => 'validate[custom[email]]', 'placeholder' => 'Enter Email Address'));
     $this->addElement($emailElement);
     $addressElement = new Zend_Form_Element_Text('address');
     $addressElement->setAttribs(array('placeholder' => 'Enter Current Address'));
     $this->addElement($addressElement);
     $jobTitleElement = new Zend_Form_Element_Text('job_title');
     $jobTitleElement->setAttribs(array('placeholder' => 'Enter Position'));
     $this->addElement($jobTitleElement);
     $descriptionElement = new Zend_Form_Element_Textarea('description');
     $descriptionElement->setAttribs(array('placeholder' => 'Descrtion Here...'));
     $this->addElement($descriptionElement);
     $rowsStock = $db->getGlobalDb('SELECT LocationId,Name FROM tb_sublocation WHERE Name!=""  ORDER BY LocationId DESC ');
     $optionsStock = array('1' => 'Default Location', '-1' => 'Add New Location');
     if (count($rowsStock) > 0) {
         foreach ($rowsStock as $readStock) {
             $optionsStock[$readStock['LocationId']] = $readStock['Name'];
         }
     }
     $mainStockElement = new Zend_Form_Element_Select('main_stock_id');
     $mainStockElement->setAttribs(array('OnChange' => 'AddLocation()', 'class' => 'demo-code-language'));
     $mainStockElement->setMultiOptions($optionsStock);
     $this->addElement($mainStockElement);
     //set value when edit
     if ($data != null) {
         $idElement = new Zend_Form_Element_Hidden('id');
         $this->addElement($idElement);
         $idElement->setValue($data['agent_id']);
         $nameElement->setValue($data['name']);
         $phoneElement->setValue($data['phone']);
         $emailElement->setValue($data['email']);
         $addressElement->setValue($data['address']);
         $jobTitleElement->setValue($data['job_title']);
         $mainStockElement->setValue($data["stock_id"]);
         $descriptionElement->setValue($data['description']);
     }
     return $this;
 }
Example #20
0
 function init()
 {
     $this->setMethod('post');
     $this->addAttribs(array('id' => 'file-manager', 'class' => ''));
     $action = new Zend_Form_Element_Hidden('action');
     $action->setValue('add');
     $this->addElement($action);
     $description = new Zend_Form_Element_Textarea('description');
     $description->setLabel('Description');
     $description->setAttribs(array('class' => 'mess_textarea validate[required]', 'placeholder' => 'Description', 'style' => 'width:272px'));
     $this->addElement($description);
     $button = new Zend_Form_Element_Submit('rightSubmit');
     $button->setValue('UPLOAD FILE');
     $button->setAttribs(array('class' => 'comments_submit'));
     $button->setIgnore(true);
     $this->addElement($button);
 }
Example #21
0
 function init()
 {
     $this->setMethod('post');
     $this->addAttribs(array('id' => 'share-file', 'class' => ''));
     $action = new Zend_Form_Element_Hidden('action');
     $action->setValue('sharefile');
     $this->addElement($action);
     $idFile = new Zend_Form_Element_Hidden('idFile');
     $idFile->setValue(Zend_Controller_Front::getInstance()->getRequest()->getParam('id'));
     $this->addElement($idFile);
     //BEGIN:Users
     $idUserTo = new Zend_Form_Element_Select('idUserTo');
     $idUserTo->setLabel('To: ');
     $options = array('' => 'Select user');
     $shops = new Default_Model_Users();
     $select = $shops->getMapper()->getDbTable()->select()->where('id != ?', Zend_Registry::get('user')->getId())->where('NOT deleted')->order('name DESC');
     $result = $shops->fetchAll($select);
     if (NULL != $result) {
         foreach ($result as $value) {
             $options[$value->getId()] = $value->getName();
         }
     }
     $idUserTo->addMultiOptions($options);
     $idUserTo->addValidator(new Zend_Validate_InArray(array_keys($options)));
     $idUserTo->setAttribs(array('class' => 'validate[required] form_selector_fm', 'id' => 'idUserTo'));
     $idUserTo->setRequired(true);
     $this->addElement($idUserTo);
     //END:Users
     $subject = new Zend_Form_Element_Text('subject');
     $subject->setLabel('Subject');
     $subject->setAttribs(array('class' => 'form_subject w_424 validate[required]', 'placeholder' => 'Subject'));
     $subject->setRequired(true);
     $this->addElement($subject);
     $message = new Zend_Form_Element_Textarea('message');
     $message->setLabel('Observations');
     $message->setAttribs(array('class' => 'form_textarea w_424 h_97 validate[required]', 'placeholder' => 'Observations', 'style' => 'width:290px'));
     $message->setRequired(true);
     $this->addElement($message);
     $button = new Zend_Form_Element_Submit('rightSubmit');
     $button->setValue('SEND');
     $button->setAttribs(array('class' => 'comments_submit'));
     $button->setIgnore(true);
     $this->addElement($button);
 }
Example #22
0
 public function init()
 {
     // faq_modulo
     $faqModulo = new Zend_Form_Element_Text("faq_modulo");
     $faqModulo->setLabel("Módulo");
     $faqModulo->setRequired();
     $faqModulo->setAttribs(array('class' => 'form-control'));
     // faq_pergunta
     $faqPergunta = new Zend_Form_Element_Text("faq_pergunta");
     $faqPergunta->setLabel("Pergunta");
     $faqPergunta->setRequired();
     $faqPergunta->setAttribs(array('class' => 'form-control'));
     // faq_resposta
     $faqResposta = new Zend_Form_Element_Textarea("faq_resposta");
     $faqResposta->setLabel("Resposta");
     $faqResposta->setRequired();
     $faqResposta->setAttribs(array('class' => 'form-control', 'rows' => 10));
     $this->addElements(array($faqModulo, $faqPergunta, $faqResposta));
     parent::init();
 }
 public function orderSubstockForm($data = null)
 {
     $db = new Application_Model_DbTable_DbGlobal();
     $nameElement = new Zend_Form_Element_Text('Stock Name');
     $nameElement->setAttribs(array('class' => 'validate[required]', 'placeholder' => 'Enter Stock Name'));
     $this->addElement($nameElement);
     $contactElement = new Zend_Form_Element_Text('Contact Name');
     $contactElement->setAttribs(array('placeholder' => 'Enter Contact Name'));
     $this->addElement($contactElement);
     $phoneElement = new Zend_Form_Element_Text('Contact Number');
     $phoneElement->setAttribs(array('placeholder' => 'Enter Phone Number'));
     $this->addElement($phoneElement);
     $locationElement = new Zend_Form_Element_Textarea('Stock Location');
     $locationElement->setAttribs(array('placeholder' => 'Enter Stock Location'));
     $this->addElement($locationElement);
     $descriptionElement = new Zend_Form_Element_Textarea('description');
     $descriptionElement->setAttribs(array('placeholder' => 'Description Here...'));
     $this->addElement($descriptionElement);
     $optionsStatus = array(1 => "Active", 2 => 'Deactive');
     $statusElement = new Zend_Form_Element_Select('status');
     $statusElement->setMultiOptions($optionsStatus);
     $statusElement->setValue($data["status"]);
     $statusElement->setAttribs(array('class' => 'demo-code-language'));
     $this->addElement($statusElement);
     //set value when edit
     if ($data != null) {
         $idElement = new Zend_Form_Element_Hidden('id');
         $this->addElement($idElement);
         $idElement->setValue($data['LocationId']);
         $nameElement->setValue($data['Name']);
         $contactElement->setValue($data['contact']);
         $phoneElement->setValue($data['phone']);
         $locationElement->setValue($data['stock_add']);
         $descriptionElement->setValue($data['remark']);
     }
     return $this;
 }
Example #24
0
 function init()
 {
     $this->setMethod('post');
     $this->addAttribs(array('id' => 'formTemplateAdd', 'class' => ''));
     $formNumber = new Zend_Form_Element_Hidden('formNumber');
     $this->addElement($formNumber);
     $const = new Zend_Form_Element_Hidden('const');
     $this->addElement($const);
     $subject = new Zend_Form_Element_Text('subject');
     $subject->setLabel(Zend_Registry::get('translate')->_('admin_email_templates_subject'));
     $subject->setAttribs(array('class' => 'text large validate[required]'));
     $subject->setRequired(true);
     $this->addElement($subject);
     $content = new Zend_Form_Element_Textarea('content');
     $content->setLabel(Zend_Registry::get('translate')->_('admin_email_templates_content'));
     $content->setAttribs(array('class' => 'text large validate[required]'));
     $content->setRequired(true);
     $this->addElement($content);
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setValue('');
     $submit->setAttribs(array('class' => 'submit'));
     $submit->setIgnore(true);
     $this->addElement($submit);
 }
 public function init()
 {
     // categoria_id
     $categoria_id = new Zend_Form_Element_Select("categoria_id");
     $categoria_id->setLabel("Categoria: ");
     $categoria_id->setRequired();
     $categoria_id->setDecorators(App_Forms_Decorators::$simpleElementDecorators);
     $categoria_id->setAttribs(array('class' => 'form-control'));
     $categoria_id->setMultiOptions($this->getCategorias());
     // especialidade_nome
     $especialidade_nome = new Zend_Form_Element_Text("especialidade_nome");
     $especialidade_nome->setLabel("Nome Especialidade: ");
     $especialidade_nome->setRequired();
     $especialidade_nome->setDecorators(App_Forms_Decorators::$simpleElementDecorators);
     $especialidade_nome->setAttribs(array('class' => 'form-control'));
     // especialidade_descricao
     $especialidade_descricao = new Zend_Form_Element_Textarea("especialidade_descricao");
     $especialidade_descricao->setLabel("Descrição Especialidade: ");
     $especialidade_descricao->setRequired();
     $especialidade_descricao->setDecorators(App_Forms_Decorators::$simpleElementDecorators);
     $especialidade_descricao->setAttribs(array('class' => 'form-control', 'rows' => 5));
     $this->addElements(array($categoria_id, $especialidade_nome, $especialidade_descricao));
     parent::init();
 }
Example #26
0
 public function FrmMenu($data = null)
 {
     //item_code
     $item_code = new Zend_Form_Element_Text('item_code');
     $item_code->setAttribs(array('class' => 'form-control', 'onkeyup' => 'displayPhoto()'));
     $menu_code = new Zend_Form_Element_Text('menu_code');
     $menu_code->setAttribs(array('class' => 'form-control'));
     //menu_group
     $menu_group = new Zend_Form_Element_Select('menu_group');
     $menu_group->setAttribs(array('class' => 'form-control input-xlarge select2me', 'onClick' => 'FuncMenuGroup()'));
     $db = new Menu_Model_DbTable_DbMenu();
     $opt = $db->getAllGroupMenu();
     $menu_group->setMultiOptions($opt);
     $root_code = new Zend_Form_Element_Select('root_code');
     $root_code->setAttribs(array('class' => 'form-control', 'onClick' => 'FuncRootMenuCode()'));
     $select_root_code_opt = array("" => $this->tr->translate("SELECT_GROUP_CODE"), -1 => $this->tr->translate("ADD_NEW"));
     $root_code->setMultiOptions($select_root_code_opt);
     //root_menu
     $root_menu = new Zend_Form_Element_Select('root_menu');
     $root_menu->setAttribs(array('class' => 'form-control input-xlarge select2me', 'onClick' => 'FuncRootMenuCode()'));
     $db = new Menu_Model_DbTable_DbMenu();
     $opt = $db->getAllRootMenu();
     $root_menu->setMultiOptions($opt);
     $root_menus = new Zend_Form_Element_Select('root_menus');
     $root_menus->setAttribs(array('class' => 'form-control', 'onClick' => 'FuncRootMenuCode()'));
     $root_menu_opt = array("" => $this->tr->translate("SELECT_ROOT_MENU"), -1 => $this->tr->translate("ADD_NEW"));
     $root_menus->setMultiOptions($root_menu_opt);
     $print_code = new Zend_Form_Element_Select('print_code');
     $print_code->setAttribs(array('class' => 'form-control input-xlarge select2me', 'onClick' => 'FuncRootMenuCode()'));
     $select_print_code_opt = array("" => $this->tr->translate("SELECT_PRINT_CODE"), -1 => $this->tr->translate("ADD_NEW"));
     $print_code->setMultiOptions($select_print_code_opt);
     $description = new Zend_Form_Element_Text('description');
     $description->setAttribs(array('class' => 'form-control', 'onchange' => 'displayPhoto()'));
     $lang_1 = new Zend_Form_Element_Text('lang_1');
     $lang_1->setAttribs(array('class' => 'form-control', 'onchange' => 'displayPhoto()'));
     $lang_2 = new Zend_Form_Element_Text('lang_2');
     $lang_2->setAttribs(array('checked' => 'checked', 'class' => 'form-control', 'onchange' => 'displayPhoto()'));
     $lang_3 = new Zend_Form_Element_Text('lang_3');
     $lang_3->setAttribs(array('checked' => 'checked', 'class' => 'form-control'));
     $note = new Zend_Form_Element_Text('note');
     $note->setAttribs(array('checked' => 'checked', 'class' => 'form-control'));
     if ($data != null) {
         // 			print_r($data);
     }
     $db = new Application_Model_DbTable_DbGlobal();
     $show_description = new Zend_Form_Element_Select('show_description');
     $show_description->setAttribs(array('class' => 'form-control', 'onchange' => 'displayPhoto()'));
     $opt = $db->getVewOptoinTypeByType(1, 1, null, 1);
     $show_description->setMultiOptions($opt);
     $photo = new Zend_Form_Element_File('photo');
     $background = new Zend_Form_Element_Text('background');
     $background->setAttribs(array('class' => 'form-control color-picker-rgba'));
     $font_color = new Zend_Form_Element_Text('font_color');
     $font_color->setAttribs(array('class' => 'form-control', 'id' => "selected-color1"));
     $font_size = new Zend_Form_Element_Text('demo3');
     $font_size->setAttribs(array('class' => 'form-control', 'id' => "demo3", 'value' => 12, 'placeholder' => '0'));
     $font_size = new Zend_Form_Element_Select('demo3');
     $font_size->setAttribs(array('class' => 'form-control'));
     $description_opt = array("" => $this->tr->translate("\$600"), -1 => $this->tr->translate("\$500"));
     $font_size->setMultiOptions($description_opt);
     $photo = new Zend_Form_Element_File('photo');
     $background = new Zend_Form_Element_Text('background');
     $background->setAttribs(array('class' => 'form-control color-picker-rgba'));
     $apply = new Zend_Form_Element_Select('apply');
     $apply->setAttribs(array('class' => 'form-control'));
     $apply_opt = array("" => $this->tr->translate("SELECT_APPLY_TO_COMPANY"), -1 => $this->tr->translate("ADD_NEW"));
     $apply->setMultiOptions($apply_opt);
     $combo = new Zend_Form_Element_Checkbox('combo');
     $combo->setAttribs(array('class' => 'red'));
     $print_to = new Zend_Form_Element_Checkbox('print_to');
     $print_to->setAttribs(array('class' => 'red'));
     $show_screen = new Zend_Form_Element_Checkbox('show_screen');
     $show_screen->setAttribs(array('class' => 'red'));
     $discount = new Zend_Form_Element_Checkbox('discount');
     $discount->setAttribs(array('class' => 'red'));
     $time = new Zend_Form_Element_Checkbox('time');
     $time->setAttribs(array('class' => 'red'));
     $is_root = new Zend_Form_Element_Checkbox('$is_root');
     $is_root->setAttribs(array('class' => 'red'));
     $require_qty = new Zend_Form_Element_Checkbox('require_qty');
     $require_qty->setAttribs(array('class' => 'red'));
     $is_service = new Zend_Form_Element_Checkbox('is_service');
     $is_service->setAttribs(array('class' => 'red'));
     $active = new Zend_Form_Element_Checkbox('active');
     $active->setAttribs(array('class' => 'red', 'Checked' => 'Checked'));
     $format = new Zend_Form_Element_Text('demo4');
     $format->setAttribs(array('class' => 'form-control', 'id' => "demo4", 'value' => 12, 'placeholder' => '0'));
     $setting = new Zend_Form_Element_Select('setting');
     $setting->setAttribs(array('class' => 'form-control'));
     $setting_opt = array("" => $this->tr->translate("SELECT_SETTING"));
     $setting->setMultiOptions($setting_opt);
     $arrange = new Zend_Form_Element_Text('arrange');
     $arrange->setAttribs(array('class' => 'form-control'));
     $resize = new Zend_Form_Element_Text('resize');
     $resize->setAttribs(array('class' => 'form-control', 'id' => "resize", 'value' => 12, 'placeholder' => '12'));
     $note = new Zend_Form_Element_Textarea('note');
     $note->setAttribs(array('class' => 'form-control', 'style' => "margin-top: 0px; margin-bottom: 0px; height: 100px;"));
     $backgroun_color = new Zend_Form_Element_Text('backgroun_color');
     $backgroun_color->setAttribs(array('class' => 'colorpicker-rgba form-control', 'onclick' => 'displayPhoto()'));
     $font_site = new Zend_Form_Element_text('font_size');
     $font_site->setAttribs(array('class' => ' spinner-input form-control', 'onkeyup' => 'displayPhoto()', 'onclick' => 'displayPhoto()'));
     $font_site->setValue(18);
     $apply = new Zend_Form_Element_Select('apply');
     $apply->setAttribs(array('class' => 'form-control'));
     $font_color = new Zend_Form_Element_text('font_color');
     $font_color->setAttribs(array('class' => 'colorpicker-default form-control', 'onclick' => 'displayPhoto()'));
     $select_apply = new Zend_Form_Element_Select('select_apply');
     $select_apply->setAttribs(array('class' => 'form-control', 'onClick' => 'FuncApplyCompany()'));
     $select_apply_opt = array("" => $this->tr->translate("SELECT_APPLY_TO_COMPANY"), -1 => $this->tr->translate("ADD_NEW"));
     $select_apply->setMultiOptions($select_apply_opt);
     $photo = new Zend_Form_Element_file('photo');
     $id = new Zend_Form_Element_Hidden('id');
     if (!empty($data)) {
         $id->setValue($data['id']);
         $item_code->setValue($data['bar_code']);
         $description->setValue($data['desc']);
         $lang_1->setValue($data['lang1']);
         $lang_2->setValue($data['lang2']);
         $font_size->setValue($data['price']);
         $show_description->setValue($data['display_by']);
         $menu_group->setValue($data['category_id']);
         $root_menu->setValue($data['root_menuid']);
         $print_code->setValue($data['print_code']);
         $print_to->setValue($data['printto_print']);
         $is_service->setValue($data['is_service']);
         $backgroun_color->setValue($data['background_color']);
         $font_color->setValue($data['font_color']);
         $font_site->setValue($data['font_size']);
         $active->setValue($data['status']);
         $note->setValue($data['note']);
         $show_screen->setValue($data['showscreen']);
         $is_root->setValue($data['is_root']);
         $time->setValue($data['time']);
         $discount->setValue($data['is_discound']);
         $require_qty->setValue($data['is_reqty']);
     }
     $this->addElements(array($select_apply, $require_qty, $root_code, $menu_group, $item_code, $apply, $active, $combo, $menu_code, $description, $lang_1, $lang_2, $lang_3, $print_code, $print_to, $show_screen, $time, $discount, $show_description, $background, $font_color, $font_size, $format, $setting, $arrange, $resize, $note, $is_root, $root_menu, $root_menus, $id, $photo, $note, $backgroun_color, $font_site, $font_color, $is_service));
     return $this;
 }
Example #27
0
 public function FrmProduct($frm = null)
 {
     $db = new Application_Model_DbTable_DbGlobal();
     $status = new Zend_Form_Element_Select('status');
     $_arr_status = array(1 => $this->tr->translate("ACTIVE"), 0 => $this->tr->translate("DACTIVE"));
     $status->setMultiOptions($_arr_status);
     $status->setAttribs(array('class' => 'form-control validate[required]'));
     $pro_code = new Zend_Form_Element_Text("pro_code");
     $pro_code->setAttribs(array('class' => 'form-control validate[required]', 'placeholder' => $this->tr->translate("P_CODE"), "OnChange" => "GetCatName(3)"));
     $row_pro_code = $db->getProductCode();
     $pro_code->setValue($row_pro_code);
     $measure = new Zend_Form_Element_Select("measure");
     $measure->setAttribs(array('class' => 'select', 'style' => 'width:100%'));
     $row_measure = $db->getMeasure();
     //$option_measure = array(0=>$this->tr->translate("CHOOSE_MEASURE"));
     foreach ($row_measure as $rs) {
         $option_measure[$rs["id"]] = $rs["name_kh"];
     }
     $measure->setMultiOptions($option_measure);
     $stock_type = new Zend_Form_Element_Select("stock_type");
     $stock_type->setAttribs(array('class' => '', 'style' => 'width:100%'));
     $option_st_type = array(1 => $this->tr->translate("CALCULATE_STOCK"));
     $stock_type->setMultiOptions($option_st_type);
     $pro_size = new Zend_Form_Element_Text("pro_size");
     $pro_size->setAttribs(array('class' => 'form-control validate[required]', 'placeholder' => $this->tr->translate("SIZE")));
     $qty_unit = new Zend_Form_Element_Text("qty_unit");
     $qty_unit->setAttribs(array('class' => 'form-control validate[required]', 'placeholder' => $this->tr->translate("QTY_UNIT"), 'readonly' => true));
     $qty_unit->setValue(1);
     $qty_per_unit = new Zend_Form_Element_Text("qty_per_unit");
     $qty_per_unit->setValue(1);
     $qty_per_unit->setAttribs(array('class' => 'form-control validate[required]', 'placeholder' => $this->tr->translate("QTY_PER_UNIT")));
     $label = new Zend_Form_Element_Text("label");
     $label->setAttribs(array('class' => '', 'placeholder' => $this->tr->translate("LABEL")));
     $cat_id = new Zend_Form_Element_Select("cat_id");
     $cat_id->setAttribs(array('class' => 'select', 'style' => 'width:100%'));
     $category = $db->getAllProCategories();
     $option_category = array(0 => $this->tr->translate("CHOOSE_CATEGORY"));
     foreach ($category as $row_cat) {
         $option_category[$row_cat["cat_id"]] = $row_cat["cat_name_km"] . " - " . $row_cat["cat_name_en"];
     }
     $cat_id->setMultiOptions($option_category);
     $brand = new Zend_Form_Element_Select("brand");
     $brand->setAttribs(array('class' => 'select', 'style' => 'width:100%'));
     $row_brand = $db->getAllBrand();
     $option_brand = array(0 => $this->tr->translate("CHOOSE_BRAND"));
     foreach ($row_brand as $rs) {
         $option_brand[$rs["brand_id"]] = $rs["name_kh"] . " - " . $rs["name_en"];
     }
     $brand->setMultiOptions($option_brand);
     $name_en = new Zend_Form_Element_Text("name_en");
     $name_en->setAttribs(array('class' => 'validate[required]', 'placeholder' => $this->tr->translate("NAME_EN"), "OnChange" => ""));
     $currency = new Zend_Form_Element_Select("currency");
     $currency->setAttribs(array('class' => 'form-control validate[required]', 'readonly' => 'readonly'));
     $currencys = $db->getAllCurrency();
     $option_currency = array(0 => $this->tr->translate("CHOOSE_CURRENCY"));
     foreach ($currencys as $row_currency) {
         $option_currency[$row_currency["cu_id"]] = $row_currency["cu_name_km"] . " - " . $row_currency["cu_name_en"];
     }
     $currency->setMultiOptions($option_currency);
     $currency->setValue(1);
     $price = new Zend_Form_Element_Text("price");
     $price->setAttribs(array('class' => 'validate[required]', 'placeholder' => $this->tr->translate("PRICE")));
     $description = new Zend_Form_Element_Textarea("description");
     $description->setAttribs(array('class' => '', 'placeholder' => $this->tr->translate("DESCRIPTION")));
     $name_km = new Zend_Form_Element_Text("name_km");
     $name_km->setAttribs(array('class' => 'validate[required]', 'placeholder' => $this->tr->translate("NAME_KM"), "OnChange" => ""));
     $icon = new Zend_Form_Element_File("icon");
     $unit_price = new Zend_Form_Element_Text("unit_price");
     $unit_price->setAttribs(array('class' => 'validate[required]', 'placeholder' => $this->tr->translate("UNIT_PRICE")));
     $unit_price->setValue(0);
     $qty_price = new Zend_Form_Element_Text("qty_price");
     $qty_price->setAttribs(array('class' => 'validate[required]', 'placeholder' => $this->tr->translate("PRICE_PER_QTY")));
     $qty_price->setValue(0);
     $qty_onhand = new Zend_Form_Element_Text("qty_onhand");
     $qty_onhand->setAttribs(array('placeholder' => $this->tr->translate("QTY")));
     $qty_onhand->setValue(0);
     $qty_unit_onhand = new Zend_Form_Element_Text("qty_unit_onhand");
     $qty_unit_onhand->setAttribs(array('placeholder' => $this->tr->translate("QTY")));
     $qty_unit_onhand->setValue(0);
     $this->addElements(array($qty_unit_onhand, $description, $price, $icon, $status, $name_en, $name_km, $cat_id, $pro_code, $currency, $brand, $qty_per_unit, $qty_unit, $label, $stock_type, $measure, $pro_size, $unit_price, $qty_onhand, $qty_price));
     if ($frm != "") {
         $cat_id->setValue($frm["cate_id"]);
         $name_en->setValue($frm["name_en"]);
         $name_km->setValue($frm["name_kh"]);
         $status->setValue($frm["status"]);
         $currency->setValue($frm["cu_id"]);
         $brand->setValue($frm["brand_id"]);
         $label->setValue($frm["label"]);
         $pro_code->setValue($frm["item_code"]);
         $measure->setValue($frm["measure_id"]);
         $stock_type->setValue($frm["stock_type"]);
         //$qty_->setValue($frm["qty_onhand"]);
         $qty_unit->setValue(1);
         $qty_per_unit->setValue($frm["qty_perunit"]);
         //$qty_unit_onhand->setValue($frm[""]);
         $pro_size->setValue($frm["item_size"]);
         $unit_price->setValue($frm["unit_sale_price"]);
         $qty_price->setValue($frm["price_per_qty"]);
         $description->setValue($frm["description"]);
     }
     return $this;
 }
Example #28
0
 public function init()
 {
     $this->setMethod("post");
     // produto_nome
     $produto_nome = new Zend_Form_Element_Text("produto_nome");
     $produto_nome->setLabel("Nome");
     $produto_nome->setRequired();
     $produto_nome->setAttribs(array('class' => 'form-control', 'placeholder' => 'Informe o nome do produto'));
     $produto_nome->setDecorators(App_Forms_Decorators::$simpleElementDecorators);
     // produto_id
     $produto_id = new Zend_Form_Element_Hidden("produto_id");
     // fabricante_nome
     $fabricante_nome = new Zend_Form_Element_Text("fabricante_nome");
     $fabricante_nome->setLabel("Fabricante");
     //$fabricante_nome->setRequired();
     $fabricante_nome->setAttribs(array('class' => 'form-control', 'placeholder' => 'Informe o nome do fabricante'));
     $fabricante_nome->setDecorators(App_Forms_Decorators::$simpleElementDecorators);
     // fabricante_id
     $fabricante_id = new Zend_Form_Element_Hidden("fabricante_id");
     // marca_nome
     $marca_nome = new Zend_Form_Element_Text("marca_nome");
     $marca_nome->setLabel("Marca");
     $marca_nome->setRequired();
     $marca_nome->setAttribs(array('class' => 'form-control', 'placeholder' => 'Informe o nome da marca'));
     $marca_nome->setDecorators(App_Forms_Decorators::$simpleElementDecorators);
     // marca_id
     $marca_id = new Zend_Form_Element_Hidden("marca_id");
     // reclamacao_nome
     $reclamacao_nome = new Zend_Form_Element_Text("reclamacao_nome");
     $reclamacao_nome->setLabel("Nome");
     $reclamacao_nome->setAttribs(array('class' => 'form-control', 'placeholder' => 'Informe seu nome'));
     // reclamacap_email
     $reclamacao_email = new Zend_Form_Element_Text("reclamacao_email");
     $reclamacao_email->setLabel("E-mail");
     $reclamacao_email->setAttribs(array('class' => 'form-control', 'placeholder' => 'Informe seu e-mail'));
     // reclamacao_empresa
     $reclamacao_empresa = new Zend_Form_Element_Text("reclamacao_empresa");
     $reclamacao_empresa->setLabel("Empresa onde comprou o produto");
     $reclamacao_empresa->setAttribs(array('class' => 'form-control', 'placeholder' => 'Informe seu e-mail'));
     // reclamacao_cidade
     $reclamacao_cidade = new Zend_Form_Element_Text("reclamacao_cidade");
     $reclamacao_cidade->setLabel("Cidade");
     $reclamacao_cidade->setAttribs(array('class' => 'form-control', 'placeholder' => 'Informe sua cidade'));
     // reclamacao_estado
     $reclamacao_estado = new Zend_Form_Element_Select("reclamacao_estado");
     $reclamacao_estado->setLabel("Estado");
     $reclamacao_estado->setAttribs(array('class' => 'form-control'));
     $reclamacao_estado->setMultiOptions($this->getEstados());
     // reclamacao_descricao
     $reclamacao_descricao = new Zend_Form_Element_Textarea("reclamacao_descricao");
     $reclamacao_descricao->setLabel("Descreva sua reclamação");
     $reclamacao_descricao->setRequired();
     $reclamacao_descricao->setDecorators(App_Forms_Decorators::$simpleElementDecorators);
     $reclamacao_descricao->setAttribs(array('class' => 'form-control', 'rows' => 5, 'placeholder' => 'Informe porque você está insatisfeito com o produto', 'maxlenght' => 500));
     $reclamacao_descricao->addValidator(new App_Validate_Reclamacao());
     // reclamacao_nota
     $reclamacao_nota = new Zend_Form_Element_Radio("reclamacao_nota");
     $reclamacao_nota->setLabel("Dê sua nota para o produto");
     $reclamacao_nota->setRequired();
     $reclamacao_nota->setAttribs(array('class' => ''));
     $reclamacao_nota->setMultiOptions($this->getNotasHtml());
     $reclamacao_nota->setOptions(array('escape' => false));
     $reclamacao_nota->setSeparator(" ");
     $reclamacao_nota->setDecorators(App_Forms_Decorators::$checkboxElementDecorators);
     // submit
     $submit = new Zend_Form_Element_Submit("submit");
     $submit->setLabel("Registrar Reclamação");
     $submit->setAttrib("class", 'form-control btn btn-success');
     $this->addElements(array($produto_nome, $fabricante_nome, $marca_nome, $reclamacao_descricao, $reclamacao_nome, $reclamacao_email, $reclamacao_cidade, $reclamacao_estado, $reclamacao_nota, $submit, $produto_id, $marca_id, $fabricante_id));
 }
Example #29
0
 public function FrmTables($data = null)
 {
     $table_code = new Zend_Form_Element_Text('table_code');
     $table_code->setAttribs(array('class' => 'form-control', 'required' => true, 'onkeyup' => 'displayPhoto()'));
     $db = new Application_Model_DbTable_DbGlobal();
     $g_code = new Zend_Form_Element_Select('group_code');
     $g_code->setAttribs(array('class' => 'form-control select2me', 'onchange' => 'displayDescriptions()'));
     $option = $db->getGroupCode();
     $g_code->setMultiOptions($option);
     $g_code1 = new Zend_Form_Element_Text('g_code1');
     $g_code1->setAttribs(array('class' => 'form-control'));
     $est_time = new Zend_Form_Element_Text('est_time');
     $est_time->setAttribs(array('class' => 'form-control clockface_1 clockface-open', 'data-format' => "hh:mm A", 'id' => 'mask_number'));
     $price = new Zend_Dojo_Form_Element_NumberTextBox('price');
     $price->setAttribs(array('class' => 'form-control'));
     $max_seat = new Zend_Form_Element_Text('max_seat');
     $max_seat->setAttribs(array('class' => 'form-control', 'id' => 'mask_number'));
     $time = new Zend_Form_Element_Text('time');
     $time->setAttribs(array('class' => 'form-control'));
     $time->setValue('00:00');
     $description = new Zend_Form_Element_Text('description');
     $description->setAttribs(array('class' => 'form-control', 'required' => true, 'onkeyup' => 'displayPhoto()'));
     $lang_1 = new Zend_Form_Element_Text('lang_1');
     $lang_1->setAttribs(array('class' => 'form-control', 'onkeyup' => 'displayPhoto()'));
     $lang_2 = new Zend_Form_Element_Text('lang_2');
     $lang_2->setAttribs(array('checked' => 'checked', 'class' => 'form-control', 'onkeyup' => 'displayPhoto()'));
     $lang_3 = new Zend_Form_Element_Text('lang_3');
     $lang_3->setAttribs(array('checked' => 'checked', 'class' => 'form-control'));
     if ($data != null) {
         // 			print_r($data);
     }
     $db = new Application_Model_DbTable_DbGlobal();
     $description_opt = array("" => $this->tr->translate("SELECT_DESCRIPTION"));
     $show_description1 = new Zend_Form_Element_Select('show_description');
     $show_description1->setAttribs(array('class' => 'form-control', 'onchange' => 'displayPhoto()'));
     $opt = $db->getVewOptoinTypeByType(1, 1, null, 1);
     $show_description1->setMultiOptions($opt);
     $type_of_table = new Zend_Form_Element_Select('type_of_table');
     $type_of_table->setAttribs(array('class' => 'form-control select2me', 'onchange' => 'popoupTableType()'));
     $opt_type_table = $db->getTypeOfTable();
     $type_of_table->setMultiOptions($opt_type_table);
     $apply_to_company = new Zend_Form_Element_Select('apply_to_company');
     $apply_to_company->setAttribs(array('class' => 'form-control'));
     $opt = array('0' => 'select company', '1' => 'A', '2' => 'B', '3' => 'C');
     $apply_to_company->setMultiOptions($opt);
     $photo = new Zend_Form_Element_File('photo');
     $background = new Zend_Form_Element_Text('background');
     $background->setAttribs(array('class' => 'form-control color-picker-rgba'));
     $backgroun_color = new Zend_Form_Element_Text('backgroun_color');
     $backgroun_color->setAttribs(array('class' => 'colorpicker-rgba form-control', 'onclick' => 'displayPhoto()'));
     $apply = new Zend_Form_Element_Select('apply');
     $apply->setAttribs(array('class' => 'form-control'));
     $apply_opt = array("" => $this->tr->translate("SELECT_APPLY_TO_COMPANY"));
     $apply->setMultiOptions($apply_opt);
     $combo = new Zend_Form_Element_Checkbox('combo');
     $combo->setAttribs(array('class' => 'red'));
     $active = new Zend_Form_Element_Checkbox('active');
     $active->setAttribs(array('class' => 'red', 'checked' => 'checked'));
     $time_ck = new Zend_Form_Element_Checkbox('time_ck');
     $time_ck->setAttribs(array('class' => 'red'));
     $dicount_ck = new Zend_Form_Element_Checkbox('dicount_ck');
     $dicount_ck->setAttribs(array('class' => 'red'));
     $format = new Zend_Form_Element_Text('demo4');
     $format->setAttribs(array('class' => 'form-control', 'id' => "demo4", 'value' => 12, 'placeholder' => '12'));
     $font_color = new Zend_Form_Element_text('font_color');
     $font_color->setAttribs(array('class' => 'colorpicker-default form-control', 'onclick' => 'displayPhoto()'));
     $font_site = new Zend_Form_Element_text('font_size');
     $font_site->setAttribs(array('class' => ' spinner-input form-control', 'onkeyup' => 'displayPhoto()', 'onclick' => 'displayPhoto()'));
     $font_site->setValue(20);
     $resize = new Zend_Form_Element_Text('resize');
     $resize->setAttribs(array('class' => 'form-control', 'id' => "resize", 'value' => 12, 'placeholder' => '12'));
     $note = new Zend_Form_Element_Textarea('note');
     $note->setAttribs(array('class' => 'form-control', 'style' => "margin-top: 0px; margin-bottom: 0px; height: 150px;"));
     $note1 = new Zend_Form_Element_Textarea('note1');
     $note1->setAttribs(array('class' => 'form-control', 'style' => "margin-top: 0px; margin-bottom: 0px; height: 150px;"));
     $id = new Zend_Form_Element_Hidden('id');
     if ($data != null) {
         //print_r($data);exit();
         $id->setValue($data['id']);
         $table_code->setValue($data['code']);
         $description->setValue($data['description']);
         $lang_1->setValue($data['lang1']);
         $lang_2->setValue($data['lang2']);
         $g_code->setValue($data['tbl_groupid']);
         $type_of_table->setValue($data['tbl_type']);
         $show_description1->setValue($data['display_by']);
         $max_seat->setValue($data['max_sit']);
         $apply_to_company->setValue($data['compid']);
         $active->setValue($data['active']);
         $time_ck->setValue($data['time_charge_id']);
         $dicount_ck->setValue($data['is_discound']);
         $price->setValue($data['price']);
         $est_time->setValue($data['est_time']);
         $backgroun_color->setValue($data['backgroud_color']);
         $font_color->setValue($data['font_color']);
         $font_site->setValue($data['font_size']);
         $note->setValue($data['note']);
     }
     $this->addElements(array($id, $photo, $dicount_ck, $time_ck, $type_of_table, $est_time, $price, $max_seat, $time, $g_code, $apply, $active, $combo, $table_code, $description, $lang_1, $lang_2, $lang_3, $note1, $backgroun_color, $g_code1, $show_description1, $apply_to_company, $background, $font_color, $format, $font_color, $font_site, $resize, $note));
     return $this;
 }
Example #30
0
 public function popupSaleAgent($data = null)
 {
     $tr = Application_Form_FrmLanguages::getCurrentlanguage();
     $db = new Application_Model_DbTable_DbGlobal();
     $agent_Element = new Zend_Form_Element_Text('agent_name');
     $agent_Element->setAttribs(array('placeholder' => 'Enter Agent Name', 'class' => 'validate[required]'));
     $this->addElement($agent_Element);
     $contact_Element = new Zend_Form_Element_Text('contact_phone');
     $contact_Element->setAttribs(array('placeholder' => 'Contact Phone', 'class' => 'validate[required]'));
     $this->addElement($contact_Element);
     $position_Element = new Zend_Form_Element_Text('positon');
     $position_Element->setAttribs(array('placeholder' => 'Enter Positon'));
     $this->addElement($position_Element);
     $options = "";
     $sql = "SELECT LocationId, Name FROM tb_sublocation WHERE Name!='' ";
     $user = $this->GetuserInfo();
     if ($user["level"] != 1 and $user["level"] != 2) {
         $sql .= " AND LocationId = " . $user["location_id"];
     }
     $sql .= " ORDER BY LocationId DESC";
     $rs = $db->getGlobalDb($sql);
     //$productValue = $request->getParam('LocationId');
     if (!empty($rs)) {
         foreach ($rs as $read) {
             $options[$read['LocationId']] = $read['Name'];
         }
     }
     $locationID = new Zend_Form_Element_Select('brand_name');
     $locationID->setAttribs(array('class' => 'validate[required]'));
     $locationID->setMultiOptions($options);
     $locationID->setattribs(array('id' => 'brand_name'));
     $this->addElement($locationID);
     $address_Element = new Zend_Form_Element_Textarea('desc_agent');
     $address_Element->setAttribs(array('placeholder' => 'Description Here'));
     $this->addElement($address_Element);
     return $this;
 }