本文整理汇总了PHP中paloSantoGrid::pagingShow方法的典型用法代码示例。如果您正苦于以下问题:PHP paloSantoGrid::pagingShow方法的具体用法?PHP paloSantoGrid::pagingShow怎么用?PHP paloSantoGrid::pagingShow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类paloSantoGrid
的用法示例。
在下文中一共展示了paloSantoGrid::pagingShow方法的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: listFax
function listFax($smarty, $module_name, $local_templates_dir)
{
$limit = 30;
$oFax = new paloFax();
$total = $oFax->getTotalFax();
$oGrid = new paloSantoGrid($smarty);
$oGrid->setLimit($limit);
$oGrid->setTotal($total);
$oGrid->pagingShow(true);
$oGrid->setURL("?menu=faxlist");
$oGrid->setTitle(_tr("Virtual Fax List"));
$oGrid->setIcon("/modules/{$module_name}/images/fax_virtual_fax_list.png");
$arrColumns = array(_tr("Virtual Fax Name"), _tr("Fax Extension"), _tr("Secret"), _tr("Destination Email"), _tr("Caller ID Name"), _tr("Caller ID Number"), _tr("Status"));
$oGrid->setColumns($arrColumns);
$offset = $oGrid->calculateOffset();
$arrFax = $oFax->getFaxList($offset, $limit);
$arrFaxStatus = $oFax->getFaxStatus();
$arrData = array();
foreach ($arrFax as $fax) {
$arrTmp = array();
$arrTmp[0] = " <a href='?menu=faxnew&action=view&id=" . $fax['id'] . "'>" . $fax['name'] . "</a>";
$arrTmp[1] = $fax['extension'];
$arrTmp[2] = $fax['secret'];
$arrTmp[3] = $fax['email'];
$arrTmp[4] = $fax['clid_name'] . " ";
$arrTmp[5] = $fax['clid_number'] . " ";
$arrTmp[6] = $arrFaxStatus['modems']['ttyIAX' . $fax['dev_id']] . ' on ttyIAX' . $fax['dev_id'];
$arrData[] = $arrTmp;
}
$session = getSession();
$session['faxlist']['faxListStatus'] = $arrData;
putSession($session);
$oGrid->setData($arrData);
return $oGrid->fetchGrid();
}
示例3: 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;
}
示例4: 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;
}
示例5: reportTelefonosinactivos
function reportTelefonosinactivos($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf)
{
$pTelefonosinactivos = new paloSantoTelefonosinactivos($pDB);
$filter_field = getParameter("filter_field");
$filter_value = getParameter("filter_value");
//begin grid parameters
$oGrid = new paloSantoGrid($smarty);
$oGrid->setTitle(_tr("Teléfonos inactivos"));
$oGrid->pagingShow(true);
// show paging section.
$oGrid->enableExport();
// enable export.
$oGrid->setNameFile_Export(_tr("Teléfonos inactivos"));
$url = array("menu" => $module_name, "filter_field" => $filter_field, "filter_value" => $filter_value);
$oGrid->setURL($url);
$arrColumns = array(_tr("Cliente"), _tr("Cédula"), _tr("Descripción"), _tr("Telefono"), _tr("Acción"));
$oGrid->setColumns($arrColumns);
$total = $pTelefonosinactivos->getNumTelefonosinactivos($filter_field, $filter_value);
$arrData = null;
if ($oGrid->isExportAction()) {
$limit = $total;
// max number of rows.
$offset = 0;
// since the start.
} else {
$limit = 200;
// Default 20
$oGrid->setLimit($limit);
$oGrid->setTotal($total);
$offset = $oGrid->calculateOffset();
}
$arrResult = $pTelefonosinactivos->getTelefonosinactivos($limit, $offset, $filter_field, $filter_value);
if (is_array($arrResult) && $total > 0) {
foreach ($arrResult as $key => $value) {
$arrTmp[0] = $value['cliente'];
$arrTmp[1] = $value['ci'];
$arrTmp[2] = $value['descripcion'];
$arrTmp[3] = $value['telefono'];
$arrTmp[4] = "<a href=index.php?menu={$module_name}&id={$value['id']}&action=activar>Activar</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;
}
示例6: reportReportedeCalltypes
function reportReportedeCalltypes($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf)
{
$pReportedeCalltypes = new paloSantoReportedeCalltypes($pDB);
$filter_field = getParameter("filter_field");
$filter_value = getParameter("filter_value");
$id_campania = getParameter("id_campania");
$filter_field_adicional = getParameter("adicionales");
$filter_value_adicional = getParameter("filtro_adicional");
//begin grid parameters
$oGrid = new paloSantoGrid($smarty);
$oGrid->setTitle(_tr("Reporte Ultima Gestion Recargables"));
$oGrid->pagingShow(true);
// show paging section.
$oGrid->enableExport();
// enable export.
$oGrid->setNameFile_Export(_tr("Reporte Ultima Gestion Recargables"));
$url = array("menu" => $module_name, "filter_field" => $filter_field, "filter_value" => $filter_value, "id_campania" => $id_campania, "adicionales" => $filter_field_adicional, "filtro_adicional" => $filter_value_adicional);
$oGrid->setURL($url);
// Columnas base
$arrColumns = array(_tr("Fecha"), _tr("Hora"), _tr("Campaña"), _tr("Base"), _tr("Cliente"), _tr("CI"), _tr("Teléfono"), _tr("Agente"), _tr("Contactabilidad"), _tr("Calltype"), _tr("Provincia"), _tr("Ciudad"), _tr("Nacimiento"), _tr("Correo Personal"), _tr("Correo Trabajo"), _tr("Estado Civil"), _tr("Formulario"));
// Otras columnas
if ($id_campania != "") {
// Columnas adicionales
$arrColumnasAdicionales = $pReportedeCalltypes->getColumnasAdicionales($id_campania);
$arrColumns = array_merge($arrColumns, $arrColumnasAdicionales);
$smarty->assign("mostrarAdicional", "si");
$smarty->assign("filtro_adicionales", filter_adicionales($arrColumnasAdicionales, null));
// 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, $filter_field_adicional, $filter_value_adicional);
$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, $filter_field_adicional, $filter_value_adicional);
if (is_array($arrResult) && $total > 0) {
foreach ($arrResult as $key => $value) {
$fecha = date("Y-m-d", strtotime($value['fecha']));
$hora = date("H:i:s", strtotime($value['fecha']));
$arrTmp[0] = $fecha;
$arrTmp[1] = $hora;
$arrTmp[2] = $value['campania'];
$arrTmp[3] = $value['base'];
$arrTmp[4] = $value['cliente'];
$arrTmp[5] = $value['ci'];
$arrTmp[6] = $value['telefono'];
$arrTmp[7] = $value['agente'];
$arrTmp[8] = $value['contactabilidad'];
$arrTmp[9] = $value['calltype'];
$arrTmp[10] = $value['provincia'];
$arrTmp[11] = $value['ciudad'];
$arrTmp[12] = $value['nacimiento'];
$arrTmp[13] = $value['correo_personal'];
$arrTmp[14] = $value['correo_trabajo'];
$arrTmp[15] = $value['estado_civil'];
// $arrTmp[8] = $value['formulario'];
// Así lo requiere RUBENING
$arrTmp[16] = "<a href=modules/{$module_name}/gestion_info.php?id_gestion={$value['id_gestion']} 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']}&user=" . $_SESSION["elastix_user"] . " target=\"_blank\" onClick=\"window.open(this.href, this.target, 'width=600,height=400,scrollbars=1'); return false;\">Editar</a>";
// Datos adicionales
$arrDatosAdicionales = $pReportedeCalltypes->getDatosAdicionales($value['id_cliente'], $value['id_base']);
$i = 17;
foreach ($arrColumnasAdicionales as $k => $columnaAdicional) {
$arrTmp[$i] = $arrDatosAdicionales[$columnaAdicional];
$i++;
}
unset($arrDatosAdicionales);
$numColumnasFijas = $i;
// Datos de gestión
$arrFormValues = $pReportedeCalltypes->getFormValues($value['id_gestion']);
// 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);
}
}
//.........这里部分代码省略.........
示例7: 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;
}
示例8: reportRules
function reportRules($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf)
{
$pRules = new paloSantoRules($pDB);
$action = getParameter("action");
$id = getParameter("id");
$smarty->assign("ID", $id);
$oFilterForm = new paloForm($smarty, array());
//begin grid parameters
$oGrid = new paloSantoGrid($smarty);
$first_time = $pRules->isFirstTime();
//$oGrid->setTplFile("$local_templates_dir/_list.tpl");
$totalRules = $pRules->ObtainNumRules();
$error = "";
if ($action == 'edit') {
$arrtmp = $pRules->getRule($id);
$arripsource = explode("/", $arrtmp['ip_source']);
$arripdst = explode("/", $arrtmp['ip_destiny']);
$arrValues['id_traffic'] = $arrtmp['traffic'];
$arrValues['interface_in'] = $arrtmp['eth_in'];
$arrValues['interface_out'] = $arrtmp['eth_out'];
$arrValues['ip_source'] = $arripsource[0];
$arrValues['mask_source'] = $arripsource[1];
$arrValues['port_in'] = $arrtmp['sport'];
$arrValues['ip_destin'] = $arripdst[0];
$arrValues['mask_destin'] = $arripdst[1];
$arrValues['port_out'] = $arrtmp['dport'];
$arrValues['type_icmp'] = $arrtmp['icmp_type'];
$arrValues['id_ip'] = $arrtmp['number_ip'];
$arrValues['id_protocol'] = $arrtmp['protocol'];
$arrValues['target'] = $arrtmp['target'];
$arrValues['orden'] = $arrtmp['rule_order'];
$arrValues['state'] = $arrtmp['state'];
$arrValues['id'] = $id;
$content = newRules($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrValues, $action);
return $content;
} elseif ($action == 'Activate') {
$pRules->setActivated($id);
} elseif ($action == 'Desactivate') {
$pRules->setDesactivated($id);
}
$limit = 30;
$total = $totalRules;
$oGrid->setLimit($limit);
$oGrid->setTotal($total);
$oGrid->setTitle(_tr("FireWall Rules"));
$oGrid->setIcon("/modules/{$module_name}/images/security_firewall_rules.png");
$oGrid->pagingShow(true);
$offset = $oGrid->calculateOffset();
$url = "?menu={$module_name}";
$oGrid->setURL($url);
$arrData = null;
$arrResult = $pRules->ObtainRules($limit, $offset);
$start = getParameter("start");
$accion = getParameter("nav");
if ($accion == "end") {
if ($total % $limit == 0) {
$start = $total - 2 * $limit + 1;
} else {
$start = $total - $total % $limit - $limit + 1;
}
} elseif ($accion == "previous") {
$start = $start - 2 * $limit;
}
if ($first_time) {
$arrColumns = array("", _tr("Order"), _tr("Traffic"), _tr("Target"), _tr("Interface"), _tr("IP Source"), _tr("IP Destiny"), _tr("Protocol"), _tr("Details"));
} else {
$oGrid->deleteList("Are you sure you wish to delete the Rule?", "delete", _tr("Delete"));
$arrColumns = array("", _tr("Order"), _tr("Traffic"), _tr("Target"), _tr("Interface"), _tr("IP Source"), _tr("IP Destiny"), _tr("Protocol"), _tr("Details"), "", "");
}
$oGrid->setColumns($arrColumns);
if (is_array($arrResult) && $total > 0) {
foreach ($arrResult as $key => $value) {
if (!$first_time) {
$arrTmp[0] = "<input type='checkbox' name='id_" . $value['id'] . "' />";
$arrTmp[1] = "<div id='div_{$value['id']}' style='width: 22px; font-size: 14pt;color:#E35332;float:left;text-align:right'>{$value['rule_order']} </div>";
}
if (!$first_time) {
//if($offset!=0)
$arrTmp[1] .= "<a href='javascript:void(0);' class='up' id='rulerup_{$value['id']}_{$value['rule_order']}'>" . "<img src='modules/{$module_name}/images/up.gif' border=0 title='" . _tr('Up') . "' /></a>" . "<a href='javascript:void(0);' class='down' id='rulerdown_{$value['id']}_{$value['rule_order']}'>" . "<img src='modules/{$module_name}/images/down.gif' border=0 title='" . _tr('Down') . "' /></a>";
/*else
$arrTmp[1].="<a href='?menu=$module_name&action=$changeOrder&id=$value[id]&order=$value[rule_order]&direction=up;' class='up' id='rulerup_$value[id]_$value[rule_order]'>"."<img src='modules/$module_name/images/up.gif' border=0 title='"._tr('Up')."' /></a>"."<a href='javascript:void(0);' class='down' id='rulerdown_$value[id]_$value[rule_order]'>"."<img src='modules/$module_name/images/down.gif' border=0 title='"._tr('Down')."' /></a>";*/
}
if ($value['traffic'] == "INPUT") {
$image = "modules/{$module_name}/images/fw_input.gif";
$title = _tr("INPUT");
$arrTmp[4] = _tr("IN") . ": {$value['eth_in']}";
} elseif ($value['traffic'] == "OUTPUT") {
$image = "modules/{$module_name}/images/fw_output.gif";
$title = _tr("OUTPUT");
$arrTmp[4] = _tr("OUT") . ": {$value['eth_out']}";
} else {
$image = "modules/{$module_name}/images/fw_forward.gif";
$title = _tr("FORWARD");
$arrTmp[4] = _tr("IN") . ": {$value['eth_in']}<br />" . _tr("OUT") . ": {$value['eth_out']}";
}
$arrTmp[2] = "<a><img src='{$image}' border=0 title='" . _tr($title) . "'</a>";
if ($value['target'] == "ACCEPT") {
$image = "modules/{$module_name}/images/target_accept.gif";
$title = _tr("ACCEPT");
} elseif ($value['target'] == "DROP") {
//.........这里部分代码省略.........
示例9: viewFormDomain
function viewFormDomain($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf, $arrLang)
{
$pEmail = new paloEmail($pDB);
$oGrid = new paloSantoGrid($smarty);
$arrDomains = $pEmail->getDomains();
$end = count($arrDomains);
$arrData = array();
$oGrid->pagingShow(true);
$url = array("menu" => $module_name);
$oGrid->setURL($url);
$oGrid->setTitle(_tr("Domain List"));
$oGrid->setIcon("modules/{$module_name}/images/email_domains.png");
$arrColumns = array(_tr("Domain"), _tr("Number of Accounts"));
$oGrid->setColumns($arrColumns);
$total = 0;
$limit = 20;
$limitInferior = "";
$limitSuperior = "";
$oGrid->setLimit($limit);
$oGrid->addNew("submit_create_domain", _tr('Create Domain'));
if (is_array($arrDomains) && $end > 0) {
$oGrid->setTotal($end);
$offset = $oGrid->calculateOffset();
$cont = 0;
$limitInferior = $offset;
$limitSuperior = $offset + $limit - 1;
foreach ($arrDomains as $domain) {
$arrTmp = array();
if ($cont > $limitSuperior) {
break;
}
if ($cont >= $limitInferior & $cont <= $limitSuperior) {
$arrTmp[0] = " <a href='?menu=email_domains&action=view&id=" . $domain[0] . "'>{$domain['1']}</a>";
//obtener el numero de cuentas que posee ese email
$arrTmp[1] = $pEmail->getNumberOfAccounts($domain[0]);
$arrData[] = $arrTmp;
}
$cont++;
}
} else {
$oGrid->setTotal($total);
$offset = $oGrid->calculateOffset();
}
$oGrid->setData($arrData);
$content = $oGrid->fetchGrid();
return $content;
}
示例10: _moduleContent
//.........这里部分代码省略.........
$oGrid->addFilterControl(_tr("Filter applied: ") . _tr("Status") . " = " . $valueStatus, $paramFiltro, array('status' => 'ALL'), true);
$oGrid->addFilterControl(_tr("Filter applied: ") . _tr("Ring Group") . " = " . $valueRingGRoup, $paramFiltro, array('ringgroup' => ''));
$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);
示例11: listarColaFax_raw
function listarColaFax_raw($smarty, $module_name, $local_templates_dir, $listaColaFax)
{
$oGrid = new paloSantoGrid($smarty);
$oGrid->pagingShow(FALSE);
$oGrid->setURL('?menu=faxqueue');
$oGrid->setTitle(_tr('Fax Queue'));
$oGrid->deleteList('Are you sure to cancel selected jobs?', 'remove', _tr('Cancel job'));
$arrColumns = array('', _tr('Job ID'), _tr('Priority'), _tr('Destination'), _tr('Pages'), _tr('Retries'), _tr('Status'));
$oGrid->setColumns($arrColumns);
function listarColaFax_toHTML($t)
{
return array('<input type="radio" name="jobid" value="' . $t['jobid'] . '"/>', $t['jobid'], $t['priority'], $t['outnum'], sprintf(_tr('Sent %d pages of %d'), $t['sentpages'], $t['totalpages']), sprintf(_tr('Try %d of %d'), $t['retries'], $t['totalretries']), '[' . $t['state'] . '] ' . _tr($t['status']));
}
$oGrid->setData(array_map('listarColaFax_toHTML', $listaColaFax));
return $oGrid->fetchGrid();
}
示例12: listPortKnockCurrentAuths
function listPortKnockCurrentAuths(&$smarty, $module_name, $local_templates_dir, &$pDB, $arrConf)
{
$eth_in = getParameter('eth_in');
if (is_null($eth_in)) {
Header("Location: ?menu={$module_name}");
return NULL;
}
include_once "libs/paloSantoACL.class.php";
$pACL = new paloACL($arrConf['elastix_dsn']['acl']);
$pk = new paloSantoPortKnockInterfaces($pDB);
$oGrid = new paloSantoGrid($smarty);
$oGrid->setTitle(_tr('PortKnock Interface Authorizations'));
$oGrid->setColumns(array('', _tr('IP'), _tr('User'), _tr('Ports'), _tr('Since')));
$oGrid->deleteList(_tr('Are you sure you wish to revoke this authorization?'), 'delete', _tr('Revoke authorization'));
if (isset($_POST['delete']) && isset($_POST['id_user_ip'])) {
$l = explode('-', $_POST['id_user_ip']);
if (count($l) >= 2) {
$bExito = $pk->removeAuthorizationsUserInterface($l[0], $l[1]);
if (!$bExito) {
$smarty->assign("mb_title", _tr("Error"));
$smarty->assign("mb_message", $pk->errMsg);
} else {
Header("Location: ?menu={$module_name}");
return NULL;
}
}
}
$recordset = $pk->listAuthorizationsInterface($eth_in);
$data = array();
if (is_array($recordset)) {
foreach ($recordset as $id_user => $auth_user) {
$userinfo = $pACL->getUsers($id_user);
foreach ($auth_user as $ip_source => $auth_ips) {
$listaProto = array();
$ruleStart = NULL;
foreach ($auth_ips as $id_auth => $info_auth) {
$listaProto[] = $info_auth['name'];
$ruleStart = $info_auth['rule_start'];
}
$data[] = array('<input type="radio" name="id_user_ip" value="' . $id_user . '-' . $ip_source . '" />', $ip_source, $userinfo[0][1], implode(' ', $listaProto), $ruleStart);
}
}
}
$oGrid->pagingShow(false);
$url = array("menu" => $module_name);
$oGrid->setURL($url);
$oGrid->setData($data);
return $oGrid->fetchGrid();
}
示例13: reportWeakKeys
function reportWeakKeys($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf)
{
$pWeakKeys = new paloSantoWeakKeys($pDB);
$filter_field = getParameter("filter_field");
$filter_value = getParameter("filter_value");
//begin grid parameters
$oGrid = new paloSantoGrid($smarty);
$total = $pWeakKeys->getNumWeakKeys($filter_field, $filter_value);
$pDB2 = new paloDB($arrConf['elastix_dsn']['acl']);
$pACL = new paloACL($pDB2);
$oGrid->enableExport();
// enable csv export.
$oGrid->pagingShow(true);
// show paging section.
$oGrid->setTitle(_tr("Weak Secrets"));
$oGrid->setIcon("modules/{$module_name}/images/security_weak_keys.png");
$oGrid->setNameFile_Export(_tr("Weak Secrets"));
if ($oGrid->isExportAction()) {
$limit = $total;
$offset = 0;
$bExportation = true;
} else {
$limit = 30;
$oGrid->setLimit($limit);
$oGrid->setTotal($total);
$offset = $oGrid->calculateOffset();
$bExportation = false;
}
$url = array('menu' => $module_name, 'filter_field' => $filter_field, 'filter_value' => $filter_value);
$oGrid->setURL($url);
$arrResult = $pWeakKeys->getWeakKeys($limit, $offset, $filter_field, $filter_value);
$arrData = null;
//$arrResult =$pWeakKeys->getWeakKeysChecker();
$arrColumns = array(_tr("Extension"), _tr("Description"), _tr("Status"));
$oGrid->setColumns($arrColumns);
if (is_array($arrResult) && $total > 0) {
foreach ($arrResult as $tech) {
foreach ($tech as $key => $value) {
$arrTmp[0] = $value['id'];
$arrTmp[1] = $value['description'];
$mensaje = getMensaje($value['id'], $value['data']);
if ($mensaje != "OK" && !$bExportation) {
if ($pACL->isUserAdministratorGroup($_SESSION['elastix_user']) || $pACL->getUserExtension($_SESSION['elastix_user']) == $value['id']) {
$mensaje = _tr("Weak Key") . ": {$mensaje} <a href='?menu={$module_name}&action=change&id={$value['id']}'>" . _tr("Change Secret") . "</a>";
}
}
$arrTmp[2] = $mensaje;
$arrData[] = $arrTmp;
}
}
}
$oGrid->setData($arrData);
//begin section filter
$arrFormFilterWeakKeys = createFieldFilter();
$oFilterForm = new paloForm($smarty, $arrFormFilterWeakKeys);
$smarty->assign("SHOW", _tr("Show"));
$_POST["filter_field"] = $filter_field;
$_POST["filter_value"] = $filter_value;
$oGrid->addFilterControl(_tr("Filter applied: ") . _tr("Extension") . " = " . $filter_value, $_POST, array("filter_field" => "extension", "filter_value" => ""));
$htmlFilter = $oFilterForm->fetchForm("{$local_templates_dir}/filter.tpl", "", $_POST);
//end section filter
$oGrid->showFilter(trim($htmlFilter));
$content = $oGrid->fetchGrid();
//end grid parameters
return $content;
}
示例14: reportMonitoring
function reportMonitoring($smarty, $module_name, $local_templates_dir, &$pDB, $pACL, $arrConf, $user, $extension, $esAdministrador)
{
$pMonitoring = new paloSantoMonitoring($pDB);
//var_dump($arrConfg);
$pMonitoring->setConfig($arrConf);
$filter_field = getParameter("filter_field");
switch ($filter_field) {
case "dst":
$filter_field = "dst";
$nameFilterField = _tr("Destination");
break;
case "userfield":
$filter_field = "userfield";
$nameFilterField = _tr("Type");
break;
default:
$filter_field = "src";
$nameFilterField = _tr("Source");
break;
}
if ($filter_field == "userfield") {
$filter_value = getParameter("filter_value_userfield");
$filter = "";
$filter_userfield = $filter_value;
} else {
$filter_value = getParameter("filter_value");
$filter = $filter_value;
$filter_userfield = "";
}
switch ($filter_value) {
case "outgoing":
$smarty->assign("SELECTED_2", "Selected");
$nameFilterUserfield = _tr("Outgoing");
break;
case "queue":
$smarty->assign("SELECTED_3", "Selected");
$nameFilterUserfield = _tr("Queue");
break;
case "group":
$smarty->assign("SELECTED_4", "Selected");
$nameFilterUserfield = _tr("Group");
break;
default:
$smarty->assign("SELECTED_1", "Selected");
$nameFilterUserfield = _tr("Incoming");
break;
}
$date_ini = getParameter("date_start");
$date_end = getParameter("date_end");
$path_record = $arrConf['records_dir'];
$_POST['date_start'] = isset($date_ini) ? $date_ini : date("d M Y");
$_POST['date_end'] = isset($date_end) ? $date_end : date("d M Y");
if ($date_ini === "") {
$_POST['date_start'] = " ";
}
if ($date_end === "") {
$_POST['date_end'] = " ";
}
if (!empty($pACL->errMsg)) {
echo "ERROR DE ACL: {$pACL->errMsg} <br>";
}
$date_initial = date('Y-m-d', strtotime($_POST['date_start'])) . " 00:00:00";
$date_final = date('Y-m-d', strtotime($_POST['date_end'])) . " 23:59:59";
$_DATA = $_POST;
//begin grid parameters
$oGrid = new paloSantoGrid($smarty);
$oGrid->setTitle(_tr("Monitoring"));
$oGrid->setIcon("modules/{$module_name}/images/pbx_monitoring.png");
$oGrid->pagingShow(true);
// show paging section.
$oGrid->enableExport();
// enable export.
$oGrid->setNameFile_Export(_tr("Monitoring"));
if ($esAdministrador) {
$totalMonitoring = $pMonitoring->getNumMonitoring($filter_field, $filter_value, null, $date_initial, $date_final);
} elseif (!($extension == "" || is_null($extension))) {
$totalMonitoring = $pMonitoring->getNumMonitoring($filter_field, $filter_value, $extension, $date_initial, $date_final);
} else {
$totalMonitoring = 0;
}
$url = array('menu' => $module_name);
$paramFilter = array('filter_field' => $filter_field, 'filter_value' => $filter, 'filter_value_userfield' => $filter_userfield, 'date_start' => $_POST['date_start'], 'date_end' => $_POST['date_end']);
$url = array_merge($url, $paramFilter);
$oGrid->setURL($url);
$arrData = null;
if ($oGrid->isExportAction()) {
$limit = $totalMonitoring;
$offset = 0;
$arrColumns = array(_tr("Date"), _tr("Time"), _tr("Source"), _tr("Destination"), _tr("Duration"), _tr("Type"), _tr("File"));
$oGrid->setColumns($arrColumns);
if ($esAdministrador) {
$arrResult = $pMonitoring->getMonitoring($limit, $offset, $filter_field, $filter_value, null, $date_initial, $date_final);
} elseif (!($extension == "" || is_null($extension))) {
$arrResult = $pMonitoring->getMonitoring($limit, $offset, $filter_field, $filter_value, $extension, $date_initial, $date_final);
} else {
$arrResult = array();
}
if (is_array($arrResult) && $totalMonitoring > 0) {
foreach ($arrResult as $key => $value) {
$arrTmp[0] = date('d M Y', strtotime($value['calldate']));
//.........这里部分代码省略.........
示例15: reportClientesagendados
function reportClientesagendados($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf)
{
$pClientesagendados = new paloSantoClientesagendados($pDB);
$filter_field = getParameter("filter_field");
$filter_value = getParameter("filter_value");
//begin grid parameters
$oGrid = new paloSantoGrid($smarty);
$oGrid->setTplFile("/var/www/html/modules/{$module_name}/themes/default/_list.tpl");
$oGrid->setTitle(_tr("Clientes agendados"));
$oGrid->pagingShow(true);
// show paging section.
$oGrid->enableExport();
// enable export.
$oGrid->setNameFile_Export(_tr("Clientes agendados"));
$url = array("menu" => $module_name, "filter_field" => $filter_field, "filter_value" => $filter_value);
$oGrid->setURL($url);
$arrColumns = array(_tr("Apellido"), _tr("Nombre"), _tr("CI"), _tr("Campaña"), _tr("Fecha de agendamiento"), _tr("Call type"), _tr("Agente agendado"), "<input class=\"button\" type=\"submit\" name=\"action\" value=\"Reasignar\">");
$oGrid->setColumns($arrColumns);
$total = $pClientesagendados->getNumClientesagendados($filter_field, $filter_value);
$arrData = null;
if ($oGrid->isExportAction()) {
$limit = $total;
// max number of rows.
$offset = 0;
// since the start.
} else {
$limit = 20;
$oGrid->setLimit($limit);
$oGrid->setTotal($total);
$offset = $oGrid->calculateOffset();
}
$arrResult = $pClientesagendados->getClientesagendados($limit, $offset, $filter_field, $filter_value);
if (is_array($arrResult) && $total > 0) {
foreach ($arrResult as $key => $value) {
$arrTmp[0] = $value['apellido'];
$arrTmp[1] = $value['nombre'];
$arrTmp[2] = $value['ci'];
$arrTmp[3] = $value['nombre_campania'];
$arrTmp[4] = $value['fecha_agendamiento'];
$arrTmp[5] = $value['ultimo_calltype'];
$arrTmp[6] = $value['agente_agendado'];
if (empty($value['id_campania_cliente'])) {
$arrTmp[7] = getFormSelectAgentesCampaniaRecargable($pClientesagendados, $value['id_campania'], $value['id_campania_recargable_cliente'], $value['agente_agendado']);
} else {
$arrTmp[7] = getFormSelectAgentesCampania($pClientesagendados, $value['id_campania'], $value['id_campania_cliente'], $value['agente_agendado']);
}
$arrData[] = $arrTmp;
}
}
$oGrid->setData($arrData);
//begin section filter
$oFilterForm = new paloForm($smarty, createFieldFilter());
$smarty->assign("SHOW", _tr("Show"));
$htmlFilter = $oFilterForm->fetchForm("{$local_templates_dir}/filter.tpl", "", $_POST);
//end section filter
$oGrid->showFilter(trim($htmlFilter));
$content = $oGrid->fetchGrid();
//end grid parameters
return $content;
}