public function calendarioAction()
 {
     //Conectamos con BBDD
     $sid = new Container('base');
     $db_name = $sid->offsetGet('dbNombre');
     $this->dbAdapter = $this->getServiceLocator()->get($db_name);
     //Instancias
     $part = new PartidaMantTable($this->dbAdapter);
     //Consultamos Partidas
     $partidas = $part->getPartidas();
     //Retornamos a la vista
     $this->layout('layout/comite');
     $result = new ViewModel(array('partidas' => $partidas));
     //$result->setTerminal(true);
     return $result;
 }
Example #2
0
 public function resumenfinAction()
 {
     //Conectamos con BBDD
     $sid = new Container('base');
     $db_name = $sid->offsetGet('dbNombre');
     $this->dbAdapter = $this->getServiceLocator()->get($db_name);
     //Abrimos Instancias
     $fon = new FondosTable($this->dbAdapter);
     $mor = new MorososTable($this->dbAdapter);
     $ing = new IngresoTable($this->dbAdapter);
     $egr = new EgresoTable($this->dbAdapter);
     $cic = new CicloAdminTable($this->dbAdapter);
     $pmt = new PartidaMantTable($this->dbAdapter);
     //Obtenemos dia de cierre y calculamos restantes
     $cierre = $cic->getCiclo();
     if (date('j') > $cierre[0]['dia']) {
         $dias_mes = cal_days_in_month(CAL_GREGORIAN, date('n'), date('Y'));
         $dif = $dias_mes - date('j') + $cierre[0]['dia'];
         $mes_cierre = date('F', strtotime('+1 month'));
     } else {
         $dif = $cierre[0]['dia'] - date('j');
         $mes_cierre = date('F');
     }
     //Obtenemos datos
     $fondo = $fon->getFondoOper();
     $fondores = $fon->getFondoRes();
     $cchica = $fon->getCajaChica();
     $morosos = $mor->getTotal($this->dbAdapter);
     $egresos = $egr->getEgresosPeriodo($this->dbAdapter);
     $egrpend = $egr->getEgresosPendiente($this->dbAdapter);
     $ingresos = $ing->getIngresosPeriodo($this->dbAdapter);
     $mant = $pmt->getPartidasMes(date('M'));
     //Armamos Array para la vista
     $datos = array('fondo' => $fondo[0]['saldo'], 'fondores' => $fondores[0]['saldo'], 'cajachica' => $cchica[0]['saldo'], 'morosos' => $morosos[0]['total'], 'egresos' => $egresos, 'ingresos' => $ingresos, 'dias_restantes' => $dif, 'pagos_pendientes' => $egrpend[0]['pagos'], 'mant_periodo' => count($mant));
     $result = new ViewModel($datos);
     $result->setTerminal(true);
     return $result;
 }
 public function guardarpartidaAction()
 {
     //Conectamos con BBDD
     $sid = new Container('base');
     $db_name = $sid->offsetGet('dbNombre');
     $this->dbAdapter = $this->getServiceLocator()->get($db_name);
     //Instancias
     $part = new PartidaMantTable($this->dbAdapter);
     //Obtenemos datos POST
     $lista = $this->request->getPost();
     //Validamos post
     if (isset($lista['categoria'])) {
         //Retornamos formulario a la vista
         $result = new ViewModel(array('categoria' => $categoria, 'rsptaOK' => SysFnc::rspOK()));
         $result->setTerminal(true);
         return $result;
     } else {
         //Guardamos partida
         $partida = $part->guardarPartida($lista);
     }
     //Retornamos a la vista
     $descripcion = "Cambios guardados exitosamente...";
     $result = new JsonModel(array('status' => 'ok', 'descripcion' => $descripcion));
     return $result;
 }