<?php

class Sinistro_FerramentasController extends Agro_Controller_Action {

	public function getModel(){
		return new Sinistro_Model_Ferramentas();
	}

    public function indexAction() {
        $this->view->title = 'Ferramentas Sinistro';
    }

    public function emissaoetiquetasAction(){
    	$this->view->title = 'Sinistro » Ferramentas » Emissão de Etiquetas';
    	$this->view->form = new Sinistro_Form_EmissaoEtiquetas();
    }

    public function mostraretiquetasemitidasAction(){
    	$this->getHelper('layout')->disableLayout();

    	$Model = $this->getModel();

    	$propostas = $this->getRequest()->getParam("propostas");
		$arProposta = explode(",",$propostas);

    	try {

	    	$this->view->propostas = $Model->mostrarEtiquetasEmitidas($arProposta);

    	} catch (Exception $e) {
    		$this->view->propostas = false;
    		$this->view->erro = $e->getMessage();
    	}
    }
}
