﻿<?
class Sinistro_Form_PesquisaAviso extends Agro_Form {
	
	public function init() {
		$Safras = new Sinistro_Model_Safras();
		$this->addElement('select', 'id_safra', array(
			'MultiOptions' => $Safras->getCombo(0, false, true),
			'decorators' => $this->elementDecorator,
			'label' => 'Safra',
			'required' => false,
			'value' => $Safras->safraCurrent
		));
		
        $Status = new Sistema_Model_Status();
		$this->addElement('select', 'id_status', array(
			'MultiOptions' => $Status->getComboGerenciaAvisoSinistro(),
			'decorators' => $this->elementDecorator,
			'label' => 'Status do Aviso',
			'required' => false
		));
		
		$Eventos = new Produto_Model_Eventos();
		$this->addElement('select', 'id_evento', array(
		        'MultiOptions' => $Eventos->getCombo(),
		        'decorators' => $this->elementDecorator,
		        'label' => 'Evento',
		        'required' => false
		));		
		
		$Produtos = new Sinistro_Model_Produtos();
		$this->addElement('select', 'id_produto', array(
			'MultiOptions' => $Produtos->getCombo(),
			'decorators' => $this->elementDecorator,
			'label' => 'Produto',
			'required' => false,
			'class' => ''
		));

        $this->addElement('select', 'tp_pessoa', array(
			'MultiOptions' => array('F'=>'Física','J'=>'Jurídica'),
			'decorators' => $this->elementDecorator,
			'label' => 'Tipo Pessoa',
			'required' => false
		));

		$this->addElement('text', 'cpf_cnpj', array(
			'decorators' => $this->elementDecorator,
			'label' => 'CPF/CNPJ',
			'required' => false
		));
		
		$Estados = new Sistema_Model_Estados();
		$this->addElement('select', 'id_estado', array(
			'decorators' => $this->elementDecorator,
		    'MultiOptions' => $Estados->getCombo(),
			'label' => 'Estado',
			'required' => false,
			'class' => 'atualizar'
		));
		
		$this->addElement('select', 'id_municipio', array(
			'decorators' => $this->elementDecorator,
			'label' => 'Município',
			'required' => false,
			'class' => ''
		));
		
		$this->addElement('select', 'fl_pasta_aberta', array(
			'MultiOptions' => array("" => "--- Todos ---", "1" => "Aberta", "2" => "Aguardando abertura"),
			'decorators' => $this->elementDecorator,
			'label' => 'Pasta',
			'required' => false
		));

		$this->addElement('text', 'ds_endereco', array(
			'decorators' => $this->elementDecorator,
			'label' => 'Endereço',
			'required' => false,
			'size' => 60
		));
		
		$this->addElement('text', 'dt_criacao_inicial', array(
			'decorators' => $this->elementDecorator,
			'label' => 'Dt. encerramento(inicio)',
			'class' => 'data',
			'required' => true
		));
		   
		$this->addElement('text', 'dt_criacao_final', array(
			'decorators' => $this->elementDecorator,
			'label' => 'Dt. encerramento(final)',
			'class' => 'data',
			'required' => true
		));   
	}
}