コード例 #1
0
ファイル: nginx.peer.www.php プロジェクト: BillTheBest/1.6.x
function table()
{
    $sock = new sockets();
    $q = new mysql();
    $CountDeFreeWebs = $q->COUNT_ROWS("freeweb", "artica_backup");
    $EnableFreeWeb = $sock->GET_INFO("EnableFreeWeb");
    if (!is_numeric($EnableFreeWeb)) {
        $EnableFreeWeb = 0;
    }
    $q = new mysql_squid_builder();
    if (!$q->TABLE_EXISTS("reverse_www")) {
        $f = new squid_reverse();
    }
    if (!$q->TABLE_EXISTS("reverse_sources")) {
        $f = new nginx_sources();
        $f->PatchTables();
    }
    if (!$q->FIELD_EXISTS("reverse_sources", "OnlyTCP")) {
        $q->QUERY_SQL("ALTER TABLE `reverse_sources` ADD `OnlyTCP` smallint(1) NOT NULL DEFAULT '0'");
        if (!$q->ok) {
            echo "<p class=text-error>{$q->mysql_error} in " . basename(__FILE__) . " line " . __LINE__ . "</p>";
        }
    }
    $page = CurrentPageName();
    $tpl = new templates();
    $date = $tpl->_ENGINE_parse_body("{zDate}");
    $description = $tpl->_ENGINE_parse_body("{description}");
    $context = $tpl->_ENGINE_parse_body("{context}");
    $events = $tpl->_ENGINE_parse_body("{events}");
    $destination = $tpl->_ENGINE_parse_body("{destination}");
    $website = $tpl->_ENGINE_parse_body("{website}");
    $settings = $tpl->javascript_parse_text("{watchdog_squid_settings}");
    $empty_events_text_ask = $tpl->javascript_parse_text("{empty_events_text_ask}");
    $apply_parameters = $tpl->javascript_parse_text("{rebuild_all_websites}");
    $purge_caches = $tpl->javascript_parse_text("{purge_caches}");
    $import_export = $tpl->javascript_parse_text("{import_export}");
    $new_server = $tpl->javascript_parse_text("{new_server}");
    $TB_HEIGHT = 450;
    $TB_WIDTH = 927;
    $TB2_WIDTH = 551;
    $all = $tpl->_ENGINE_parse_body("{all}");
    $t = time();
    $buttons = "\n\tbuttons : [\n\t\n\t{name: '{$apply_parameters}', bclass: 'apply', onpress :  apply_parameters{$t}},\n\t{name: '{$purge_caches}', bclass: 'Delz', onpress :  purge_caches{$t}},\n\t{name: '{$import_export}', bclass: 'Down', onpress :  import_export{$t}},\n\n\n\n\n\t],\t";
    $buttons = "\n\tbuttons : [\n\t{name: '{$new_server}', bclass: 'add', onpress : New{$t}},\n\t{name: '{$apply_parameters}', bclass: 'apply', onpress :  apply_parameters{$t}},\n\t],\t";
    $html = "\n\t<table class='NGINX_MAIN_TABLE2' style='display: none' id='NGINX_MAIN_TABLE2' style='width:99%'></table>\n\t<script>\n\tfunction BuildTable{$t}(){\n\t\$('#NGINX_MAIN_TABLE2').flexigrid({\n\turl: '{$page}?list=yes&t={$t}&ID={$_GET["ID"]}',\n\tdataType: 'json',\n\tcolModel : [\n\t{display: '&nbsp;', name : 'severity', width :70, sortable : false, align: 'center'},\n\t{display: '{$website}', name : 'servername', width :560, sortable : true, align: 'left'},\n\t{display: '&nbsp;', name : 'compile', width :60, sortable : false, align: 'center'},\n\t{display: '&nbsp;', name : 'delete', width :60, sortable : false, align: 'center'},\n\t],\n\t{$buttons}\n\n\tsearchitems : [\n\t{display: '{$website}', name : 'servername'},\n\t],\n\tsortname: 'zOrder',\n\tsortorder: 'asc',\n\tusepager: true,\n\ttitle: '',\n\tuseRp: true,\n\trp: 50,\n\tshowTableToggleBtn: false,\n\twidth: '99%',\n\theight: 550,\n\tsingleSelect: true,\n\trpOptions: [10, 20, 30, 50,100,200,500]\n\n});\n}\n\nfunction apply_parameters{$t}(){\n\tLoadjs('nginx.destination.progress.php?cacheid={$_GET["ID"]}')\n}\nfunction purge_caches{$t}(){\nLoadjs('system.services.cmd.php?APPNAME=APP_NGINX&action=purge&cmd=%2Fetc%2Finit.d%2Fnginx&appcode=APP_NGINX');\n}\nfunction import_export{$t}(){\nLoadjs('miniadmin.proxy.reverse.import.php');\n}\n\nfunction New{$t}(){\nLoadjs('nginx.new.php?peer-id={$_GET["ID"]}');\n}\n\tBuildTable{$t}();\n\t</script>";
    echo $html;
}
コード例 #2
0
function websites_search()
{
    $sock = new sockets();
    $q = new mysql();
    $CountDeFreeWebs = $q->COUNT_ROWS("freeweb", "artica_backup");
    $EnableFreeWeb = $sock->GET_INFO("EnableFreeWeb");
    if (!is_numeric($EnableFreeWeb)) {
        $EnableFreeWeb = 0;
    }
    $q = new mysql_squid_builder();
    if (!$q->TABLE_EXISTS("reverse_www")) {
        $f = new squid_reverse();
    }
    if (!$q->TABLE_EXISTS("reverse_sources")) {
        $f = new nginx_sources();
        $f->PatchTables();
    }
    if (!$q->FIELD_EXISTS("reverse_sources", "OnlyTCP")) {
        $q->QUERY_SQL("ALTER TABLE `reverse_sources` ADD `OnlyTCP` smallint(1) NOT NULL DEFAULT '0'");
        if (!$q->ok) {
            echo "<p class=text-error>{$q->mysql_error} in " . basename(__FILE__) . " line " . __LINE__ . "</p>";
        }
    }
    $CountDereverse = $q->COUNT_ROWS("reverse_www");
    if ($CountDereverse == 0) {
        if ($CountDeFreeWebs > 0) {
            $sock->getFrameWork("nginx.php?sync-freewebs=yes");
        }
    }
    $STATUS = unserialize(@file_get_contents("/usr/share/artica-postfix/ressources/logs/web/nginx.status.acl"));
    $searchstring = string_to_flexquery("websites-search");
    $sql = "SELECT * FROM reverse_www WHERE 1 {$searchstring} ORDER BY servername LIMIT 0,250";
    if (!AdminPrivs()) {
        $sql = "SELECT reverse_www.* FROM reverse_www,reverse_privs \n\t\tWHERE reverse_privs.servername=reverse_www.servername\n\t\tAND reverse_privs.uid='{$_SESSION["uid"]}' {$searchstring} ORDER BY servername LIMIT 0,250";
    }
    $results = $q->QUERY_SQL($sql, 'artica_backup');
    if (!$q->ok) {
        echo $q->mysql_error_html();
        return;
    }
    $tpl = new templates();
    $all_text = $tpl->_ENGINE_parse_body("{all}");
    $GLOBALS["CLASS_TPL"] = $tpl;
    $boot = new boostrap_form();
    $page = CurrentPageName();
    $q1 = new mysql();
    $t = time();
    while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) {
        $icon2 = "arrow-right-64.png";
        $icon = "domain-main-64.png";
        $freewebicon = "64-firewall-search.png";
        $color = "black";
        $status = array();
        $portText = null;
        if ($ligne["ssl"] == 1) {
            $certificate_text = $tpl->_ENGINE_parse_body("<div>{certificate}: {default}</div>");
        }
        $md = md5(serialize($ligne));
        $RedirectQueries = $ligne["RedirectQueries"];
        $default_server = $ligne["default_server"];
        $explain_text = null;
        $SiteEnabled = $ligne["enabled"];
        $servername = $ligne["servername"];
        $servername_enc = urlencode($servername);
        $limit_rate = $ligne["limit_rate"];
        $limit_rate_after = $ligne["limit_rate_after"];
        $DeleteFreeWeb = "Loadjs('{$page}?delete-websites-js=yes&servername={$servername_enc}&md={$md}')";
        if ($ligne["DenyConf"] == 1) {
            $icon = "hearth-blocked-64.png";
        }
        if ($SiteEnabled == 0) {
            $icon = "domain-main-64-grey.png";
            $color = "#8a8a8a";
            $icon2 = "arrow-right-64-grey.png";
        }
        $delete = imgsimple("delete-48.png", null, $DeleteFreeWeb);
        $jsEditWW = $boot->trswitch("Loadjs('website-js=yes&servername={$servername_enc}')");
        $jsedit = $boot->trswitch("Loadjs('{$page}?website-js=yes&servername={$servername_enc}')");
        $jseditA = $jsedit;
        $jseditC = $boot->trswitch("Loadjs('{$page}?website-script-js=yes&servername={$servername}')");
        if ($ligne["certificate"] != null) {
            $certificate_text = "" . $tpl->_ENGINE_parse_body("<div>{certificate}: {$ligne["certificate"]}</div>");
        }
        if (isset($STATUS[$servername])) {
            $ac = FormatNumber($STATUS[$servername]["AC"]);
            $ACCP = FormatNumber($STATUS[$servername]["ACCP"]);
            $ACHDL = FormatNumber($STATUS[$servername]["ACHDL"]);
            $ACRAQS = FormatNumber($STATUS[$servername]["ACRAQS"]);
            if ($STATUS[$servername]["ACCP"] > 0) {
                $ss = round($STATUS[$servername]["ACRAQS"] / $STATUS[$servername]["ACCP"], 2);
            }
            $reading = FormatNumber($STATUS[$servername]["reading"]);
            $writing = FormatNumber($STATUS[$servername]["writing"]);
            $waiting = FormatNumber($STATUS[$servername]["waiting"]);
            $status[] = "{active_connections}: {$ac}&nbsp;|&nbsp;{accepteds}: {$ACCP}&nbsp;|&nbsp;{handles}:{$ACRAQS} ({$ss}/{second})";
            $status[] = "&nbsp;|&nbsp;{keepalive}: {$waiting}&nbsp;|&nbsp;{reading}: {$reading}&nbsp;|&nbsp;{writing}:{$writing}";
        }
        if ($limit_rate > 0) {
            $limit_rate_after_caption = $tpl->_ENGINE_parse_body("{limit_rate_after_caption}");
            $limit_rate_after_caption = str_replace("%s", "{$limit_rate}MB/s", $limit_rate_after_caption);
            $limit_rate_after_caption = str_replace("%f", "{$limit_rate_after}MB", $limit_rate_after_caption);
            $status[] = "<div style='font-size:12px;font-weight:bold;color:#EEB853'>{$limit_rate_after_caption}</div>";
        }
        if (count($status) > 0) {
            $status_text = $tpl->_ENGINE_parse_body("<div style='font-size:12px'>" . @implode("", $status) . "</div>");
        }
        $FreeWebText = null;
        $explain_text = null;
        if ($EnableFreeWeb == 0) {
            if ($ligne["ipaddr"] == "127.0.0.1") {
                $ligne["ipaddr"] = "{error}";
            }
            if ($ligne["cache_peer_id"] == 0) {
                $ligne["cache_peer_id"] = -1;
            }
        }
        if ($ligne["ipaddr"] == "127.0.0.1" or $ligne["cache_peer_id"] == 0) {
            $jsedit = $boot->trswitch("Loadjs('freeweb.edit.php?hostname={$servername}&t={$t}')");
            $certificate_text = null;
            $explain_text = EXPLAIN_REVERSE($ligne["servername"]);
            $delete = imgsimple("delete-48.png", null, $DeleteFreeWeb);
            $jseditS = null;
            $freewebicon = "domain-64.png";
            $FreeWebText = "\n\t\t\t\t\t<a href=\"javascript:blur();\" OnClick=\"javascript:Loadjs('freeweb.edit.php?hostname={$servername}&t={$t}')\">\n\t\t\t\t\t127.0.0.1:82 (FreeWeb)</a>";
        } else {
            $explain_text = EXPLAIN_REVERSE($ligne["servername"]);
            if ($ligne["port"] > 0) {
                $portText = ":{$ligne["port"]}";
            }
            $ligne2 = mysql_fetch_array($q->QUERY_SQL("SELECT servername,ipaddr,port,OnlyTCP FROM reverse_sources WHERE ID='{$ligne["cache_peer_id"]}'"));
            $OnlyTCP = $ligne2["OnlyTCP"];
            $FreeWebText = "{$ligne2["servername"]}:{$ligne2["port"]}";
            $jseditS = $boot->trswitch("Loadjs('{$page}?js-source=yes&source-id={$ligne["cache_peer_id"]}')");
            if ($OnlyTCP == 0) {
                $ligne["owa"] = 0;
                if ($ligne["ssl"] == 1) {
                    if ($ligne["port"] == 80) {
                        $portText = $portText . "/443";
                    }
                }
            }
            if ($OnlyTCP == 1) {
                $certificate_text = null;
                $portText = $portText . " <strong>TCP</strong>";
            }
        }
        if ($ligne["owa"] == 1) {
            $freewebicon = "exchange-2010-64.png";
        }
        if ($ligne["poolid"] > 0) {
            $freewebicon = "64-cluster.png";
            $ligne2 = mysql_fetch_array($q->QUERY_SQL("SELECT poolname FROM nginx_pools WHERE ID='{$ligne["poolid"]}'"));
            $ligne["ipaddr"] = $ligne2["poolname"];
            $jseditS = $boot->trswitch("Loadjs('miniadmin.proxy.reverse.nginx-pools.php?poolid-js={$ligne["poolid"]}&pool-id={$ligne["poolid"]}')");
        }
        $sql = "SELECT * FROM nginx_aliases WHERE servername='{$servername}' {$searchstring} ORDER BY alias LIMIT 0,250";
        $results2 = $q->QUERY_SQL($sql);
        $ali = array();
        $alitext = null;
        while ($ligne = mysql_fetch_array($results2, MYSQL_ASSOC)) {
            $ali[] = "{$ligne["alias"]}";
        }
        if (count($ali) > 0) {
            $alitext = "&nbsp;<i>(" . @implode("{or} ", $ali) . ")</i>&nbsp;";
        }
        $stats = null;
        $ligne2 = mysql_fetch_array($q1->QUERY_SQL("SELECT COUNT(*) as tcount FROM awstats_files WHERE servername='{$servername}'", "artica_backup"));
        if (!$q1->ok) {
            echo "<p class=text-error>{$q1->mysql_error}</p>";
        }
        if ($ligne2["tcount"] > 0) {
            // Abandonné pour l'instant
            //$stats="<a href='miniadmin.proxy.reverse.awstats.php?servername=".urlencode($servername)."'><img src='img/statistics-48.png'></a>";
        }
        $FinalDestination = "{$ligne["ipaddr"]}{$FreeWebText}";
        if ($RedirectQueries != null) {
            $FinalDestination = $RedirectQueries;
            $explain_text = $tpl->_ENGINE_parse_body("<br>{RedirectQueries_explain_table}");
        }
        if ($default_server == 1) {
            $servername = "{$servername} ({$all_text} * )";
            $icon = "free-web-64.png";
            if ($SiteEnabled == 0) {
                $icon = "free-web-64-grey.png";
            }
        }
        $tr[] = "\n\t\t\t\t<tr style='color:{$color}' id='{$md}'>\n\t\t\t\t\t<td width=64px nowrap {$jseditC}><img src='img/script-64.png' style='width:64px'></td>\n\t\t\t\t\t<td width=64px nowrap {$jseditA}><img src='img/{$icon}' style='width:64px'></td>\n\t\t\t\t\t<td width=80% style='vertical-align:middle'>\n\t\t\t\t\t\t<a href=\"javascript:blur();\" \n\t\t\t\t\t\tstyle='font-size:18px;font-weight:bold;text-decoration:underline'\n\t\t\t\t\t\tOnClick=\"javascript:Loadjs('{$page}?website-js=yes&servername={$servername_enc}')\">{$servername}{$portText}</a>\n\t\t\t\t\t\t{$alitext}{$certificate_text}{$status_text}\n\t\t\t\t\t\t{$explain_text}\n\t\t\t\t\t\t</td>\n\t\t\t\t\t<td width=1% nowrap style='vertical-align:middle'>{$stats}</td>\n\t\t\t\t\t<td width=64px nowrap {$jsedit} style='vertical-align:middle'><img src='img/{$freewebicon}' style='width:64px'></td>\n\t\t\t\t\t<td width=64px nowrap {$jsedit} style='vertical-align:middle'><img src='img/{$icon2}' style='width:64px'></td>\n\t\t\t\t\t<td width=1% nowrap {$jseditS} style='vertical-align:middle'>\n\t\t\t\t\t\t<span style='font-size:18px;font-weight:bold'>{$FinalDestination}</span>\n\t\t\t\t\t\t\n\t\t\t\t\t</td>\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t<td width=1% nowrap style='vertical-align:middle'>{$delete}</td>\n\t\t\t\t</tr>\n\t\t\t\t";
    }
    $t = time();
    $freeweb_compile_background = $tpl->javascript_parse_text("{freeweb_compile_background}");
    $reset_admin_password = $tpl->javascript_parse_text("{reset_admin_password}");
    $delete_freeweb_text = $tpl->javascript_parse_text("{delete_freeweb_text}");
    $delete_freeweb_nginx_text = $tpl->javascript_parse_text("{delete_freeweb_nginx_text}");
    $delete_freeweb_dnstext = $tpl->javascript_parse_text("{delete_freeweb_dnstext}");
    echo $tpl->_ENGINE_parse_body("\n\t\n\t\t<table class='table table-bordered table-hover'>\n\t\n\t\t\t<thead>\n\t\t\t\t<tr>\n\t\t\t\t\t<th colspan=4>{website}</th>\n\t\t\t\t\t\n\t\t\t\t\t<th colspan=2>{destination}</th>\n\t\t\t\t\t<th>&nbsp;</th>\n\t\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t <tbody>") . @implode("", $tr) . "</tbody></table>\n<script>\nvar FreeWebIDMEM{$t}='';\n\t\t\n\tfunction FreeWebWebDavPerUsers(){\n\t\tLoadjs('freeweb.webdavusr.php?t={$t}')\n\t}\n\t\n\tfunction RestoreSite(){\n\t\tLoadjs('freeweb.restoresite.php?t={$t}')\n\t}\n\t\n\tfunction FreeWebsRefreshWebServersList(){\n\t\tExecuteByClassName('SearchFunction');\n\t}\n\t\n\t\n\tvar x_EmptyEvents= function (obj) {\n\t\tvar results=obj.responseText;\n\t\tif(results.length>3){alert(results);return;}\n\t\tExecuteByClassName('SearchFunction');\n\n\t\t\n\t}\t\n\t\n\tvar x_FreeWebsRebuildvHostsTable= function (obj) {\n\t\tvar results=obj.responseText;\n\t\tif(results.length>3){alert(results);return;}\n\t\talert('{$freeweb_compile_background}');\n\t\tExecuteByClassName('SearchFunction');\n\t\t}\n\n\t\n\tvar x_klmsresetwebpassword{$t}= function (obj) {\n\t\tvar results=obj.responseText;\n\t\tif(results.length>3){alert(results);return;}\n\t\tExecuteByClassName('SearchFunction');\n\t}\t\n\t\nvar xDelete{$t}=function (obj) {\n\tvar results=obj.responseText;\n\tif(results.length>10){alert(results);return;}\t\n\t\$('#'+FreeWebIDMEM{$t}).remove();\n}\t\n\t\t\nfunction Delete{$t}(server,md){\n\tFreeWebIDMEM{$t}=md;\n\tif(confirm('{$delete_freeweb_text}')){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('website-delete',server);\n    \tXHR.sendAndLoad('{$page}', 'POST',xDelete{$t});\n\t}\n}\n\nvar xDeleteFreeWeb{$t}=function (obj) {\n\tvar results=obj.responseText;\n\tif(results.length>10){alert(results);return;}\t\n\t\$('#'+FreeWebIDMEM{$t}).remove();\n}\t\n\nfunction DeleteFreeWeb{$t}(server,md){\n\tFreeWebIDMEM{$t}=md;\n\tif(confirm('{$delete_freeweb_nginx_text}')){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('delete-servername',server);\n    \tXHR.sendAndLoad('freeweb.php', 'GET',xDeleteFreeWeb{$t});\n\t}\n}\n\nvar x_FreeWebRefresh=function (obj) {\n\tvar results=obj.responseText;\n\tif(results.length>10){alert(results);return;}\t\n\tExecuteByClassName('SearchFunction');\n}\t\t\n\t\t\n\t\tfunction FreeWebAddDefaultVirtualHost(){\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tXHR.appendData('AddDefaultOne','yes');\n    \t\tXHR.sendAndLoad('freeweb.php', 'POST',x_FreeWebRefresh);\t\t\n\t\t}\n\t\t\n\t\tfunction FreeWeCheckVirtualHost(){\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tXHR.appendData('CheckAVailable','yes');\n    \t\tXHR.sendAndLoad('freeweb.php', 'POST',x_FreeWebDelete);\t\t\t\n\t\t}\n\t\t\n\t\tvar x_RebuildFreeweb{$t}=function (obj) {\n\t\t\tvar results=obj.responseText;\n\t\t\tif(results.length>0){alert(results);}\t\t\t\n\t\t\tExecuteByClassName('SearchFunction');\n\t\t}\t\t\t\n\t\t\n\t\tfunction RebuildFreeweb(){\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tXHR.appendData('rebuild-items','yes');\n    \t\tXHR.sendAndLoad('freeweb.php', 'GET',x_RebuildFreeweb{$t});\n\t\t\n\t\t}\n\n\t\tfunction klmsresetwebpassword(){\n\t\t  if(confirm('{$reset_admin_password} ?')){\n\t\t\t\tvar XHR = new XHRConnection();\n\t\t\t\tXHR.appendData('klms-reset-password','yes');\n    \t\t\tXHR.sendAndLoad('klms.php', 'POST',x_klmsresetwebpassword{$t});\n    \t\t}\t\t\n\t\t}\n\t\t\n\tfunction FreeWebsRebuildvHostsTable(servername){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('FreeWebsRebuildvHosts',servername);\n\t\tXHR.sendAndLoad('freeweb.edit.php', 'POST',x_FreeWebsRebuildvHostsTable);\n\t}\n\n\tfunction FreeWebsEnableSite(servername){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('FreeWebsEnableSite',servername);\n\t\tXHR.sendAndLoad('freeweb.servers.php', 'POST',x_FreeWebRefresh);\t\n\t}\n</script>\t\t\t \t\t\t\t\t \t\t\t\t \t\t\n";
}
コード例 #3
0
ファイル: nginx.caches.php プロジェクト: BillTheBest/1.6.x
function table()
{
    $sock = new sockets();
    $q = new mysql();
    $CountDeFreeWebs = $q->COUNT_ROWS("freeweb", "artica_backup");
    $EnableFreeWeb = $sock->GET_INFO("EnableFreeWeb");
    if (!is_numeric($EnableFreeWeb)) {
        $EnableFreeWeb = 0;
    }
    $q = new mysql_squid_builder();
    if (!$q->TABLE_EXISTS("reverse_www")) {
        $f = new squid_reverse();
    }
    if (!$q->TABLE_EXISTS("reverse_sources")) {
        $f = new nginx_sources();
        $f->PatchTables();
    }
    if (!$q->FIELD_EXISTS("reverse_sources", "OnlyTCP")) {
        $q->QUERY_SQL("ALTER TABLE `reverse_sources` ADD `OnlyTCP` smallint(1) NOT NULL DEFAULT '0'");
        if (!$q->ok) {
            echo "<p class=text-error>{$q->mysql_error} in " . basename(__FILE__) . " line " . __LINE__ . "</p>";
        }
    }
    $page = CurrentPageName();
    $tpl = new templates();
    $date = $tpl->_ENGINE_parse_body("{zDate}");
    $description = $tpl->_ENGINE_parse_body("{description}");
    $context = $tpl->_ENGINE_parse_body("{context}");
    $events = $tpl->_ENGINE_parse_body("{events}");
    $destination = $tpl->_ENGINE_parse_body("{destination}");
    $website = $tpl->_ENGINE_parse_body("{website}");
    $settings = $tpl->javascript_parse_text("{watchdog_squid_settings}");
    $maxsize = $tpl->javascript_parse_text("{maxsize}");
    $apply_parameters = $tpl->javascript_parse_text("{refresh_caches_status}");
    $name = $tpl->javascript_parse_text("{name}");
    $directory = $tpl->javascript_parse_text("{directory}");
    $new_cache = $tpl->javascript_parse_text("{new_cache}");
    $TB_HEIGHT = 450;
    $TB_WIDTH = 927;
    $TB2_WIDTH = 551;
    $all = $tpl->_ENGINE_parse_body("{all}");
    $t = time();
    $buttons = "\n\tbuttons : [\n\t{name: '<strong style=font-size:20px>{$new_cache}</strong>', bclass: 'add', onpress : New{$t}},\n\t{name: '<strong style=font-size:20px>{$apply_parameters}</strong>', bclass: 'apply', onpress :  apply_parameters{$t}},\n\t\n\t\n\t\n\t\n\t\n\t],\t";
    $html = "\n\t<table class='NGINX_CACHE_TABLE' style='display: none' id='NGINX_CACHE_TABLE' style='width:99%'></table>\n\t<script>\nfunction BuildTable{$t}(){\n\t\$('#NGINX_CACHE_TABLE').flexigrid({\n\turl: '{$page}?list=yes&t={$t}',\n\t\tdataType: 'json',\n\t\t\tcolModel : [\n\t\t\t{display: '<span style=font-size:18px>{$name}</span>', name : 'keys_zone', width :284, sortable : true, align: 'left'},\n\t\t\t{display: '<span style=font-size:18px>{$directory}</span>', name : 'directory', width :602, sortable : false, align: 'left'},\n\t\t\t\n\t\t\t{display: '<span style=font-size:18px>{$maxsize}</span>', name : 'maxsize', width :220, sortable : false, align: 'left'},\n\t\t\t{display: '&nbsp;', name : 'up', width :78, sortable : false, align: 'center'},\n\t\t\t{display: '&nbsp;', name : 'down', width :78, sortable : false, align: 'center'},\n\n\t\t\t],\n\t\t\t{$buttons}\n\n\tsearchitems : [\n\t{display: '{$name}', name : 'name'},\n\t{display: '{$directory}', name : 'directory'},\n\t],\n\tsortname: 'keys_zone',\n\tsortorder: 'asc',\n\tusepager: true,\n\ttitle: '',\n\tuseRp: true,\n\trp: 50,\n\tshowTableToggleBtn: false,\n\twidth: '99%',\n\theight: 550,\n\tsingleSelect: true,\n\trpOptions: [10, 20, 30, 50,100,200,500]\n\t\n\t});\n\t}\n\nfunction apply_parameters{$t}(){\n\tLoadjs('nginx.caches.progress.php');\n}\nfunction purge_caches{$t}(){\n\tLoadjs('system.services.cmd.php?APPNAME=APP_NGINX&action=purge&cmd=%2Fetc%2Finit.d%2Fnginx&appcode=APP_NGINX');\n}\nfunction import_export{$t}(){\n\tLoadjs('miniadmin.proxy.reverse.import.php');\n}\n\nfunction New{$t}(){\n\tLoadjs('{$page}?js-cache=yes&ID=0');\n}\nBuildTable{$t}();\t\t\n</script>";
    echo $html;
}