<?php

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

    public function executeList(sfWebRequest $request) {
        $consul = Doctrine_Manager::getInstance()->getCurrentConnection()->getDbh();
        $sql = "select c.*
            from credencial c
            join MODULOS m ON m.nombre='NOMINA' and c.id_mod = m.id_mod
            where c.id_tipo = 2
            order by c.propietario, c.orden";
        $st = $consul->query($sql);
        $array = $st->fetchAll();
        $data = array();
        foreach ($array as $key => $value) {
            $val = array();
            foreach ($value as $k => $v) {
                $val[strtolower($k)] = $v;
            }
            $data[strtolower($key)] = $val;
        }
        $this->list_data = $data;
    }

}

