public function init() { // Verifica se o campo select esta com o valor null $required = new Zend_Validate_NotEmpty(); $required->setType($required->getType() | Zend_Validate_NotEmpty::STRING | Zend_Validate_NotEmpty::ZERO); $data_now = new Zend_Date(); $options_sim_nao = array('Não', 'Sim'); $options_categoria = array('Alto padrão' => 'Alto padrão', 'Médio padrão' => 'Médio padrão', 'Econômico' => 'Econômico'); $options_empty = array(''); $options_tipo = array('0' => '--- Selecione uma opção ---', '1' => 'Apartamento', '2' => 'Casa'); $this->addElement('text', 'nome', array('label' => 'Nome', 'required' => true, 'filters' => array('StringTrim'), 'class' => 'form-control', 'decorators' => $this->setColSize(12))); $this->addElement('text', 'logradouro', array('label' => 'Logradouro', 'required' => true, 'filters' => array('StringTrim'), 'class' => 'form-control', 'decorators' => $this->setColSize(6))); $this->addElement('select', 'categoria', array('label' => 'Categoria', 'required' => true, 'filters' => array('StringTrim'), 'class' => 'form-control', 'multiOptions' => $options_categoria, 'decorators' => $this->setColSize(3))); $this->addElement('select', 'tipo', array('label' => 'Tipo de empreendimento', 'required' => true, 'filters' => array('StringTrim'), 'class' => 'form-control', 'multiOptions' => $options_tipo, 'decorators' => $this->setColSize(3), 'validators' => array($required))); $this->addElement('select', 'cad_corretagem', array('label' => 'Cad. Corretagem Mediação', 'required' => true, 'filters' => array('StringTrim'), 'class' => 'form-control', 'multiOptions' => $options_sim_nao, 'decorators' => $this->setColSize(3))); $this->addElement('text', 'incorporadora', array('label' => 'Proprietario(a)', 'required' => true, 'filters' => array('StringTrim'), 'class' => 'form-control', 'decorators' => $this->setColSize(6))); $this->addElement('hidden', 'unidades', array('label' => '', 'decorators' => $this->setColSize(1))); $this->addElement('hidden', 'created_user_id', array('value' => CURRENT_USER_ID, 'decorators' => $this->setColSize(1))); $this->addElement('hidden', 'last_user_id', array('value' => CURRENT_USER_ID, 'decorators' => $this->setColSize(1))); $this->addElement('hidden', 'locked', array('value' => CURRENT_USER_ID, 'decorators' => $this->setColSize(1))); $this->addElement('hidden', 'locked_by', array('value' => CURRENT_USER_ID, 'decorators' => $this->setColSize(1))); $this->addElement('submit', 'Enviar', array('label' => 'Enviar', 'ignore' => 'true', 'class' => 'btn btn-success pull-right', 'decorators' => $this->setColSize(12, false))); $this->setDecorators(array('FormElements', array(array('in' => 'HtmlTag'), array('tag' => 'div', 'class' => 'row')), 'Form', array('HtmlTag', array('tag' => 'div', 'class' => 'panel panel-body panel-default')))); $this->setAttrib('class', 'form'); $this->setAttrib('id', 'empreendimento'); $this->setMethod('post'); }
public function init() { // Verifica se o campo select esta com o valor null $required = new Zend_Validate_NotEmpty(); $required->setType($required->getType() | Zend_Validate_NotEmpty::STRING | Zend_Validate_NotEmpty::ZERO); $data_now = new Zend_Date(); $options_estado_civil = array('-- Selecione --', 'casado' => 'Casado', 'solteiro' => 'Solteiro', 'divorciado' => 'Divorciado', 'viuvo' => 'Viuvo'); $options_empty = array('-- Selecione --'); $options_meio_comunicacao = array('-- Selecione --', 'Telefone' => 'Telefone', 'Tv' => 'TV', 'Local' => 'Pass. no Local', 'Radio' => 'Rádio', 'Faixas' => 'Faixas', 'Email' => 'Email', 'Panfletagem' => 'Panfletagem', 'Mala direta' => 'Mala direta', 'Indicação' => 'Indicação', 'Internet' => 'Internet', 'Jornal' => 'Jornal', 'Outdoor' => 'Outdoor', 'Outros' => 'Outros'); $options_renda = array('-- Selecione --', 'formal' => 'Formal', 'informal' => 'Informal', 'mista' => 'Mista'); $options_sim_nao = array('Não', 'Sim'); $this->addElement('hidden', 'data', array('value' => $data_now->toString('YYYY-MM-dd'), 'decorators' => $this->setColSize(12))); // Adicionando tag HTML usando description do elemento $this->addElement('hidden', 'data_desc', array('ignore' => true, 'decorators' => array(array('Description', array('escape' => false, 'tag' => 'div', 'class' => "col-xs-2 pull-right"))))); // Adicionando tag HTML usando description do elemento $this->addElement('hidden', 'header3', array('description' => '<h3>FICHA DE ATENDIMENTO AO CLIENTE</h3>', 'ignore' => true, 'decorators' => array(array('Description', array('escape' => false, 'tag' => 'div', 'class' => "col-xs-12"))))); $this->addElement('text', 'nome', array('label' => 'Nome', 'required' => true, 'filters' => array('StringTrim'), 'class' => 'form-control', 'decorators' => $this->setColSize(6))); $this->addElement('text', 'cpf', array('label' => 'CPF', 'required' => true, 'filters' => array('StringTrim'), 'class' => 'form-control', 'decorators' => $this->setColSize(3))); $this->addElement('select', 'estado_civil', array('label' => 'Estado Civil', 'required' => true, 'filters' => array('StringTrim'), 'class' => 'form-control', 'multiOptions' => $options_estado_civil, 'validators' => array($required), 'decorators' => $this->setColSize(3))); $this->addElement('text', 'email', array('label' => 'E-mail', 'required' => false, 'filters' => array('StringTrim'), 'class' => 'form-control', 'decorators' => $this->setColSize(6))); $this->addElement('text', 'data_nasc', array('label' => 'Data de Nascimento', 'required' => false, 'description' => '<span class="glyphicon glyphicon-calendar"></span>', 'filters' => array('StringTrim'), 'class' => 'form-control', 'decorators' => $this->setColSize(3, true, true))); // Adicionando tag HTML usando description do elemento $this->addElement('hidden', 'hr_filiacao', array('description' => '<h3>FILIAÇÃO</h3>', 'ignore' => true, 'decorators' => array(array('Description', array('escape' => false, 'tag' => 'div', 'class' => "col-xs-12"))))); $this->addElement('text', 'filiacao_pai', array('label' => 'Pai', 'required' => true, 'filters' => array('StringTrim'), 'class' => 'form-control', 'decorators' => $this->setColSize(6))); $this->addElement('text', 'filiacao_mae', array('label' => 'Mãe', 'required' => true, 'filters' => array('StringTrim'), 'class' => 'form-control', 'decorators' => $this->setColSize(6))); // Adicionando tag HTML usando description do elemento $this->addElement('hidden', 'hr_end', array('description' => '<hr/>', 'ignore' => true, 'decorators' => array(array('Description', array('escape' => false, 'tag' => 'div', 'class' => "col-xs-12"))))); $this->addElement('text', 'cep', array('label' => 'CEP', 'required' => false, 'filters' => array('StringTrim'), 'class' => 'form-control', 'decorators' => $this->setColSize(3))); $this->addElement('text', 'endereco', array('label' => 'Endereço', 'required' => false, 'filters' => array('StringTrim'), 'class' => 'form-control', 'decorators' => $this->setColSize(9))); $this->addElement('text', 'bairro', array('label' => 'Bairro', 'required' => false, 'filters' => array('StringTrim'), 'class' => 'form-control', 'decorators' => $this->setColSize(6))); $this->addElement('select', 'estado', array('label' => 'Estado', 'required' => true, 'filters' => array('StringTrim'), 'class' => 'form-control', 'multiOptions' => $options_empty, 'validators' => array($required), 'decorators' => $this->setColSize(6))); $this->addElement('select', 'cidade', array('label' => 'Cidade', 'required' => true, 'filters' => array('StringTrim'), 'class' => 'form-control', 'multiOptions' => $options_empty, 'validators' => array($required), 'decorators' => $this->setColSize(6))); $this->addElement('text', 'fone_resid', array('label' => 'Fone Resid.', 'required' => false, 'filters' => array('StringTrim'), 'class' => 'form-control', 'decorators' => $this->setColSize(4))); $this->addElement('text', 'fone_com', array('label' => 'Fone Com.', 'required' => false, 'filters' => array('StringTrim'), 'class' => 'form-control', 'decorators' => $this->setColSize(4))); $this->addElement('text', 'fone_cel', array('label' => 'Celular', 'required' => false, 'filters' => array('StringTrim'), 'class' => 'form-control', 'decorators' => $this->setColSize(4))); // Adicionando tag HTML usando description do elemento $this->addElement('hidden', 'hr_contato', array('description' => '<hr/>', 'ignore' => true, 'decorators' => array(array('Description', array('escape' => false, 'tag' => 'div', 'class' => "col-xs-12"))))); $this->addElement('text', 'empresa_trabalha', array('label' => 'Empresa na qual trabalha', 'required' => false, 'filters' => array('StringTrim'), 'class' => 'form-control', 'decorators' => $this->setColSize())); $this->addElement('text', 'profissao', array('label' => 'Profissão', 'required' => false, 'filters' => array('StringTrim'), 'class' => 'form-control', 'decorators' => $this->setColSize(6))); $this->addElement('text', 'cargo', array('label' => 'Cargo', 'required' => false, 'filters' => array('StringTrim'), 'class' => 'form-control', 'decorators' => $this->setColSize(6))); $this->addElement('text', 'renda_familiar', array('label' => 'Renda Familiar', 'required' => false, 'filters' => array('StringTrim'), 'class' => 'form-control', 'decorators' => $this->setColSize(6))); $this->addElement('select', 'renda', array('label' => 'Renda', 'required' => true, 'filters' => array('StringTrim'), 'class' => 'form-control', 'multiOptions' => $options_renda, 'validators' => array($required), 'decorators' => $this->setColSize(6))); $this->addElement('select', 'fgts', array('label' => 'FGTS', 'filters' => array('StringTrim'), 'class' => 'form-control', 'multiOptions' => $options_sim_nao, 'decorators' => $this->setColSize(3))); $this->addElement('select', 'fgts_tres_anos', array('label' => 'Mais de 3 anos', 'filters' => array('StringTrim'), 'class' => 'form-control', 'multiOptions' => $options_sim_nao, 'decorators' => $this->setColSize(3))); $this->addElement('text', 'saldo_fgts', array('label' => 'Saldo FGTS', 'required' => false, 'filters' => array('StringTrim'), 'class' => 'form-control', 'decorators' => $this->setColSize(3))); $this->addElement('text', 'valor_entrada', array('label' => 'Valor de entrada', 'required' => false, 'filters' => array('StringTrim'), 'class' => 'form-control', 'decorators' => $this->setColSize(3))); // Adicionando tag HTML usando description do elemento $this->addElement('hidden', 'header3_atendimento', array('description' => '<h3>SOBRE O ATENDIEMENTO</h3>', 'ignore' => true, 'decorators' => array(array('Description', array('escape' => false, 'tag' => 'div', 'class' => "col-xs-12"))))); $this->addElement('select', 'meio_comunicacao', array('label' => 'Meio de Comunicação', 'required' => true, 'filters' => array('StringTrim'), 'class' => 'form-control', 'multiOptions' => $options_meio_comunicacao, 'validators' => array($required), 'decorators' => $this->setColSize())); $this->addElement('textarea', 'observacoes', array('label' => 'Observações', 'required' => false, 'filters' => array('StringTrim'), 'class' => 'form-control', 'cols' => 80, 'rows' => 5, 'decorators' => $this->setColSize())); $this->addElement('hidden', 'created_user_id', array('value' => CURRENT_USER_ID, 'decorators' => $this->setColSize(12))); $this->addElement('hidden', 'last_user_id', array('value' => CURRENT_USER_ID, 'decorators' => $this->setColSize(12))); $this->addElement('hidden', 'locked', array('value' => CURRENT_USER_ID, 'decorators' => $this->setColSize(12))); $this->addElement('hidden', 'locked_by', array('value' => CURRENT_USER_ID, 'decorators' => $this->setColSize(12))); $this->addElement('submit', 'Enviar', array('label' => 'Enviar', 'ignore' => 'true', 'class' => 'btn btn-success pull-right', 'decorators' => $this->setColSize(12, false))); $this->setDecorators(array('FormElements', array(array('in' => 'HtmlTag'), array('tag' => 'div', 'class' => 'row')), 'Form', array('HtmlTag', array('tag' => 'div', 'class' => 'panel panel-body panel-default')))); $this->setAttrib('class', 'form'); $this->setAttrib('id', 'ficha-atendimento'); $this->setMethod('post'); }
public function init() { // Verifica se o campo select esta com o valor null $required = new Zend_Validate_NotEmpty(); $required->setType($required->getType() | Zend_Validate_NotEmpty::INTEGER | Zend_Validate_NotEmpty::ZERO); // Pega a lista de perfis no banco de dados na tabela #__perfis $perfis = new Application_Model_Usuarios(); $lista_options = $perfis->getPerfis(); $options_perfil = array("-- Selecione --"); foreach ($lista_options as $option) { $options_perfil[$option->id] = $option->role; } $this->addElement('text', 'nome', array('label' => 'Nome', 'required' => true, 'filters' => array('StringTrim'), 'class' => 'form-control')); $this->addElement('text', 'email', array('label' => 'Email', 'required' => true, 'filters' => array('StringTrim'), 'class' => 'form-control')); $this->addElement('select', 'id_perfil', array('label' => 'Perfil', 'required' => true, 'filters' => array('StringTrim'), 'class' => 'form-control', 'multiOptions' => $options_perfil, 'validators' => array($required))); $this->addElement('select', 'acesso', array('label' => 'Habilitado', 'required' => true, 'class' => 'form-control', 'multiOptions' => array('0' => 'não', '1' => 'sim')))->setDefault('acesso', '0'); $this->addElement('password', 'password', array('label' => 'Senha', 'required' => true, 'filters' => array('StringTrim'), 'class' => 'form-control', 'autocomplete' => 'off', 'validators' => array(array('StringLength', false, array('min' => 4, 'max' => 10))))); $this->addElement('password', 'confirm', array('label' => 'Confirma Senha', 'required' => true, 'filters' => array('StringTrim'), 'class' => 'form-control', 'validators' => array(array('identical', false, array('token' => 'password'))))); $submit = $this->addElement('submit', 'Cadastrar', array('class' => 'btn btn-primary btn-md')); $this->setElementDecorators(array('ViewHelper', 'Errors', 'Label', 'Description', array('HtmlTag', array('tag' => 'div', 'class' => 'form-group'))), array('Cadastrar'), false); $this->setElementDecorators(array('ViewHelper', 'Errors', 'Description', array('HtmlTag', array('tag' => 'div', 'class' => 'form-group'))), array('Cadastrar'), true); $this->setDecorators(array('FormElements', 'Form', array('HtmlTag', array('tag' => 'div', 'class' => 'panel panel-body panel-default')))); $this->setAttrib('id', 'add_usuario'); $this->setAttrib('class', 'form'); $this->setMethod('post'); }
public function init() { // Verifica se o campo select esta com o valor null $required = new Zend_Validate_NotEmpty(); $required->setType($required->getType() | Zend_Validate_NotEmpty::STRING | Zend_Validate_NotEmpty::ZERO); $data_now = new Zend_Date(); $this->addElement('hidden', 'parcelas', array('Label' => '', 'required' => true, 'filters' => array('StringTrim'), 'class' => 'form-control', 'decorators' => $this->setColSize(12))); $this->addElement('hidden', 'id_proposta', array('value' => '', 'decorators' => $this->setColSize(12))); $this->addElement('hidden', 'last_user_id', array('value' => CURRENT_USER_ID, 'decorators' => $this->setColSize(12))); $this->setDecorators(array('FormElements', array(array('in' => 'HtmlTag'), array('tag' => 'div', 'class' => 'row')), 'Form', array('HtmlTag', array('tag' => 'div', 'class' => 'panel panel-body panel-default')))); $this->setAttrib('class', 'form'); $this->setAttrib('id', 'condicoes-pagamento'); $this->setMethod('post'); }
public function editAction() { $request = $this->getRequest(); $cid = $request->getParam('cid'); $id = $request->getParam('id'); $model = new Application_Model_Propostas(); $modelCliente = new Application_Model_Clientes(); $documentos = new Application_Model_Documentos(); $form = new Application_Form_Proposta(); if (!in_array(CURRENT_USER_ROLE, array('Corretor', 'Financeiro'))) { $users = new Application_Model_Usuarios(); $db = Zend_Db_Table::getDefaultAdapter(); $result = $db->fetchAll($users->selectAll()); $options = array(); $required = new Zend_Validate_NotEmpty(); $required->setType($required->getType() | Zend_Validate_NotEmpty::STRING | Zend_Validate_NotEmpty::ZERO); foreach ($result as $key => $value) { $options[$value['id']] = $value['nome'] . ' - ' . $value['role']; } $form->addElement('select', 'created_user_id', array('label' => 'Usuário', 'title' => 'Mude usuário responsável pela proposta', 'required' => true, 'filters' => array('StringTrim'), 'class' => 'form-control', 'multiOptions' => $options, 'validators' => array($required), 'decorators' => $form->setColSize(4))); } if ($request->isPost() && $form->isValid($request->getPost())) { $data = $request->getPost(); if ($id == 0) { unset($data['id']); if ($model->insert($data)) { $this->_FlashMessenger->setNamespace($this->_controllerName)->addMessage('Proposta adicionada com sucesso!'); $this->view->message_type = 'alert-success'; $this->redirect($this->_controllerName . '/edit/id/' . $model->lastInserId() . '/cid/' . $cid); } } else { if ($model->update($id, $data)) { $this->view->messages = array('Atualziado com sucesso!'); $this->view->message_type = 'alert-success'; } else { $this->view->messages = array('Sem alterações!'); $this->view->message_type = 'alert-info'; } } } else { $dataProposta = $model->selectById($id); // Verificando se ja existe uma proposta if ($dataProposta) { $data = $dataProposta; if (!empty($data['dados_extras'])) { $dadosExtras = json_decode($data['dados_extras'], true); $data = array_merge($data, $dadosExtras); unset($data['dados_extras']); } } else { $data = $modelCliente->selectById($cid); $dadosExtras = json_decode($data['dados_cliente'], true); $data = array_merge($data, $dadosExtras); // removendo id de quem criou a ficha do cliente $data['created_user_id'] = CURRENT_USER_ID; } } $model->lockRow($data['id'], CURRENT_USER_ID, 1); // Verifica se esta bloquedo $is_locked = $this->_acl_model->checkLocked($data['locked'], $data['locked_by']); if ($is_locked) { $this->view->messages = array('Item bloqueado para edição'); $this->view->hide = true; $this->view->form = ''; return false; } // Verifica sem tem permissão pra acessar o conteudo. $is_autorized = $this->_acl_model->autorized($data['created_user_id'], $this->_ids); if (!$is_autorized) { $this->view->messages = array('Sem permissão de acesso'); $this->view->barTitle = 'Editando Proposta'; $this->view->form = ''; return false; } // Pega Condições de pagamento $condicoes = $model->selectCondicoesPagamento($id); if ($condicoes) { $this->view->sinal = $condicoes['sinal']; $this->view->parcelas = json_decode($condicoes['parcelas'], true); } // Pega todos os arquivos relacinados ao cliente $this->view->anexos = $documentos->readDir(PUBLIC_PATH . DIRECTORY_SEPARATOR . 'uploads', $id); $this->view->documentos = $documentos; $this->view->barTitle = "Editando Proposta :: " . $data['nome']; $this->view->form = $form; $this->view->data = $data; $form->populate($data); }
/** * Ensures that the validator follows expected behavior * * @return void */ public function testGetType() { $this->assertEquals(493, $this->_validator->getType()); }
/** * @author code generate * @return mixed */ public function __construct($option = array()) { $userId = new Zend_Form_Element_Hidden('TutorId'); $userId->setDecorators(array('ViewHelper')); $this->addElement($userId); $birthDay = new Zend_Form_Element_Text('Birthday'); $birthDay->setLabel('Ngày sinh *'); $birthDay->addFilter('StringTrim'); $birthDay->setRequired(true); $birthDay->setDecorators(array('ViewHelper', array(array('control' => 'HtmlTag'), array('tag' => 'div', 'class' => 'element-control')), array('Label', array('class' => 'col-lg-2 control-label')), array(array('controls' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group')))); $birthDay->addValidator('stringLength', false, array(2, 50, "messages" => "Ngày sinh dài tối đa 50 ký tự")); $this->addElement($birthDay); $gender = new Zend_Form_Element_Select('Gender'); $gender->setLabel('Giới tính *'); $gender->addFilter('StringTrim'); $gender->setRequired(true); $gender->setMultiOptions(array('1' => 'Nam', '0' => 'Nữ')); $gender->setDecorators(array('ViewHelper', array(array('control' => 'HtmlTag'), array('tag' => 'div', 'class' => 'element-control')), array('Label', array('class' => 'control-label')), array(array('controls' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group')))); $gender->setSeparator(''); $gender->setValue("1"); $this->addElement($gender); $email = new Zend_Form_Element_Text('Email'); $email->setLabel('Email *'); $email->addFilter('StringTrim'); $email->setRequired(true); $email->setDecorators(array('ViewHelper', array(array('control' => 'HtmlTag'), array('tag' => 'div', 'class' => 'element-control')), array('Label', array('class' => 'col-lg-2 control-label')), array(array('controls' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group')))); $email->addValidator(new Zend_Validate_Db_NoRecordExists("Tutors", "Email")); $email->addValidator('EmailAddress', true); $email->setRequired(true)->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => "Email không phù hợp"))); $this->addElement($email); $userName = new Zend_Form_Element_Text('UserName'); $userName->setLabel('Họ tên *'); $userName->addFilter('StringTrim'); $userName->setRequired(true); $userName->setDecorators(array('ViewHelper', array(array('control' => 'HtmlTag'), array('tag' => 'div', 'class' => 'element-control')), array('Label', array('class' => 'col-lg-2 control-label')), array(array('controls' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group')))); $userName->addValidator('stringLength', false, array(2, 50, "messages" => "Họ tên dài tối đa 2-50 ký tự")); $this->addElement($userName); $address = new Zend_Form_Element_Text('Address'); $address->setLabel('Địa chỉ *'); $address->addFilter('StringTrim'); $address->setRequired(true); $address->setDecorators(array('ViewHelper', array(array('control' => 'HtmlTag'), array('tag' => 'div', 'class' => 'element-control')), array('Label', array('class' => 'col-lg-2 control-label')), array(array('controls' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group')))); $userName->addValidator('stringLength', false, array(1, 100, "messages" => "Địa chỉ dài tối đa 100 ký tự")); $this->addElement($address); $phone = new Zend_Form_Element_Text('Phone'); $phone->setLabel('Điện thoại *'); $phone->addFilter('StringTrim'); $phone->setRequired(true); $phone->setDecorators(array('ViewHelper', array(array('control' => 'HtmlTag'), array('tag' => 'div', 'class' => 'element-control')), array('Label', array('class' => 'col-lg-2 control-label')), array(array('controls' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group')))); $phone->addValidator('stringLength', false, array(6, 50, "messages" => "Điện thoại dài tối đa 6-50 ký tự")); $this->addElement($phone); $required = new Zend_Validate_NotEmpty(); $required->setType($required->getType() | Zend_Validate_NotEmpty::INTEGER | Zend_Validate_NotEmpty::ZERO); $level = new Zend_Form_Element_Select('Level'); $level->setLabel('Trình độ *'); $level->addFilter('StringTrim'); $level->addValidator('Int'); $level->setRequired(true); $level->setDecorators(array('ViewHelper', array(array('control' => 'HtmlTag'), array('tag' => 'div', 'class' => 'element-control')), array('Label', array('class' => 'control-label')), array(array('controls' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group')))); $level->addValidators(array($required)); $level->setMultiOptions(unserialize(TUTOR_LEVELS)); $this->addElement($level); $university = new Zend_Form_Element_Text('University'); $university->setLabel('Trường tốt nghiệp *'); $university->addFilter('StringTrim'); $university->setRequired(true); $university->setDecorators(array('ViewHelper', array(array('control' => 'HtmlTag'), array('tag' => 'div', 'class' => 'element-control')), array('Label', array('class' => 'control-label')), array(array('controls' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group')))); $university->addValidator('stringLength', false, array(1, 100, "messages" => "Trường tố nghiệp dài tối đa 100 ký tự")); $this->addElement($university); $subject = new Zend_Form_Element_Text('Subject'); $subject->setLabel('Chuyên ngành *'); $subject->addFilter('StringTrim'); $subject->setRequired(true); $subject->setDecorators(array('ViewHelper', array(array('control' => 'HtmlTag'), array('tag' => 'div', 'class' => 'element-control')), array('Label', array('class' => 'control-label')), array(array('controls' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group')))); $subject->addValidator('stringLength', false, array(1, 100, "messages" => "Chuyên ngành dài tối đa 100 ký tự")); $this->addElement($subject); $experienceYears = new Zend_Form_Element_Select('ExperienceYears'); $experienceYears->setLabel('Số Năm Kinh Nghiệm *'); $experienceYears->addFilter('StringTrim'); $experienceYears->setRequired(false); $experienceYears->setDecorators(array('ViewHelper', array(array('control' => 'HtmlTag'), array('tag' => 'div', 'class' => 'element-control')), array('Label', array('class' => 'control-label')), array(array('controls' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group')))); $options = unserialize(EXPERIENCE_YEAR); //$experienceYears->addMultiOptions(array_combine($options, $options)); $experienceYears->setMultiOptions(unserialize(EXPERIENCE_YEAR)); $this->addElement($experienceYears); $career = new Zend_Form_Element_Select('Career'); $career->setLabel('Hiện tại là *'); $career->addFilter('StringTrim'); $career->addValidator('Int'); $career->setRequired(true); $career->setDecorators(array('ViewHelper', array(array('control' => 'HtmlTag'), array('tag' => 'div', 'class' => 'element-control')), array('Label', array('class' => 'control-label')), array(array('controls' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group')))); $career->setMultiOptions(unserialize(TUTOR_CAREERS)); $this->addElement($career); $careerLocation = new Zend_Form_Element_Text('CareerLocation'); $careerLocation->setLabel('Nơi Công Tác ( Giáo hoặc Giảng Viên ) *'); $careerLocation->addFilter('StringTrim'); $careerLocation->setRequired(false); $careerLocation->setAttrib('style', 'min-height: 30px;'); $careerLocation->setDecorators(array('ViewHelper', array(array('control' => 'HtmlTag'), array('tag' => 'div', 'class' => 'element-control')), array('Label', array('class' => 'control-label')), array(array('controls' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group')))); $careerLocation->addValidator('stringLength', false, array(1, 100, "messages" => "Nơi Công Tác dài tối đa 100 ký tự")); $this->addElement($careerLocation); $teachableInClass = new Zend_Form_Element_Text('TeachableInClass'); $teachableInClass->setLabel('Lớp Có Thể Dạy'); $teachableInClass->addFilter('StringTrim'); $teachableInClass->setRequired(false); $teachableInClass->setAttrib('disabled', true); $teachableInClass->setDescription('<a id="grades-modal" class="btn btn-info" title="Chọn lớp">...</a>'); $teachableInClass->setDecorators(array('ViewHelper', array('Description', array('escape' => false)), array(array('control' => 'HtmlTag'), array('tag' => 'div', 'class' => 'element-control col-lg-6')), array('Label', array('class' => 'control-label col-lg-2')), array(array('controls' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group')))); $this->addElement($teachableInClass); $teachableSubjects = new Zend_Form_Element_Text('TeachableSubjects'); $teachableSubjects->setLabel('Môn Có Thể Dạy'); $teachableSubjects->addFilter('StringTrim'); $teachableSubjects->setRequired(false); $teachableSubjects->setAttrib('disabled', true); $teachableSubjects->setDescription('<a id="subjects-modal" class="btn btn-info" title="Chọn môn">...</a>'); $teachableSubjects->setDecorators(array('ViewHelper', array('Description', array('escape' => false)), array(array('control' => 'HtmlTag'), array('tag' => 'div', 'class' => 'element-control col-lg-6')), array('Label', array('class' => 'control-label col-lg-2')), array(array('controls' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group')))); $this->addElement($teachableSubjects); $teachableDistricts = new Zend_Form_Element_Text('TeachableDistricts'); $teachableDistricts->setLabel('Khu Vực Có Thể Dạy'); $teachableDistricts->addFilter('StringTrim'); $teachableDistricts->setRequired(false); $teachableDistricts->setAttrib('disabled', true); $teachableDistricts->setDescription('<span id="districts-modal" class="btn btn-info" title="Chọn quận">...</span>'); $teachableDistricts->setDecorators(array('ViewHelper', array('Description', array('escape' => false)), array(array('control' => 'HtmlTag'), array('tag' => 'div', 'class' => 'element-control col-lg-6')), array('Label', array('class' => 'control-label col-lg-2')), array(array('controls' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group')))); $this->addElement($teachableDistricts); $avatar = new Zend_Form_Element_Hidden('Upload'); $avatar->setLabel('Hình đại diện'); $avatar->setRequired(false); $avatar->setDescription('fieldlabel'); $avatar->setDecorators(array('ViewHelper', array(array('Description' => 'HtmlTag'), array('tag' => 'div', 'id' => "file-uploader")), array(array('Errors' => 'HtmlTag'), array('placement' => 'append', 'tag' => 'img', 'id' => 'progress-img', 'src' => "/scripts/upload/loading.gif")), array(array('control' => 'HtmlTag'), array('tag' => 'div', 'class' => 'element-control', 'style' => "position: relative;float: left;margin-left: 20px;")), array('Label', array('class' => 'control-label')), array(array('controls' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group')))); $this->addElement($avatar); $avatarNote = new Zend_Form_Element_Hidden('Avatar'); $avatarNote->setLabel('Chú ý'); $avatarNote->setRequired(false); $avatarNote->setDescription("Kích thước khoảng: 240 x 120 (px)<br>Kích cỡ cho phép: " . IMAGE_SIZE_LIMIT . " kB"); $avatarNote->setDecorators(array('ViewHelper', array('Description', array('escape' => false, 'tag' => 'div')), array(array('control' => 'HtmlTag'), array('tag' => 'div', 'class' => 'element-control')), array('Label', array('class' => 'control-label')), array(array('controls' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group', 'style' => "float: left;")))); $this->addElement($avatarNote); $introduction = new Zend_Form_Element_Textarea('Introduction'); $introduction->setLabel('Giới thiệu bản thân'); $introduction->addFilter('StringTrim'); $introduction->setRequired(false); $introduction->setOptions(array('cols' => '10', 'rows' => '4')); /* $introduction->setDecorators(array('ViewHelper')); */ $introduction->setDecorators(array('ViewHelper', array(array('control' => 'HtmlTag'), array('tag' => 'div', 'class' => 'element-control')), array('Label', array('class' => 'control-label')), array(array('controls' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group')))); $subject->addValidator('stringLength', false, array(1, 2000, "messages" => "Giới thiệu bản thân dài tối đa 2000 ký tự")); $this->addElement($introduction); $isDisabled = new Zend_Form_Element_Text('IsDisabled'); $isDisabled->setLabel('IsDisabled'); $isDisabled->addFilter('StringTrim'); $isDisabled->addValidator('Int'); $isDisabled->setDecorators(array('ViewHelper', array(array('control' => 'HtmlTag'), array('tag' => 'div', 'class' => 'element-control')), array('Label', array('class' => 'control-label')), array(array('controls' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group')))); $this->addElement($isDisabled); $submit = new Zend_Form_Element_Submit('Save'); $submit->setLabel('Đăng ký'); $submit->setAttrib('class', 'btn btn-primary'); $submit->setDecorators(array('ViewHelper')); $this->addElement($submit); $reset = new Zend_Form_Element_Reset('Reset'); $reset->setLabel('Làm lại'); $reset->setAttrib('class', 'btn btn-primary'); $reset->setDecorators(array('ViewHelper')); $this->addElement($reset); $this->addDisplayGroup(array('UserName', 'Gender', 'Birthday', 'Email', 'Address', 'Phone'), 'contact', array('disableLoadDefaultDecorators' => false, 'legend' => 'Thông tin cá nhân')); $contact = $this->getDisplayGroup('contact'); $contact->setDecorators(array('FormElements', 'Fieldset', array('HtmlTag', array('tag' => 'fieldset', 'class' => 'well the-fieldset')))); $this->addDisplayGroup(array('Level', 'University', 'Subject', 'Career', 'CareerLocation', 'ExperienceYears'), 'level', array('disableLoadDefaultDecorators' => false, 'legend' => 'Thông tin học vấn')); $level = $this->getDisplayGroup('level'); $level->setDecorators(array('FormElements', 'Fieldset', array('HtmlTag', array('tag' => 'fieldset', 'class' => 'well the-fieldset')))); $this->addDisplayGroup(array('TeachableInClass', 'TeachableSubjects', 'TeachableDistricts', 'Upload', 'Avatar', 'Introduction'), 'extra', array('disableLoadDefaultDecorators' => false, 'legend' => 'Thông tin thêm')); $extra = $this->getDisplayGroup('extra'); $extra->setDecorators(array('FormElements', 'Fieldset', array('HtmlTag', array('tag' => 'fieldset', 'class' => 'well the-fieldset')))); $this->addDisplayGroup(array('Save', 'Reset'), 'submit', array('disableLoadDefaultDecorators' => false, 'legend' => 'Thông tin học vấn')); $submit = $this->getDisplayGroup('submit'); $submit->setDecorators(array('FormElements', 'Fieldset', array('HtmlTag', array('tag' => 'fieldset', 'class' => 'well the-fieldset')))); }
public function init() { // Verifica se o campo select esta com o valor null $required = new Zend_Validate_NotEmpty(); $required->setType($required->getType() | Zend_Validate_NotEmpty::STRING | Zend_Validate_NotEmpty::ZERO); $data_now = new Zend_Date(); $imovel = new Application_Model_Empreendimentos(); $options_estado_civil = array('-- Selecione --', 'casado' => 'Casado', 'solteiro' => 'Solteiro', 'divorciado' => 'Divorciado', 'viuvo' => 'Viuvo'); $options_empty = array('-- Selecione --'); $options_imovel = array('-- Selecione --'); $dataImovies = $imovel->selectAll(1); foreach ($dataImovies as $imovel) { $options_imovel[$imovel->id] = $imovel->nome; } $options_meio_comunicacao = array('-- Selecione --', 'Telefone' => 'Telefone', 'Tv' => 'TV', 'Local' => 'Pass. no Local', 'Radio' => 'Rádio', 'Faixas' => 'Faixas', 'Email' => 'Email', 'Panfletagem' => 'Panfletagem', 'Mala direta' => 'Mala direta', 'Indicação' => 'Indicação', 'Internet' => 'Internet', 'Jornal' => 'Jornal', 'Outdoor' => 'Outdoor', 'Outros' => 'Outros'); $options_renda = array('-- Selecione --', 'formal' => 'Formal', 'informal' => 'Informal', 'mista' => 'Mista'); $options_sim_nao = array('Não', 'Sim'); $this->addElement('hidden', 'created_user_id', array('value' => CURRENT_USER_ID, 'decorators' => $this->setColSize(1, false))); // Adicionando tag HTML usando description do elemento $this->addElement('hidden', 'header3_imovel', array('description' => '<h3>DADOS IMÓVEL</h3>', 'ignore' => true, 'decorators' => array(array('Description', array('escape' => false, 'tag' => 'div', 'class' => "col-xs-12"))))); $this->addElement('select', 'imovel', array('label' => 'Empreendimento /imovel', 'required' => true, 'filters' => array('StringTrim'), 'class' => 'form-control', 'multiOptions' => $options_imovel, 'validators' => array($required), 'decorators' => $this->setColSize(4))); $this->addElement('select', 'imovel_bloco_quadra', array('label' => 'Bloco /Quadra /Nº Casa', 'required' => true, 'filters' => array('StringTrim'), 'class' => 'form-control', 'multiOptions' => $options_empty, 'validators' => array($required), 'decorators' => $this->setColSize(4))); $this->addElement('text', 'imovel_unidade', array('label' => 'Unidade', 'required' => true, 'filters' => array('StringTrim'), 'class' => 'form-control', 'decorators' => $this->setColSize(4))); // Adicionando tag HTML usando description do elemento $this->addElement('hidden', 'header3', array('description' => '<h3>DADOS CADASTRAIS</h3>', 'ignore' => true, 'decorators' => array(array('Description', array('escape' => false, 'tag' => 'div', 'class' => "col-xs-12"))))); $this->addElement('text', 'nome', array('label' => 'Nome', 'required' => false, 'filters' => array('StringTrim'), 'class' => 'form-control', 'decorators' => $this->setColSize(6))); $this->addElement('text', 'cpf', array('label' => 'CPF', 'required' => false, 'filters' => array('StringTrim'), 'class' => 'form-control', 'decorators' => $this->setColSize(3))); $this->addElement('select', 'estado_civil', array('label' => 'Estado Civil', 'required' => false, 'filters' => array('StringTrim'), 'class' => 'form-control', 'multiOptions' => $options_estado_civil, 'validators' => array($required), 'decorators' => $this->setColSize(3))); $this->addElement('text', 'regime_casamento', array('label' => 'Regime de casamento', 'required' => false, 'filters' => array('StringTrim'), 'class' => 'form-control', 'decorators' => $this->setColSize(5))); $this->addElement('text', 'email', array('label' => 'E-mail', 'required' => false, 'filters' => array('StringTrim'), 'class' => 'form-control', 'decorators' => $this->setColSize(5))); $this->addElement('text', 'data_nasc', array('label' => 'Data de nascimento', 'required' => false, 'description' => '<span class="glyphicon glyphicon-calendar"></span>', 'filters' => array('StringTrim'), 'class' => 'form-control', 'decorators' => $this->setColSize(2, true, true))); $this->addElement('text', 'rg', array('label' => 'Identidade', 'required' => false, 'description' => '', 'filters' => array('StringTrim'), 'class' => 'form-control', 'decorators' => $this->setColSize(2))); $this->addElement('text', 'rg_orgao_expeditor', array('label' => 'Orgão expedidor', 'required' => false, 'description' => '', 'filters' => array('StringTrim'), 'class' => 'form-control', 'decorators' => $this->setColSize(2))); $this->addElement('text', 'nacionalidade', array('label' => 'Nacionalidade', 'required' => false, 'description' => '', 'filters' => array('StringTrim'), 'class' => 'form-control', 'decorators' => $this->setColSize(2))); $this->addElement('select', 'naturalidade_estado', array('label' => 'Estado', 'required' => false, 'filters' => array('StringTrim'), 'class' => 'form-control', 'multiOptions' => array(), 'decorators' => $this->setColSize(2))); $naturalidade_estado = $this->getElement('naturalidade_estado'); $naturalidade_estado->setRegisterInArrayValidator(false); $this->addElement('select', 'naturalidade', array('label' => 'Naturalidade', 'required' => false, 'filters' => array('StringTrim'), 'class' => 'form-control', 'multiOptions' => array(), 'decorators' => $this->setColSize(2))); $naturalidade = $this->getElement('naturalidade'); $naturalidade->setRegisterInArrayValidator(false); $this->addElement('select', 'sexo', array('label' => 'Sexo', 'required' => false, 'filters' => array('StringTrim'), 'class' => 'form-control', 'multiOptions' => array('M' => 'Masculino', 'F' => 'Feminio'), 'decorators' => $this->setColSize(2))); // Adicionando tag HTML usando description do elemento $this->addElement('hidden', 'hr_filiacao', array('description' => '<h3>FILIAÇÃO</h3>', 'ignore' => true, 'decorators' => array(array('Description', array('escape' => false, 'tag' => 'div', 'class' => "col-xs-12"))))); $this->addElement('text', 'filiacao_pai', array('label' => 'Pai', 'required' => false, 'filters' => array('StringTrim'), 'class' => 'form-control', 'decorators' => $this->setColSize(6))); $this->addElement('text', 'filiacao_mae', array('label' => 'Mãe', 'required' => false, 'filters' => array('StringTrim'), 'class' => 'form-control', 'decorators' => $this->setColSize(6))); // Adicionando tag HTML usando description do elemento $this->addElement('hidden', 'hr_end', array('description' => '<hr/>', 'ignore' => true, 'decorators' => array(array('Description', array('escape' => false, 'tag' => 'div', 'class' => "col-xs-12"))))); $this->addElement('text', 'cep', array('label' => 'CEP', 'required' => false, 'filters' => array('StringTrim'), 'class' => 'form-control', 'decorators' => $this->setColSize(3))); $this->addElement('text', 'endereco', array('label' => 'Endereço', 'required' => false, 'filters' => array('StringTrim'), 'class' => 'form-control', 'decorators' => $this->setColSize(9))); $this->addElement('text', 'bairro', array('label' => 'Bairro', 'required' => false, 'filters' => array('StringTrim'), 'class' => 'form-control', 'decorators' => $this->setColSize(6))); $this->addElement('select', 'estado', array('label' => 'Estado', 'required' => false, 'filters' => array('StringTrim'), 'class' => 'form-control', 'multiOptions' => $options_empty, 'validators' => array($required), 'decorators' => $this->setColSize(3))); $this->addElement('select', 'cidade', array('label' => 'Cidade', 'required' => false, 'filters' => array('StringTrim'), 'class' => 'form-control', 'multiOptions' => $options_empty, 'validators' => array($required), 'decorators' => $this->setColSize(3))); // Adicionando tag HTML usando description do elemento $this->addElement('hidden', 'hr_phones', array('description' => '<hr/>', 'ignore' => true, 'decorators' => array(array('Description', array('escape' => false, 'tag' => 'div', 'class' => "col-xs-12"))))); $this->addElement('text', 'fone_resid', array('label' => 'Fone Resid.', 'required' => false, 'filters' => array('StringTrim'), 'class' => 'form-control', 'decorators' => $this->setColSize(4))); $this->addElement('text', 'fone_com', array('label' => 'Fone Com.', 'required' => false, 'filters' => array('StringTrim'), 'class' => 'form-control', 'decorators' => $this->setColSize(4))); $this->addElement('text', 'fone_cel', array('label' => 'Celular', 'required' => false, 'filters' => array('StringTrim'), 'class' => 'form-control', 'decorators' => $this->setColSize(4))); // Adicionando tag HTML usando description do elemento $this->addElement('hidden', 'hr_contato', array('description' => '<hr/>', 'ignore' => true, 'decorators' => array(array('Description', array('escape' => false, 'tag' => 'div', 'class' => "col-xs-12"))))); $this->addElement('text', 'empresa_trabalha', array('label' => 'Empresa na qual trabalha', 'required' => false, 'filters' => array('StringTrim'), 'class' => 'form-control', 'decorators' => $this->setColSize())); $this->addElement('text', 'profissao', array('label' => 'Profissão', 'required' => false, 'filters' => array('StringTrim'), 'class' => 'form-control', 'decorators' => $this->setColSize(6))); $this->addElement('text', 'cargo', array('label' => 'Cargo', 'required' => false, 'filters' => array('StringTrim'), 'class' => 'form-control', 'decorators' => $this->setColSize(6))); $this->addElement('text', 'renda_pessoal', array('label' => 'Renda Pessoal', 'required' => false, 'filters' => array('StringTrim'), 'class' => 'form-control', 'decorators' => $this->setColSize(6))); $this->addElement('select', 'renda', array('label' => 'Renda', 'required' => false, 'filters' => array('StringTrim'), 'class' => 'form-control', 'multiOptions' => $options_renda, 'validators' => array($required), 'decorators' => $this->setColSize(6))); $this->addElement('select', 'fgts', array('label' => 'FGTS', 'filters' => array('StringTrim'), 'class' => 'form-control', 'multiOptions' => $options_sim_nao, 'decorators' => $this->setColSize(3))); $this->addElement('select', 'fgts_tres_anos', array('label' => 'Mais de 3 anos', 'filters' => array('StringTrim'), 'class' => 'form-control', 'multiOptions' => $options_sim_nao, 'decorators' => $this->setColSize(3))); $this->addElement('text', 'saldo_fgts', array('label' => 'Saldo FGTS', 'required' => false, 'filters' => array('StringTrim'), 'class' => 'form-control', 'decorators' => $this->setColSize(3))); // Adicionando tag HTML usando description do elemento $this->addElement('hidden', 'hr_conj', array('description' => '<hr/>', 'ignore' => true, 'decorators' => array(array('Description', array('escape' => false, 'tag' => 'div', 'class' => "col-xs-12"))))); // Adicionando tag HTML usando description do elemento $this->addElement('hidden', 'header3_conj', array('description' => '<h3>CONJUGE OU SEGUNDO PROPONENTE</h3>', 'ignore' => true, 'decorators' => array(array('Description', array('escape' => false, 'tag' => 'div', 'class' => "col-xs-12"))))); $this->addElement('text', 'conj_nome', array('label' => 'Nome', 'required' => false, 'filters' => array('StringTrim'), 'class' => 'form-control', 'decorators' => $this->setColSize(6))); $this->addElement('text', 'conj_cpf', array('label' => 'CPF', 'required' => false, 'filters' => array('StringTrim'), 'class' => 'form-control', 'decorators' => $this->setColSize(3))); $this->addElement('select', 'conj_estado_civil', array('label' => 'Estado Civil', 'required' => false, 'filters' => array('StringTrim'), 'class' => 'form-control', 'multiOptions' => $options_estado_civil, 'validators' => array($required), 'decorators' => $this->setColSize(3))); $this->addElement('text', 'conj_regime_casamento', array('label' => 'Regime de casamento', 'required' => false, 'filters' => array('StringTrim'), 'class' => 'form-control', 'decorators' => $this->setColSize(5))); $this->addElement('text', 'conj_email', array('label' => 'E-mail', 'required' => false, 'filters' => array('StringTrim'), 'class' => 'form-control', 'decorators' => $this->setColSize(5))); $this->addElement('text', 'conj_data_nasc', array('label' => 'Data de nascimento', 'required' => false, 'description' => '<span class="glyphicon glyphicon-calendar"></span>', 'filters' => array('StringTrim'), 'class' => 'form-control', 'decorators' => $this->setColSize(2, true, true))); $this->addElement('text', 'conj_rg', array('label' => 'Identidade', 'required' => false, 'description' => '', 'filters' => array('StringTrim'), 'class' => 'form-control', 'decorators' => $this->setColSize(2))); $this->addElement('text', 'conj_rg_orgao_expeditor', array('label' => 'Orgão expedidor', 'required' => false, 'description' => '', 'filters' => array('StringTrim'), 'class' => 'form-control', 'decorators' => $this->setColSize(2))); $this->addElement('text', 'conj_nacionalidade', array('label' => 'Nacionalidade', 'required' => false, 'description' => '', 'filters' => array('StringTrim'), 'class' => 'form-control', 'decorators' => $this->setColSize(2))); $this->addElement('select', 'conj_naturalidade_estado', array('label' => 'Estado', 'required' => false, 'filters' => array('StringTrim'), 'class' => 'form-control', 'multiOptions' => array(), 'decorators' => $this->setColSize(2))); $conj_naturalidade = $this->getElement('conj_naturalidade_estado'); $conj_naturalidade->setRegisterInArrayValidator(false); $this->addElement('select', 'conj_naturalidade', array('label' => 'Naturalidade', 'required' => false, 'filters' => array('StringTrim'), 'class' => 'form-control', 'multiOptions' => array(), 'decorators' => $this->setColSize(2))); $conj_naturalidade = $this->getElement('conj_naturalidade'); $conj_naturalidade->setRegisterInArrayValidator(false); $this->addElement('select', 'conj_sexo', array('label' => 'Sexo', 'required' => false, 'filters' => array('StringTrim'), 'class' => 'form-control', 'multiOptions' => array('M' => 'Masculino', 'F' => 'Feminio'), 'decorators' => $this->setColSize(2))); // Adicionando tag HTML usando description do elemento $this->addElement('hidden', 'conj_hr_filiacao', array('description' => '<h3>FILIAÇÃO</h3>', 'ignore' => true, 'decorators' => array(array('Description', array('escape' => false, 'tag' => 'div', 'class' => "col-xs-12"))))); $this->addElement('text', 'conj_filiacao_pai', array('label' => 'Pai', 'required' => false, 'filters' => array('StringTrim'), 'class' => 'form-control', 'decorators' => $this->setColSize(6))); $this->addElement('text', 'conj_filiacao_mae', array('label' => 'Mãe', 'required' => false, 'filters' => array('StringTrim'), 'class' => 'form-control', 'decorators' => $this->setColSize(6))); // Adicionando tag HTML usando description do elemento $this->addElement('hidden', 'conj_hr_end', array('description' => '<hr/>', 'ignore' => true, 'decorators' => array(array('Description', array('escape' => false, 'tag' => 'div', 'class' => "col-xs-12"))))); $this->addElement('text', 'conj_cep', array('label' => 'CEP', 'required' => false, 'filters' => array('StringTrim'), 'class' => 'form-control', 'decorators' => $this->setColSize(3))); $this->addElement('text', 'conj_endereco', array('label' => 'Endereço', 'required' => false, 'filters' => array('StringTrim'), 'class' => 'form-control', 'decorators' => $this->setColSize(9))); $this->addElement('text', 'conj_bairro', array('label' => 'Bairro', 'required' => false, 'filters' => array('StringTrim'), 'class' => 'form-control', 'decorators' => $this->setColSize(6))); $this->addElement('select', 'conj_estado', array('label' => 'Estado', 'required' => false, 'filters' => array('StringTrim'), 'class' => 'form-control', 'multiOptions' => $options_empty, 'validators' => array($required), 'decorators' => $this->setColSize(3))); $this->addElement('select', 'conj_cidade', array('label' => 'Cidade', 'required' => false, 'filters' => array('StringTrim'), 'class' => 'form-control', 'multiOptions' => $options_empty, 'validators' => array($required), 'decorators' => $this->setColSize(3))); // Adicionando tag HTML usando description do elemento $this->addElement('hidden', 'hr_phones_conj', array('description' => '<hr/>', 'ignore' => true, 'decorators' => array(array('Description', array('escape' => false, 'tag' => 'div', 'class' => "col-xs-12"))))); $this->addElement('text', 'conj_fone_resid', array('label' => 'Fone Resid.', 'required' => false, 'filters' => array('StringTrim'), 'class' => 'form-control', 'decorators' => $this->setColSize(4))); $this->addElement('text', 'conj_fone_com', array('label' => 'Fone Com.', 'required' => false, 'filters' => array('StringTrim'), 'class' => 'form-control', 'decorators' => $this->setColSize(4))); $this->addElement('text', 'conj_fone_cel', array('label' => 'Celular', 'required' => false, 'filters' => array('StringTrim'), 'class' => 'form-control', 'decorators' => $this->setColSize(4))); // Adicionando tag HTML usando description do elemento $this->addElement('hidden', 'conj_hr_contato', array('description' => '<hr/>', 'ignore' => true, 'decorators' => array(array('Description', array('escape' => false, 'tag' => 'div', 'class' => "col-xs-12"))))); $this->addElement('text', 'conj_empresa_trabalha', array('label' => 'Empresa na qual trabalha', 'required' => false, 'filters' => array('StringTrim'), 'class' => 'form-control', 'decorators' => $this->setColSize())); $this->addElement('text', 'conj_profissao', array('label' => 'Profissão', 'required' => false, 'filters' => array('StringTrim'), 'class' => 'form-control', 'decorators' => $this->setColSize(6))); $this->addElement('text', 'conj_cargo', array('label' => 'Cargo', 'required' => false, 'filters' => array('StringTrim'), 'class' => 'form-control', 'decorators' => $this->setColSize(6))); $this->addElement('text', 'conj_renda_pessoal', array('label' => 'Renda Pessoal', 'required' => false, 'filters' => array('StringTrim'), 'class' => 'form-control', 'decorators' => $this->setColSize(6))); $this->addElement('select', 'conj_renda', array('label' => 'Renda', 'required' => false, 'filters' => array('StringTrim'), 'class' => 'form-control', 'multiOptions' => $options_renda, 'validators' => array($required), 'decorators' => $this->setColSize(6))); $this->addElement('select', 'conj_fgts', array('label' => 'FGTS', 'filters' => array('StringTrim'), 'class' => 'form-control', 'multiOptions' => $options_sim_nao, 'decorators' => $this->setColSize(3))); $this->addElement('select', 'conj_fgts_tres_anos', array('label' => 'Mais de 3 anos', 'filters' => array('StringTrim'), 'class' => 'form-control', 'multiOptions' => $options_sim_nao, 'decorators' => $this->setColSize(3))); $this->addElement('text', 'conj_saldo_fgts', array('label' => 'Saldo FGTS', 'required' => false, 'filters' => array('StringTrim'), 'class' => 'form-control', 'decorators' => $this->setColSize(3))); // Adicionando tag HTML usando description do elemento $this->addElement('hidden', 'separador_entrada', array('description' => '<hr/>', 'ignore' => true, 'decorators' => array(array('Description', array('escape' => false, 'tag' => 'div', 'class' => "col-xs-12"))))); $this->addElement('text', 'valor_entrada', array('label' => 'Valor de entrada', 'required' => false, 'filters' => array('StringTrim'), 'class' => 'form-control', 'decorators' => $this->setColSize(3))); $this->addElement('text', 'renda_familiar', array('label' => 'Renda Familiar', 'required' => false, 'filters' => array('StringTrim'), 'class' => 'form-control', 'decorators' => $this->setColSize(3))); // Adicionando tag HTML usando description do elemento $this->addElement('hidden', 'hr_atendimento', array('description' => '<hr/>', 'ignore' => true, 'decorators' => array(array('Description', array('escape' => false, 'tag' => 'div', 'class' => "col-xs-12"))))); // Adicionando tag HTML usando description do elemento $this->addElement('hidden', 'header3_atendimento', array('description' => '<h3>SOBRE O ATENDIMENTO</h3>', 'ignore' => true, 'decorators' => array(array('Description', array('escape' => false, 'tag' => 'div', 'class' => "col-xs-12"))))); $this->addElement('select', 'meio_comunicacao', array('label' => 'Meio de Comunicação', 'required' => false, 'filters' => array('StringTrim'), 'class' => 'form-control', 'multiOptions' => $options_meio_comunicacao, 'validators' => array($required), 'decorators' => $this->setColSize())); $this->addElement('textarea', 'observacoes', array('label' => 'Observações', 'required' => false, 'filters' => array('StringTrim'), 'class' => 'form-control', 'cols' => 80, 'rows' => 5, 'decorators' => $this->setColSize())); $this->addElement('hidden', 'data_proposta', array('value' => $data_now->toString('YYYY-MM-dd'), 'decorators' => $this->setColSize(1, false))); $this->addElement('hidden', 'data', array('value' => $data_now->toString('YYYY-MM-dd'), 'decorators' => $this->setColSize(1, false))); $this->addElement('hidden', 'id_cliente', array('value' => '', 'decorators' => $this->setColSize(1, false))); $this->addElement('hidden', 'id', array('value' => '', 'decorators' => $this->setColSize(1, false))); $this->addElement('hidden', 'last_user_id', array('value' => CURRENT_USER_ID, 'decorators' => $this->setColSize(1, false))); $this->addElement('hidden', 'locked', array('value' => '', 'decorators' => $this->setColSize(1, false))); $this->addElement('hidden', 'locked_by', array('value' => CURRENT_USER_ID, 'decorators' => $this->setColSize(1, false))); $this->addElement('hidden', 'status', array('value' => '2', 'decorators' => $this->setColSize(1, false))); $this->addElement('submit', 'Enviar', array('label' => 'Enviar', 'ignore' => 'true', 'class' => 'btn btn-success pull-right', 'decorators' => $this->setColSize(1, false))); $this->setDecorators(array('FormElements', array(array('in' => 'HtmlTag'), array('tag' => 'div', 'class' => 'row')), 'Form', array('HtmlTag', array('tag' => 'div', 'class' => 'panel panel-body panel-default')))); $this->setAttrib('class', 'form'); $this->setAttrib('id', 'ficha-proposta'); $this->setMethod('post'); }