<?php

class Cms_IndexController extends Pampa_Controller_Action {

  public function init() {
  }

  public function indexAction() {
    // action body
    $modelPages = new Model_Cms_System_Modules;

    $this->view->list = $modelPages->homeList();
  }
    public function obrasAction() {
    	$this->_helper->viewRenderer->setNoRender(true);
    $this->_helper->layout->disableLayout();

    $modelObras= new Model_Obras();
    $obras = $modelObras->getAll();
    $this->renderJson($obras);
  }  
  public function obrasItensAction() {
    $this->_helper->viewRenderer->setNoRender(true);
    $this->_helper->layout->disableLayout();

   

      $obra_id = $_POST['obra_id'];
     
      if (!empty($obra_id)) {
        $modelObrasItens = new Model_Obras_Itens();
        $obraItens = $modelObrasItens->getByObra($obra_id);

        $this->renderJson($obraItens);
      }
    
  }
}