<?php
class Sistema_Form_Municipio extends Agro_Form {
	
	public function init() {
		$this->addElement('hidden', 'id', array('decorators' => $this->elementDecorator));
		
		$Estado = new Sistema_Model_Estados();
		$this->addElement('select', 'id_estado', array(
			'MultiOptions' => $Estado->fetchPairs('id', 'ds_nome_estado'),
			'decorators' => $this->elementDecorator,
			'label' => 'Estado',
			'required' => true
		));
		
		$Regiao = new Sistema_Model_Regioes();
		$this->addElement('select', 'id_regiao', array(
			'MultiOptions' => $Regiao->fetchPairs('id', 'ds_nome_regiao'),
			'decorators' => $this->elementDecorator,
			'label' => 'Região',
			'required' => false
		));
		
		$this->addElement('select', 'id_estado_search', array(
			'MultiOptions' => $Estado->fetchPairs('id', 'ds_nome_estado'),
			'decorators' => $this->elementDecorator,
			'label' => 'Estado',
			'required' => false
		));
		
		$this->addElement('text', 'ds_nome_municipio', array(
			'decorators' => $this->elementDecorator,
			'required' => true,
			'maxlength' => 100,
			'label' => 'Nome',
			'size' => 50
		));
		
		$this->addElement('text', 'ds_latitude', array(
			'decorators' => $this->elementDecorator,
			'maxlength' => 7,
			'label' => 'Latitude',
			'size' => 15
		));
		
		$this->addElement('text', 'ds_longitude', array(
			'decorators' => $this->elementDecorator,
			'maxlength' => 7,
			'label' => 'Longitude',
			'size' => 15
		));
		
		$this->addElement('text', 'vl_altitude', array(
			'decorators' => $this->elementDecorator,
			'maxlength' => 4,
			'label' => 'Altitude',
			'class' => 'decimal',
			'size' => 15
		));
		
		$this->addElement('text', 'vl_area', array(
			'decorators' => $this->elementDecorator,
			'maxlength' => 15,
			'label' => 'Área',
			'class' => 'decimal',
			'size' => 15
		));
		
		$this->addElement('text', 'ds_ano_instalacao', array(
			'decorators' => $this->elementDecorator,
			'maxlength' => 4,
			'label' => 'Ano Instalação',
			'class' => 'integer',
			'size' => 15
		));
		
		$this->addElement('text', 'cd_bacen', array(
			'decorators' => $this->elementDecorator,
			'maxlength' => 6,
			'label' => 'Cód. BACEN',
			'class' => 'integer',
			'size' => 15
		));
		
		$this->addElement('text', 'nr_cep', array(
			'decorators' => $this->elementDecorator,
			'label' => 'CEP',
			'maxlength' => 8,
			'class' => 'integer',
			'size' => 15
		));
		
		$this->addElement('text', 'nr_ibge', array(
			'decorators' => $this->elementDecorator,
			'maxlength' => 7,
			'label' => 'Nº IBGE',
			'class' => 'integer',
			'size' => 15
		));

		$this->addElement('text', 'ds_regiao_ibge', array(
			'decorators' => $this->elementDecorator,
			'maxlength' => 100,
			'label' => 'Região IBGE',
			'size' => 50,
			'required' => false
		));
	}
}
