Exemplo n.º 1
0
function reportClientesagendados($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf)
{
    $pClientesagendados = new paloSantoClientesagendados($pDB);
    $filter_field = getParameter("filter_field");
    $filter_value = getParameter("filter_value");
    //begin grid parameters
    $oGrid = new paloSantoGrid($smarty);
    $oGrid->setTplFile("/var/www/html/modules/{$module_name}/themes/default/_list.tpl");
    $oGrid->setTitle(_tr("Clientes agendados"));
    $oGrid->pagingShow(true);
    // show paging section.
    $oGrid->enableExport();
    // enable export.
    $oGrid->setNameFile_Export(_tr("Clientes agendados"));
    $url = array("menu" => $module_name, "filter_field" => $filter_field, "filter_value" => $filter_value);
    $oGrid->setURL($url);
    $arrColumns = array(_tr("Apellido"), _tr("Nombre"), _tr("CI"), _tr("Campaña"), _tr("Fecha de agendamiento"), _tr("Call type"), _tr("Agente agendado"), "<input class=\"button\" type=\"submit\" name=\"action\" value=\"Reasignar\">");
    $oGrid->setColumns($arrColumns);
    $total = $pClientesagendados->getNumClientesagendados($filter_field, $filter_value);
    $arrData = null;
    if ($oGrid->isExportAction()) {
        $limit = $total;
        // max number of rows.
        $offset = 0;
        // since the start.
    } else {
        $limit = 20;
        $oGrid->setLimit($limit);
        $oGrid->setTotal($total);
        $offset = $oGrid->calculateOffset();
    }
    $arrResult = $pClientesagendados->getClientesagendados($limit, $offset, $filter_field, $filter_value);
    if (is_array($arrResult) && $total > 0) {
        foreach ($arrResult as $key => $value) {
            $arrTmp[0] = $value['apellido'];
            $arrTmp[1] = $value['nombre'];
            $arrTmp[2] = $value['ci'];
            $arrTmp[3] = $value['nombre_campania'];
            $arrTmp[4] = $value['fecha_agendamiento'];
            $arrTmp[5] = $value['ultimo_calltype'];
            $arrTmp[6] = $value['agente_agendado'];
            if (empty($value['id_campania_cliente'])) {
                $arrTmp[7] = getFormSelectAgentesCampaniaRecargable($pClientesagendados, $value['id_campania'], $value['id_campania_recargable_cliente'], $value['agente_agendado']);
            } else {
                $arrTmp[7] = getFormSelectAgentesCampania($pClientesagendados, $value['id_campania'], $value['id_campania_cliente'], $value['agente_agendado']);
            }
            $arrData[] = $arrTmp;
        }
    }
    $oGrid->setData($arrData);
    //begin section filter
    $oFilterForm = new paloForm($smarty, createFieldFilter());
    $smarty->assign("SHOW", _tr("Show"));
    $htmlFilter = $oFilterForm->fetchForm("{$local_templates_dir}/filter.tpl", "", $_POST);
    //end section filter
    $oGrid->showFilter(trim($htmlFilter));
    $content = $oGrid->fetchGrid();
    //end grid parameters
    return $content;
}
Exemplo n.º 2
0
function reportClientesCampania($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf)
{
    $pClientesagendados = new paloSantoClientesCampania($pDB);
    $filter_field = getParameter("filter_field");
    $filter_value = getParameter("filter_value");
    //begin grid parameters
    $oGrid = new paloSantoGrid($smarty);
    $oGrid->setTplFile("/var/www/html/modules/{$module_name}/themes/default/_list.tpl");
    $oGrid->setTitle(_tr("Clientes por campaña"));
    $oGrid->pagingShow(true);
    // show paging section.
    $oGrid->enableExport();
    // enable export.
    $oGrid->setNameFile_Export(_tr("Clientes por campaña"));
    $url = array("menu" => $module_name, "filter_field" => $filter_field, "filter_value" => $filter_value);
    $oGrid->setURL($url);
    $arrColumns = array(_tr("CI"), _tr("Cliente"), _tr("Campaña"), _tr("Agendamiento"), _tr("Agendado a"), _tr("Acción"));
    $oGrid->setColumns($arrColumns);
    $total = $pClientesagendados->getNumClientesCampania($filter_field, $filter_value);
    $arrData = null;
    if ($oGrid->isExportAction()) {
        $limit = $total;
        // max number of rows.
        $offset = 0;
        // since the start.
    } else {
        $limit = 100;
        $oGrid->setLimit($limit);
        $oGrid->setTotal($total);
        $offset = $oGrid->calculateOffset();
    }
    $arrResult = $pClientesagendados->getClientesCampania($limit, $offset, $filter_field, $filter_value);
    if (is_array($arrResult) && $total > 0) {
        foreach ($arrResult as $key => $value) {
            $arrTmp[0] = $value['ci'];
            $arrTmp[1] = $value['cliente'];
            $arrTmp[2] = $value['campania'];
            $arrTmp[3] = $value['fecha_agendamiento'];
            $arrTmp[4] = $value['agente_agendado'];
            //$arrTmp[3] = getFormSelectAgentesCampania($pClientesagendados,$value['id_campania'],$value['id_campania_cliente'],$value['agente_agendado']);
            $arrTmp[5] = "<a href='index.php?menu={$module_name}&id_campania_cliente={$value['id_campania_cliente']}&action=agendar'>Agendar</a>" . " / <a href='index.php?menu=hispana_clientes_datosbasicos&id_cliente=" . $value['id_cliente'] . "'>Editar</a>";
            $arrData[] = $arrTmp;
        }
    }
    $oGrid->setData($arrData);
    //begin section filter
    $oFilterForm = new paloForm($smarty, createFieldFilter());
    $smarty->assign("SHOW", _tr("Show"));
    $htmlFilter = $oFilterForm->fetchForm("{$local_templates_dir}/filter.tpl", "", $_POST);
    //end section filter
    $oGrid->showFilter(trim($htmlFilter));
    $content = $oGrid->fetchGrid();
    //end grid parameters
    return $content;
}