本文整理汇总了PHP中paloSantoGrid::setNameFile_Export方法的典型用法代码示例。如果您正苦于以下问题:PHP paloSantoGrid::setNameFile_Export方法的具体用法?PHP paloSantoGrid::setNameFile_Export怎么用?PHP paloSantoGrid::setNameFile_Export使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类paloSantoGrid
的用法示例。
在下文中一共展示了paloSantoGrid::setNameFile_Export方法的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;
}
示例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;
}
示例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;
}
示例4: _moduleContent
//.........这里部分代码省略.........
}
}
$bElastixNuevo = method_exists('paloSantoGrid', 'setURL');
$oGrid = new paloSantoGrid($smarty);
$oGrid->enableExport();
// enable export.
$oGrid->showFilter($htmlFilter);
$bExportando = $bElastixNuevo ? $oGrid->isExportAction() : isset($_GET['exportcsv']) && $_GET['exportcsv'] == 'yes' || isset($_GET['exportspreadsheet']) && $_GET['exportspreadsheet'] == 'yes' || isset($_GET['exportpdf']) && $_GET['exportpdf'] == 'yes';
$offset = 0;
$limit = 20;
if (isset($fieldPat['type'])) {
$fieldPat['type'] = array_map('strtoupper', $fieldPat['type']);
}
$arrCallsAgentTmp = $oCallsAgent->obtenerCallsAgent($date_start, $date_end, $fieldPat);
if (!is_array($arrCallsAgentTmp)) {
$smarty->assign(array('mb_title' => _tr('ERROR'), 'mb_message' => $oCallsAgent->errMsg));
$arrCallsAgentTmp = array();
}
$totalCallsAgents = count($arrCallsAgentTmp);
// Si se quiere avanzar a la sgte. pagina
if ($bElastixNuevo) {
$oGrid->setLimit($limit);
$oGrid->setTotal($totalCallsAgents + 1);
$offset = $oGrid->calculateOffset();
} else {
if (isset($_GET['nav']) && $_GET['nav'] == "end") {
// Mejorar el sgte. bloque.
if ($totalCallsAgents % $limit == 0) {
$offset = $totalCallsAgents - $limit;
} else {
$offset = $totalCallsAgents - $totalCallsAgents % $limit;
}
}
// Si se quiere avanzar a la sgte. pagina
if (isset($_GET['nav']) && $_GET['nav'] == "next") {
$offset = $_GET['start'] + $limit - 1;
}
// Si se quiere retroceder
if (isset($_GET['nav']) && $_GET['nav'] == "previous") {
$offset = $_GET['start'] - $limit - 1;
}
}
// Bloque comun
$arrCallsAgent = array_slice($arrCallsAgentTmp, $offset, $limit);
$arrData = array();
$sumCallAnswered = $sumDuration = $timeMayor = 0;
foreach ($arrCallsAgent as $cdr) {
$arrData[] = array($cdr['agent_number'], htmlentities($cdr['agent_name'], ENT_COMPAT, 'UTF-8'), $cdr['type'], $cdr['queue'], $cdr['num_answered'], formatoSegundos($cdr['sum_duration']), formatoSegundos($cdr['avg_duration']), formatoSegundos($cdr['max_duration']));
$sumCallAnswered += $cdr['num_answered'];
// Total de llamadas contestadas
$sumDuration += $cdr['sum_duration'];
// Total de segundos en llamadas
$timeMayor = $timeMayor < $cdr['max_duration'] ? $cdr['max_duration'] : $timeMayor;
}
$sTagInicio = !$bExportando ? '<b>' : '';
$sTagFinal = $sTagInicio != '' ? '</b>' : '';
$arrData[] = array($sTagInicio . _tr('Total') . $sTagFinal, '', '', '', $sTagInicio . $sumCallAnswered . $sTagFinal, $sTagInicio . formatoSegundos($sumDuration) . $sTagFinal, $sTagInicio . formatoSegundos($sumCallAnswered > 0 ? $sumDuration / $sumCallAnswered : 0) . $sTagFinal, $sTagInicio . formatoSegundos($timeMayor) . $sTagFinal);
// Construyo el URL base
if (isset($arrFilterExtraVars) && is_array($arrFilterExtraVars) && count($arrFilterExtraVars) > 0) {
$urlVars = array_merge($urlVars, $arrFilterExtraVars);
}
if ($bElastixNuevo) {
$oGrid->setURL(construirURL($urlVars, array("nav", "start")));
$oGrid->setData($arrData);
$arrColumnas = array(_tr("No.Agent"), _tr("Agent"), _tr("Type"), _tr("Queue"), _tr("Calls answered"), _tr("Duration"), _tr("Average"), _tr("Call longest"));
$oGrid->setColumns($arrColumnas);
$oGrid->setTitle(_tr("Calls per Agent"));
$oGrid->pagingShow(true);
$oGrid->setNameFile_Export(_tr("Calls per Agent"));
$smarty->assign("SHOW", _tr("Show"));
return $oGrid->fetchGrid();
} else {
$url = construirURL($urlVars, array("nav", "start"));
$offset = 0;
$total = count($arrData);
$limit = $total;
$arrGrid = array("title" => _tr("Calls per Agent"), "url" => $url, "icon" => "images/user.png", "width" => "99%", "start" => $total == 0 ? 0 : $offset + 1, "end" => $offset + $limit <= $total ? $offset + $limit : $total, "total" => $total, "columns" => array(0 => array("name" => _tr("No.Agent"), "property" => ""), 1 => array("name" => _tr("Agent"), "property" => ""), 2 => array("name" => _tr("Type"), "property" => ""), 3 => array("name" => _tr("Queue"), "property" => ""), 4 => array("name" => _tr("Calls answered"), "property" => ""), 5 => array("name" => _tr("Duration"), "property" => ""), 6 => array("name" => _tr("Average"), "property" => ""), 7 => array("name" => _tr("Call longest"), "property" => "")));
if (isset($_GET['exportpdf']) && $_GET['exportpdf'] == 'yes' && method_exists($oGrid, 'fetchGridPDF')) {
return $oGrid->fetchGridPDF($arrGrid, $arrData);
}
if (isset($_GET['exportspreadsheet']) && $_GET['exportspreadsheet'] == 'yes' && method_exists($oGrid, 'fetchGridXLS')) {
return $oGrid->fetchGridXLS($arrGrid, $arrData);
}
if ($bExportando) {
header("Cache-Control: private");
header("Pragma: cache");
header('Content-Type: application/octet-stream');
header('Content-disposition: inline; filename="calls_per_agent.csv"');
header('Content-Type: application/force-download');
}
if ($bExportando) {
return $oGrid->fetchGridCSV($arrGrid, $arrData);
}
$sContenido = $oGrid->fetchGrid($arrGrid, $arrData, $arrLang);
if (strpos($sContenido, '<form') === FALSE) {
$sContenido = "<form method=\"POST\" style=\"margin-bottom:0;\" action=\"{$url}\">{$sContenido}</form>";
}
return $sContenido;
}
}
示例5: reportReportedeCalltypes
function reportReportedeCalltypes($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf, $argv)
{
$pReportedeCalltypes = new paloSantoReportedeCalltypes($pDB);
$filter_field = $argv[3];
//getParameter("filter_field");
$filter_value = $argv[4];
//getParameter("filter_value");
$id_campania = $argv[1];
//getParameter("id_campania");
$tiempo_unix = $argv[2];
$nombre_archivo = '/modules/hispana_reporte_calltype/reportes/Reporte_de_Calltypes_' . $id_campania . "_{$tiempo_unix}.xls";
$pReportedeCalltypes->registraReporteOffline($id_campania, $tiempo_unix, $nombre_archivo, "{$filter_field}={$filter_value}");
//begin grid parameters
$oGrid = new paloSantoGrid($smarty);
$oGrid->setTitle(_tr("Reporte de Calltypes"));
$oGrid->pagingShow(true);
// show paging section.
$oGrid->enableExport();
// enable export.
$oGrid->setNameFile_Export(_tr("Reporte de Calltypes"));
$url = array("menu" => $module_name, "filter_field" => $filter_field, "filter_value" => $filter_value, "id_campania" => $id_campania);
$oGrid->setURL($url);
// Columnas base
$arrColumns = array(_tr("Fecha"), _tr("Campaña"), _tr("Base"), _tr("Cliente"), _tr("CI"), _tr("Teléfono"), _tr("Agente"), _tr("Contactabilidad"), _tr("Mejor calltype"), _tr("Formulario"));
// Otras columnas
if ($id_campania != "") {
// Columnas adicionales
$arrColumnasAdicionales = $pReportedeCalltypes->getColumnasAdicionales($id_campania);
$arrColumns = array_merge($arrColumns, $arrColumnasAdicionales);
// Columnas de gestión
$arrTmp = $pReportedeCalltypes->getFormFields($id_campania);
$i = 0;
foreach ($arrTmp as $formField) {
$arrOrden[] = $formField['id'];
$arrColumnsAdicionales[$i] = $formField['etiqueta'];
$i++;
}
$arrColumns = array_merge($arrColumns, $arrColumnsAdicionales);
}
$oGrid->setColumns($arrColumns);
$total = $pReportedeCalltypes->getNumReportedeCalltypes($filter_field, $filter_value, $id_campania);
$arrData = null;
//if($oGrid->isExportAction()){
$limit = $total;
// max number of rows.
$offset = 0;
// since the start.
/*}else{
$limit = 20; // default 20
$oGrid->setLimit($limit);
$oGrid->setTotal($total);
$offset = $oGrid->calculateOffset();
}*/
$arrResult = $pReportedeCalltypes->getReportedeCalltypes($limit, $offset, $filter_field, $filter_value, $id_campania);
if (is_array($arrResult) && $total > 0) {
foreach ($arrResult as $key => $value) {
$arrTmp[0] = $value['fecha'];
$arrTmp[1] = $value['base'];
$arrTmp[2] = $value['campania'];
$arrTmp[3] = $value['cliente'];
$arrTmp[4] = $value['ci'];
$arrTmp[5] = $value['telefono'];
$arrTmp[6] = $value['agente'];
$arrTmp[7] = $value['contactabilidad'];
$arrTmp[8] = $value['mejor_calltype'];
// $arrTmp[8] = $value['formulario'];
// Así lo requiere RUBENING
/*$arrTmp[9] = "<a href=modules/$module_name/gestion_info.php?id_gestion=$value[id_gestion_mejor_calltype] target=\"_blank\" onClick=\"window.open(this.href, this.target, 'width=600,height=400'); return false;\">Ver gestión</a>".
"<br>".
"<a href=modules/$module_name/gestion_edit.php?id_gestion=$value[id_gestion_mejor_calltype]&user=".$_SESSION["elastix_user"]." target=\"_blank\" onClick=\"window.open(this.href, this.target, 'width=600,height=400'); return false;\">Editar</a>"*/
//$arrTmp[9] = "<a href=modules/$module_name/gestion_info.php?id_gestion=$value[id_gestion_mejor_calltype] target=\"_blank\" onClick=\"window.open(this.href, this.target, 'width=600,height=400'); return false;\">Ver gestión</a>";
// Datos adicionales
$arrDatosAdicionales = $pReportedeCalltypes->getDatosAdicionales($value['ci']);
$i = 10;
foreach ($arrColumnasAdicionales as $k => $columnaAdicional) {
$arrTmp[$i] = $arrDatosAdicionales[$columnaAdicional];
$i++;
}
unset($arrDatosAdicionales);
$numColumnasFijas = $i;
// Datos de gestión
$arrFormValues = $pReportedeCalltypes->getFormValues($value['id_gestion_mejor_calltype']);
// array_search retorna el key dado el valor a buscar
foreach ($arrFormValues as $formValue) {
// echo $formValue['valor'] . " " . array_search($formValue['id_form_field'],$arrOrden) . "<br>";
$ubicacionReal = array_search($formValue['id_form_field'], $arrOrden) + $numColumnasFijas;
if (is_array($formValue['valor'])) {
$formValue['valor'] = print_r($formValue['valor'], true);
}
$arrTmp[$ubicacionReal] = $formValue['valor'];
}
$arrData[] = $arrTmp;
unset($arrTmp);
}
}
$oGrid->setData($arrData);
/* Para colocar en $arrTmp
*/
//begin section filter
//$oFilterForm = new paloForm($smarty, createFieldFilter());
//.........这里部分代码省略.........
示例6: 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;
}
//.........这里部分代码省略.........
示例7: reportCDR
function reportCDR($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $credentials)
{
global $arrPermission;
$error = '';
$pCDR = new paloSantoCDR($pDB);
$pORGZ = new paloSantoOrganization($arrConf['elastix_dsn']["elastix"]);
$pPBX = new paloAsteriskDB($arrConf['elastix_dsn']["elastix"]);
if ($credentials['userlevel'] == 'superadmin') {
$domain = getParameter('organization');
$domain = empty($domain) ? 'all' : $domain;
$arrOrgz = array("all" => _tr("all"));
foreach ($pORGZ->getOrganization(array()) as $value) {
$arrOrgz[$value["domain"]] = $value["name"];
}
} else {
$arrOrgz = array();
$domain = $credentials['domain'];
}
$date_start = getParameter('date_start');
if (!preg_match("/^[[:digit:]]{1,2}[[:space:]]+[[:alnum:]]{3}[[:space:]]+[[:digit:]]{4}\$/", $date_start)) {
$date_start = date("d M Y");
}
$date_end = getParameter('date_end');
if (!preg_match("/^[[:digit:]]{1,2}[[:space:]]+[[:alnum:]]{3}[[:space:]]+[[:digit:]]{4}\$/", $date_end)) {
$date_end = date("d M Y");
}
$src = getParameter("src");
if (isset($src) && $src != '') {
$expression = $pPBX->getRegexPatternFromAsteriskPattern($src);
if ($expression === false) {
$src = '';
}
}
$dst = getParameter("dst");
if (isset($dst) && $dst != '') {
$expression = $pPBX->getRegexPatternFromAsteriskPattern($dst);
if ($expression === false) {
$dst = '';
}
}
$src_channel = getParameter("src_channel");
$dst_channel = getParameter("dst_channel");
$calltype = getParameter("calltype");
$arrCallType = array("all" => _tr("ALL"), 'incoming' => _tr('Incoming'), 'outgoing' => _tr("Outgoing"));
$calltype = array_key_exists($calltype, $arrCallType) ? $calltype : "all";
$status = getParameter("status");
$arrStatus = array("all" => _tr("ALL"), 'ANSWERED' => _tr('ANSWERED'), 'BUSY' => _tr("BUSY"), 'FAILED' => _tr("FAILED"), "NO ANSWER " => _tr("NO ANSWER"));
$status = array_key_exists($status, $arrStatus) ? $status : "all";
$accountcode = getParameter('accountcode');
$url['menu'] = $module_name;
$url['organization'] = $paramFiltro['organization'] = $domain;
$url['date_start'] = $paramFiltro['date_start'] = $date_start;
$url['date_end'] = $paramFiltro['date_end'] = $date_end;
$url['src'] = $paramFiltro['src'] = $src;
$url['dst'] = $paramFiltro['dst'] = $dst;
$url['src_channel'] = $paramFiltro['src_channel'] = $src_channel;
$url['dst_channel'] = $paramFiltro['dst_channel'] = $dst_channel;
$url['calltype'] = $paramFiltro['calltype'] = $calltype;
$url['status'] = $paramFiltro['status'] = $status;
$url['accountcode'] = $paramFiltro['accountcode'] = $accountcode;
//permission
$delete = in_array("delete", $arrPermission);
$export = in_array("export", $arrPermission);
//begin grid parameters
$oGrid = new paloSantoGrid($smarty);
$oGrid->setTitle(_tr("CDR Report"));
$oGrid->pagingShow(true);
if ($export) {
$oGrid->enableExport();
// enable export.
$oGrid->setNameFile_Export(_tr("CDRReport"));
}
$oGrid->setURL($url);
if ($delete && !$oGrid->isExportAction()) {
$arrColumns[] = "<input type='checkbox' name='cdrcheckall' class='cdrcheckall' id='cdrcheckall' onclick='jqCheckAll(this.id)';>";
}
if ($credentials['userlevel'] == 'superadmin') {
$arrColumns[] = _tr("Organization");
}
$arrColumns[] = _tr("Date");
$arrColumns[] = _tr("Source");
if ($credentials['userlevel'] != 'superadmin') {
$arrColumns[] = _tr("Ring Group");
}
$arrColumns[] = _tr("Destination");
$arrColumns[] = _tr("Src. Channel");
$arrColumns[] = _tr("Account Code");
$arrColumns[] = _tr("Dst. Channel");
$arrColumns[] = _tr("Call Direction");
$arrColumns[] = _tr("Status");
$arrColumns[] = _tr("Duration");
$oGrid->setColumns($arrColumns);
//get NumCDR
$total = $pCDR->getNumCDR($paramFiltro);
if ($total === false) {
$total = 0;
$error = _tr("An error has ocurred to retrieve CDR data") . " " . "DATABASE ERROR";
}
$arrData = array();
$arrResult = array();
//.........这里部分代码省略.........
示例8: 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;
}
示例9: 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;
}
示例10: reportBillingRates
function reportBillingRates($smarty, $module_name, $local_templates_dir, &$pDB, &$pDB2, &$pDB3, $arrConf, $arrLang)
{
$pBillingRates = new paloSantoBillingRates($pDB);
$action = getParameter("nav");
$start = getParameter("start");
$as_csv = getParameter("exportcsv");
$arrResult = "";
$arrColumns = "";
//obtain parameters from new rates
$prefix_new = getParameter("Prefix");
$name_new = getParameter("Name");
$rate_new = getParameter("Rate");
$rate_offset_new = getParameter("Rate_offset");
$trunk_new = getParameter("Trunk");
$hidden_digits = getParameter("Hidden_Digits");
$id = getParameter("id");
//exists Default rate in rate.db // actualizar los rates por defecto en settings
$cant = $pBillingRates->contRates();
if (isset($cant['cant']) & $cant['cant'] < 1) {
$pBillingRates->existsDefaultRate($pDB3);
}
$action = getAction();
//begin grid parameters
$oGrid = new paloSantoGrid($smarty);
$totalBillingRates = $pBillingRates->getNumBillingRates();
$url = array('menu' => $module_name);
//$oGrid->enableExport(); // enable csv export.
$oGrid->pagingShow(true);
// show paging section.
$oGrid->setTitle(_tr("Billing Rates"));
$oGrid->setIcon("modules/{$module_name}/images/reports_billing_rates.png");
$oGrid->setNameFile_Export("Billing_Rates");
$oGrid->setURL($url);
$oGrid->addNew("new_rate", _tr("create_rate"));
$smarty->assign("module_name", $module_name);
$arrData = null;
if ($oGrid->isExportAction()) {
$limit = $totalBillingRates;
$offset = 0;
$arrResult = $pBillingRates->getBillingRates($limit, $offset);
if (is_array($arrResult) && $totalBillingRates > 0) {
foreach ($arrResult as $key => $value) {
$arrTmp[0] = isset($value['prefix']) & $value['prefix'] != "" ? $value['prefix'] : "*";
$arrTmp[1] = isset($value['name']) & $value['name'] != "" ? $value['name'] : "-";
$arrTmp[2] = isset($value['rate']) & $value['rate'] != "" ? $value['rate'] : "-";
$arrTmp[3] = isset($value['rate_offset']) & $value['rate_offset'] != "" ? $value['rate_offset'] : "-";
$arrTmp[4] = isset($value['hided_digits']) & $value['hided_digits'] != "" ? $value['hided_digits'] : "-";
$arrTmp[5] = isset($value['trunk']) & $value['trunk'] != "" ? $value['trunk'] : "*";
$arrTmp[6] = isset($value['fecha_creacion']) & $value['fecha_creacion'] != "" ? $value['fecha_creacion'] : "-";
$arrData[] = $arrTmp;
}
}
$arrColumns = array(_tr("Prefix"), _tr("Name"), _tr("Rate"), _tr("Rate Offset"), _tr("Hidden_Digits"), _tr("Trunk"), _tr("Creation Date"));
} else {
$limit = 20;
$oGrid->setLimit($limit);
$oGrid->setTotal($totalBillingRates);
$offset = $oGrid->calculateOffset();
$arrResult = $pBillingRates->getBillingRates($limit, $offset);
if (is_array($arrResult) && $totalBillingRates > 0) {
foreach ($arrResult as $key => $value) {
if ($value['name'] == "Default") {
$default = $arrLang['Default'];
$arrTmp[0] = "<font color='green'>*</font>";
$arrTmp[1] = "<font color='green'>" . $default . "</font>";
$arrTmp[2] = "<font color='green'>" . $value['rate'] . "</font>";
$arrTmp[3] = "<font color='green'>" . $value['rate_offset'] . "</font>";
$arrTmp[4] = "<font color='green'>" . $value['hided_digits'] . "</font>";
$arrTmp[5] = "<font color='green'>*</font>";
$arrTmp[6] = "<font color='green'>" . $value['fecha_creacion'] . "</font>";
$arrTmp[7] = "<a href='?menu={$module_name}&action=view&id=" . $value['id'] . "'>" . _tr("View") . "</a>";
} else {
$arrTmp[0] = $value['prefix'];
$arrTmp[1] = $value['name'];
$arrTmp[2] = $value['rate'];
$arrTmp[3] = $value['rate_offset'];
$arrTmp[4] = $value['hided_digits'];
$arrTmp[5] = $value['trunk'];
$arrTmp[6] = $value['fecha_creacion'];
$arrTmp[7] = "<a href='?menu={$module_name}&action=view&id=" . $value['id'] . "'>" . _tr("View") . "</a>";
}
$arrData[] = $arrTmp;
}
}
// arreglo de columnas
$arrColumns = array(_tr("Prefix"), _tr("Name"), _tr("Rate"), _tr("Rate Offset"), _tr("Hidden_Digits"), _tr("Trunk"), _tr("Creation Date"), _tr("View"));
}
$oGrid->setColumns($arrColumns);
$oGrid->setData($arrData);
//begin section filter
$arrFormFilterBillingRates = createFieldFilter($arrLang);
$oFilterForm = new paloForm($smarty, $arrFormFilterBillingRates);
$smarty->assign("import_rate", _tr("import_rate"));
$smarty->assign("by_min", _tr("by_min"));
$smarty->assign("Date_close", _tr("Date close"));
$htmlFilter = $oFilterForm->fetchForm("{$local_templates_dir}/filter.tpl", "", $_POST);
//end section filter
$oGrid->customAction("import_rate", _tr("import_rate"));
$content = $oGrid->fetchGrid();
return $content;
//.........这里部分代码省略.........
示例11: 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;
}
示例12: 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;
}
示例13: 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();
}
示例14: 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;
}
示例15: 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;
}