本文整理汇总了PHP中paloSantoGrid::setURL方法的典型用法代码示例。如果您正苦于以下问题:PHP paloSantoGrid::setURL方法的具体用法?PHP paloSantoGrid::setURL怎么用?PHP paloSantoGrid::setURL使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类paloSantoGrid
的用法示例。
在下文中一共展示了paloSantoGrid::setURL方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: listRepositories
function listRepositories($smarty, $module_name, $local_templates_dir, $arrConf)
{
$oRepositories = new PaloSantoRepositories();
$arrReposActivos = array();
$typeRepository = getParameter("typeRepository");
if (isset($_POST['submit_aceptar'])) {
foreach ($_POST as $key => $value) {
if (substr($key, 0, 5) == 'repo-') {
$arrReposActivos[] = substr($key, 5);
}
}
$oRepositories->setRepositorios($arrConf['ruta_repos'], $arrReposActivos, $typeRepository, $arrConf["main_repos"]);
}
$option["main"] = "";
$option["others"] = "";
$option["all"] = "";
$arrRepositorios = $oRepositories->getRepositorios($arrConf['ruta_repos'], $typeRepository, $arrConf["main_repos"]);
$limit = 40;
$total = count($arrRepositorios);
$oGrid = new paloSantoGrid($smarty);
$oGrid->setLimit($limit);
$oGrid->setTotal($total);
$offset = $oGrid->calculateOffset();
$end = $oGrid->getEnd();
$arrData = array();
$version = $oRepositories->obtenerVersionDistro();
$arch = $oRepositories->obtenerArquitectura();
if (is_array($arrRepositorios)) {
for ($i = $offset; $i < $end; $i++) {
$activo = "";
if ($arrRepositorios[$i]['activo']) {
$activo = "checked='checked'";
}
$arrData[] = array("<input {$activo} name='repo-" . $arrRepositorios[$i]['id'] . "' type='checkbox' id='repo-{$i}' />", $valor = str_replace(array("\$releasever", "\$basearch"), array($version, $arch), $arrRepositorios[$i]['name']));
}
}
if (isset($typeRepository)) {
$oGrid->setURL("?menu={$module_name}&typeRepository={$typeRepository}");
$_POST["typeRepository"] = $typeRepository;
} else {
$oGrid->setURL("?menu={$module_name}");
$_POST["typeRepository"] = "main";
}
$arrGrid = array("title" => _tr("Repositories"), "icon" => "web/apps/{$module_name}/images/system_updates_repositories.png", "width" => "99%", "start" => $total == 0 ? 0 : $offset + 1, "end" => $end, "total" => $total, "columns" => array(0 => array("name" => _tr("Active"), "property1" => ""), 1 => array("name" => _tr("Name"), "property1" => "")));
$oGrid->customAction('submit_aceptar', _tr('Save/Update'));
$oGrid->addButtonAction("default", _tr('Default'), null, "defaultValues({$total},'{$version}','{$arch}')");
$FilterForm = new paloForm($smarty, createFilter());
$arrOpt = array("main" => _tr('Main'), "others" => _tr('Others'), "all" => _tr('All'));
if (isset($arrOpt[$typeRepository])) {
$valorfiltro = $arrOpt[$typeRepository];
} else {
$valorfiltro = _tr('Main');
}
$oGrid->addFilterControl(_tr("Filter applied ") . _tr("Repo") . " = " . $valorfiltro, $_POST, array("typeRepository" => "main"), true);
$htmlFilter = $FilterForm->fetchForm("{$local_templates_dir}/new.tpl", "", $_POST);
$oGrid->showFilter($htmlFilter);
$contenidoModulo = $oGrid->fetchGrid($arrGrid, $arrData);
return $contenidoModulo;
}
示例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: 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;
}
示例4: 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;
}
示例5: 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;
}
示例6: reportRegestion
function reportRegestion($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf)
{
$pRegestion = new paloSantoRegestion($pDB);
$filter_field = getParameter("filter_field");
$filter_value = getParameter("filter_value");
//begin grid parameters
$oGrid = new paloSantoGrid($smarty);
$oGrid->setTitle(_tr("Regestión de campañas"));
$oGrid->pagingShow(true);
// show paging section.
$oGrid->enableExport();
// enable export.
$oGrid->setNameFile_Export(_tr("Regestión de campañas"));
$url = array("menu" => $module_name, "filter_field" => $filter_field, "filter_value" => $filter_value);
$oGrid->setURL($url);
$arrColumns = array(_tr("Campaña padre"), _tr("Clase de calltypes"), _tr("Acción"));
$oGrid->setColumns($arrColumns);
$total = $pRegestion->getNumRegestion($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 = $pRegestion->getRegestion($limit, $offset, $filter_field, $filter_value);
if (is_array($arrResult) && $total > 0) {
foreach ($arrResult as $key => $value) {
$arrTmp[0] = $value['nombre'];
$arrTmp[1] = "<form method='POST' action=\"index.php?menu={$module_name}\">";
$arrTmp[1] .= "<select name=\"clase_calltype\">\n\t\t\t <option value=\"Contactado\">Contactado</option>\n\t\t\t <option value=\"No contactado\">No contactado</option>\n\t\t\t <option value=\"Agendado\">Agendado</option>\n\t\t\t </select>";
$arrTmp[1] .= "<input type=hidden name=\"action\" value=\"view_edit\">";
$arrTmp[1] .= "<input type=hidden name=\"id\" value={$value['id']}>";
$arrTmp[2] = "<input type=submit value=\"Regestionar\">";
$arrTmp[2] .= "</form>";
$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;
}
示例7: _moduleContent
//.........这里部分代码省略.........
$paramFiltro = $paramFiltroBase;
unset($_POST['delete']);
// Se aborta el intento de borrar CDRs, si había uno.
}
// Tradudir fechas a formato ISO para comparación y para API de CDRs.
$url = array_merge($url, $paramFiltro);
$paramFiltro['date_start'] = translateDate($paramFiltro['date_start']) . ' 00:00:00';
$paramFiltro['date_end'] = translateDate($paramFiltro['date_end']) . ' 23:59:59';
// Valores de filtrado que no se seleccionan mediante filtro
if ($sExtension != '') {
$paramFiltro['extension'] = $sExtension;
}
// Ejecutar el borrado, si se ha validado.
if (isset($_POST['delete'])) {
if ($isAdministrator) {
if ($paramFiltro['date_start'] <= $paramFiltro['date_end']) {
$r = $oCDR->borrarCDRs($paramFiltro);
if (!$r) {
$smarty->assign(array('mb_title' => _tr('ERROR'), 'mb_message' => $oCDR->errMsg));
}
} else {
$smarty->assign(array('mb_title' => _tr('ERROR'), 'mb_message' => _tr("Please End Date must be greater than Start Date")));
}
} else {
$smarty->assign(array('mb_title' => _tr('ERROR'), 'mb_message' => _tr("Only administrators can delete CDRs")));
}
}
$oGrid->setTitle(_tr("CDR Report"));
$oGrid->pagingShow(true);
// show paging section.
$oGrid->enableExport();
// enable export.
$oGrid->setNameFile_Export(_tr("CDRReport"));
$oGrid->setURL($url);
//if($isAdministrator)
//$oGrid->deleteList("Are you sure you wish to delete CDR(s) Report(s)?","delete",_tr("Delete"));
$arrData = null;
if (!isset($sExtension) || $sExtension == "" && !$isAdministrator) {
$total = 0;
} else {
$total = $oCDR->contarCDRs($paramFiltro);
}
if ($oGrid->isExportAction()) {
$limit = $total;
$offset = 0;
$arrColumns = array(_tr("Date"), _tr("Source"), _tr("Ring Group"), _tr("Destination"), _tr("Src. Channel"), _tr("Account Code"), _tr("Dst. Channel"), _tr("Status"), _tr("Duration"));
$oGrid->setColumns($arrColumns);
$arrResult = $oCDR->listarCDRs($paramFiltro, $limit, $offset);
if (is_array($arrResult['cdrs']) && $total > 0) {
foreach ($arrResult['cdrs'] as $key => $value) {
$arrTmp[0] = date("d-m-Y H:i:s", strtotime($value[0]));
$arrTmp[1] = $value[1];
$arrTmp[2] = $value[11];
$arrTmp[3] = $value[3];
$arrTmp[4] = $value[9];
$arrTmp[5] = $value[5];
$iDuracion = $value[8];
$iSec = $iDuracion % 60;
$iDuracion = (int) (($iDuracion - $iSec) / 60);
$iMin = $iDuracion % 60;
$iDuracion = (int) (($iDuracion - $iMin) / 60);
$sTiempo = "{$value[6]}s";
if ($value[6] >= 60) {
if ($iDuracion > 0) {
$sTiempo .= " ({$iDuracion}h {$iMin}m {$iSec}s)";
} elseif ($iMin > 0) {
示例8: listarFaxes
function listarFaxes(&$smarty, $module_name, $local_templates_dir)
{
$smarty->assign(array('SEARCH' => _tr('Search')));
$oFax = new paloFaxVisor();
// Generación del filtro
$oFilterForm = new paloForm($smarty, getFormElements());
// Parámetros base y validación de parámetros
$url = array('menu' => $module_name);
$paramFiltroBase = $paramFiltro = array('name_company' => '', 'fax_company' => '', 'date_fax' => NULL, 'filter' => 'All');
foreach (array_keys($paramFiltro) as $k) {
if (!is_null(getParameter($k))) {
$paramFiltro[$k] = getParameter($k);
}
}
$oGrid = new paloSantoGrid($smarty);
$arrType = array("All" => _tr('All'), "In" => _tr('in'), "Out" => _tr('out'));
$oGrid->addFilterControl(_tr("Filter applied ") . _tr("Company Name") . " = " . $paramFiltro['name_company'], $paramFiltro, array("name_company" => ""));
$oGrid->addFilterControl(_tr("Filter applied ") . _tr("Company Fax") . " = " . $paramFiltro['fax_company'], $paramFiltro, array("fax_company" => ""));
$oGrid->addFilterControl(_tr("Filter applied ") . _tr("Fax Date") . " = " . $paramFiltro['date_fax'], $paramFiltro, array("date_fax" => NULL));
$oGrid->addFilterControl(_tr("Filter applied ") . _tr("Type Fax") . " = " . $arrType[$paramFiltro['filter']], $paramFiltro, array("filter" => "All"), true);
$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['faxes_delete']);
// Se aborta el intento de borrar faxes, si había uno.
}
$url = array_merge($url, $paramFiltro);
// Ejecutar el borrado, si se ha validado.
if (isset($_POST['faxes_delete']) && isset($_POST['faxes']) && is_array($_POST['faxes']) && count($_POST['faxes']) > 0) {
$msgError = NULL;
foreach ($_POST['faxes'] as $idFax) {
if (!$oFax->deleteInfoFax($idFax)) {
if ($oFax->errMsg = '') {
$msgError = _tr('Unable to eliminate pdf file from the path.');
} else {
$msgError = _tr('Unable to eliminate pdf file from the database.') . ' - ' . $oFax->errMsg;
}
}
}
if (!is_null($msgError)) {
$smarty->assign(array('mb_title' => _tr('ERROR'), 'mb_message' => $oFax->errMsg));
}
}
$oGrid->setTitle(_tr("Fax Viewer"));
$oGrid->setIcon("modules/{$module_name}/images/kfaxview.png");
$oGrid->pagingShow(true);
// show paging section.
$oGrid->setURL($url);
$arrData = NULL;
$total = $oFax->obtener_cantidad_faxes($paramFiltro['name_company'], $paramFiltro['fax_company'], $paramFiltro['date_fax'], $paramFiltro['filter']);
$limit = 20;
$oGrid->setLimit($limit);
$oGrid->setTotal($total);
$offset = $oGrid->calculateOffset();
$arrResult = $oFax->obtener_faxes($paramFiltro['name_company'], $paramFiltro['fax_company'], $paramFiltro['date_fax'], $offset, $limit, $paramFiltro['filter']);
$oGrid->setColumns(array("", _tr('Type'), _tr('File'), _tr('Company Name'), _tr('Company Fax'), _tr('Fax Destiny'), _tr('Fax Date'), _tr('Status'), _tr('Options')));
if (is_array($arrResult) && $total > 0) {
foreach ($arrResult as $fax) {
foreach (array('pdf_file', 'company_name', 'company_fax', 'destiny_name', 'destiny_fax', 'errormsg') as $k) {
$fax[$k] = htmlentities($fax[$k], ENT_COMPAT, 'UTF-8');
}
if (empty($fax['status']) && !empty($fax['errormsg'])) {
$fax['status'] = 'failed';
}
$arrData[] = array('<input type="checkbox" name="faxes[]" value="' . $fax['id'] . '" />', _tr($fax['type']), strtolower($fax['type']) == 'in' || strpos($fax['pdf_file'], '.pdf') !== FALSE ? "<a href='?menu={$module_name}&action=download&id=" . $fax['id'] . "&rawmode=yes'>" . $fax['pdf_file'] . "</a>" : $fax['pdf_file'], $fax['company_name'], $fax['company_fax'], $fax['destiny_name'] . " - " . $fax['destiny_fax'], $fax['date'], _tr($fax['status']) . (empty($fax['errormsg']) ? '' : ': ' . $fax['errormsg']), "<a href='?menu={$module_name}&action=edit&id=" . $fax['id'] . "'>" . _tr('Edit') . "</a>");
}
}
if (!is_array($arrResult)) {
$smarty->assign(array('mb_title' => _tr('ERROR'), 'mb_message' => $oFax->errMsg));
}
$oGrid->setData($arrData);
$oGrid->deleteList(_tr('Are you sure you wish to delete fax (es)?'), "faxes_delete", _tr("Delete"));
$oGrid->showFilter($htmlFilter);
return $oGrid->fetchGrid();
}
示例9: reportANI
function reportANI($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf, $credentials)
{
global $arrPermission;
$error = "";
$smarty->assign("SHOW_DIV_ERROR", "0");
//FIXED: can show div error message with javascript
$smarty->assign("mb_message", "hide");
//FIXED: can show div error message with javascript
$pORGZ = new paloSantoOrganization($pDB);
$domain = getParameter("organization");
$domain = empty($domain) ? 'all' : $domain;
if ($credentials['userlevel'] != "superadmin") {
$domain = $credentials['domain'];
}
$ani_prefix = getParameter("ani_prefix");
$pANI = new paloSantoANI($pDB, $domain);
$url['menu'] = $module_name;
$url['organization'] = $domain;
$url['ani_prefix'] = $ani_prefix;
$total = $pANI->getNumANI($domain, $ani_prefix);
$arrOrgz = array();
if ($credentials['userlevel'] == "superadmin") {
$arrOrgz = array("all" => _tr("all"));
foreach ($pORGZ->getOrganization(array()) as $value) {
$arrOrgz[$value["domain"]] = $value["name"];
}
}
if ($total === false) {
$error = $pANI->errMsg;
$total = 0;
}
$limit = 20;
$oGrid = new paloSantoGrid($smarty);
$oGrid->setLimit($limit);
$oGrid->setTotal($total);
$offset = $oGrid->calculateOffset();
$end = $offset + $limit <= $total ? $offset + $limit : $total;
$oGrid->setTitle(_tr('ANI List'));
$oGrid->setWidth("99%");
$oGrid->setStart($total == 0 ? 0 : $offset + 1);
$oGrid->setEnd($end);
$oGrid->setTotal($total);
$oGrid->setURL($url);
$arrColum = array();
if ($credentials['userlevel'] == "superadmin") {
$arrColum[] = _tr("Organization");
}
$arrColum[] = _tr("Trunk Name");
$arrColum[] = _tr("Prefix ANI");
$oGrid->setColumns($arrColum);
$arrANI = array();
$arrData = array();
if ($total != 0) {
$arrANI = $pANI->getANI($domain, $ani_prefix, $limit, $offset);
}
if ($arrANI === false) {
$error = _tr("Error to obtain ANI") . $pANI->errMsg;
$arrANI = array();
}
if ($error != "") {
$smarty->assign("mb_title", _tr("MESSAGE"));
$smarty->assign("mb_message", $error);
$smarty->assign("SHOW_DIV_ERROR", "1");
}
foreach ($arrANI as $row) {
$arrTmp = array();
if ($credentials['userlevel'] == "superadmin") {
$arrTmp[] = $arrOrgz[$row["organization_domain"]];
}
$arrTmp[] = $row["name"];
$arrTmp[] = "<input type='text' style='width:60px; text-align:center;' id='text#{$row['organization_domain']}#{$row['trunkid']}' value='{$row['ani_prefix']}' /> \n <input type='button' id='button#{$row['organization_domain']}#{$row['trunkid']}' value='" . _tr("Save") . "' />";
$arrData[] = $arrTmp;
}
$smarty->assign("USERLEVEL", $credentials['userlevel']);
$smarty->assign("SEARCH", "<input type='submit' class='button' value='" . _tr('Search') . "' name='report'>");
if ($pORGZ->getNumOrganization(array()) == 0) {
$smarty->assign("mb_title", _tr("MESSAGE"));
$smarty->assign("mb_message", _tr("It's necesary you create at least one organization so you can use this module"));
$smarty->assign("SHOW_DIV_ERROR", "1");
}
if ($credentials['userlevel'] == 'superadmin') {
$_POST["organization"] = $domain;
$oGrid->addFilterControl(_tr("Filter applied ") . _tr("Organization") . " = " . $arrOrgz[$domain], $_POST, array("organization" => "all"), true);
}
$_POST["ani_prefix"] = $ani_prefix;
$oGrid->addFilterControl(_tr("Filter applied ") . _tr("ANI Prefix") . " = " . $ani_prefix, $_POST, array("ani_prefix" => ""));
$arrFormElements = createFieldFilter($arrOrgz);
$oFilterForm = new paloForm($smarty, $arrFormElements);
$htmlFilter = $oFilterForm->fetchForm("{$local_templates_dir}/filter.tpl", "", $_POST);
$oGrid->showFilter(trim($htmlFilter));
return $oGrid->fetchGrid(array(), $arrData);
}
示例10: reportMemberList
function reportMemberList($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf, $credentials)
{
global $arrPermission;
$pEmailList = new paloSantoEmailList($pDB);
$id_list = getParameter("id");
if ($credentials['userlevel'] == 'superadmin') {
$emailList = $pEmailList->getEmailList($id_list);
} else {
$emailList = $pEmailList->getEmailList($id_list, $credentials['domain']);
}
if ($emailList == false) {
$smarty->assign("mb_title", _tr("Error"));
$error = $emailList === false ? _tr("Couldn't be retrieved Email List data") : _tr("Email List does not exist");
$smarty->assign("mb_message", $error);
return reportEmailList($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $credentials);
}
$field_type = getParameter("filter_type");
$field_pattern = getParameter("filter_txt");
$smarty->assign("IDEMAILLIST", $id_list);
$smarty->assign("ACTION", 'view_memberlist');
$smarty->assign("SHOW", _tr("Show"));
$smarty->assign("RETURN", _tr("Return"));
$smarty->assign("LINK", "?menu={$module_name}&action=export&id={$id_list}&rawmode=yes");
$smarty->assign("EXPORT", _tr("Export Members"));
$edit_permission = in_array('edit_list', $arrPermission);
$totalMembers = $pEmailList->getTotalMembers($id_list);
$oGrid = new paloSantoGrid($smarty);
$limit = 20;
$oGrid->setLimit($limit);
$oGrid->setTotal($totalMembers);
$oGrid->setTitle(_tr("List Members of") . " " . $pEmailList->getListName($id_list));
$oGrid->setIcon("web/apps/{$module_name}/images/email.png");
$oGrid->pagingShow(true);
$offset = $oGrid->calculateOffset();
$url['menu'] = $module_name;
$url['action'] = 'view_memberlist';
$url['id'] = $id_list;
$url['filter_type'] = $field_type;
$url['filter_txt'] = $field_pattern;
$oGrid->setURL($url);
if ($edit_permission) {
$arrColumns[] = '';
}
$arrColumns[] = _tr("Member name");
$arrColumns[] = _tr("Member email");
$oGrid->setColumns($arrColumns);
$arrResult = $pEmailList->getMembers($limit, $offset, $id_list, $field_type, $field_pattern);
$arrData = null;
//print_r($arrResult);
if (is_array($arrResult) && $totalMembers > 0) {
foreach ($arrResult as $list) {
$arrTmp = array();
if ($edit_permission) {
$arrTmp[] = "<input type='checkbox' name='del_emailmembers[{$list["mailmember"]}]'>";
}
$arrTmp[] = $list["namemember"];
$arrTmp[] = $list["mailmember"];
$arrData[] = $arrTmp;
}
}
$arrFormFilterMembers = createFieldFilterViewMembers();
$oFilterForm = new paloForm($smarty, $arrFormFilterMembers);
$arrType = array("name" => _tr("Name"), "email" => _tr("Email"));
if (!is_null($field_type)) {
$nameField = $arrType[$field_type];
} else {
$nameField = "";
}
$oGrid->customAction("return", _tr("Return"));
if ($edit_permission) {
$oGrid->addNew("new_memberlist", _tr("Add Member(s) to List"));
$oGrid->deleteList(_tr("Are you sure you wish to delete the Email List(s)."), "remove_memberlist", _tr("Delete"));
}
$oGrid->customAction("?menu={$module_name}&action=export&id={$id_list}&rawmode=yes", _tr("Export Members"), null, true);
$oGrid->addFilterControl(_tr("Filter applied: ") . $nameField . " = " . $field_pattern, $_POST, array("filter_type" => "name", "filter_txt" => ""));
$htmlFilter = $oFilterForm->fetchForm("{$local_templates_dir}/view_members.tpl", "", $_POST);
$oGrid->showFilter(trim($htmlFilter));
$content = $oGrid->fetchGrid(array(), $arrData);
return $content;
}
示例11: 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());
//.........这里部分代码省略.........
示例12: reportOtherDestinations
function reportOtherDestinations($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf, $credentials)
{
global $arrPermission;
$error = "";
$pORGZ = new paloSantoOrganization($pDB);
$domain = getParameter("organization");
$domain = empty($domain) ? 'all' : $domain;
if ($credentials['userlevel'] != "superadmin") {
$domain = $credentials['domain'];
}
$other_destination_name = getParameter("other_destination_name");
$pOtherDestinations = new paloSantoOtherDestinations($pDB, $domain);
$url['menu'] = $module_name;
$url['organization'] = $domain;
$url['other_destination_name'] = $other_destination_name;
$total = $pOtherDestinations->getNumOtherDestinations($domain, $other_destination_name);
$arrOrgz = array();
if ($credentials['userlevel'] == "superadmin") {
$arrOrgz = array("all" => _tr("all"));
foreach ($pORGZ->getOrganization(array()) as $value) {
$arrOrgz[$value["domain"]] = $value["name"];
}
}
if ($total === false) {
$error = $pOtherDestinations->errMsg;
$total = 0;
}
$limit = 20;
$oGrid = new paloSantoGrid($smarty);
$oGrid->setLimit($limit);
$oGrid->setTotal($total);
$offset = $oGrid->calculateOffset();
$end = $offset + $limit <= $total ? $offset + $limit : $total;
$oGrid->setTitle(_tr('Other Destinations List'));
//$oGrid->setIcon('url de la imagen');
$oGrid->setWidth("99%");
$oGrid->setStart($total == 0 ? 0 : $offset + 1);
$oGrid->setEnd($end);
$oGrid->setTotal($total);
$oGrid->setURL($url);
$arrColum = array();
if ($credentials['userlevel'] == "superadmin") {
$arrColum[] = _tr("Organization");
}
$arrColum[] = _tr("Other Destination Name");
$arrColum[] = _tr("Dial Destination");
$oGrid->setColumns($arrColum);
$arrOtherDestinations = array();
$arrData = array();
if ($total != 0) {
$arrOtherDestinations = $pOtherDestinations->getOtherDestinations($domain, $other_destination_name, $limit, $offset);
}
if ($arrOtherDestinations === false) {
$error = _tr("Error to obtain Other Destinations") . $pOtherDestinations->errMsg;
$arrOtherDestinations = array();
}
foreach ($arrOtherDestinations as $row) {
$arrTmp = array();
if ($credentials['userlevel'] == "superadmin") {
$arrTmp[] = $arrOrgz[$row["organization_domain"]];
}
$arrTmp[] = " <a href='?menu={$module_name}&action=view&id=" . $row['id'] . "&organization={$row['organization_domain']}'>" . htmlentities($row["description"], ENT_QUOTES, "UTF-8") . "</a>";
$arrTmp[] = $row["destdial"];
$arrData[] = $arrTmp;
}
$smarty->assign("USERLEVEL", $credentials['userlevel']);
$smarty->assign("SEARCH", "<input type='submit' class='button' value='" . _tr('Search') . "' name='report'>");
if ($pORGZ->getNumOrganization(array()) >= 1) {
if (in_array('create', $arrPermission)) {
if ($credentials['userlevel'] == 'superadmin') {
$oGrid->addComboAction("organization_add", _tr("ADD Other Destination"), array_slice($arrOrgz, 1), $selected = null, "create_other_destination", $onchange_select = null);
} else {
$oGrid->addNew("create_other_destination", _tr("ADD Other Destination"));
}
}
if ($credentials['userlevel'] == 'superadmin') {
$_POST["organization"] = $domain;
$oGrid->addFilterControl(_tr("Filter applied ") . _tr("Organization") . " = " . $arrOrgz[$domain], $_POST, array("organization" => "all"), true);
}
$_POST["other_destination_name"] = $other_destination_name;
// name
$oGrid->addFilterControl(_tr("Filter applied ") . _tr("Other Destination Name") . " = " . $other_destination_name, $_POST, array("other_destination_name" => ""));
$arrFormElements = createFieldFilter($arrOrgz);
$oFilterForm = new paloForm($smarty, $arrFormElements);
$htmlFilter = $oFilterForm->fetchForm("{$local_templates_dir}/filter.tpl", "", $_POST);
$oGrid->showFilter(trim($htmlFilter));
} else {
$smarty->assign("mb_title", _tr("MESSAGE"));
$smarty->assign("mb_message", _tr("It's necesary you create at least one organization so you can use this module"));
}
if ($error != "") {
$smarty->assign("mb_title", _tr("MESSAGE"));
$smarty->assign("mb_message", $error);
}
$contenidoModulo = $oGrid->fetchGrid(array(), $arrData);
$mensaje = showMessageReload($module_name, $pDB, $credentials);
$contenidoModulo = $mensaje . $contenidoModulo;
return $contenidoModulo;
}
示例13: 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;
}
示例14: 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") {
//.........这里部分代码省略.........
示例15: 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;
}