✏️ 正在编辑: ComissionamentoCorretor.php
路径:
/srv/systems_dir/yuppiecred-bkp/application/forms/Filtro/ComissionamentoCorretor.php
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
<?php class Form_Filtro_ComissionamentoCorretor extends Core_Form { public function init() { $this->setMethod('post'); $this->setName('f_comissao_corretor'); $this->setAttrib('autocomplete', 'off'); $select = new Zend_Form_Element_Select('corretor_id'); $select->setLabel('Corretor:') ->addMultiOptions(Core_Combos::getCorretoresOptions()); $this->addElement($select); $select = new Zend_Form_Element_Select('banco_id'); $select->setLabel('Banco:') ->addMultiOptions(Core_Combos::getBancosOptions()); $this->addElement($select); $select = new Zend_Form_Element_Select('convenio_id'); $select->setLabel('Convênio:') ->addMultiOptions(Core_Combos::getConveniosOptions()) ->setAttrib('onchange', "populateComboTabelas(this.id, 'tabela_id', 'banco_id')") ->addDecorator('Label', array( 'tag' => 'dt', 'tagClass' => 'clear' )); $this->addElement($select); $select = new Zend_Form_Element_Select('tabela_id'); $select->setLabel('Tabela:') ->setRegisterInArrayValidator(false); $this->addElement($select); $text = new Zend_Form_Element_Text('prazo'); $text->setOptions(array( 'label' => 'Prazo:', 'size' => 4, 'maxlength' => 2)) ->addDecorator('Label', array( 'tag' => 'dt', 'tagClass' => 'clear' )); $this->addElement($text); $this->addElement('text', 'cpf', array( 'label' => "CPF corretor:", 'onkeypress' => "mascara(this, fcpf)", 'size' => 14, 'maxlength' => 14 )); $this->addElement('text', 'idade_inicial', [ 'label' => 'Idade Inicial:', 'onkeypress' => 'mascara(this, soNumeros)' ]); $this->addElement('text', 'idade_final', [ 'label' => 'Idade Final:', 'onkeypress' => 'mascara(this, soNumeros)' ]); $this->getElement('idade_inicial') ->addDecorator('Label', ['tag' => 'dt', 'tagClass' => 'clear']); $this->addElement('select', 'base_comissao', array( 'label' => 'Base Comissão:', 'multiOptions' => array("" => "") + Core_Combos::getTipoComissaoValorOptions() )); $this->getElement('base_comissao') ->addDecorator('Label', array( 'tag' => 'dt', 'tagClass' => 'clear' )); $select = new Zend_Form_Element_Select('tipo_produto'); $select->setLabel('Tipo Produto:') ->addMultiOptions(Core_Combos::getTiposProdutosOptions()); $this->addElement($select); $select = new Zend_Form_Element_Select('supervisor_id'); $select->setLabel('Supervisor:') ->addMultiOptions(Core_Combos::getSupervisoresOptions()) ->addDecorator('Label', array( 'tag' => 'dt', 'tagClass' => 'clear' )); $this->addElement($select); $this->addElement('select', 'comissao_ativa', [ 'label' => 'Comissões Vigentes:', 'multiOptions' => [ 0 => 'Todos', 1 => 'Sim', 2 => 'Não' ] ]); $this->addElement('submit', 'btn_visualizar', array( 'label' => 'Buscar', 'class' => 'bt_find' )); $this->addElement('button', 'btn_new', array( 'label' => 'Novo Cadastro', 'class' => 'bt_new', 'onclick' => "window.location='" . $this->getView()->baseUrl() . "/comissionamento-corretor/save'" )); $this->addElement('button', 'btn_export', array( 'label' => 'Exportar', 'class' => 'bt_export', 'onclick' => "window.location='" . $this->getView()->baseUrl() . "/comissionamento-corretor/exportar'" )); $this->addDisplayGroup(['btn_visualizar', 'btn_new', 'btn_export', 'btn_adicionar'], 'buttons'); } public function populate(array $values) { if( !empty($values['convenio_id']) && !empty($values['banco_id']) ){ $tabela = $this->getElement('tabela_id'); $tabela->addMultiOptions( Core_Combos::getTabelasOptions($values['convenio_id'], $values['banco_id']) ); } return parent::populate($values); } public function search() { $request = Zend_Controller_Front::getInstance()->getRequest(); $id = get_class($this); $ns = new Zend_Session_Namespace($id); if ($request->isPost() && $this->isValid($request->getPost())) { $ns->unsetAll(); $ns->$id = $request->getPost(); } if(!empty($ns->$id)){ $this->populate($ns->$id); } $model = new Model_ComissionamentoCorretor(); return $model->listarPercValido($ns->$id); } }
💾 保存文件
← 返回文件管理器