public function resumenPersona($cidpers, $crazsoc)
 {
     $parameters[] = $cidpers;
     $dataAdapter = new Model_DataAdapter();
     $rows = $dataAdapter->executeAssocQuery("pl_function.panel_persona", $parameters);
     if ($rows != null) {
         $mperson = $rows[0];
     } else {
         $mperson = array('cidpers' => $cidpers, 'crazsoc' => $crazsoc, 'vnrodoc' => 'No existe información', 'dfecdoc' => '', 'vmotivo' => '', 'ntotpre' => '0', 'ntotcom' => '0', 'nbaseim' => '0.00', 'nimpanu' => '0.00', 'vprofis' => 'No', 'vprotra' => 'No', 'dfecpag' => '');
     }
     $rows = $dataAdapter->executeAssocQuery("pl_function.resumen_saldo_personal", $parameters);
     if ($rows != null) {
         $msaldos = $rows[0];
     } else {
         $msaldos = array('cidpers' => '', 'ntotals' => '', 'npendie' => '', 'ncancel' => '', 'nporcen' => '', 'vindica' => 'ff0000.png');
     }
     return array("mperson" => $mperson, "msaldos" => $msaldos);
 }
 public function registrarAction()
 {
     $this->_helper->layout->disableLayout();
     $this->_helper->getHelper('ajaxContext')->initContext();
     if ($this->getRequest()->isXmlHttpRequest()) {
         $name = $this->_request->getParam('name');
         $procedure = $this->_request->getParam('procedure');
         $print = $this->_request->getParam('print');
         $parameters = json_decode($this->_request->getParam('parameters'), true);
         $dataAdapter = new Model_DataAdapter();
         if ($print == 'true') {
             $rows = $dataAdapter->executeAssocQuery($procedure, $parameters);
             $this->_helper->viewRenderer->setNoRender();
             echo $this->_helper->json($rows);
         } else {
             $records = $dataAdapter->saveQuery($name, $procedure, $parameters);
             $this->view->name = $name;
             $this->view->records = $records;
         }
     }
 }
 public function listarpredioAction()
 {
     $this->_helper->getHelper('ajaxContext')->initContext();
     if ($this->getRequest()->isXmlHttpRequest()) {
         $this->_helper->layout->disableLayout();
         $name = $this->_request->getParam('name');
         if (isset($name)) {
             $dataSet = new Zend_Session_Namespace($name);
             $rows = $dataSet->data;
             $this->view->cidpers = $rows[0][0];
             $this->view->vnombre = $rows[0][1];
             $this->view->vdirecc = $rows[0][2];
             $this->_request->setParam('cidpers', $rows[0][0]);
         } else {
             $this->view->cidpers = $this->_request->getParam('cidpers');
             $this->view->vnombre = $this->_request->getParam('crazsoc');
             $this->view->vdirecc = $this->_request->getParam('direccf');
             $mhresum = $this->_request->getParam('mhresum');
             if (isset($mhresum)) {
                 $this->view->mhresum = $this->_request->getParam('mhresum');
                 $this->view->vnrodoc = $this->_request->getParam('vnrodoc');
             } else {
                 $parameters[] = $this->view->cidpers;
                 $dataAdapter = new Model_DataAdapter();
                 $rows = $dataAdapter->executeAssocQuery("pl_function.panel_persona", $parameters);
                 if (count($rows) == 1) {
                     $this->view->mhresum = $rows[0]['mhresum'];
                     $this->view->vnrodoc = $rows[0]['vnrodoc'];
                 }
             }
         }
         //$this->view->cidpers;
         //'%','0','2013-03-08','0','0','%'
         $parameters[] = $this->view->cidpers;
         $parameters[] = '%';
         $parameters[] = '0';
         $parameters[] = date("y-m-d");
         $parameters[] = '0';
         $parameters[] = '0';
         $parameters[] = '%';
         $dataAdapter = new Model_DataAdapter();
         $rows = $dataAdapter->executeAssocQuery("tesoreria.fx_Estadocuenta", $parameters);
         //	echo count($rows );
         //	print_r($rows);
         $pintar = new Libreria_Pintar();
         if (count($rows) > 0) {
             $deudas = '<table width="500" >';
             //               	$deudas.='<tr>';
             //               	$deudas.='<td>Tributo</td>';
             //               	$deudas.='<td>Cod.Predio</td>';
             //               	$deudas.='<td>A&ntilde;o</td>';
             //               	$deudas.='<td>Periodo</td>';
             //               	$deudas.='<td>Insoluto</td>';
             //               	$deudas.='<td>Mora</td>';
             //               	$deudas.='<td>Total</td>';
             //               	$deudas.='<td>Estado</td>';
             //               	$deudas.='<td><input type="checkbox" id="checkfracctodos"  onClick="checktodosfracci();" /></td>';
             //               	$deudas.='</tr>';
             $montototal = 0;
             for ($i = 0; $i < count($rows); ++$i) {
                 $montototal += $rows[$i]['ntotals'];
                 $deudas .= '<tr>';
                 $deudas .= '<td>' . (string) $rows[$i]['ctiprc0'] . '</td>';
                 $deudas .= '<td>' . (string) $rows[$i]['ccodpre'] . '</td>';
                 $deudas .= '<td>' . (string) $rows[$i]['cejerci'] . '</td>';
                 $deudas .= '<td>' . (string) $rows[$i]['cperiod'] . '</td>';
                 $deudas .= '<td>' . (string) $rows[$i]['nimpins'] . '</td>';
                 $deudas .= '<td>' . (string) $rows[$i]['nimpmor'] . '</td>';
                 $deudas .= '<td>' . (string) $rows[$i]['ntotals'] . '</td>';
                 $deudas .= '<td>' . (string) $rows[$i]['vestad2'] . '</td>';
                 $deudas .= '<td><input id="' . $rows[$i]['idsigma'] . '" type="checkbox" class="checkfracc" value="' . $rows[$i]['ntotals'] . '" onclick="calculamontofracc(this.id);" /> </td>';
                 $deudas .= '</tr>';
             }
             $deudas .= '</table>';
             $val[] = array('tabladeudas', $deudas, 'html');
             $val[] = array('txtdeudatotal', $montototal, 'val');
             //$js[]=array('$("#txtnrocuotas").spinner();');
             $js[] = array('themeTextBox(); themeComboBox();');
             $pintar->PintarValor($val);
             $pintar->EjecutarFuncion($js);
         }
     }
 }
 public function guardarrusticoAction()
 {
     $this->_helper->getHelper('ajaxContext')->initContext();
     if ($this->getRequest()->isXmlHttpRequest()) {
         $this->_helper->layout->disableLayout();
         $ddatosuserlog = new Zend_Session_Namespace('datosuserlog');
         $coduser = $ddatosuserlog->cidpers;
         $vhostnm = $ddatosuserlog->vhostnm;
         /*    cubinor  
           						  cubisur 
         						  cubiest 
         						  cubioes 
         						  cpronor 
         						  cprosur 
         						  cproest 
         						  cprooes 
         						  cpculti 
         						  canagua 
         						  nestado
         					*/
         $row = $_POST['idsigma'] . ',' . $_POST['dpredio'] . ',' . '' . ',' . '' . ',' . '' . ',' . '' . ',' . '' . ',' . '' . ',' . '' . ',' . '' . ',' . '' . ',' . '' . ',' . $_POST['nestado'] . ',' . $vhostnm . ',' . $coduser . ',' . date("y-m-d");
         $parameters[] = $row;
         $dataAdapter = new Model_DataAdapter();
         $rows = $dataAdapter->executeSelect("pl_function.guardar_mrustic", $parameters);
         $row2 = $_POST['idsigma'] . ',' . $rows[0][0] . ',' . $_POST['cclasif'] . ',' . $_POST['ccatego'] . ',' . $_POST['narance'] . ',' . $_POST['nhectar'] . ',' . $_POST['nvalrus'] . ',' . $_POST['nestado'] . ',' . $vhostnm . ',' . $coduser . ',' . date("y-m-d") . ',' . $_POST['cperiod'];
         $parameters2[] = $row2;
         $dataAdapter2 = new Model_DataAdapter();
         $rows2 = $dataAdapter->executeSelect("pl_function.guardar_drustic", $parameters2);
         if ($rows > 0) {
             $parameters3 = array($_POST['dpredio'], $_POST["cperiod"]);
             $data['error'] = "";
             $data['data'] = $dataAdapter->executeAssocQuery("pl_function.listar_caracteristica_rustico", $parameters3);
         } else {
             $data['error'] = "Error al actualizar";
             $data['data'] = "";
         }
         $this->_helper->json($data);
     }
 }