<?

class Produto_Form_CondicaoPagamentoUsuario extends Agro_Form {
	
	public function init() {
		$Util = new Agro_Util();
		
		$this->id_parcelamento = $this->createElement('hidden', 'id_parcelamento');
		$this->id_parcelamento->setDecorators($this->buttonDecorator);
		$this->addElement($this->id_parcelamento);
		
		$this->fk_condicao_pagamento = $this->createElement('hidden', 'fk_condicao_pagamento');
		$this->fk_condicao_pagamento->setDecorators($this->buttonDecorator);
		$this->addElement($this->fk_condicao_pagamento);
		
		$this->ds_mes = $this->createElement('select', 'ds_mes');
		$this->ds_mes->setDecorators($this->elementDecorator);
		$this->ds_mes->setRequired(true);
		$this->ds_mes->setLabel('Mês');
		$this->ds_mes->addMultiOptions($Util->mes);
		$this->addElement($this->ds_mes);
		
		$this->ds_ano = $this->createElement('text', 'ds_ano');
		$this->ds_ano->setDecorators($this->elementDecorator);
		$this->ds_ano->setLabel('Ano');
		$this->ds_ano->setAttrib('class', 'integer');
		$this->ds_ano->setRequired(true);
		$this->addElement($this->ds_ano);
		
		$this->nr_parcelas = $this->createElement('text', 'nr_parcelas');
		$this->nr_parcelas->setDecorators($this->elementDecorator);
		$this->nr_parcelas->setLabel('Nº. Parcelas');
		$this->nr_parcelas->setAttrib('class', 'integer');
		$this->nr_parcelas->setRequired(true);
		$this->addElement($this->nr_parcelas);
		
		$this->ds_dia_preferencial = $this->createElement('text', 'ds_dia_preferencial');
		$this->ds_dia_preferencial->setDecorators($this->elementDecorator);
		$this->ds_dia_preferencial->setLabel('Dia preferêncial');
		$this->ds_dia_preferencial->setAttrib('class', 'integer');
		$this->ds_dia_preferencial->setRequired(true);
		$this->addElement($this->ds_dia_preferencial);
		
		$this->save = $this->createElement('button', 'salvar', array('onclick'=>'this.disabled=true;saveParcelamento();'));
		$this->save->setDecorators($this->buttonDecorator);
		$this->save->setLabel('Salvar');
		$this->addElement($this->save);
		
		$this->cancel = $this->createElement('button', 'cancelar');
		$this->cancel->setDecorators($this->buttonDecorator);
		$this->cancel->setLabel('Cancelar');
		$this->cancel->setAttrib('class', 'jqmClose');
		$this->addElement($this->cancel);
		
	}
	
}