<?

class Sistema_Form_UploadArquivoCorretor extends Agro_Form {
	public $id_corretor;
	public $arquivo;
	public $id_tipo_arquivo;
	
	public function init() {
		$this->id_corretor = $this->createElement('hidden', 'id_corretor');
		$this->id_corretor->setDecorators($this->buttonDecorator);
		$this->addElement($this->id_corretor);
		
		$this->arquivo = $this->createElement('file','arquivo');
		$this->arquivo->setDestination(APPLICATION_PATH . '/upload_files/corretores/');
		$this->arquivo->setLabel('Arquivo');
		$this->arquivo->setRequired(true);
		$this->addElement($this->arquivo);
		
		$TipoArquivoCorretor = new Sistema_Model_TipoArquivoCorretor();
		$this->id_tipo_arquivo = $this->createElement('select', 'id_tipo_arquivo');
		$this->id_tipo_arquivo->addMultiOptions($TipoArquivoCorretor->getCombo(false));
		$this->id_tipo_arquivo->setRequired(true);
		$this->id_tipo_arquivo->setLabel('Tipo');
		$this->addElement($this->id_tipo_arquivo);
	}
}