本文整理汇总了PHP中paloSantoGrid::exportType方法的典型用法代码示例。如果您正苦于以下问题:PHP paloSantoGrid::exportType方法的具体用法?PHP paloSantoGrid::exportType怎么用?PHP paloSantoGrid::exportType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类paloSantoGrid
的用法示例。
在下文中一共展示了paloSantoGrid::exportType方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: reportReportedeCalltypes
//.........这里部分代码省略.........
$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());
//$smarty->assign("SHOW", _tr("Show"));
//$smarty->assign("filter_campaign", filter_campaign($pDB, $id_campania));
//$htmlFilter = $oFilterForm->fetchForm("$local_templates_dir/filter.tpl","",$_POST);
//end section filter
//$oGrid->showFilter(trim($htmlFilter));
$export = $oGrid->exportType();
$content = $oGrid->fetchGrid();
//end grid parameters
//REPORTE OFFLINE
//exportspreadsheet=yes&rawmode=yes
if ($export == 'csv' || $export == 'pdf' || ($export = 'xls')) {
$nombre_archivo = '/var/www/html/modules/hispana_reporte_calltype/reportes/Reporte_de_Calltypes_' . $id_campania . "_{$tiempo_unix}." . $export;
$fd = fopen($nombre_archivo, "w");
fwrite($fd, $content);
fclose($fd);
}
$nombre_archivo = '/modules/hispana_reporte_calltype/reportes/Reporte_de_Calltypes_' . $id_campania . "_{$tiempo_unix}." . $export;
$pReportedeCalltypes->actualizaReporteOffline($id_campania, $tiempo_unix);
return $content;
}