✏️ 正在编辑: Cliente.php
路径:
/srv/systems_dir/yuppiecred-bkp/application/forms/Cliente.php
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
<?php class Form_Cliente extends Core_Form { public function init() { $this->setName('f_save_cliente'); $this->addElement('hidden', 'id', array( 'class' => 'invisivel' )); $select = new Zend_Form_Element_Select('empresa_id'); $select->setLabel('Empresa:') ->setRequired(true) ->addMultiOptions(Core_Combos::getEmpresasOptions()); $this->addElement($select); $this->addElement('text', 'nome', array( 'label' => 'Nome:', 'size' => 35, 'required' => true )); $this->addElement('text', 'cpf', array( 'label' => 'CPF:', 'onkeypress' => 'mascara(this, fcpf)', 'maxlength' => 14, 'required' => true, 'validators' => array( new Validators_Cpf() ) )); $this->addElement('text', 'rg', array( 'label' => 'RG:', )); $this->addElement('text', 'orgao_expedidor', array( 'label' => 'Órgão:', )); $this->addElement('text', 'data_nascimento', array( 'label' => 'Data Nascimento:', 'onkeypress' => 'mascara(this, data)', 'maxlength' => 10, 'size' => 11, 'validators' => array( new Validators_DataNascimento() ) )); $this->addElement('text', 'nome_pai', array( 'label' => 'Pai:', 'size' => 35, )); $this->addElement('text', 'nome_mae', array( 'label' => 'Mãe:', 'size' => 35, )); $this->addElement('text', 'conjuge', array( 'label' => 'Cônjuge:', 'size' => 35, )); $this->addElement('text', 'endereco', array( 'label' => 'Endereço:', 'size' => 35, )); $this->addElement('text', 'complemento', array( 'label' => 'Complemento:', 'size' => 35, )); $this->addElement('text', 'bairro', array( 'label' => 'Bairro:', )); $this->addElement('text', 'cidade', array( 'label' => 'Cidade:', )); $this->addElement('text', 'uf', array( 'label' => 'UF:', 'maxlength' => 2, 'size' => 3, 'validators' => array( new Validators_Uf() ) )); $this->addElement('text', 'cep', array( 'label' => 'CEP:', 'maxlength' => 8 )); //Display Group $this->addDisplayGroup(array( 'cep', 'endereco', 'complemento', 'bairro', 'cidade', 'uf', ), 'dados_fiscais', array( 'legend' => 'Endereço' )); foreach ($this->_displayGroups as $dg){ $dg->removeDecorator('DtDdWrapper'); } $this->addElement('text', 'email', array( 'label' => 'E-mail:', 'validators' => array( 'EmailAddress' ), 'size' => 35 )); $this->addElement('text', 'celular', array( 'label' => 'Celular:', 'onkeypress' => 'mascara(this, telefone)', 'maxlength' => 15, 'size' => 15, 'validators' => array( new Yuppie_Validate_Phone() ) )); $this->addElement('text', 'fax', array( 'label' => 'Fax:', 'onkeypress' => 'mascara(this, telefone)', 'maxlength' => 14, 'size' => 15 )); $this->addElement('text', 'fone', array( 'label' => 'Fone Residencial:', 'onkeypress' => 'mascara(this, telefone)', 'maxlength' => 15, 'size' => 15 )); $this->addElement('text', 'telefone_comercial', array( 'label' => 'Fone Comercial:', 'onkeypress' => 'mascara(this, telefone)', 'maxlength' => 15, 'size' => 15 )); $this->addElement('text', 'senha_contracheque', array( 'label' => 'Senha contra-cheque:', 'size' => 30, 'class' => 'not_upper' )); $this->addElement('text', 'matricula', array( 'label' => 'Matrícula:', 'size' => 40 )); $this->addElement('text', 'orgao', array( 'label' => 'Orgão:', 'size' => 40 )); $this->addElement('textarea', 'obs', array( 'label' => 'Observação:', 'rows' => 5, 'cols' => 40 )); $this->addElement('button', 'btn_back', array( 'label' => 'Voltar', 'class' => 'bt_back', 'onclick' => "window.location='" . $this->getView()->baseUrl() . "/cliente'" )); $this->addElement('submit', 'btn_save', array( 'label' => 'Salvar', 'class' => 'bt_save' )); $this->addElement('button', 'btn_new', array( 'label' => 'Novo Cadastro', 'class' => 'bt_new', 'onclick' => "window.location='" . $this->getView()->baseUrl() . "/cliente/save'" )); // $this->_addButtonNovoContrato(); $this->addDisplayGroup(array( 'btn_back', 'btn_save', 'btn_new', 'btn_new_contrato' ), 'buttons'); } protected function _addButtonNovoContrato() { $front = Zend_Controller_Front::getInstance(); //pega o id do cliente $id = (int)$front->getRequest()->getParam('id'); //verifica se passou o id por parâmetro if( $id > 0 ){ $this->addElement('button', 'btn_new_contrato', array( 'label' => 'Adicionar Contrato', 'class' => 'bt_new_contrato', 'onclick' => "window.location='" . $this->getView()->baseUrl() . "/contrato/save/cliente_id/" . $id . "'" )); } } }
💾 保存文件
← 返回文件管理器