function popup_add_proxy_list()
{
    $sock = new sockets();
    $datas = unserialize(base64_decode($sock->GET_INFO("ProxyPacDatas")));
    if (!is_array($datas["PROXYS"])) {
        $data['page'] = $page;
        $data['total'] = $total;
        $data['rows'] = array();
        echo json_encode($data);
        return;
    }
    $tpl = new templates();
    $final_proxy = $tpl->_ENGINE_parse_body("{final_proxy}");
    $deleteTxt = $tpl->_ENGINE_parse_body("{delete}");
    $data = array();
    $data['page'] = 1;
    $data['total'] = count($datas["PROXYS"]) + count($datas["FINAL_PROXY"]);
    $data['rows'] = array();
    while (list($num, $uri) = each($datas["PROXYS"])) {
        $id = md5($num);
        $conditions = null;
        $delete = imgtootltip("delete-24.png", "{$deleteTxt} {$uri}", "squid_proxy_pacc_del_proxy('{$num}')");
        $JSGROUP = "AddProxycondition({$num})";
        $conditions = popup_add_proxy_list_conditions($num, $datas["CONDITIONS"][$num]);
        $data['rows'][] = array('id' => "Proxy{$num}", 'cell' => array("<a href=\"javascript:blur();\" OnClick=\"{$JSGROUP}\"  style='font-size:16px;font-weight:bold;color:black;text-decoration:underline'>{$uri}</a></span>", $conditions, $delete));
    }
    if (count($datas["FINAL_PROXY"]) > 0) {
        while (list($num, $uri) = each($datas["FINAL_PROXY"])) {
            $delete = imgtootltip("delete-24.png", "{$deleteTxt} {$uri}", "squid_proxy_pacc_del_final_proxy('{$num}')");
            $data['rows'][] = array('id' => "Proxy{$num}", 'cell' => array("<span style='font-size:16px;font-weight:bold;color:black;'>{$final_proxy}:{$uri}</a></span>", "&nbsp;", $delete));
        }
    }
    echo json_encode($data);
}
function popup_add_proxy_list()
{
    $sock = new sockets();
    $q = new mysql_squid_builder();
    $sql = "SELECT ProxyPacDatas,ProxyPacRemoveProxyListAtTheEnd FROM usersisp WHERE userid='{$_SESSION["uid"]}'";
    $ligne = @mysql_fetch_array($q->QUERY_SQL($sql));
    $datas = unserialize(base64_decode($ligne["ProxyPacDatas"]));
    $ProxyPacRemoveProxyListAtTheEnd = $ligne["ProxyPacRemoveProxyListAtTheEnd"];
    if (!is_array($datas["PROXYS"])) {
        $data['page'] = $page;
        $data['total'] = $total;
        $data['rows'] = array();
        echo json_encode($data);
        return;
    }
    $tpl = new templates();
    $final_proxy = $tpl->_ENGINE_parse_body("{final_proxy}");
    $deleteTxt = $tpl->_ENGINE_parse_body("{delete}");
    $data = array();
    $data['page'] = 1;
    $data['total'] = count($datas["PROXYS"]) + count($datas["FINAL_PROXY"]);
    $data['rows'] = array();
    $data['total'] = $data['total'] + 1;
    $squid = new squidbee();
    $SquidISPProxyServerAddress = $sock->GET_INFO("SquidISPProxyServerAddress");
    if ($SquidISPProxyServerAddress == null) {
        $SquidISPProxyServerAddress = $sock->GET_INFO("SquidBinIpaddr");
    }
    $SquidISPProxyServerAddress = $SquidISPProxyServerAddress . ":" . $squid->listen_port;
    $JSGROUP = "AddProxycondition({$SquidISPProxyServerAddress})";
    $conditions = popup_add_proxy_list_conditions($SquidISPProxyServerAddress, $datas["CONDITIONS"][$SquidISPProxyServerAddress]);
    $data['rows'][] = array('id' => "Proxy1", 'cell' => array("<a href=\"javascript:blur();\" OnClick=\"{$JSGROUP}\"  style='font-size:16px;font-weight:bold;color:black;text-decoration:underline'>{$SquidISPProxyServerAddress}</a></span>", $conditions, "&nbsp;"));
    while (list($num, $uri) = each($datas["PROXYS"])) {
        $id = md5($num);
        $conditions = null;
        $delete = imgtootltip("delete-24.png", "{$deleteTxt} {$uri}", "squid_proxy_pacc_del_proxy('{$num}')");
        $JSGROUP = "AddProxycondition({$num})";
        $conditions = popup_add_proxy_list_conditions($num, $datas["CONDITIONS"][$num]);
        $data['rows'][] = array('id' => "Proxy{$num}", 'cell' => array("<a href=\"javascript:blur();\" OnClick=\"{$JSGROUP}\"  style='font-size:16px;font-weight:bold;color:black;text-decoration:underline'>{$uri}</a></span>", $conditions, $delete));
    }
    if (count($datas["FINAL_PROXY"]) > 0) {
        while (list($num, $uri) = each($datas["FINAL_PROXY"])) {
            $delete = imgtootltip("delete-24.png", "{$deleteTxt} {$uri}", "squid_proxy_pacc_del_final_proxy('{$num}')");
            $data['rows'][] = array('id' => "Proxy{$num}", 'cell' => array("<span style='font-size:16px;font-weight:bold;color:black;'>{$final_proxy}:{$uri}</a></span>", "&nbsp;", $delete));
        }
    }
    echo json_encode($data);
}
Example #3
0
function popup_add_proxy_list()
{
    $sock = new sockets();
    $datas = unserialize(base64_decode($sock->GET_INFO("ProxyPacDatas")));
    if (!is_array($datas["PROXYS"])) {
        return null;
    }
    $html = "<table style='width:100%'>\n\t<tr>\n\t\t<th colspan=4>{proxys_list}</th>\n\t</tr>\n\t";
    //print_r($datas);
    while (list($num, $uri) = each($datas["PROXYS"])) {
        if ($color == null) {
            $color = "#fafafa";
        } else {
            $color = null;
        }
        $html = $html . "<tr style='background-color:{$color};'>\n\t\t<td width=1%><img src='img/fw_bold.gif'></td>\n\t\t<td style='font-size:14px' " . CellRollOver("AddProxycondition({$num})", "{add_condition}") . ">{$uri}</td>\n\t\t<td valign='top'>" . popup_add_proxy_list_conditions($num, $datas["CONDITIONS"][$num]) . "</td>\n\t\t<td width=1%>" . imgtootltip("ed_delete.gif", "{delete}", "squid_proxy_pacc_del_proxy('{$num}')") . "</td>\n\t\t</tr>";
    }
    if (count($datas["FINAL_PROXY"]) > 0) {
        $html = $html . "<tr><td colspan=4><hr></td></tr>";
        while (list($num, $uri) = each($datas["FINAL_PROXY"])) {
            if ($color == null) {
                $color = "#fafafa";
            } else {
                $color = null;
            }
            $html = $html . "<tr style='background-color:{$color};'>\n\t\t\t\t<td width=1%><img src='img/fw_bold.gif'></td>\n\t\t\t\t<td style='font-size:14px'>{final_proxy}:{$uri}</td>\n\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t<td width=1%>" . imgtootltip("ed_delete.gif", "{delete}", "squid_proxy_pacc_del_final_proxy('{$num}')") . "</td>\n\t\t\t\t</tr>";
        }
    }
    $html = $html . "</table>";
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html);
}