<?php

/**
 * generar_aportes_cont actions.
 *
 * @package    nomina
 * @subpackage generar_aportes_cont
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class generar_aportes_contActions extends sfActions {

    /**
     * Executes index action
     *
     * @param sfRequest $request A request object
     */
    public function executeIndex(sfWebRequest $request) {

        $this->logMessage("---BEGIN Logging request");
        foreach ($request->getPostParameters() as $key => $value) {
            $this->logMessage("request[$key] = $value");
        }
        $this->logMessage("--------------------------------------------------* Ip: " . $_SERVER['REMOTE_ADDR']);
        foreach ($request->getGetParameters() as $key => $value) {
            $this->logMessage("request[$key] = $value");
        }
        $this->logMessage("---END Logging request");

        /*
         * Variables de filtro
         */
        $this->id_periodo = $request['id_periodo_filtro'];
        $this->id_periodo_actual = $request['id_periodo'];
        $this->vig_ini = $request['vig_ini'];
        $this->per_ini = $request['per_ini'];
        $this->vig_fin = $request['vig_fin'];
        $this->per_fin = $request['per_fin'];
        $this->fecha_pago = $request['fecha_pago'];
        $this->whereFuncionarioNumDoc = '';
        $this->whereFuncionarioTipoDoc = '';
    }

    /**
     * Executes index2388 action - 20170322
     *
     * @param sfRequest $request A request object
     */
    public function executeIndex2388(sfWebRequest $request) {

        $this->logMessage("---BEGIN Logging request");
        foreach ($request->getPostParameters() as $key => $value) {
            $this->logMessage("request[$key] = $value");
        }
        $this->logMessage("--------------------------------------------------* Ip: " . $_SERVER['REMOTE_ADDR']);
        foreach ($request->getGetParameters() as $key => $value) {
            $this->logMessage("request[$key] = $value");
        }
        $this->logMessage("---END Logging request");

        /*
         * Variables de filtro
         */
        $this->id_periodo = $request['id_periodo_filtro'];
        $this->id_periodo_actual = $request['id_periodo'];
        $this->vig_ini = $request['vig_ini'];
        $this->per_ini = $request['per_ini'];
        $this->vig_fin = $request['vig_fin'];
        $this->per_fin = $request['per_fin'];
        $this->fecha_pago = $request['fecha_pago'];
        $this->whereFuncionarioNumDoc = '';
        $this->whereFuncionarioTipoDoc = '';


        /**
         * Incidente #35692, filtro de pasante segun tipo periodo - 20231130
         */
        //Sql
        $sql = <<<EOD
select 
definitivo as definitivo,
fecha_ini as fecha_desde_tipter,
fecha_fin as fecha_hasta_tipter,
id_anhos as id_anhos_tipter,
id_meses as id_meses_tipter, 
nvl(id_tipo_periodo,0) as id_tipo_periodo 
from no_periodo 
    where id_periodo = $this->id_periodo 
EOD;
        //Ejecutar SQL
        $record_tipper = CN_TABLE::executeSQL($sql);

        $this->id_tipo_periodo = $record_tipper[0]['id_tipo_periodo'];
    }

}
