当前位置: 首页>>代码示例>>PHP>>正文


PHP paloSantoGrid::enableExport方法代码示例

本文整理汇总了PHP中paloSantoGrid::enableExport方法的典型用法代码示例。如果您正苦于以下问题:PHP paloSantoGrid::enableExport方法的具体用法?PHP paloSantoGrid::enableExport怎么用?PHP paloSantoGrid::enableExport使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在paloSantoGrid的用法示例。


在下文中一共展示了paloSantoGrid::enableExport方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getParameter

function reportListadodecampañas($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf)
{
    $pListadodecampañas = new paloSantoListadodecampañas($pDB);
    $filter_field = getParameter("filter_field");
    $filter_value = getParameter("filter_value");
    //begin grid parameters
    $oGrid = new paloSantoGrid($smarty);
    $oGrid->setTitle(_tr("Listado de campañas"));
    $oGrid->pagingShow(true);
    // show paging section.
    $oGrid->enableExport();
    // enable export.
    $oGrid->setNameFile_Export(_tr("Listado de campañas"));
    $url = array("menu" => $module_name, "filter_field" => $filter_field, "filter_value" => $filter_value);
    $oGrid->setURL($url);
    $arrColumns = array(_tr("Nombre"), _tr("Fecha Inicial"), _tr("Fecha Final"), _tr("Form"), _tr("# de Bases"), _tr("# de Agentes"), _tr("Tipo"), _tr("Acción"));
    $oGrid->setColumns($arrColumns);
    $total = $pListadodecampañas->getNumListadodecampañas($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 = $pListadodecampañas->getListadodecampañas($limit, $offset, $filter_field, $filter_value);
    if (is_array($arrResult) && $total > 0) {
        foreach ($arrResult as $key => $value) {
            $arrBasesAgentes = $pListadodecampañas->getBasesAgentes($value['id']);
            $arrTmp[0] = $value['nombre'];
            $arrTmp[1] = $value['fecha_inicio'];
            $arrTmp[2] = $value['fecha_fin'];
            $arrTmp[3] = $value['form'];
            $arrTmp[4] = $arrBasesAgentes['bases'];
            $arrTmp[5] = $arrBasesAgentes['agentes'];
            $arrTmp[6] = $value['tipo'];
            if ($value['tipo'] == "RECARGABLE") {
                $arrTmp[7] = "<a href=index.php?menu=hispana_campania_recargable&action=view_edit&id=" . $value['id'] . ">Editar</a>";
            } else {
                $arrTmp[7] = "<a href=index.php?menu=hispana_crear_campania&action=view_edit&id=" . $value['id'] . ">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;
}
开发者ID:veraveramanolo,项目名称:cpc2c_uio,代码行数:60,代码来源:index.php

示例2: reportListadodebases

function reportListadodebases($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf)
{
    $pListadodebases = new paloSantoListadodebases($pDB);
    $filter_field = getParameter("filter_field");
    $filter_value = getParameter("filter_value");
    //begin grid parameters
    $oGrid = new paloSantoGrid($smarty);
    $oGrid->setTitle(_tr("Listado de bases"));
    $oGrid->pagingShow(true);
    // show paging section.
    $oGrid->enableExport();
    // enable export.
    $oGrid->setNameFile_Export(_tr("Listado de bases"));
    $url = array("menu" => $module_name, "filter_field" => $filter_field, "filter_value" => $filter_value);
    $oGrid->setURL($url);
    $arrColumns = array(_tr("Base"), _tr("CI"), _tr("Nombre"), _tr("Apellido"), _tr("Provincia"), _tr("Ciudad"), _tr("Nacimiento"), _tr("Correo personal"), _tr("Correo trabajo"), _tr("Estado civil"), _tr("Action"));
    $oGrid->setColumns($arrColumns);
    $total = $pListadodebases->getNumListadodebases($filter_field, $filter_value);
    $arrData = null;
    if ($oGrid->isExportAction()) {
        $limit = $total;
        // max number of rows.
        $offset = 0;
        // since the start.
    } else {
        //$limit  = 20;
        $limit = 200;
        $oGrid->setLimit($limit);
        $oGrid->setTotal($total);
        $offset = $oGrid->calculateOffset();
    }
    $arrResult = $pListadodebases->getListadodebases($limit, $offset, $filter_field, $filter_value);
    if (is_array($arrResult) && $total > 0) {
        foreach ($arrResult as $key => $value) {
            $arrTmp[0] = $value['base'];
            $arrTmp[1] = $value['ci'];
            $arrTmp[2] = $value['nombre'];
            $arrTmp[3] = $value['apellido'];
            $arrTmp[4] = $value['provincia'];
            $arrTmp[5] = $value['ciudad'];
            $arrTmp[6] = $value['nacimiento'];
            $arrTmp[7] = $value['correo_personal'];
            $arrTmp[8] = $value['correo_trabajo'];
            $arrTmp[9] = $value['estado_civil'];
            $arrTmp[10] = "<a href='?menu=hispana_clientes_datosbasicos&ci=" . $value['ci'] . "'>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;
}
开发者ID:veraveramanolo,项目名称:cpc2c_uio,代码行数:59,代码来源:index.php

示例3: getParameter

function reportReporteGeneraldeGestión($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf)
{
    $pReporteGeneraldeGestión = new paloSantoReporteGeneraldeGestión($pDB);
    $filter_field = getParameter("filter_field");
    $filter_value = getParameter("filter_value");
    //begin grid parameters
    $oGrid = new paloSantoGrid($smarty);
    $oGrid->setTitle(_tr("Reporte General de Gestión"));
    $oGrid->pagingShow(true);
    // show paging section.
    $oGrid->enableExport();
    // enable export.
    $oGrid->setNameFile_Export(_tr("Reporte General de Gestión"));
    $url = array("menu" => $module_name, "filter_field" => $filter_field, "filter_value" => $filter_value);
    $oGrid->setURL($url);
    $arrColumns = array(_tr("Campaña"), _tr("Cliente"), _tr("CI"), _tr("Teléfono"), _tr("Agente"), _tr("Calltype"), _tr("Fecha"), _tr("Audio"));
    $oGrid->setColumns($arrColumns);
    $total = $pReporteGeneraldeGestión->getNumReporteGeneraldeGestión($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 = $pReporteGeneraldeGestión->getReporteGeneraldeGestión($limit, $offset, $filter_field, $filter_value);
    if (is_array($arrResult) && $total > 0) {
        foreach ($arrResult as $key => $value) {
            $arrTmp[0] = $value['campania'];
            $arrTmp[1] = $value['cliente'];
            $arrTmp[2] = $value['cedula'];
            $arrTmp[3] = $value['telefono'];
            $arrTmp[4] = $value['agente'];
            $arrTmp[5] = $value['calltype'];
            $arrTmp[6] = $value['fecha'];
            if (stripos($value['calltype'], "contactado") >= 0) {
                $arrTmp[7] = "<a href=monitoring_translator.php?action=download&id=" . $value['timestamp'] . "&rawmode=yes>Descargar</a>";
            }
            //$arrTmp[7] = "";
            $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;
}
开发者ID:veraveramanolo,项目名称:cpc2c_uio,代码行数:58,代码来源:index1.php

示例4: reportReportedeCalltypes

function reportReportedeCalltypes($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf)
{
    $pReportedeCalltypes = new paloSantoAgendadosAgente($pDB);
    $filter_field = getParameter("filter_field");
    $filter_value = getParameter("filter_value");
    $aditional_key = getParameter("aditional_key");
    $aditional_value = getParameter("aditional_value");
    $mostrar_adicionales = getParameter("mostrar_adicionales");
    $calltype_list = getParameter("calltype_list");
    //begin grid parameters
    $oGrid = new paloSantoGrid($smarty);
    $oGrid->setTitle(_tr("Agendados de Agente"));
    $oGrid->pagingShow(true);
    // show paging section.
    $oGrid->enableExport();
    // enable export.
    $oGrid->setNameFile_Export(_tr("Agendados de Agente"));
    $url = array("menu" => $module_name, "filter_field" => $filter_field, "filter_value" => $filter_value, "aditional_value" => $aditional_value, "aditional_key" => $aditional_key, "mostrar_adicionales" => $mostrar_adicionales);
    $oGrid->setURL($url);
    $arrColumns = array(_tr("Campaña"), _tr("Origen"), _tr("Agendamiento"), _tr("Cliente"), _tr("Teléfono"), _tr("Mejor calltype"), _tr("Observación"), _tr("Acción"));
    //Datos Adicionales
    $arrColumnasAdicionales = $pReportedeCalltypes->getColumnasAdicionales();
    if ($mostrar_adicionales == "on") {
        $arrColumns = array_merge($arrColumns, $arrColumnasAdicionales);
    }
    //fin datos adicionales
    $oGrid->setColumns($arrColumns);
    $total = $pReportedeCalltypes->getNumReporteAgendados($filter_field, $filter_value, $_SESSION['elastix_user'], $aditional_key, $aditional_value, $calltype_list);
    $arrData = null;
    if ($oGrid->isExportAction()) {
        $limit = $total;
        // max number of rows.
        $offset = 0;
        // since the start.
    } else {
        $limit = 200;
        // default 20 (muy poco)
        $oGrid->setLimit($limit);
        $oGrid->setTotal($total);
        $offset = $oGrid->calculateOffset();
    }
    $arrResult = $pReportedeCalltypes->getReporteAgendados($limit, $offset, $filter_field, $filter_value, $_SESSION['elastix_user'], $aditional_key, $aditional_value, $calltype_list);
    if (is_array($arrResult) && $total > 0) {
        foreach ($arrResult as $key => $value) {
            $arrTmp[0] = $value['campania'];
            $arrTmp[1] = $value['origen'];
            $arrTmp[2] = $value['fecha_agendamiento'];
            $arrTmp[3] = $value['cliente'];
            $arrTmp[4] = $value['telefono'];
            $arrTmp[5] = $value['contactabilidad'] . " - " . $value['mejor_calltype'];
            $arrTmp[6] = $value['observacion'];
            if (empty($value[id_campania_cliente])) {
                $arrTmp[7] = "<a href=index.php?menu=hispana_interfaz_agente&action=gestionar&id_campania_cliente_recargable={$value['id_campania_recargable_cliente']}>Gestionar</a>";
            } else {
                $arrTmp[7] = "<a href=index.php?menu=hispana_interfaz_agente&action=gestionar&id_campania_cliente={$value['id_campania_cliente']}>Gestionar</a>";
            }
            if ($mostrar_adicionales == "on") {
                if (empty($value[id_campania_cliente])) {
                    $arrDatosAdicionales = $pReportedeCalltypes->getDatosAdicionalesRecargable($value["id_campania_recargable_cliente"]);
                } else {
                    $arrDatosAdicionales = $pReportedeCalltypes->getDatosAdicionales($value["ci"]);
                }
                $i = 8;
                foreach ($arrColumnasAdicionales as $k => $columnaAdicional) {
                    $arrTmp[$i] = $arrDatosAdicionales[$columnaAdicional];
                    $i++;
                }
                unset($arrDatosAdicionales);
            }
            $arrData[] = $arrTmp;
        }
    }
    $oGrid->setData($arrData);
    /* Para colocar en $arrTmp 
     */
    //begin section filter
    $arrFormElements = createFieldFilter();
    //if($mostrar_adicionales=="on"){
    foreach ($arrColumnasAdicionales as $key => $value) {
        $arrAdicionales[$value] = $value;
    }
    $arrCalltypes = $pReportedeCalltypes->getCalltypes();
    $arrFormElements["calltype_list"] = array("LABEL" => _tr("Calltype"), "REQUIRED" => "no", "INPUT_TYPE" => "SELECT", "INPUT_EXTRA_PARAM" => $arrCalltypes, "VALIDATION_TYPE" => "text", "VALIDATION_EXTRA_PARAM" => "");
    $arrFormElements["aditional_key"] = array("LABEL" => _tr("Campo Adicional"), "REQUIRED" => "no", "INPUT_TYPE" => "SELECT", "INPUT_EXTRA_PARAM" => $arrAdicionales, "VALIDATION_TYPE" => "text", "VALIDATION_EXTRA_PARAM" => "");
    $arrFormElements["aditional_value"] = array("LABEL" => _tr("Valor"), "REQUIRED" => "no", "INPUT_TYPE" => "TEXT", "INPUT_EXTRA_PARAM" => "", "VALIDATION_TYPE" => "text", "VALIDATION_EXTRA_PARAM" => "");
    //}
    $oFilterForm = new paloForm($smarty, $arrFormElements);
    $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;
}
开发者ID:veraveramanolo,项目名称:cpc2c_uio,代码行数:95,代码来源:index.php

示例5: reportReporteEfectividad

function reportReporteEfectividad($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf)
{
    $pReporteEfectividad = new paloSantoReporteEfectividad($pDB);
    $filter_field = getParameter("filter_field");
    $filter_value = getParameter("filter_value");
    //begin grid parameters
    $oGrid = new paloSantoGrid($smarty);
    $oGrid->setTitle(_tr("Reporte de efectividad"));
    $oGrid->pagingShow(true);
    // show paging section.
    $oGrid->enableExport();
    // enable export.
    $oGrid->setNameFile_Export(_tr("Reporte de efectividad"));
    $url = array("menu" => $module_name, "filter_field" => $filter_field, "filter_value" => $filter_value);
    $oGrid->setURL($url);
    $arrColumns = array(_tr("Campaña"), _tr("Acción"));
    $oGrid->setColumns($arrColumns);
    $total = $pReporteEfectividad->getNumReporteEfectividad($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 = $pReporteEfectividad->getReporteEfectividad($limit, $offset, $filter_field, $filter_value);
    if (is_array($arrResult) && $total > 0) {
        foreach ($arrResult as $key => $value) {
            $arrTmp[0] = $value['nombre'];
            $arrTmp[1] = "<a href=index.php?menu={$module_name}&id={$value['id']}&action=efectividad>Ver reporte de efectividad</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;
}
开发者ID:veraveramanolo,项目名称:cpc2c_uio,代码行数:49,代码来源:index.php

示例6: reportListadodeCallTypes

function reportListadodeCallTypes($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf)
{
    $pListadodeCallTypes = new paloSantoListadodeCallTypes($pDB);
    $filter_field = getParameter("filter_field");
    $filter_value = getParameter("filter_value");
    //begin grid parameters
    $oGrid = new paloSantoGrid($smarty);
    $oGrid->setTitle(_tr("Listado de Call Types"));
    $oGrid->pagingShow(true);
    // show paging section.
    $oGrid->enableExport();
    // enable export.
    $oGrid->setNameFile_Export(_tr("Listado de Call Types"));
    $url = array("menu" => $module_name, "filter_field" => $filter_field, "filter_value" => $filter_value);
    $oGrid->setURL($url);
    $arrColumns = array(_tr("Campaña"), _tr("Call Type"), _tr("Clase de Call Type"), _tr("Peso"), _tr("Status"), _tr("Acción"));
    $oGrid->setColumns($arrColumns);
    $total = $pListadodeCallTypes->getNumListadodeCallTypes($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 = $pListadodeCallTypes->getListadodeCallTypes($limit, $offset, $filter_field, $filter_value);
    if (is_array($arrResult) && $total > 0) {
        foreach ($arrResult as $key => $value) {
            $arrTmp[0] = $value['campania'];
            $arrTmp[1] = $value['call_type'];
            $arrTmp[2] = $value['clase'];
            $arrTmp[3] = $value['peso'];
            $arrTmp[4] = $value['status'] == "A" ? "Activo" : "Inactivo";
            $arrTmp[5] = "<a href=index.php?menu={$module_name}&id={$value['id']}&id_campania={$value['id_campania']}&action=change_status&status=";
            if ($value['status'] == "A") {
                $arrTmp[5] .= "I";
                $accion = "Desactivar";
            } else {
                $arrTmp[5] .= "A";
                $accion = "Activar";
            }
            $arrTmp[5] .= ">{$accion}</a>";
            $arrTmp[5] .= " <a href=index.php?menu=hispana_call_types&id={$value['id']}&id_campania={$value['id_campania']}&action=view_edit>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;
}
开发者ID:veraveramanolo,项目名称:cpc2c_uio,代码行数:62,代码来源:index.php

示例7: report_adress_book

function report_adress_book($smarty, $module_name, $local_templates_dir, $pDB, $pDB_2, $arrLang, $arrConf, $dsn_agi_manager, $dsnAsterisk)
{
    $padress_book = new paloAdressBook($pDB);
    $arrBooker = $padress_book->getBookerList();
    $arrPayment_type = array(0 => 'Khách lẻ không thường xuyên', 1 => 'Khách lẻ thường xuyên', 2 => 'Khách hàng công ty', 3 => 'Khách hàng đại lý');
    $arrComboElements = array("customer_code" => "Mã khách hàng", "firstname" => "Tên khách hàng", "phone" => "Số điện thoại", "email" => "Email", "agent_id" => "Booker", "sale" => "Kinh Doanh", "booker" => "Kế Toán", "type" => "Loại khách hàng");
    $arrFormElements = array("field" => array("LABEL" => "Tìm theo", "REQUIRED" => "no", "INPUT_TYPE" => "SELECT", "INPUT_EXTRA_PARAM" => $arrComboElements, "VALIDATION_TYPE" => "text", "VALIDATION_EXTRA_PARAM" => ""), "pattern" => array("LABEL" => "", "REQUIRED" => "no", "INPUT_TYPE" => "TEXT", "VALIDATION_TYPE" => "text", "VALIDATION_EXTRA_PARAM" => "", "INPUT_EXTRA_PARAM" => array('id' => 'filter_value')), "booker" => array("LABEL" => "", "REQUIRED" => "no", "INPUT_TYPE" => "SELECT", "INPUT_EXTRA_PARAM" => $arrBooker, "VALIDATION_TYPE" => "text", "VALIDATION_EXTRA_PARAM" => ""), "payment" => array("LABEL" => "", "REQUIRED" => "no", "INPUT_TYPE" => "SELECT", "INPUT_EXTRA_PARAM" => $arrPayment_type, "VALIDATION_TYPE" => "text", "VALIDATION_EXTRA_PARAM" => ""));
    $oFilterForm = new paloForm($smarty, $arrFormElements);
    $smarty->assign("SHOW", "Tìm");
    $smarty->assign("module_name", $module_name);
    $field = NULL;
    $pattern = NULL;
    $namePattern = NULL;
    if (isset($_POST['field']) and isset($_POST['pattern']) and $_POST['pattern'] != "") {
        $field = $_POST['field'];
        $pattern = "%" . trim($_POST['pattern']) . "%";
        $namePattern = trim($_POST['pattern']);
        //$nameField=$arrComboElements[$field];
        //$agent_id = $_POST['booker'];
        //$payment_type = $_POST['booker'];
    }
    $arrFilter = array("field" => $field, "pattern" => $namePattern);
    $startDate = $endDate = date("Y-m-d H:i:s");
    $oGrid = new paloSantoGrid($smarty);
    $oGrid->enableExport();
    // enable export.
    $oGrid->setNameFile_Export("HNH_KhachHang");
    $oGrid->addFilterControl(_tr("Filter applied ") . $field . " = {$namePattern}", $arrFilter, array("field" => "name", "pattern" => ""));
    $htmlFilter = $oFilterForm->fetchForm("{$local_templates_dir}/filter_adress_book.tpl", "", $arrFilter);
    $total = $padress_book->getAddressBook(NULL, NULL, $field, $pattern, TRUE);
    $total_datos = $total[0]["total"];
    //Paginacion
    if ($oGrid->isExportAction()) {
        $total = $total_datos;
        $limit = $total;
        $arr_cols = array(0 => array("name" => "Mã KH", "property1" => ""), 1 => array("name" => "Tên khách hàng", "property1" => ""), 2 => array("name" => "Họ/Hình thức", "property1" => ""), 3 => array("name" => "Điện thoại/Liên hệ", "property1" => ""), 4 => array("name" => "Email/Liên hệ", "property1" => ""), 5 => array("name" => "Booker", "property1" => ""), 6 => array("name" => "Kinh doanh", "property1" => ""), 7 => array("name" => "Kế toán", "property1" => ""), 8 => array("name" => "Phân loại", "property1" => ""), 9 => array("name" => "Thẻ thành viên", "property1" => ""), 10 => array("name" => "Cách thanh toán", "property1" => ""));
    } else {
        $limit = 20;
        $total = $total_datos;
        $arr_cols = array(0 => array("name" => "", "property1" => ""), 1 => array("name" => "Mã KH", "property1" => ""), 2 => array("name" => "Tên khách hàng", "property1" => ""), 3 => array("name" => "Họ/Hình thức", "property1" => ""), 4 => array("name" => "Điện thoại/Liên hệ", "property1" => ""), 5 => array("name" => "Email/Liên hệ", "property1" => ""), 6 => array("name" => "Booker", "property1" => ""), 7 => array("name" => "Kinh doanh", "property1" => ""), 8 => array("name" => "Kế toán", "property1" => ""), 9 => array("name" => "Phân loại", "property1" => ""), 10 => array("name" => "Thẻ thành viên", "property1" => ""), 11 => array("name" => "Cách thanh toán", "property1" => ""), 12 => array("name" => "Lựa chọn", "property1" => ""));
    }
    $oGrid->setLimit($limit);
    $oGrid->setTotal($total);
    $offset = $oGrid->calculateOffset();
    $inicio = $total == 0 ? 0 : $offset + 1;
    $end = $offset + $limit <= $total ? $offset + $limit : $total;
    //Fin Paginacion
    $arrResult = $padress_book->getAddressBook($limit, $offset, $field, $pattern, FALSE);
    //var_dump($arrResult);die;
    $arrData = null;
    //echo print_r($arrResult,true);
    if (is_array($arrResult) && $total > 0) {
        if ($oGrid->isExportAction()) {
            foreach ($arrResult as $key => $adress_book) {
                $typeContact = "";
                switch ($adress_book['type']) {
                    case '0':
                        $typeContact = "Khách hàng lẽ";
                        break;
                    case '1':
                        $typeContact = "Khách lẽ thường xuyên";
                        break;
                    case '2':
                        $typeContact = 'Khách hàng công ty';
                        break;
                    case '3':
                        $typeContact = "Khách hàng đại lý";
                        break;
                    default:
                        break;
                }
                $phone_list = '';
                if (isset($adress_book['number']) && count($adress_book['number']) > 0) {
                    foreach ($adress_book['number'] as $phone) {
                        $phone_list .= is_null($phone) || trim($phone) == '' ? '' : $phone . '\\n';
                    }
                }
                //SDT column
                $email_list = '';
                if (count($adress_book['email']) > 0) {
                    foreach ($adress_book['email'] as $email) {
                        $email_list .= is_null($email) || trim($email) == '' ? '' : $email . '\\n';
                    }
                }
                $arrTmp[] = $adress_book['customer_code'];
                //Ten column
                $arrTmp[] = $adress_book['firstname'];
                //Ten column
                $arrTmp[] = $adress_book['lastname'];
                //Ten column
                $arrTmp[] = $phone_list;
                $arrTmp[] = $email_list;
                $arrTmp[] = $adress_book['booker'];
                $arrTmp[] = $adress_book['sale'];
                $arrTmp[] = $adress_book['accountant'];
                $arrTmp[] = $typeContact;
                $arrTmp[] = $adress_book['membership'];
                $arrTmp[] = $adress_book['payment'];
                $arrData[] = $arrTmp;
            }
//.........这里部分代码省略.........
开发者ID:hardikk,项目名称:HNH,代码行数:101,代码来源:index.php

示例8: _moduleContent


//.........这里部分代码省略.........
    $htmlFilter = $oFilterForm->fetchForm("{$local_templates_dir}/filter.tpl", "", $paramFiltro);
    if (!$oFilterForm->validateForm($paramFiltro)) {
        $smarty->assign(array('mb_title' => _tr('Validation Error'), 'mb_message' => '<b>' . _tr('The following fields contain errors') . ':</b><br/>' . implode(', ', array_keys($oFilterForm->arrErroresValidacion))));
        $paramFiltro = $paramFiltroBase;
        unset($_POST['delete']);
        // Se aborta el intento de borrar CDRs, si había uno.
    }
    // Tradudir fechas a formato ISO para comparación y para API de CDRs.
    $url = array_merge($url, $paramFiltro);
    $paramFiltro['date_start'] = translateDate($paramFiltro['date_start']) . ' 00:00:00';
    $paramFiltro['date_end'] = translateDate($paramFiltro['date_end']) . ' 23:59:59';
    // Valores de filtrado que no se seleccionan mediante filtro
    if ($sExtension != '') {
        $paramFiltro['extension'] = $sExtension;
    }
    // Ejecutar el borrado, si se ha validado.
    if (isset($_POST['delete'])) {
        if ($isAdministrator) {
            if ($paramFiltro['date_start'] <= $paramFiltro['date_end']) {
                $r = $oCDR->borrarCDRs($paramFiltro);
                if (!$r) {
                    $smarty->assign(array('mb_title' => _tr('ERROR'), 'mb_message' => $oCDR->errMsg));
                }
            } else {
                $smarty->assign(array('mb_title' => _tr('ERROR'), 'mb_message' => _tr("Please End Date must be greater than Start Date")));
            }
        } else {
            $smarty->assign(array('mb_title' => _tr('ERROR'), 'mb_message' => _tr("Only administrators can delete CDRs")));
        }
    }
    $oGrid->setTitle(_tr("CDR Report"));
    $oGrid->pagingShow(true);
    // show paging section.
    $oGrid->enableExport();
    // enable export.
    $oGrid->setNameFile_Export(_tr("CDRReport"));
    $oGrid->setURL($url);
    //if($isAdministrator)
    //$oGrid->deleteList("Are you sure you wish to delete CDR(s) Report(s)?","delete",_tr("Delete"));
    $arrData = null;
    if (!isset($sExtension) || $sExtension == "" && !$isAdministrator) {
        $total = 0;
    } else {
        $total = $oCDR->contarCDRs($paramFiltro);
    }
    if ($oGrid->isExportAction()) {
        $limit = $total;
        $offset = 0;
        $arrColumns = array(_tr("Date"), _tr("Source"), _tr("Ring Group"), _tr("Destination"), _tr("Src. Channel"), _tr("Account Code"), _tr("Dst. Channel"), _tr("Status"), _tr("Duration"));
        $oGrid->setColumns($arrColumns);
        $arrResult = $oCDR->listarCDRs($paramFiltro, $limit, $offset);
        if (is_array($arrResult['cdrs']) && $total > 0) {
            foreach ($arrResult['cdrs'] as $key => $value) {
                $arrTmp[0] = date("d-m-Y H:i:s", strtotime($value[0]));
                $arrTmp[1] = $value[1];
                $arrTmp[2] = $value[11];
                $arrTmp[3] = $value[3];
                $arrTmp[4] = $value[9];
                $arrTmp[5] = $value[5];
                $iDuracion = $value[8];
                $iSec = $iDuracion % 60;
                $iDuracion = (int) (($iDuracion - $iSec) / 60);
                $iMin = $iDuracion % 60;
                $iDuracion = (int) (($iDuracion - $iMin) / 60);
                $sTiempo = "{$value[6]}s";
                if ($value[6] >= 60) {
开发者ID:hardikk,项目名称:HNH,代码行数:67,代码来源:index.php

示例9: reportClientesCampania

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;
}
开发者ID:veraveramanolo,项目名称:cpc2c_uio,代码行数:55,代码来源:index.php

示例10: report_CashCollection

function report_CashCollection($smarty, $module_name, $local_templates_dir, &$pDB, $pDB_2)
{
    $pCashCollection = new Cash_Collection($pDB);
    $pACL = new paloACL($pDB_2);
    // get filter parameters
    $filter = array('date_start' => trim($_POST['date_start']) == '' ? '' : date("Y-m-d", strtotime($_POST['date_start'])), 'date_end' => trim($_POST['date_end']) == '' ? '' : date("Y-m-d", strtotime($_POST['date_end'])), 'customer_name' => trim($_POST['customer_name']), 'customer_phone' => trim($_POST['customer_number']), 'ticket_code' => trim($_POST['ticket_code']), 'status' => trim($_POST['status']));
    //begin grid parameters
    $oGrid = new paloSantoGrid($smarty);
    $oGrid->setTitle("Thu tiền giao vé");
    $oGrid->pagingShow(true);
    // show paging section.
    $oGrid->enableExport();
    // enable export.
    $oGrid->setNameFile_Export("Cash_Collection");
    $url = array("menu" => $module_name);
    $oGrid->setURL($url);
    $arrColumns = array("ID", "Tên Khách Hàng", "Số điện thoại", "Ngày mua vé", "Booker", "Địa chỉ", "Tiền trả", "Mã số vé", "Tình trạng", "Nhân viên giao", "Ngày phân công", "Nhân viên nhận tiền", "Ngày nhận tiền", "   ");
    $oGrid->setColumns($arrColumns);
    $total = $pCashCollection->getNumCash_Collection($filter);
    $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 = $pCashCollection->getCash_Collection($limit, $offset, $filter);
    if (is_array($arrResult) && $total > 0) {
        foreach ($arrResult as $key => $value) {
            $ticket = '';
            $name = $pACL->getUsers($value['accounting_id']);
            $elastix_user = is_null($value['accounting_id']) ? '(Chưa nhận)' : $name[0][1];
            foreach ($value['ticket_code'] as $row) {
                $ticket .= $row . '<br>';
            }
            $arrTmp[0] = $value['id'];
            $arrTmp[1] = $value['customer_name'];
            $arrTmp[2] = $value['customer_phone'];
            $arrTmp[3] = is_null($value['purchase_date']) ? '' : date("d-m-Y H:m:s", strtotime($value['purchase_date']));
            $arrTmp[4] = $value['agent_name'];
            $arrTmp[5] = '<a href="javascript:void(1)" onclick="alert(\'' . $value['deliver_address'] . '\')">Xem</a>';
            $arrTmp[6] = $value['pay_amount'];
            $arrTmp[7] = $ticket;
            $arrTmp[8] = showStatus($value['status']);
            $arrTmp[9] = $value['delivery_name'];
            $arrTmp[10] = is_null($value['delivery_date']) ? '' : date("d-m-Y H:m:s", strtotime($value['delivery_date']));
            $arrTmp[11] = $elastix_user;
            $arrTmp[12] = is_null($value['collection_date']) ? '' : date("d-m-Y H:m:s", strtotime($value['collection_date']));
            $arrTmp[13] = $value['status'] == 'Đang giao' ? '<a href="javascript:void(1)" onclick="collect_form(\'' . $value['id'] . '\')">Nhận tiền</a>' : '';
            $arrData[] = $arrTmp;
        }
    }
    $oGrid->setData($arrData);
    //begin section filter
    $oFilterForm = new paloForm($smarty, createFieldFilter());
    // get delivery man list
    $delivery_man_list = $pCashCollection->getDeliveryMan();
    $smarty->assign("DELIVERY_MAN_LIST", $delivery_man_list);
    $htmlFilter = $oFilterForm->fetchForm("{$local_templates_dir}/filter.tpl", "", $_POST);
    //end section filter
    $oGrid->showFilter(trim($htmlFilter));
    $content = $oGrid->fetchGrid();
    //end grid parameters
    return $content;
}
开发者ID:hardikk,项目名称:HNH,代码行数:70,代码来源:index.php

示例11: listadoLoginLogout

function listadoLoginLogout($pDB, $smarty, $module_name, $local_templates_dir)
{
    $oCalls = new paloSantoLoginLogout($pDB);
    $smarty->assign(array('SHOW' => _tr('Show'), 'Filter' => _tr('Find')));
    $arrFormElements = array('date_start' => array('LABEL' => _tr('Date Init'), 'REQUIRED' => 'yes', 'INPUT_TYPE' => 'DATE', 'INPUT_EXTRA_PARAM' => '', 'VALIDATION_TYPE' => 'ereg', 'VALIDATION_EXTRA_PARAM' => '^[[:digit:]]{1,2}[[:space:]]+[[:alnum:]]{3}[[:space:]]+[[:digit:]]{4}$'), 'date_end' => array('LABEL' => _tr('Date End'), 'REQUIRED' => 'yes', 'INPUT_TYPE' => 'DATE', 'INPUT_EXTRA_PARAM' => '', 'VALIDATION_TYPE' => 'ereg', 'VALIDATION_EXTRA_PARAM' => '^[[:digit:]]{1,2}[[:space:]]+[[:alnum:]]{3}[[:space:]]+[[:digit:]]{4}$'), 'detailtype' => array('LABEL' => _tr('Tipo'), 'REQUIRED' => 'no', 'INPUT_TYPE' => 'SELECT', 'INPUT_EXTRA_PARAM' => array('D' => _tr('Detallado'), 'G' => _tr('General')), 'VALIDATION_TYPE' => 'text', 'VALIDATION_EXTRA_PARAM' => ''), 'queue' => array('LABEL' => _tr('Incoming Queue'), 'REQUIRED' => 'no', 'INPUT_TYPE' => 'SELECT', 'INPUT_EXTRA_PARAM' => generarComboColasEntrantes($oCalls), 'VALIDATION_TYPE' => 'text', 'VALIDATION_EXTRA_PARAM' => '^\\d+$'));
    $oFilterForm = new paloForm($smarty, $arrFormElements);
    // Parámetros base y validación de parámetros
    $url = array('menu' => $module_name);
    $paramFiltroBase = $paramFiltro = array('date_start' => date('d M Y'), 'date_end' => date('d M Y'), 'detailtype' => 'D', 'queue' => '');
    foreach (array_keys($paramFiltro) as $k) {
        if (!is_null(getParameter($k))) {
            $paramFiltro[$k] = getParameter($k);
        }
    }
    $htmlFilter = $oFilterForm->fetchForm("{$local_templates_dir}/filter.tpl", "", $paramFiltro);
    if (!$oFilterForm->validateForm($paramFiltro)) {
        $smarty->assign(array('mb_title' => _tr('Validation Error'), 'mb_message' => '<b>' . _tr('The following fields contain errors') . ':</b><br/>' . implode(', ', array_keys($oFilterForm->arrErroresValidacion))));
        $paramFiltro = $paramFiltroBase;
    }
    // Tradudir fechas a formato ISO para comparación y para API de CDRs.
    $url = array_merge($url, $paramFiltro);
    $paramFiltro['date_start'] = translateDate($paramFiltro['date_start']) . ' 00:00:00';
    $paramFiltro['date_end'] = translateDate($paramFiltro['date_end']) . ' 23:59:59';
    // Consulta y recorte de registros
    $recordset = $oCalls->leerRegistrosLoginLogout($paramFiltro['detailtype'], $paramFiltro['date_start'], $paramFiltro['date_end'], trim($paramFiltro['queue']) == '' ? NULL : $paramFiltro['queue']);
    if (!is_array($recordset)) {
        $smarty->assign(array('mb_title' => _tr('Query Error'), 'mb_message' => $oCalls->errMsg));
        $recordset = array();
    }
    $oGrid = new paloSantoGrid($smarty);
    $bExportando = $oGrid->isExportAction();
    $oGrid->setLimit(LIMITE_PAGINA);
    $oGrid->setTotal(count($recordset));
    $offset = $oGrid->calculateOffset();
    // Formato del arreglo de datos a mostrar
    $arrData = array();
    $sTagInicio = !$bExportando ? '<b>' : '';
    $sTagFinal = $sTagInicio != '' ? '</b>' : '';
    $recordSlice = $bExportando ? $recordset : array_slice($recordset, $offset, LIMITE_PAGINA);
    foreach ($recordSlice as $tupla) {
        $arrData[] = array($tupla['number'], $tupla['name'], $tupla['datetime_init'], $tupla['estado'] == 'ONLINE' ? $sTagInicio . $tupla['datetime_end'] . $sTagFinal : $tupla['datetime_end'], format_time($tupla['duration']), format_time($tupla['total_incoming']), format_time($tupla['total_outgoing']), format_time($tupla['total_incoming'] + $tupla['total_outgoing']), number_format(100.0 * ($tupla['duration'] <= 0 ? 0 : ($tupla['total_incoming'] + $tupla['total_outgoing']) / $tupla['duration']), 2), _tr($tupla['estado']));
    }
    // Calcular totales de pie de página
    $ktotales = array('duration', 'total_incoming', 'total_outgoing');
    $totales = array_combine($ktotales, array_fill(0, count($ktotales), 0));
    foreach ($recordset as $tupla) {
        foreach ($ktotales as $k) {
            $totales[$k] += $tupla[$k];
        }
    }
    $arrData[] = array($sTagInicio . _tr('Total') . $sTagFinal, '', '', '', $sTagInicio . format_time($totales['duration']) . $sTagFinal, $sTagInicio . format_time($totales['total_incoming']) . $sTagFinal, $sTagInicio . format_time($totales['total_outgoing']) . $sTagFinal, $sTagInicio . format_time($totales['total_incoming'] + $totales['total_outgoing']) . $sTagFinal, '', '');
    $oGrid->enableExport();
    $oGrid->setURL($url);
    $oGrid->setData($arrData);
    $arrColumnas = array(_tr('Agente'), _tr('Nombre'), _tr('Date Init'), _tr('Date End'), _tr('Total Login'), _tr('Llamadas entrantes'), _tr('Llamadas salientes'), _tr('Tiempo en Llamadas'), _tr('Service(%)'), _tr('Estado'));
    $oGrid->setColumns($arrColumnas);
    $oGrid->setTitle(_tr('Login Logout'));
    $oGrid->pagingShow(true);
    $oGrid->setNameFile_Export(_tr('Login Logout'));
    $oGrid->showFilter($htmlFilter);
    return $oGrid->fetchGrid();
}
开发者ID:hardikk,项目名称:HNH,代码行数:62,代码来源:index.php

示例12: reportOtrosdatos

function reportOtrosdatos($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf)
{
    $pOtrosdatos = new paloSantoOtrosdatos($pDB);
    $filter_field = getParameter("filter_field");
    $filter_value = getParameter("filter_value");
    //begin grid parameters
    $oGrid = new paloSantoGrid($smarty);
    $oGrid->setTitle(_tr("Datos complementarios"));
    $oGrid->pagingShow(true);
    // show paging section.
    $oGrid->enableExport();
    // enable export.
    $oGrid->setNameFile_Export(_tr("Datos complementarios"));
    $url = array("menu" => $module_name, "filter_field" => $filter_field, "filter_value" => $filter_value);
    $oGrid->setURL($url);
    switch ($filter_field) {
        case "cliente_direccion":
            $arrColumns = array(_tr("Descripción"), _tr("Dirección"), _tr("Acción"));
            break;
        case "cliente_adicional":
            $arrColumns = array(_tr("Descripción"), _tr("Dato adicional"), _tr("Acción"));
            break;
        case "cliente_telefono":
        default:
            $arrColumns = array(_tr("Descripción"), _tr("Número"), _tr("Acción"));
            break;
    }
    $oGrid->setColumns($arrColumns);
    if (!empty($_SESSION["id_campania_cliente_recargable"])) {
        $total = $pOtrosdatos->getNumOtrosdatosRecargable($filter_field, $filter_value, $_SESSION['id_campania_cliente_recargable']);
    } elseif (!empty($_SESSION['id_cliente'])) {
        $total = $pOtrosdatos->getNumOtrosdatosIdCliente($filter_field, $filter_value, $_SESSION['id_cliente']);
    } else {
        $total = $pOtrosdatos->getNumOtrosdatos($filter_field, $filter_value, $_SESSION['ci']);
    }
    $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();
    }
    if (!empty($_SESSION["id_campania_cliente_recargable"])) {
        $arrResult = $pOtrosdatos->getOtrosdatosRecargable($limit, $offset, $filter_field, $filter_value, $_SESSION["id_campania_cliente_recargable"]);
    } elseif (!empty($_SESSION['id_cliente'])) {
        $arrResult = $pOtrosdatos->getOtrosdatosIdCliente($limit, $offset, $filter_field, $filter_value, $_SESSION['id_cliente']);
    } else {
        $arrResult = $pOtrosdatos->getOtrosdatos($limit, $offset, $filter_field, $filter_value, $_SESSION['ci']);
    }
    //_pre($arrResult);
    if (is_array($arrResult) && $total > 0) {
        foreach ($arrResult as $key => $value) {
            $arrTmp[0] = $value['descripcion'];
            $arrTmp[1] = $value['valor'];
            $arrTmp[2] = "<a href=index.php?menu=hispana_clientes_datosotros_reporte&id={$value['id']}&action=delete&filter_field={$filter_field} onclick = \"if (! confirm('¿Realmente desea desactivarlo?')) return false;\">Desactivar</a>";
            if ($filter_field == "cliente_adicional") {
                // se pueden editar los adicionales del cliente
                $arrTmp[2] .= " <a href=index.php?menu=hispana_clientes_datosotros_reporte&id={$value['id']}&action=view_edit&filter_field={$filter_field}>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;
}
开发者ID:veraveramanolo,项目名称:cpc2c_uio,代码行数:78,代码来源:index.php

示例13: reportReportsBreak

function reportReportsBreak($smarty, $module_name, $local_templates_dir, &$pDB)
{
    // Obtener rango de fechas de consulta. Si no existe, se asume día de hoy
    $sFechaInicio = date('d M Y');
    if (isset($_GET['txt_fecha_init'])) {
        $sFechaInicio = $_GET['txt_fecha_init'];
    }
    if (isset($_POST['txt_fecha_init'])) {
        $sFechaInicio = $_POST['txt_fecha_init'];
    }
    $sFechaFinal = date('d M Y');
    if (isset($_GET['txt_fecha_end'])) {
        $sFechaFinal = $_GET['txt_fecha_end'];
    }
    if (isset($_POST['txt_fecha_end'])) {
        $sFechaFinal = $_POST['txt_fecha_end'];
    }
    $arrFilterExtraVars = array("txt_fecha_init" => $sFechaInicio, "txt_fecha_end" => $sFechaFinal);
    $arrFormElements = createFieldFilter();
    $oFilterForm = new paloForm($smarty, $arrFormElements);
    // Validación de las fechas recogidas
    if (!$oFilterForm->validateForm($arrFilterExtraVars)) {
        $smarty->assign("mb_title", _tr("Validation Error"));
        $arrErrores = $oFilterForm->arrErroresValidacion;
        $strErrorMsg = '<b>' . _tr('The following fields contain errors') . '</b><br/>';
        foreach ($arrErrores as $k => $v) {
            $strErrorMsg .= "{$k}, ";
        }
        $smarty->assign("mb_message", $strErrorMsg);
        $arrFilterExtraVars = array("txt_fecha_init" => date('d M Y'), "txt_fecha_end" => date('d M Y'));
    }
    $htmlFilter = $oFilterForm->fetchForm("{$local_templates_dir}/filter.tpl", "", $arrFilterExtraVars);
    // Obtener fechas en formato yyyy-mm-dd
    $sFechaInicio = translateDate($arrFilterExtraVars['txt_fecha_init']);
    $sFechaFinal = translateDate($arrFilterExtraVars['txt_fecha_end']);
    $oReportsBreak = new paloSantoReportsBreak($pDB);
    //begin grid parameters
    $bElastixNuevo = method_exists('paloSantoGrid', 'setURL');
    $oGrid = new paloSantoGrid($smarty);
    $oGrid->enableExport();
    // enable export.
    $oGrid->showFilter($htmlFilter);
    $arrColumnas = array(_tr('Agent Number'), _tr('Agent Name'));
    $bExportando = $bElastixNuevo ? $oGrid->isExportAction() : isset($_GET['exportcsv']) && $_GET['exportcsv'] == 'yes' || isset($_GET['exportspreadsheet']) && $_GET['exportspreadsheet'] == 'yes' || isset($_GET['exportpdf']) && $_GET['exportpdf'] == 'yes';
    $datosBreaks = $oReportsBreak->getReportesBreak($sFechaInicio, $sFechaFinal);
    $mapa = array();
    // Columna del break dado su ID
    $sTagInicio = !$bExportando ? '<b>' : '';
    $sTagFinal = $sTagInicio != '' ? '</b>' : '';
    $filaTotales = array($sTagInicio . _tr('Total') . $sTagFinal, '');
    foreach ($datosBreaks['breaks'] as $idBreak => $sNombreBreak) {
        $mapa[$idBreak] = count($arrColumnas);
        $arrColumnas[] = $sNombreBreak;
        $filaTotales[] = 0;
        // Total de segundos usado por todos los agentes en este break
    }
    $mapa['TOTAL'] = count($arrColumnas);
    $filaTotales[] = 0;
    // Total de segundos usado por todos los agentes en todos los breaks
    $arrColumnas[] = _tr('Total');
    $arrData = array();
    foreach ($datosBreaks['reporte'] as $infoAgente) {
        $filaAgente = array($infoAgente['numero_agente'], $infoAgente['nombre_agente']);
        $iTotalAgente = 0;
        // Total de segundos usados por agente en breaks
        // Valor inicial de todos los breaks es 0 segundos
        foreach (array_keys($datosBreaks['breaks']) as $idBreak) {
            $filaAgente[$mapa[$idBreak]] = '00:00:00';
        }
        // Asignar duración del break para este agente y break
        foreach ($infoAgente['breaks'] as $tuplaBreak) {
            $sTagInicio = !$bExportando && $tuplaBreak['duracion'] > 0 ? '<font color="green">' : '';
            $sTagFinal = $sTagInicio != '' ? '</font>' : '';
            $filaAgente[$mapa[$tuplaBreak['id_break']]] = $sTagInicio . formatoSegundos($tuplaBreak['duracion']) . $sTagFinal;
            $iTotalAgente += $tuplaBreak['duracion'];
            $filaTotales[$mapa[$tuplaBreak['id_break']]] += $tuplaBreak['duracion'];
            $filaTotales[$mapa['TOTAL']] += $tuplaBreak['duracion'];
        }
        // Total para todos los breaks de este agente
        $filaAgente[$mapa['TOTAL']] = formatoSegundos($iTotalAgente);
        $arrData[] = $filaAgente;
    }
    $sTagInicio = !$bExportando ? '<b>' : '';
    $sTagFinal = $sTagInicio != '' ? '</b>' : '';
    foreach ($mapa as $iPos) {
        $filaTotales[$iPos] = $sTagInicio . formatoSegundos($filaTotales[$iPos]) . $sTagFinal;
    }
    $arrData[] = $filaTotales;
    if ($bElastixNuevo) {
        $oGrid->setURL(construirURL($arrFilterExtraVars));
        $oGrid->setData($arrData);
        $oGrid->setColumns($arrColumnas);
        $oGrid->setTitle(_tr("Reports Break"));
        $oGrid->pagingShow(false);
        $oGrid->setNameFile_Export(_tr("Reports Break"));
        $smarty->assign("SHOW", _tr("Show"));
        return $oGrid->fetchGrid();
    } else {
        $url = construirURL($arrFilterExtraVars);
        $offset = 0;
//.........这里部分代码省略.........
开发者ID:hardikk,项目名称:HNH,代码行数:101,代码来源:index.php

示例14: report_AccessAudit

function report_AccessAudit($smarty, $module_name, $local_templates_dir)
{
    global $arrPermission;
    $pAccessLogs = new paloSantoAccessaudit();
    $listaFechas = $pAccessLogs->astLog->listarFechas();
    $arrFormElements = createFieldFilter($listaFechas);
    $field_pattern = getParameter("filter");
    $busqueda = getParameter('busqueda');
    $sUltimaBusqueda = getParameter('ultima_busqueda');
    $iUltimoOffset = getParameter('ultimo_offset');
    if (is_null($busqueda) || trim($busqueda) == '') {
        $busqueda = '';
    }
    if ($busqueda != '') {
        $_POST['busqueda'] = $busqueda;
    }
    /* Última búsqueda, si existe */
    if (is_null($sUltimaBusqueda) || $sUltimaBusqueda == '' || is_null($iUltimoOffset) || !ereg('^[[:digit:]]+$', $iUltimoOffset)) {
        $sUltimaBusqueda = NULL;
        $iUltimoOffset = NULL;
    }
    if (!ereg($arrFormElements['filter']['VALIDATION_EXTRA_PARAM'], $field_pattern)) {
        $field_pattern = $listaFechas[count($listaFechas) - 1];
    }
    $_POST['filter'] = $field_pattern;
    $oFilterForm = new paloForm($smarty, $arrFormElements);
    $oGrid = new paloSantoGrid($smarty);
    $oGrid->setTitle(_tr("Audit"));
    $oGrid->setIcon("web/apps/{$module_name}/images/security_audit.png");
    $oGrid->pagingShow(true);
    // show paging section.
    if (in_array("export", $arrPermission)) {
        $oGrid->enableExport();
    }
    // enable export.
    $oGrid->setNameFile_Export(_tr("Access audit"));
    if (in_array("export", $arrPermission)) {
        $isExport = $oGrid->isExportAction();
    } else {
        $isExport = false;
    }
    $total_datos = $pAccessLogs->ObtainNumAccessLogs($field_pattern);
    $totalBytes = $total_datos[0];
    $iNumLineasPorPagina = 30;
    $iEstimadoBytesPagina = $iNumLineasPorPagina * 128;
    $iOffsetVerdadero = getParameter('offset');
    if (is_null($iOffsetVerdadero) || !ereg('^[[:digit:]]+$', $iOffsetVerdadero)) {
        $iOffsetVerdadero = 0;
    }
    if ($iOffsetVerdadero >= $totalBytes) {
        $iOffsetVerdadero = 0;
    }
    if (isset($_GET['filter']) && isset($_POST['filter']) && $_GET['filter'] != $_POST['filter']) {
        $iOffsetVerdadero = 0;
    }
    /* Para ubicarse en la página, se obtiene la región 5 páginas estimadas hacia delante y
         5 páginas estimadas hacia atrás desde el offset indicado.
       */
    $inicioRango = $iOffsetVerdadero - 5 * $iEstimadoBytesPagina;
    if ($inicioRango < 0) {
        $inicioRango = 0;
    }
    if ($isExport) {
        $arrResult = $pAccessLogs->ObtainAccessLogs($totalBytes, 0, $field_pattern, NULL, $isExport);
    } else {
        $arrResult = $pAccessLogs->ObtainAccessLogs(10 * $iEstimadoBytesPagina, $inicioRango, $field_pattern, NULL, $isExport);
    }
    /* Localizar la línea del offset verdadero, así como los offsets de las páginas previa y siguiente */
    for ($iPos = 0; $iPos < count($arrResult); $iPos++) {
        if ($arrResult[$iPos]['offset'] >= $iOffsetVerdadero) {
            break;
        }
    }
    $iPosPrevio = $iPos - $iNumLineasPorPagina;
    $iPosSiguiente = $iPos + $iNumLineasPorPagina;
    if ($iPosPrevio < 0) {
        $iPosPrevio = 0;
    }
    if ($iPosSiguiente > count($arrResult) - 1) {
        $iPosSiguiente = count($arrResult) - 1;
    }
    $iOffsetPrevio = $arrResult[$iPosPrevio]['offset'];
    $iOffsetSiguiente = $arrResult[$iPosSiguiente]['offset'];
    $limit = 30;
    $total = (int) ($totalBytes / 128);
    $offset = $iOffsetVerdadero;
    $nav = getParameter('nav');
    if ($nav) {
        switch ($nav) {
            case 'start':
                $offset = 0;
                break;
            case 'end':
                /* Caso especial: se debe tomar la última sección del log */
                $inicioRango = $totalBytes - 5 * $iEstimadoBytesPagina;
                if ($inicioRango < 0) {
                    $inicioRango = 0;
                }
                if ($isExport) {
                    $arrResult = $pAccessLogs->ObtainAccessLogs($totalBytes, 0, $field_pattern, $busqueda != '' ? $busqueda : NULL, $isExport);
//.........这里部分代码省略.........
开发者ID:netconstructor,项目名称:elastix-mt-gui,代码行数:101,代码来源:index.php

示例15: reportMissedCalls

function reportMissedCalls($smarty, $module_name, $local_templates_dir, &$pDB, &$pDBACL, $pACL, $arrConf)
{
    ini_set('max_execution_time', 3600);
    $pCallingReport = new paloSantoMissedCalls($pDB);
    $oFilterForm = new paloForm($smarty, createFieldFilter());
    $filter_field = getParameter("filter_field");
    $filter_value = getParameter("filter_value");
    $date_start = getParameter("date_start");
    $date_end = getParameter("date_end");
    //begin grid parameters
    $oGrid = new paloSantoGrid($smarty);
    $oGrid->setTitle(_tr("Missed Calls"));
    $oGrid->pagingShow(true);
    // show paging section.
    $oGrid->enableExport();
    // enable export.
    $oGrid->setNameFile_Export(_tr("Missed Calls"));
    $url = array("menu" => $module_name, "filter_field" => $filter_field, "filter_value" => $filter_value);
    $date_start = isset($date_start) ? $date_start : date("d M Y") . ' 00:00';
    $date_end = isset($date_end) ? $date_end : date("d M Y") . ' 23:59';
    $_POST['date_start'] = $date_start;
    $_POST['date_end'] = $date_end;
    $parmFilter = array("date_start" => $date_start, "date_end" => $date_end);
    if (!$oFilterForm->validateForm($parmFilter)) {
        $smarty->assign(array('mb_title' => _tr('Validation Error'), 'mb_message' => '<b>' . _tr('The following fields contain errors') . ':</b><br/>' . implode(', ', array_keys($oFilterForm->arrErroresValidacion))));
        $date_start = date("d M Y") . ' 00:00';
        $date_end = date("d M Y") . ' 23:59';
    }
    $url = array_merge($url, array('date_start' => $date_start, 'date_end' => $date_end));
    $oGrid->setURL($url);
    $arrColumns = array(_tr("Date"), _tr("Source"), _tr("Destination"), _tr("Time since last call"), _tr("Number of attempts"), _tr("Status"));
    $oGrid->setColumns($arrColumns);
    $arrData = null;
    $date_start_format = date('Y-m-d H:i:s', strtotime($date_start . ":00"));
    $date_end_format = date('Y-m-d H:i:s', strtotime($date_end . ":59"));
    // Para usuarios que no son administradores, se restringe a los CDR de la
    // propia extensión
    $sExtension = $pACL->isUserAdministratorGroup($_SESSION['elastix_user']) ? '' : $pACL->getUserExtension($_SESSION['elastix_user']);
    $total = $pCallingReport->getNumCallingReport($date_start_format, $date_end_format, $filter_field, $filter_value, $sExtension);
    if ($oGrid->isExportAction()) {
        $limit = $total;
        // max number of rows.
        $offset = 0;
        // since the start.
        $arrResult = $pCallingReport->getCallingReport($date_start_format, $date_end_format, $filter_field, $filter_value, $sExtension);
        $arrData = $pCallingReport->showDataReport($arrResult, $total);
        $size = count($arrData);
        $oGrid->setData($arrData);
    } else {
        $limit = 20;
        $oGrid->setLimit($limit);
        $arrResult = $pCallingReport->getCallingReport($date_start_format, $date_end_format, $filter_field, $filter_value, $sExtension);
        $arrData = $pCallingReport->showDataReport($arrResult, $total);
        if ($pCallingReport->errMsg != '') {
            $smarty->assign('mb_message', $pCallingReport->errMsg);
        }
        //recalculando el total para la paginación
        $size = count($arrData);
        $oGrid->setTotal($size);
        $offset = $oGrid->calculateOffset();
        //echo $size." : ".$offset;
        $arrResult = $pCallingReport->getDataByPagination($arrData, $limit, $offset);
        $oGrid->setData($arrResult);
    }
    //begin section filter
    $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;
}
开发者ID:netconstructor,项目名称:elastix-mt-gui,代码行数:73,代码来源:index.php


注:本文中的paloSantoGrid::enableExport方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。