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


PHP paloSantoGrid::deleteList方法代码示例

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


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

示例1: listPortKnockUsers

function listPortKnockUsers(&$smarty, $module_name, $local_templates_dir, &$pDB, $arrConf)
{
    $pACL = new paloACL($arrConf['elastix_dsn']['acl']);
    $pk = new paloSantoPortKnockUsers($pDB);
    // Manejar la operación de borrar todas las autorizaciones de un usuario
    if (isset($_POST['delete']) && isset($_POST['id_user'])) {
        $r = $pk->deleteUserAuthorizations($_POST['id_user']);
        if (!$r) {
            $smarty->assign("mb_title", _tr("ERROR"));
            $smarty->assign("mb_message", $pk->errMsg);
        } else {
            // Ejecutar iptables para revocar las reglas del usuario
            require_once "modules/sec_rules/libs/paloSantoRules.class.php";
            $pr = new paloSantoRules($pDB);
            $pr->activateRules();
            $smarty->assign("mb_title", _tr("Message"));
            $smarty->assign("mb_message", _tr("Revocation successful"));
        }
    }
    $oGrid = new paloSantoGrid($smarty);
    $oGrid->setTitle(_tr('PortKnock Users'));
    $oGrid->setColumns(array('', _tr('User'), _tr('Authorized ports'), _tr('Options')));
    $oGrid->deleteList(_tr('Are you sure you wish to revoke the user authorizations?'), 'delete', _tr('Revoke authorizations'));
    $oGrid->addNew("?menu={$module_name}&action=new", _tr('Authorize new user'), true);
    // Construcción de la vista de usuarios autorizados
    $data = array();
    $recordset = $pk->listAuthorizedUsers();
    if (is_array($recordset)) {
        foreach ($recordset as $id_user => $auths) {
            $userinfo = $pACL->getUsers($id_user);
            $protocols = array();
            foreach ($auths as $a) {
                $protocols[] = $a['name'];
            }
            $data[] = array('<input type="radio" name="id_user" value="' . $id_user . '" />', $userinfo[0][1], implode(' ', $protocols), "<a href=\"?menu={$module_name}&amp;action=edit&amp;id_user={$id_user}\">[" . _tr('Add/Remove Ports') . "]</a>");
        }
    }
    $oGrid->pagingShow(false);
    $url = array("menu" => $module_name);
    $oGrid->setURL($url);
    $oGrid->setData($data);
    return $oGrid->fetchGrid();
}
开发者ID:hardikk,项目名称:HNH,代码行数:43,代码来源:index.php

示例2: reportDHCP_Configuration

function reportDHCP_Configuration($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf)
{
    $pDHCP_Configuration = new paloSantoDHCP_Configuration($pDB);
    $filter_field = getParameter("filter_field");
    $filter_value = getParameter("filter_value");
    $action = getParameter("nav");
    $start = getParameter("start");
    //begin grid parameters
    $oGrid = new paloSantoGrid($smarty);
    $nameOpt = array("hostname" => _tr('Host Name'), "ipaddress" => _tr('IP Address'), "macaddress" => _tr('MAC Address'));
    if (isset($nameOpt[$filter_field])) {
        $valorFiltro = $nameOpt[$filter_field];
    } else {
        $valorFiltro = "";
    }
    $oGrid->addFilterControl(_tr("Filter applied ") . " " . $valorFiltro . " = {$filter_value}", $_POST, array("filter_field" => "hostname", "filter_value" => ""));
    $totalDHCP_Configuration = $pDHCP_Configuration->contarIpFijas($filter_field, $filter_value);
    $oGrid->addNew("new_dhcpconft", _tr("Assign IP Address"));
    $oGrid->deleteList("Are you sure you wish to delete the DHCP configuration.", "delete_dhcpConf", _tr("Delete"));
    $limit = 20;
    $total = $totalDHCP_Configuration;
    $oGrid->setLimit($limit);
    $oGrid->setTotal($total);
    $oGrid->calculatePagination($action, $start);
    $offset = $oGrid->getOffsetValue();
    $end = $oGrid->getEnd();
    $arrData = null;
    $arrResult = $pDHCP_Configuration->leerIPsFijas($limit, $offset, $filter_field, $filter_value);
    if (is_array($arrResult) && $total > 0) {
        foreach ($arrResult as $key => $value) {
            $arrTmp[0] = "<input type='checkbox' name='DhcpConfID_{$value['id']}' />";
            $arrTmp[1] = "<a href='?menu={$module_name}&action=view_dhcpconf&id=" . $value['id'] . "'>" . $value['hostname'] . "</a>";
            $arrTmp[2] = $value['ipaddress'];
            $arrTmp[3] = $value['macaddress'];
            $arrData[] = $arrTmp;
        }
    }
    $buttonDelete = "";
    $arrGrid = array("title" => _tr('Assign IP Address to Host'), "icon" => "modules/{$module_name}/images/system_network_assign_ip_address.png", "width" => "99%", "start" => $total == 0 ? 0 : $offset + 1, "end" => $end, "total" => $total, "url" => array('menu' => $module_name, 'filter_field' => $filter_field, 'filter_value' => $filter_value), "columns" => array(0 => array("name" => $buttonDelete, "property1" => ""), 1 => array("name" => _tr('Host Name'), "property1" => ""), 2 => array("name" => _tr('IP Address'), "property1" => ""), 3 => array("name" => _tr('MAC Address'), "property1" => "")));
    //begin section filter
    $arrFormFilterDHCP_Configuration = createFieldFilter();
    $oFilterForm = new paloForm($smarty, $arrFormFilterDHCP_Configuration);
    $smarty->assign("SHOW", _tr('Show'));
    $htmlFilter = $oFilterForm->fetchForm("{$local_templates_dir}/filter.tpl", "", $_POST);
    //end section filter
    $oGrid->showFilter(trim($htmlFilter));
    $contenidoModulo = $oGrid->fetchGrid($arrGrid, $arrData);
    //end grid parameters
    return $contenidoModulo;
}
开发者ID:hardikk,项目名称:HNH,代码行数:50,代码来源:index.php

示例3: 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") {
//.........这里部分代码省略.........
开发者ID:hardikk,项目名称:HNH,代码行数:101,代码来源:index.php

示例4: report_conference

function report_conference($smarty, $module_name, $local_templates_dir, $pDB, $arrLang2, $arrConfig, $dsn_agi_manager, $dsnAsterisk)
{
    global $arrLang;
    global $arrConf;
    $bSoporteWebConf = file_exists('modules/conferenceroom_list/libs/conferenceActions.lib.php');
    $arrConference = array("Past_Conferences" => $arrLang["Past Conferences"], "Current_Conferences" => $arrLang["Current Conferences"], "Future_Conferences" => $arrLang["Future Conferences"]);
    $arrFormElements = array("conference" => array("LABEL" => $arrLang["State"], "REQUIRED" => "yes", "INPUT_TYPE" => "SELECT", "INPUT_EXTRA_PARAM" => $arrConference, "VALIDATION_TYPE" => "text", "VALIDATION_EXTRA_PARAM" => "", "EDITABLE" => "no", "SIZE" => "1"), "filter" => array("LABEL" => $arrLang["Filter"], "REQUIRED" => "no", "INPUT_TYPE" => "TEXT", "INPUT_EXTRA_PARAM" => array("id" => "filter_value"), "VALIDATION_TYPE" => "text", "VALIDATION_EXTRA_PARAM" => ""));
    $oFilterForm = new paloForm($smarty, $arrFormElements);
    $smarty->assign("SHOW", $arrLang["Show"]);
    // $smarty->assign("NEW_CONFERENCE", $arrLang["New Conference"]);
    $startDate = $endDate = date("Y-m-d H:i:s");
    $conference = getParameter("conference");
    $field_pattern = getParameter("filter");
    if ($conference) {
        $_POST['conference'] = $conference;
    } else {
        $_POST['conference'] = "Current_Conferences";
    }
    $oGrid = new paloSantoGrid($smarty);
    $oGrid->addFilterControl(_tr("Filter applied: ") . _tr("State") . " = " . $arrConference[$_POST['conference']], $_POST, array("conference" => "Current_Conferences"), true);
    $oGrid->addFilterControl(_tr("Filter applied: ") . _tr("Conference Name") . " = {$field_pattern}", $_POST, array("filter" => ""));
    $htmlFilter = $oFilterForm->fetchForm("{$local_templates_dir}/conference.tpl", "", $_POST);
    $pConference = new paloSantoConference($pDB);
    $total_datos = $pConference->ObtainNumConferences($startDate, $endDate, "confDesc", $field_pattern, $conference);
    //Paginacion
    $limit = 8;
    $total = $total_datos[0];
    $oGrid->setLimit($limit);
    $oGrid->setTotal($total);
    $offset = $oGrid->calculateOffset();
    $end = $offset + $limit <= $total ? $offset + $limit : $total;
    $url = array('menu' => $module_name, 'conference' => $conference, 'filter' => $field_pattern);
    //Fin Paginacion
    $arrResult = $pConference->ObtainConferences($limit, $offset, $startDate, $endDate, "confDesc", $field_pattern, $conference);
    $pConfWeb = NULL;
    if ($bSoporteWebConf) {
        $pConfWeb = embedded_prepareWebConfLister();
    }
    $arrData = null;
    if (is_array($arrResult) && $total > 0) {
        // En caso de haber soporte de conferencias web, se recoge el ID de
        // conferencia telefónica asociada a la conferencia web, y se construye
        // la lista de datos para las columnas adicionales
        $listaWebConf = array();
        if (!is_null($pConfWeb)) {
            $pACL = new paloACL($arrConf['elastix_dsn']['acl']);
            $listaWC = $pConfWeb->listarConferencias($pACL->isUserAdministratorGroup($_SESSION['elastix_user']));
            foreach ($listaWC as $tuplaConf) {
                if (!is_null($tuplaConf['id_cbmysql_conference'])) {
                    $listaWebConf[$tuplaConf['id_cbmysql_conference']] = $tuplaConf;
                }
            }
        }
        foreach ($arrResult as $key => $conference) {
            $arrTmp[0] = "<input type='checkbox' name='conference_{$conference['bookId']}'  />";
            $arrTmp[1] = "<a href='?menu={$module_name}&accion=view_conference&conferenceId=" . $conference['bookId'] . "'>" . htmlentities($conference['confDesc'], ENT_COMPAT, "UTF-8") . "</a>";
            $arrTmp[2] = $conference['roomNo'];
            $arrTmp[3] = $conference['startTime'] . ' - ' . $conference['endTime'];
            if ($_POST['conference'] == "Current_Conferences") {
                $arrCallers = $pConference->ObtainCallers($dsn_agi_manager, $conference['roomNo']);
                $numCallers = count($arrCallers);
                $arrTmp[4] = "<a href='?menu={$module_name}&accion=show_callers&roomNo=" . $conference['roomNo'] . "'>{$numCallers} / {$conference['maxUser']}</a>";
            } else {
                $arrTmp[4] = $conference['maxUser'];
            }
            if ($bSoporteWebConf) {
                $arrTmp[5] = '';
                $arrTmp[6] = '';
                $arrTmp[7] = '';
                $arrTmp[8] = '';
                if (isset($listaWebConf[$conference['bookId']])) {
                    $tuplaConf = $listaWebConf[$conference['bookId']];
                    $arrTmp[5] = htmlentities($tuplaConf['tema'], ENT_COMPAT, "UTF-8");
                    $arrTmp[6] = $tuplaConf['num_invitados'];
                    $arrTmp[7] = $tuplaConf['num_documentos'];
                    $arrTmp[8] = "<a href=\"?menu={$module_name}&amp;action=list_guests&amp;id_conference={$tuplaConf['id_conferencia']}\">[{$arrLang['List guests']}]</a>&nbsp;" . "<a href=\"?menu={$module_name}&amp;action=list_chatlog&amp;id_conference={$tuplaConf['id_conferencia']}\">[{$arrLang['Chatlog']}]</a>";
                }
            }
            $arrData[] = $arrTmp;
        }
    }
    $arrGrid = array("title" => $arrLang["Conference"], "url" => $url, "icon" => "/modules/{$module_name}/images/pbx_conference.png", "width" => "99%", "start" => $total == 0 ? 0 : $offset + 1, "end" => $end, "total" => $total, 'columns' => array(array('name' => ""), array("name" => $arrLang["Conference Name"]), array("name" => $arrLang["Conference #"]), array('name' => 'Period'), array('name' => $arrLang["Participants"])));
    if ($bSoporteWebConf) {
        $arrGrid['columns'][] = array('name' => $arrLang['Topic']);
        $arrGrid['columns'][] = array('name' => $arrLang['# Guests']);
        $arrGrid['columns'][] = array('name' => $arrLang['# Docs']);
        $arrGrid['columns'][] = array('name' => $arrLang['Options']);
    }
    $oGrid->addNew("new_conference", _tr('New Conference'));
    $oGrid->deleteList(_tr("Are you sure you wish to delete conference (es)?"), "delete_conference", _tr("Delete"));
    $oGrid->showFilter(trim($htmlFilter));
    $contenidoModulo = $oGrid->fetchGrid($arrGrid, $arrData, $arrLang);
    return $contenidoModulo;
}
开发者ID:hardikk,项目名称:HNH,代码行数:94,代码来源:index.php

示例5: reportCDR


//.........这里部分代码省略.........
    if ($arrResult === false) {
        $error = _tr('CDR data could not be retrieved.') . " " . "DATABASE ERROR";
    } else {
        foreach ($arrResult as $value) {
            $arrTmp = array();
            if ($delete && !$oGrid->isExportAction()) {
                $arrTmp[] = "<input type='checkbox' name='crdDel[]' class='cdrdelete' value='{$value['6']}' />";
            }
            if ($credentials['userlevel'] == "superadmin") {
                $arrTmp[] = isset($arrOrgz[$value[11]]) ? $arrOrgz[$value[11]] : '';
            }
            $arrTmp[] = $value[0];
            //calldate
            $arrTmp[] = $value[1];
            //src
            if ($credentials['userlevel'] != "superadmin") {
                $arrTmp[] = $value[10];
            }
            //rg_name
            $arrTmp[] = $value[2];
            //dst
            $arrTmp[] = $value[3];
            //channel
            $arrTmp[] = $value[9];
            //accountcode
            $arrTmp[] = $value[4];
            //dst_channel
            if ($value[12] == "1" || $value[13] == "1") {
                //call_type
                $arrTmp[] = $value[12] == "1" ? "outgoing" : "incoming";
            } else {
                $arrTmp[] = "";
            }
            $arrTmp[] = $value[5];
            //disposition
            $iDuracion = $value[8];
            //billsec
            $iSec = $iDuracion % 60;
            $iDuracion = (int) (($iDuracion - $iSec) / 60);
            $iMin = $iDuracion % 60;
            $iDuracion = (int) (($iDuracion - $iMin) / 60);
            $sTiempo = "{$value[8]}s";
            if ($value[8] >= 60) {
                if ($iDuracion > 0) {
                    $sTiempo .= " ({$iDuracion}h {$iMin}m {$iSec}s)";
                } elseif ($iMin > 0) {
                    $sTiempo .= " ({$iMin}m {$iSec}s)";
                }
            }
            $arrTmp[] = $sTiempo;
            $arrData[] = $arrTmp;
        }
    }
    $oGrid->setData($arrData);
    if ($error != "") {
        $smarty->assign("mb_title", _tr("MESSAGE"));
        $smarty->assign("mb_message", $error);
    }
    //begin section filter
    $smarty->assign("USERLEVEL", $credentials['userlevel']);
    $smarty->assign("SEARCH", "<input type='submit' class='button' value='" . _tr('Search') . "' name='report'>");
    if ($delete) {
        $oGrid->deleteList(_tr("Are you sure you want to delete?"), "delete", _tr("Delete Selected"), false);
    }
    if ($credentials['userlevel'] == 'superadmin') {
        $_POST["organization"] = $domain;
        $oGrid->addFilterControl(_tr("Filter applied ") . _tr("Organization") . " = " . $arrOrgz[$domain], $_POST, array("organization" => "all"), true);
    }
    $_POST['date_start'] = $paramFiltro['date_start'];
    $_POST['date_end'] = $paramFiltro['date_end'];
    $oGrid->addFilterControl(_tr("Filter applied ") . _tr("Start Date") . " = " . $paramFiltro['date_start'] . ", " . _tr("End Date") . " = " . $paramFiltro['date_end'], $paramFiltro, array('date_start' => date("d M Y"), 'date_end' => date("d M Y")), true);
    //DATE START - DATE END
    $_POST["src"] = $src;
    // source
    $oGrid->addFilterControl(_tr("Filter applied ") . _tr("Source") . " = " . $src, $_POST, array("src" => ""));
    $_POST["dst"] = $dst;
    // destination
    $oGrid->addFilterControl(_tr("Filter applied ") . _tr("Destination") . " = " . $dst, $_POST, array("dst" => ""));
    $_POST["src_channel"] = $src_channel;
    // source channel
    $oGrid->addFilterControl(_tr("Filter applied ") . _tr("Source Channel") . " = " . $src_channel, $_POST, array("src_channel" => ""));
    $_POST["dst_channel"] = $dst_channel;
    // destination channel
    $oGrid->addFilterControl(_tr("Filter applied ") . _tr("Destination Channel") . " = " . $dst_channel, $_POST, array("dst_channel" => ""));
    $_POST["calltype"] = $calltype;
    // call type
    $oGrid->addFilterControl(_tr("Filter applied ") . _tr("Call Destination") . " = " . $arrCallType[$calltype], $_POST, array("calltype" => "all"), true);
    $_POST["status"] = $status;
    // call status
    $oGrid->addFilterControl(_tr("Filter applied ") . _tr("Call Status") . " = " . $arrStatus[$status], $_POST, array("status" => "all"), true);
    $_POST["accountcode"] = $accountcode;
    // destination channel
    $oGrid->addFilterControl(_tr("Filter applied ") . _tr("Account Code") . " = " . $dst, $_POST, array("accountcode" => ""));
    $arrForm = createFieldFilter($arrOrgz, $arrCallType, $arrStatus);
    $oFilterForm = new paloForm($smarty, $arrForm);
    $htmlFilter = $oFilterForm->fetchForm("{$local_templates_dir}/filter.tpl", "", $_POST);
    $oGrid->showFilter(trim($htmlFilter));
    $content = $oGrid->fetchGrid();
    return $content;
}
开发者ID:netconstructor,项目名称:elastix-mt-gui,代码行数:101,代码来源:index.php

示例6: report_adress_book


//.........这里部分代码省略.........
                    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;
            }
        } else {
            foreach ($arrResult as $key => $adress_book) {
                switch ($adress_book['type']) {
                    case '0':
                        $typeContact = '<img border=0 src="/modules/' . $module_name . '/images/nor-customer.png" title="Khách hàng lẽ"/>KLE';
                        break;
                    case '1':
                        $typeContact = '<img border=0 src="/modules/' . $module_name . '/images/fre-customer.png" title="Khách hàng lẽ thường xuyên"/>KLE-TX';
                        break;
                    case '2':
                        $typeContact = '<img border=0 src="/modules/' . $module_name . '/images/company.png" title="Khách hàng công ty"/>CTY';
                        break;
                    case '3':
                        $typeContact = '<img border=0 src="/modules/' . $module_name . '/images/agency.png" title="Khách hàng đại lý"/>DLY';
                        break;
                    default:
                        break;
                }
                $phone_list = '';
                if (isset($adress_book['number']) && count($adress_book['number']) > 0) {
                    foreach ($adress_book['number'] as $phone) {
                        $phone1 = explode('-', $phone);
                        $call = trim($phone1[0]);
                        $phone_list .= is_null($call) || trim($call) == '' ? '' : "<a href='?menu={$module_name}&action=call2phone&id=" . $call . "'><img border=0 src='/modules/{$module_name}/images/call.png' title='Gọi số " . $call . "'/></a> " . $phone . '<br/>';
                        //SDT column
                    }
                }
                $email_list = '';
                if (count($adress_book['email']) > 0) {
                    foreach ($adress_book['email'] as $email) {
                        $phone1 = explode('-', $email);
                        $addr = trim($phone1[0]);
                        $email_list .= is_null($addr) || trim($addr) == '' ? '' : '<a title="Gửi mail đến hộp mail này" href="mailto:' . $addr . '?Subject=[CallCenter]:" target="_top">' . $email . '</a><br/>';
                    }
                }
                $arrTmp[0] = "<input type='checkbox' name='contact_{$adress_book['id']}'  />";
                $arrTmp[1] = $adress_book['customer_code'];
                //Ten column
                $arrTmp[2] = $adress_book['firstname'];
                //Ten column
                $arrTmp[3] = $adress_book['lastname'];
                //Ten column
                $arrTmp[4] = $phone_list;
                $arrTmp[5] = $email_list;
                $arrTmp[6] = $adress_book['booker'];
                $arrTmp[7] = $adress_book['sale'];
                $arrTmp[8] = $adress_book['accountant'];
                $arrTmp[9] = $typeContact;
                $arrTmp[10] = $adress_book['membership'];
                $arrTmp[11] = $adress_book['payment'];
                $arrTmp[12] = "<a href='?menu={$module_name}&action=show&id=" . $adress_book['id'] . "'><img src='modules/{$module_name}/images/extra.png' title='Xem'></a>&nbsp;\n                <a href='?menu={$module_name}&action=edit&id=" . $adress_book['id'] . "'><img src='modules/{$module_name}/images/edit.png' title='Sửa'></a> ";
                $arrData[] = $arrTmp;
            }
        }
    }
    $oGrid->deleteList("Bạn có muốn xóa khách hàng này không?", "delete", "Xóa");
    $arrGrid = array("title" => "Thông tin khách hàng", "url" => array('menu' => $module_name, 'filter' => $pattern), "icon" => "modules/{$module_name}/images/address_book.png", "width" => "99%", "start" => $inicio, "end" => $end, "total" => $total, "columns" => $arr_cols);
    $oGrid->addNew("new", "Thêm khách hàng");
    $oGrid->showFilter(trim($htmlFilter));
    $contenidoModulo = $oGrid->fetchGrid($arrGrid, $arrData, $arrLang);
    return $contenidoModulo;
}
开发者ID:hardikk,项目名称:HNH,代码行数:101,代码来源:index.php

示例7: reportDIDorganization

function reportDIDorganization($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $credentials)
{
    $pORGZ = new paloSantoOrganization($pDB);
    $pDID = new paloDidPBX($pDB);
    $domain = getParameter('domain');
    if ($credentials['userlevel'] != "superadmin") {
        $domain = $credentials['domain'];
    }
    if (!preg_match("/^(([[:alnum:]-]+)\\.)+([[:alnum:]])+\$/", $domain)) {
        $smarty->assign("mb_title", _tr("ERROR"));
        $smarty->assign("mb_message", _tr("Invalid domain format"));
        return reportOrganization($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $credentials);
    }
    $total = $pDID->getTotalDID($domain);
    if ($total === false) {
        $smarty->assign("mb_title", _tr("ERROR"));
        $smarty->assign("mb_message", _tr("An error has ocurred to retrieve DID data"));
        return reportOrganization($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $credentials);
    }
    $limit = 20;
    $oGrid = new paloSantoGrid($smarty);
    $oGrid->setLimit($limit);
    $oGrid->setTotal($total);
    $offset = $oGrid->calculateOffset();
    $end = $offset + $limit <= $total ? $offset + $limit : $total;
    $url['menu'] = $module_name;
    $url['domain'] = $domain;
    $oGrid->setTitle(_tr('DID Organization List'));
    $oGrid->setURL($url);
    $oGrid->setWidth("99%");
    $oGrid->setStart($total == 0 ? 0 : $offset + 1);
    $oGrid->setEnd($end);
    $oGrid->setTotal($total);
    if ($credentials['userlevel'] == "superadmin") {
        $arrColumns[] = '';
        $arrColumns[] = _tr("Organization Domain");
    }
    $arrColumns[] = _tr("DID");
    $arrColumns[] = _tr("Type");
    $arrColumns[] = _tr("Country");
    $arrColumns[] = _tr("City");
    $arrColumns[] = _tr("Country Code / Area Code");
    $oGrid->setColumns($arrColumns);
    $arrData = array();
    $arrDID = $pDID->getDIDs($domain, null, null, null, $limit, $offset);
    if ($arrDID === false) {
        $smarty->assign("mb_title", _tr("ERROR"));
        $smarty->assign("mb_message", _tr("An error has ocurred to retrieve DID data"));
        return reportOrganization($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $credentials);
    } else {
        //si es un usuario solo se ve su didsion
        //si es un administrador ve todas las didsiones
        foreach ($arrDID as $did) {
            $arrTmp = array();
            if ($credentials["userlevel"] == "superadmin") {
                $arrTmp[] = "<input type='checkbox' name='dids[]' value='{$did['id']}' />";
                $arrTmp[] = $did["organization_domain"];
            }
            $arrTmp[] = $did['did'];
            $arrTmp[] = $did["type"];
            $arrTmp[] = $did["country"];
            $arrTmp[] = $did["city"];
            $arrTmp[] = $did["country_code"] . " / " . $did["area_code"];
            $arrData[] = $arrTmp;
        }
    }
    if ($credentials['userlevel'] == "superadmin") {
        $oGrid->addNew("assignDIDs", _tr("Add DID"));
        $oGrid->deleteList(_tr('Are you sure you wish REMOVE this DID from organization'), 'removeDID', "Remove DID");
    }
    $content = $oGrid->fetchGrid(array(), $arrData);
    return $content;
}
开发者ID:lordbasex,项目名称:elastix-gui,代码行数:73,代码来源:index.php

示例8: report_backup_restore

function report_backup_restore($smarty, $module_name, $local_templates_dir, $dir_backup, &$pDB)
{
    $total_archivos = array_reverse(array_map('basename', glob("{$dir_backup}/*.tar")));
    // Paginacion
    $limit = 10;
    $total = count($total_archivos);
    $oGrid = new paloSantoGrid($smarty);
    $oGrid->setLimit($limit);
    $oGrid->setTotal($total);
    $offset = $oGrid->calculateOffset();
    $end = $oGrid->getEnd();
    $nombre_archivos = array_slice($total_archivos, $offset, $limit);
    //Fin Paginacion
    // obtencion de parametros desde la base
    $pFTPBackup = new paloSantoFTPBackup($pDB);
    $_DATA = $pFTPBackup->getStatusAutomaticBackupById(1);
    if (!(is_array($_DATA) & count($_DATA) > 0)) {
        $_DATA['status'] = "DISABLED";
    }
    $arrData = null;
    if (is_array($nombre_archivos) && $total > 0) {
        foreach ($nombre_archivos as $key => $nombre_archivo) {
            $arrTmp[0] = "<input type='checkbox' name='chk[" . $nombre_archivo . "]' id='chk[" . $nombre_archivo . "]'/>";
            $arrTmp[1] = "<a href='?menu={$module_name}&action=download_file&file_name={$nombre_archivo}&rawmode=yes'>{$nombre_archivo}</a>";
            $fecha = "";
            // se parsea el archivo para obtener la fecha
            if (preg_match("/\\w*-\\d{4}\\d{2}\\d{2}\\d{2}\\d{2}\\d{2}-\\w{2}\\.\\w*/", $nombre_archivo)) {
                //elastixbackup-20110720122759-p7.tar
                $arrMatchFile = preg_split("/-/", $nombre_archivo);
                $data = $arrMatchFile[1];
                $fecha = substr($data, -8, 2) . "/" . substr($data, -10, 2) . "/" . substr($data, 0, 4) . " " . substr($data, -6, 2) . ":" . substr($data, -4, 2) . ":" . substr($data, -2, 2);
                $id = $arrMatchFile[1] . "-" . $arrMatchFile[2];
            }
            $arrTmp[2] = $fecha;
            $arrTmp[3] = "<input type='submit' name='submit_restore[" . $nombre_archivo . "]' value='" . _tr('Restore') . "' class='button' />";
            $arrData[] = $arrTmp;
        }
    }
    $arrGrid = array("title" => _tr('Backup List'), "url" => array('menu' => $module_name), "icon" => "/modules/{$module_name}/images/system_backup_restore.png", "width" => "99%", "start" => $total == 0 ? 0 : $offset + 1, "end" => $end, "total" => $total, "columns" => array(0 => array("name" => ""), 1 => array("name" => _tr('Name Backup')), 2 => array("name" => _tr('Date')), 3 => array("name" => _tr('Action'))));
    $time = $_DATA['status'];
    $smarty->assign("FILE_UPLOAD", _tr('File Upload'));
    $smarty->assign("AUTOMATIC", _tr('AUTOMATIC'));
    $smarty->assign("UPLOAD", _tr('Upload'));
    $smarty->assign("FTP_BACKUP", _tr('FTP Backup'));
    $oGrid->addNew("backup", _tr("Backup"));
    $oGrid->deleteList(_tr("Are you sure you wish to delete backup (s)?"), 'delete_backup', _tr("Delete"));
    $oGrid->customAction("view_form_FTP", _tr("FTP Backup"));
    $backupIntervals = array('DISABLED' => _tr('DISABLED'), 'DAILY' => _tr('DAILY'), 'MONTHLY' => _tr('MONTHLY'), 'WEEKLY' => _tr('WEEKLY'));
    $oGrid->addComboAction("time", _tr("AUTOMATIC"), $backupIntervals, $time, 'automatic');
    $contenidoModulo = $oGrid->fetchGrid($arrGrid, $arrData);
    return $contenidoModulo;
}
开发者ID:netconstructor,项目名称:elastix-mt-gui,代码行数:52,代码来源:index.php

示例9: reportRecording

function reportRecording($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf, $credentials)
{
    global $arrPermission;
    $error = "";
    $pORGZ = new paloSantoOrganization($pDB);
    $name = getParameter("name");
    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'];
    }
    $url['menu'] = $module_name;
    $url['organization'] = $domain;
    $url['name'] = $name;
    $pRecording = new paloSantoRecordings($pDB);
    $total = $pRecording->getNumRecording($domain, $name);
    if ($total === false) {
        $error = $pRecording->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;
    //permission
    $create = in_array("create", $arrPermission);
    $edit = in_array("edit", $arrPermission);
    $delete = in_array("delete", $arrPermission);
    if ($delete) {
        $check = "&nbsp;<input type='checkbox' name='checkall' class='checkall' id='checkall' onclick='jqCheckAll(this.id);' />";
    } else {
        $check = "";
    }
    $oGrid->setTitle(_tr('Recordings 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);
    $arrColumns[] = $check;
    if ($credentials['userlevel'] == 'superadmin') {
        $arrColumns[] = _tr("Organization");
    }
    $arrColumns[] = _tr("Name");
    //$arrColumns[]=_tr("Source");
    $arrColumns[] = _tr("");
    $oGrid->setColumns($arrColumns);
    $arrRecordings = array();
    $arrData = array();
    if ($total != 0) {
        $arrRecordings = $pRecording->getRecordings($domain, $name, $limit, $offset);
    }
    if ($arrRecordings === false) {
        $error = _tr("Error to obtain Recordings") . $pRecording->errMsg;
        $arrRecordings = array();
    }
    $i = 0;
    foreach ($arrRecordings as $recording) {
        $arrTmp = array();
        $ext = explode(".", $recording["name"]);
        if ($delete) {
            $arrTmp[] = "&nbsp;<input type ='checkbox' class='delete' name='record_delete[]' value='" . $recording['uniqueid'] . "' />";
        }
        if ($credentials['userlevel'] == 'superadmin') {
            $arrTmp[] = $recording["organization_domain"] == '' ? '' : $arrOrgz[$recording["organization_domain"]];
        }
        //$arrTmp[] = $recording["source"];
        $idfile = $recording['uniqueid'];
        if ($ext[1] == "gsm") {
            $div_display = '';
        } else {
            $div_display = "<div class='single' id='{$i}' style='display:inline;'><span data-src='index.php?menu={$module_name}&action=download&id={$idfile}&rawmode=yes'><img style='cursor:pointer;' width='13px' src='web/apps/recordings/images/sound.png'/>&nbsp;&nbsp;</span></div>";
        }
        $download = "<a href='index.php?menu={$module_name}&action=download&id={$idfile}&rawmode=yes'>" . $recording['name'] . "</a>";
        $arrTmp[] = $div_display . $download;
        $arrTmp[] = "<audio></audio>";
        $i++;
        $arrData[] = $arrTmp;
    }
    $smarty->assign("USERLEVEL", $credentials['userlevel']);
    $smarty->assign("SEARCH", "<input type='submit' class='button' value='" . _tr('Search') . "' name='report'>");
    if ($create) {
        $oGrid->addNew("add_recording", _tr("Add Recording"));
    }
    if ($delete) {
        $oGrid->deleteList(_tr("Are you sure you want to delete?"), "remove", _tr("Delete Selected"), false);
    }
    if ($error != "") {
        $smarty->assign("mb_title", _tr("MESSAGE"));
        $smarty->assign("mb_message", $error);
    }
//.........这里部分代码省略.........
开发者ID:netconstructor,项目名称:elastix-mt-gui,代码行数:101,代码来源:index.php

示例10: listarFaxes


//.........这里部分代码省略.........
    }
    $oGrid = new paloSantoGrid($smarty);
    $arrType = array("All" => _tr('All'), "In" => _tr('in'), "Out" => _tr('out'));
    if ($credentials['userlevel'] == 'superadmin') {
        $_POST["organization"] = $organization;
        $oGrid->addFilterControl(_tr("Filter applied ") . _tr("Organization") . " = " . $arrOrgz[$organization], $_POST, array("organization" => 0), true);
        //organization
    }
    $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;
    }
    $url = array_merge($url, $paramFiltro);
    $oGrid->setTitle(_tr("Fax Viewer"));
    $oGrid->setIcon("web/apps/{$module_name}/images/kfaxview.png");
    $oGrid->pagingShow(true);
    // show paging section.
    $oGrid->setURL($url);
    $arrData = NULL;
    if ($organization == 0) {
        $total = $oFax->obtener_cantidad_faxes(null, $paramFiltro['name_company'], $paramFiltro['fax_company'], $paramFiltro['date_fax'], $paramFiltro['filter']);
    } else {
        $total = $oFax->obtener_cantidad_faxes($organization, $paramFiltro['name_company'], $paramFiltro['fax_company'], $paramFiltro['date_fax'], $paramFiltro['filter']);
    }
    if ($total === false) {
        $total = 0;
        $smarty->assign(array('mb_title' => _tr('ERROR'), 'mb_message' => $oFax->errMsg));
    }
    $delete = in_array('delete_fax', $arrPermission);
    $edit = in_array('edit_fax', $arrPermission);
    $limit = 20;
    $oGrid->setLimit($limit);
    $oGrid->setTotal($total);
    $offset = $oGrid->calculateOffset();
    if ($delete) {
        $columns[] = "<input type='checkbox' class='checkall'/>";
    }
    if ($credentials['userlevel'] == 'superadmin') {
        $columns[] = _tr('Organization');
    }
    $columns[] = _tr('Type');
    $columns[] = _tr('File');
    $columns[] = _tr('Fax Cid Name');
    $columns[] = _tr('Fax Cid Number');
    $columns[] = _tr('Fax Destiny');
    $columns[] = _tr('Fax Date');
    $columns[] = _tr('Status');
    if ($edit) {
        $columns[] = _tr('Options');
    }
    $oGrid->setColumns($columns);
    if ($total > 0) {
        if ($organization == 0) {
            $arrResult = $oFax->obtener_faxes(null, $paramFiltro['name_company'], $paramFiltro['fax_company'], $paramFiltro['date_fax'], $offset, $limit, $paramFiltro['filter']);
        } else {
            $arrResult = $oFax->obtener_faxes($organization, $paramFiltro['name_company'], $paramFiltro['fax_company'], $paramFiltro['date_fax'], $offset, $limit, $paramFiltro['filter']);
        }
        if (!is_array($arrResult)) {
            $smarty->assign(array('mb_title' => _tr('ERROR'), 'mb_message' => $oFax->errMsg));
        } else {
            foreach ($arrResult as $fax) {
                foreach (array('pdf_file', 'company_name', 'company_fax', 'destiny_name', 'destiny_fax') as $k) {
                    $fax[$k] = htmlentities($fax[$k], ENT_COMPAT, 'UTF-8');
                }
                $doc = explode(".", $fax['pdf_file']);
                $iddoc = $doc[0];
                $arrTmp = array();
                if ($delete) {
                    $arrTmp[] = '<input type="checkbox" name="faxes[]" value="' . $fax['id'] . '" />';
                }
                if ($credentials['userlevel'] == 'superadmin') {
                    $arrTmp[] = 'ttt';
                }
                //$arrOrg[$fax['id_organization']];
                $arrTmp[] = _tr($fax['type']);
                $arrTmp[] = 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'];
                $arrTmp[] = $fax['company_name'];
                $arrTmp[] = $fax['company_fax'];
                $arrTmp[] = $fax['destiny_name'] . " - " . $fax['destiny_fax'];
                $arrTmp[] = $fax['date'];
                $arrTmp[] = _tr($fax['status']) . (empty($fax['errormsg']) ? '' : ': ' . $fax['errormsg']);
                if ($edit) {
                    $arrTmp[] = "<a href='?menu={$module_name}&action=edit&id=" . $fax['id'] . "'>" . _tr('Edit') . "</a>";
                }
                $arrData[] = $arrTmp;
            }
        }
    }
    $oGrid->setData($arrData);
    if ($delete) {
        $oGrid->deleteList(_tr('Are you sure you wish to delete fax (es)?'), "faxes_delete", _tr("Delete"));
    }
    $oGrid->showFilter($htmlFilter);
    return $oGrid->fetchGrid();
}
开发者ID:netconstructor,项目名称:elastix-mt-gui,代码行数:101,代码来源:index.php

示例11: 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 paloPhoneBook($pDB);
    $arrComboElements = array("firstname" => "Tên", "lastname" => "Họ", "extension" => "Số nội bộ", "mobile" => "Số điện thoại", "company_mobile" => "Số công ty");
    $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", "INPUT_EXTRA_PARAM" => "", "VALIDATION_TYPE" => "text", "VALIDATION_EXTRA_PARAM" => "", "INPUT_EXTRA_PARAM" => array('id' => 'filter_value')));
    $oFilterForm = new paloForm($smarty, $arrFormElements);
    $smarty->assign("SHOW", "Tìm");
    $smarty->assign("NEW_adress_book", "Thêm khách hàng mới");
    $smarty->assign("CSV", $arrLang["CSV"]);
    $smarty->assign("module_name", $module_name);
    $field = NULL;
    $pattern = NULL;
    $namePattern = NULL;
    $allowSelection = array("firstname", "lastname", "extension", "mobile", "company_mobile");
    if (isset($_POST['field']) and isset($_POST['pattern']) and $_POST['pattern'] != "") {
        $field = $_POST['field'];
        if (!in_array($field, $allowSelection)) {
            $field = "firstname";
        }
        $pattern = "%{$_POST['pattern']}%";
        $namePattern = $_POST['pattern'];
        $nameField = $arrComboElements[$field];
    }
    $arrFilter = array("field" => $field, "pattern" => $namePattern);
    $startDate = $endDate = date("Y-m-d H:i:s");
    $oGrid = new paloSantoGrid($smarty);
    $oGrid->addFilterControl(_tr("Filter applied ") . $field . " = {$namePattern}", $arrFilter, array("field" => "name", "pattern" => ""));
    $htmlFilter = $oFilterForm->fetchForm("{$local_templates_dir}/filter.tpl", "", $arrFilter);
    $total = $padress_book->getAddressBook(NULL, NULL, $field, $pattern, TRUE);
    $total_datos = $total[0]["total"];
    //Paginacion
    $limit = 20;
    $total = $total_datos;
    $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) {
        foreach ($arrResult as $key => $adress_book) {
            $arrTmp[0] = "<input type='checkbox' name='contact_{$adress_book['id']}'  />";
            $arrTmp[1] = $adress_book['firstname'];
            //Ten column
            $arrTmp[2] = $adress_book['lastname'];
            //Ten column
            $arrTmp[3] = $adress_book['department'];
            //Ten column
            $arrTmp[4] = is_null($adress_book['company_mobile']) || $adress_book['company_mobile'] == '' ? '' : "<a href='?menu={$module_name}&action=call2phone&id=" . $adress_book['company_mobile'] . "'><img border=0 src='/modules/{$module_name}/images/call.png' title='Gọi số " . $adress_book['company_mobile'] . "'/></a>" . $adress_book['company_mobile'];
            $arrTmp[5] = is_null($adress_book['mobile']) || $adress_book['mobile'] == '' ? '' : "<a href='?menu={$module_name}&action=call2phone&id=" . $adress_book['mobile'] . "'><img border=0 src='/modules/{$module_name}/images/call.png' title='Gọi số " . $adress_book['mobile'] . "'/></a>" . $adress_book['mobile'];
            $arrTmp[6] = is_null($adress_book['extension']) || $adress_book['extension'] == '' ? '' : "<a href='?menu={$module_name}&action=call2phone&id=" . $adress_book['extension'] . "'><img border=0 src='/modules/{$module_name}/images/call.png' title='Gọi số " . $adress_book['extension'] . "'/></a>" . $adress_book['extension'];
            $arrTmp[7] = '<a title="Gửi mail đến hộp mail này" href="mailto:' . $adress_book['email'] . '?Subject=[CallCenter]:" target="_top">' . $adress_book['email'] . '</a>';
            $arrTmp[8] = $adress_book['note'];
            $arrTmp[9] = "<a href='?menu={$module_name}&action=edit&id=" . $adress_book['id'] . "'>Edit</a>";
            $arrData[] = $arrTmp;
        }
    }
    $oGrid->deleteList("Bạn có muốn xóa người này không?", "delete", "Xóa");
    $arrGrid = array("title" => "Danh bạ điện thoại", "url" => array('menu' => $module_name, 'filter' => $pattern), "icon" => "modules/{$module_name}/images/address_book.png", "width" => "99%", "start" => $inicio, "end" => $end, "total" => $total, "columns" => array(0 => array("name" => '', "property1" => ""), 1 => array("name" => "Tên", "property1" => ""), 2 => array("name" => "Họ", "property1" => ""), 3 => array("name" => "Phòng - Công ty", "property1" => ""), 4 => array("name" => "Số di động công ty", "property1" => ""), 5 => array("name" => "Số di động", "property1" => ""), 6 => array("name" => "Số nội bộ", "property1" => ""), 7 => array("name" => "Email", "property1" => ""), 8 => array("name" => "Ghi chú", "property1" => ""), 9 => array("name" => "Sửa", "property1" => "")));
    $oGrid->addNew("new", "Thêm danh bạ");
    $oGrid->showFilter(trim($htmlFilter));
    $contenidoModulo = $oGrid->fetchGrid($arrGrid, $arrData, $arrLang);
    return $contenidoModulo;
}
开发者ID:hardikk,项目名称:HNH,代码行数:68,代码来源:index.php

示例12: reportConference


//.........这里部分代码省略.........
    $session = getSession();
    if ($arrconference === false) {
        $error = _tr("Error getting conference data.") . $pconference->errMsg;
    } else {
        foreach ($arrconference as $conf) {
            $arrTmp = array();
            if ($delete) {
                $arrTmp[] = "<input type='checkbox' name='confdel[]' value='{$conf['bookid']}'/>";
                //delete
            }
            if ($edit) {
                $arrTmp[] = "<a href='?menu={$module_name}&action=view&id_conf={$conf['bookid']}&organization={$conf['organization_domain']}'>" . htmlentities($conf["name"], ENT_QUOTES, "UTF-8") . "</a>";
                //name
            } else {
                $arrTmp[] = htmlentities($conf["name"], ENT_QUOTES, "UTF-8");
            }
            $arrTmp[] = $conf["ext_conf"];
            //roomnumber
            $perid = "No Set";
            if (!empty($conf["startTime"]) && $conf["startTime"] != "1900-01-01 12:00:00") {
                $perid = $conf["startTime"] . " - " . $conf["endtime"];
            }
            $arrTmp[] = $perid;
            //period
            $max = empty($conf["maxusers"]) ? "unlimited" : $conf["maxusers"];
            $participants = "<spam class='conf_memb' id='{$conf['bookid']}'>" . $conf["members"] . " / {$max} </spam>";
            $status = "<spam class='conf_status'></spam>";
            if ($perid != "No Set") {
                $date = time();
                if ($date >= strtotime($conf["startTime"]) && $date <= strtotime($conf["endtime"])) {
                    if ($invite_part) {
                        $participants = "<a href='?menu={$module_name}&action=current_conf&id_conf={$conf['bookid']}&organization={$conf['organization_domain']}' class='conf_memb' id='{$conf['bookid']}'>" . $conf["members"] . " / {$max}</a>";
                    }
                    $status = "<spam class='conf_status' style='color:green'/>" . _tr("In Progress") . "</spam>";
                } else {
                    if ($date < strtotime($conf["startTime"])) {
                        $status = "<spam class='conf_status'>" . _tr("Future") . "</spam>";
                    } else {
                        $status = "<spam class='conf_status'>" . _tr("Past") . "</spam>";
                    }
                }
            } else {
                if ($invite_part) {
                    $participants = "<a href='?menu={$module_name}&action=current_conf&id_conf={$conf['bookid']}&organization={$conf['organization_domain']}' class='conf_memb' id='{$conf['bookid']}'>" . $conf["members"] . " / {$max}</a>";
                }
            }
            $arrTmp[] = $participants;
            $arrTmp[] = $status;
            $arrData[] = $arrTmp;
            //se usa para comprobar si ha habido cambios en el estado de las conferencias
            $session['conference']["conf_list"][$conf['bookid']] = array($participants, $status);
        }
    }
    //se escribe en session el estado actual de las conferencias
    putSession($session);
    //filters
    $smarty->assign("USERLEVEL", $credentials['userlevel']);
    $smarty->assign("SEARCH", "<input type='submit' class='button' value='" . _tr('Search') . "' name='report'>");
    if ($pORGZ->getNumOrganization(array()) >= 1) {
        if ($create) {
            if ($credentials['userlevel'] == 'superadmin') {
                $oGrid->addComboAction("organization_add", _tr("ADD Conference"), array_slice($arrOrgz, 1), $selected = null, "create_conference", $onchange_select = null);
            } else {
                $oGrid->addNew("create_conference", _tr("ADD Conference"));
            }
        }
        if ($delete) {
            $oGrid->deleteList(_tr("Are you sure you wish to delete conference (es)?"), "delete_conference", _tr("Delete"));
        }
        if ($credentials['userlevel'] == 'superadmin') {
            $_POST["organization"] = $domain;
            $oGrid->addFilterControl(_tr("Filter applied ") . _tr("Organization") . " = " . $arrOrgz[$domain], $_POST, array("organization" => "all"), true);
        }
        //arreglo usado para formar los elementos del filtro
        $arrState = array("all" => _tr("All"), "past" => _tr("Past Conference"), "current" => _tr("Current  Conference"), "future" => _tr("Future Conference"));
        $arrType = array("both" => _tr("Both"), "yes" => _tr("Schedule"), "no" => _tr("No Schedule"));
        $oGrid->addFilterControl(_tr("Filter applied: ") . _tr("State") . " = " . $arrState[$state_conf], $state_conf, array("state_conf" => "all"), true);
        $oGrid->addFilterControl(_tr("Filter applied: ") . _tr("Name") . " = " . $name_conf, $name_conf, array("name_conf" => ""));
        $oGrid->addFilterControl(_tr("Filter applied: ") . _tr("Type") . " = " . $arrType[$type_conf], $type_conf, array("type_conf" => "both"), true);
        $smarty->assign("SHOW", _tr("Show"));
        $arrFormElements = createFieldFilter($arrState, $arrType, $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);
    $contenidoModulo .= "<input type='hidden' name='grid_limit' id='grid_limit' value='{$limit}'>";
    $contenidoModulo .= "<input type='hidden' name='grid_offset' id='grid_offset' value='{$offset}'>";
    $contenidoModulo .= "<input type='hidden' name='conf_action' id='conf_action' value='report'>";
    $mensaje = showMessageReload($module_name, $pDB, $credentials);
    $contenidoModulo = $mensaje . $contenidoModulo;
    return $contenidoModulo;
}
开发者ID:netconstructor,项目名称:elastix-mt-gui,代码行数:101,代码来源:index.php

示例13: reportMonitoring


//.........这里部分代码省略.........
                    } else {
                        $arrTmp[] = "";
                    }
                }
                $arrTmp[] = $namefile;
                $arrData[] = $arrTmp;
            }
        } else {
            $i = 0;
            foreach ($arrResult as $monitoring) {
                $arrTmp = array();
                if ($delete) {
                    $arrTmp[] = "<input type='checkbox' name='recordDel[]' value='{$monitoring['uniqueid']}' />";
                }
                if ($credentials['userlevel'] == 'superadmin') {
                    $arrTmp[] = isset($arrOrgz[$monitoring['organization_domain']]) ? $arrOrgz[$monitoring['organization_domain']] : '';
                }
                $arrTmp[] = date('d M Y', strtotime($monitoring['calldate']));
                //date
                $arrTmp[] = date('H:i:s', strtotime($monitoring['calldate']));
                //time
                $arrTmp[] = $monitoring['src'];
                //source
                $arrTmp[] = $monitoring['dst'];
                //destination
                $arrTmp[] = SecToHHMMSS($monitoring['duration']);
                //duration
                $namefile = basename($monitoring['userfield']);
                $namefile = str_replace("audio:", "", $namefile);
                if ($monitoring['toout'] == '1') {
                    $arrTmp[] = $arrType['outgoing'];
                } elseif ($monitoring['fromout'] == '1') {
                    $arrTmp[] = $arrType['incoming'];
                } else {
                    if ($namefile[0] == 'g') {
                        $arrTmp[] = $arrType['group'];
                    } elseif ($namefile[0] == 'q') {
                        $arrTmp[] = $arrType['queue'];
                    } elseif (strpos($namefile, "meetme-conf") !== false) {
                        $arrTmp[] = $arrType['conference'];
                    } else {
                        $arrTmp[] = "";
                    }
                }
                if ($namefile == 'deleted') {
                    $arrTmp[] = $namefile;
                    $arrTmp[] = "";
                } else {
                    $explod_name = explode(".", $namefile);
                    $ext = array_pop($explod_name);
                    if ($ext == 'gsm' || $ext == 'WAV') {
                        $div_display = "<a href=\"javascript:popUp('index.php?menu={$module_name}&action=display_record&id={$monitoring['uniqueid']}&rawmode=yes',350,100)\"><img style='cursor:pointer;' width='13px' src='web/apps/recordings/images/sound.png'/></a>  ";
                    } else {
                        $div_display = "<div class='single' id='{$i}' style='display:inline;'><span data-src='index.php?menu={$module_name}&action=download&id={$monitoring['uniqueid']}&rawmode=yes'><img style='cursor:pointer;' width='13px' src='web/apps/recordings/images/sound.png'/>&nbsp;&nbsp;</span></div>";
                    }
                    $download = "<a href='index.php?menu={$module_name}&action=download&id={$monitoring['uniqueid']}&rawmode=yes'>" . $namefile . "</a>";
                    $arrTmp[] = $div_display . $download;
                    $arrTmp[] = "<audio></audio>";
                }
                $i++;
                $arrData[] = $arrTmp;
            }
        }
    }
    $oGrid->setData($arrData);
    if ($error != "") {
        $smarty->assign("mb_title", _tr("MESSAGE"));
        $smarty->assign("mb_message", $error);
    }
    //begin section filter
    $smarty->assign("USERLEVEL", $credentials['userlevel']);
    $smarty->assign("SEARCH", "<input type='submit' class='button' value='" . _tr('Search') . "' name='report'>");
    if ($delete) {
        $oGrid->deleteList(_tr("Are you sure you want to delete?"), "delete", _tr("Delete Selected"), false);
    }
    if ($credentials['userlevel'] == 'superadmin') {
        $_POST["organization"] = $domain;
        $oGrid->addFilterControl(_tr("Filter applied ") . _tr("Organization") . " = " . $arrOrgz[$domain], $_POST, array("organization" => _tr("all")), true);
    }
    $_POST['date_start'] = $arrProp['date_start'];
    $_POST['date_end'] = $arrProp['date_end'];
    $oGrid->addFilterControl(_tr("Filter applied ") . _tr("Start Date") . " = " . $arrProp['date_start'] . ", " . _tr("End Date") . " = " . $arrProp['date_end'], $arrProp, array('date_start' => date("d M Y"), 'date_end' => date("d M Y")), true);
    //DATE START - DATE END
    $_POST["type"] = $type;
    // type
    $oGrid->addFilterControl(_tr("Filter applied ") . _tr("Type") . " = " . $arrType[$type], $_POST, array("type" => ""));
    $_POST["source"] = $source;
    // source
    $oGrid->addFilterControl(_tr("Filter applied ") . _tr("Source") . " = " . $source, $_POST, array("source" => ""));
    $_POST["destination"] = $destination;
    // destination
    $oGrid->addFilterControl(_tr("Filter applied ") . _tr("Destination") . " = " . $source, $_POST, array("destination" => ""));
    $arrForm = createFieldFilter($arrOrgz, $arrType);
    $oFilterForm = new paloForm($smarty, $arrForm);
    $htmlFilter = $oFilterForm->fetchForm("{$local_templates_dir}/filter.tpl", "", $_POST);
    $oGrid->showFilter(trim($htmlFilter));
    //end section filter
    $content = $oGrid->fetchGrid();
    return $content;
}
开发者ID:netconstructor,项目名称:elastix-mt-gui,代码行数:101,代码来源:index.php

示例14: _moduleContent


//.........这里部分代码省略.........
        if (is_null($ext) || $ext == "") {
            $smarty->assign("mb_message", "<b>" . $arrLang["no_extension_assigned"] . "</b>");
        }
        $path = "/var/spool/asterisk/voicemail/default";
        $folder = "INBOX";
        if ($esAdministrador) {
            if ($handle = opendir($path)) {
                while (false !== ($dir = readdir($handle))) {
                    if ($dir != "." && $dir != ".." && ereg($extension, $dir, $regs) && is_dir($path . "/" . $dir)) {
                        $directorios[] = $dir;
                    }
                }
            }
        } else {
            $directorios[] = $extension;
        }
        //if($esAdministrador)
        $arrData = array();
        foreach ($directorios as $directorio) {
            $voicemailPath = "{$path}/{$directorio}/{$folder}";
            if (file_exists($voicemailPath)) {
                if ($handle = opendir($voicemailPath)) {
                    $bExito = true;
                    while (false !== ($file = readdir($handle))) {
                        //no tomar en cuenta . y ..
                        //buscar los archivos de texto (txt) que son los que contienen los datos de las llamadas
                        if ($file != "." && $file != ".." && ereg("(.+)\\.[txt|TXT]", $file, $regs)) {
                            //leer la info del archivo
                            $pConfig = new paloConfig($voicemailPath, $file, "=", "[[:space:]]*=[[:space:]]*");
                            $arrVoiceMailDes = array();
                            $arrVoiceMailDes = $pConfig->leer_configuracion(false);
                            //verifico que tenga datos
                            if (is_array($arrVoiceMailDes) && count($arrVoiceMailDes) > 0 && isset($arrVoiceMailDes['origtime']['valor'])) {
                                //uso las fechas del filtro
                                //si la fecha de llamada esta dentro del rango, la muestro
                                $fecha = date("Y-m-d", $arrVoiceMailDes['origtime']['valor']);
                                $hora = date("H:i:s", $arrVoiceMailDes['origtime']['valor']);
                                if (strtotime("{$fecha} {$hora}") <= strtotime($date_end) && strtotime("{$fecha} {$hora}") >= strtotime($date_start)) {
                                    $arrTmp[0] = "<input type='checkbox' name='" . utf8_encode("voc-" . $file) . ",{$directorio}' />";
                                    $arrTmp[1] = $fecha;
                                    $arrTmp[2] = $hora;
                                    $arrTmp[3] = $arrVoiceMailDes['callerid']['valor'];
                                    $arrTmp[4] = $arrVoiceMailDes['origmailbox']['valor'];
                                    $arrTmp[5] = $arrVoiceMailDes['duration']['valor'] . ' sec.';
                                    $pathRecordFile = base64_encode($regs[1] . '.wav');
                                    $recordingLink = "<a href='#' onClick=\"javascript:popUp('index.php?menu={$module_name}&action=display_record&ext={$directorio}&name={$pathRecordFile}&rawmode=yes',350,100); return false;\">{$arrLang['Listen']}</a>&nbsp;";
                                    $recordingLink .= "<a href='?menu={$module_name}&action=download&ext={$directorio}&name={$pathRecordFile}&rawmode=yes'>{$arrLang['Download']}</a>";
                                    $arrTmp[6] = $recordingLink;
                                    $arrData[] = $arrTmp;
                                }
                            }
                        }
                    }
                    closedir($handle);
                }
            } else {
                // No vale la ruta
            }
        }
        /*
        function sort_voicemails_hora_desc($a, $b) { return ($a[2] == $b[2]) ? 0 : (($a[2] < $b[2]) ? 1 : -1); }
        function sort_voicemails_fecha_desc($a, $b) { return ($a[1] == $b[1]) ? 0 : (($a[1] < $b[1]) ? 1 : -1); }
        usort($arrData, 'sort_voicemails_hora_desc');
        usort($arrData, 'sort_voicemails_fecha_desc');
        */
        $fechas = array();
        $horas = array();
        foreach ($arrData as $llave => $fila) {
            $fechas[$llave] = $fila[1];
            $horas[$llave] = $fila[2];
        }
        array_multisort($fechas, SORT_DESC, $horas, SORT_DESC, $arrData);
        //Paginacion
        $limit = 15;
        $total = count($arrData);
        $oGrid->setLimit($limit);
        $oGrid->setTotal($total);
        $offset = $oGrid->calculateOffset();
        $end = $offset + $limit <= $total ? $offset + $limit : $total;
        // Construyo el URL base
        if (isset($arrFilterExtraVars) && is_array($arrFilterExtraVars) and count($arrFilterExtraVars) > 0) {
            $url = array_merge($url, $arrFilterExtraVars);
        }
        //Fin Paginacion
        $arrVoiceData = array_slice($arrData, $offset, $limit);
    } else {
        $smarty->assign("mb_message", "<b>" . $arrLang["contact_admin"] . "</b>");
    }
    $arrGrid = array("title" => $arrLang["Voicemail List"], "url" => $url, "icon" => "/modules/{$module_name}/images/pbx_voicemail.png", "width" => "99%", "start" => $total == 0 ? 0 : $offset + 1, "end" => $end, "total" => $total, "columns" => array(0 => array("name" => "", "property1" => ""), 1 => array("name" => $arrLang["Date"], "property1" => ""), 2 => array("name" => $arrLang["Time"], "property1" => ""), 3 => array("name" => $arrLang["CallerID"], "property1" => ""), 4 => array("name" => $arrLang["Extension"], "property1" => ""), 5 => array("name" => $arrLang["Duration"], "property1" => ""), 6 => array("name" => $arrLang["Message"], "property1" => "")));
    if ($bandCustom == true) {
        $oGrid->customAction("config", _tr("Configuration"));
    }
    $oGrid->deleteList(_tr("Are you sure you wish to delete voicemails?"), "submit_eliminar", _tr("Delete"));
    $oGrid->showFilter($htmlFilter);
    $contenidoModulo = $oGrid->fetchGrid($arrGrid, $arrVoiceData, $arrLang);
    if (strpos($contenidoModulo, '<form') === FALSE) {
        $contenidoModulo = "<form style='margin-bottom:0;' method='POST' action='?menu={$module_name}'>{$contenidoModulo}</form>";
    }
    return $contenidoModulo;
}
开发者ID:hardikk,项目名称:HNH,代码行数:101,代码来源:index.php

示例15: 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();
}
开发者ID:hardikk,项目名称:HNH,代码行数:16,代码来源:index.php


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