コード例 #1
0
function requeteur_popup()
{
    $page = CurrentPageName();
    $tpl = new templates();
    squid_stats_default_values();
    $t = $_GET["t"];
    $per["1m"] = "{minute}";
    $per["5m"] = "5 {minutes}";
    $per["10m"] = "10 {minutes}";
    $per["1h"] = "{hour}";
    $per["1d"] = "{day}";
    $members["frommail"] = "{sender}";
    $members["tomail"] = "{recipient}";
    $q = new postgres_sql();
    $Selectore = $q->fieldSelectore();
    $html = "<div style='width:98%;margin-bottom:20px' class=form>\n\t<table style='width:100%'>\n\t<tr>\n\t\t\t\n\t\t<td style='vertical-align:top;font-size:18px' class=legend>{members}:</td>\n\t\t<td style='vertical-align:top;font-size:18px;'>" . Field_array_Hash($members, "members-{$t}", $_SESSION["SQUID_STATS_MEMBER"], "blur()", null, 0, "font-size:18px;") . "</td>\n\t</tr>\n\t<tr>\t\t\t\n\t\n\t\t<td style='vertical-align:top;font-size:18px' class=legend>{from_date}:</td>\n\t\t<td style='vertical-align:top;font-size:18px'>" . field_date("from-date-{$t}", $_SESSION["SQUID_STATS_DATE1"], ";font-size:18px;width:160px", $Selectore) . "\n\t\t&nbsp;" . Field_text("from-time-{$t}", $_SESSION["SQUID_STATS_TIME1"], ";font-size:18px;width:82px") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td style='vertical-align:top;font-size:18px' class=legend>{to_date}:</td>\n\t\t<td style='vertical-align:top;font-size:18px'>" . field_date("to-date-{$t}", $_SESSION["SQUID_STATS_DATE2"], ";font-size:18px;width:160px", $Selectore) . "\n\t\t&nbsp;" . Field_text("to-time-{$t}", $_SESSION["SQUID_STATS_TIME2"], ";font-size:18px;width:82px") . "</td>\n\t\t\n\t</tr>\n\t<tr>\n\t\t<td style='vertical-align:middle;font-size:18px' class=legend>{search}:</td>\n\t\t<td style='vertical-align:top;font-size:18px'>" . Field_text("search-{$t}", $_SESSION["SQUID_STATS_MEMBER_SEARCH"], ";font-size:18px;width:98%") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td style='vertical-align:top;font-size:18px;' colspan=2 align='right'><hr>" . button("{generate_statistics}", "Run{$t}()", 18) . "</td>\n\t</tr>\n\t</table>\n\t</div>\n<script>\nfunction Run{$t}(){\n\tvar date1=document.getElementById('from-date-{$t}').value;\n\tvar time1=document.getElementById('from-time-{$t}').value;\n\tvar date2=document.getElementById('to-date-{$t}').value\n\tvar time2=document.getElementById('to-time-{$t}').value;\n\tvar user=document.getElementById('members-{$t}').value;\n\tvar search=encodeURIComponent(document.getElementById('search-{$t}').value);\n\tvar interval=0;\n\t\n\n\t\n\tLoadjs('{$page}?query-js=yes&t={$t}&container=graph-{$t}&date1='+date1+'&time1='+time1+'&date2='+date2+'&time2='+time2+'&interval='+interval+'&user='******'&search='+search);\n\t\n}\n</script>\n\t";
    echo $tpl->_ENGINE_parse_body($html);
}
コード例 #2
0
function popup()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $t = time();
    $members["MAC"] = "{MAC}";
    $members["USERID"] = "{uid}";
    $members["IPADDR"] = "{ipaddr}";
    $q = new postgres_sql();
    $Selectore = $q->fieldSelectore();
    $q = new mysql_squid_builder();
    $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT params,title,report_type FROM reports_cache WHERE `zmd5`='{$_GET["zmd5"]}'"));
    if (!$q->ok) {
        echo $q->mysql_error_html();
    }
    $params = unserialize($ligne["params"]);
    $FROM_DATE = date("Y-m-d", $params["FROM"]);
    $FROM_TIME = date("H:i", $params["FROM"]);
    $TO_DATE = date("Y-m-d", $params["TO"]);
    $TO_TIME = date("H:i", $params["TO"]);
    $USER = $params["USER"];
    $searchsites = $params["searchsites"];
    $searchuser = $params["searchuser"];
    if ($ligne["report_type"] == "WEBSITES") {
        $nextFunction = "LoadAjax('WEBSITES_STATS_MAIN_GRAPH','squid.statistics.websites.php?main=yes&zmd5={$_GET["zmd5"]}&t={$_GET["t"]}');";
    }
    if ($ligne["report_type"] == "FLOW") {
        $nextFunction = "LoadAjax('WEBSITES_STATS_MAIN_GRAPH','squid.statistics.flow.php?graph1=yes&t={$_GET["t"]}&container=graph-{$t}&zmd5={$_GET["zmd5"]}&t={$_GET["t"]}');";
    }
    if ($ligne["report_type"] == "CATEGORIES") {
        $nextFunction = "LoadAjax('CATEGORIES_STATS_MAIN_GRAPH','squid.statistics.categories.php?main=yes&zmd5={$_GET["zmd5"]}&t={$_GET["t"]}');";
    }
    if ($ligne["report_type"] == "WEBFILTERING") {
        $nextFunction = "LoadAjax('WEBFILTERING_STATS_MAIN_GRAPH','squid.statistics.webfiltering.php?main=yes&zmd5={$_GET["zmd5"]}&t={$_GET["t"]}');";
    }
    $nextFunction_encoded = urlencode(base64_encode($nextFunction));
    $stylelegend = "style='vertical-align:top;font-size:18px;padding-top:5px' nowrap";
    $html = "<div style='width:98%;margin-bottom:20px' class=form>\n<table style='width:100%'>\n<tr style='height:50px'>\n\t<td style='vertical-align:middle;font-size:18px;' class=legend>{type}:</td>\n\t<td style='vertical-align:middle;font-size:18px;font-weight:bold'>{$ligne["report_type"]}</td>\n</tr>\n<tr>\n\t<td {$stylelegend} class=legend>{title2}:</td>\n\t<td style='vertical-align:top;font-size:18px'>" . Field_text("title-{$t}", utf8_encode($ligne["title"]), ";font-size:18px;width:710px") . "</td>\n</tr>\n\n<tr>\n\t<td {$stylelegend} class=legend>{from_date}:</td>\n\t<td style='vertical-align:top;font-size:18px'>" . field_date("from-date-{$t}", $FROM_DATE, ";font-size:18px;width:160px", $Selectore) . "\n\t&nbsp;" . Field_text("from-time-{$t}", $FROM_TIME, ";font-size:18px;width:82px") . "</td>\n</tr>\n<tr>\t\n\t<td {$stylelegend} class=legend>{to_date}:</td>\n\t<td style='vertical-align:top;font-size:18px'>" . field_date("to-date-{$t}", $TO_DATE, ";font-size:18px;width:160px", $Selectore) . "\n\t&nbsp;" . Field_text("to-time-{$t}", $TO_TIME, ";font-size:18px;width:82px") . "</td>\n</tr>\n\n<tr>\n\t<td {$stylelegend} class=legend>{members}:</td>\n\t<td style='vertical-align:top;font-size:18px;'>" . Field_array_Hash($members, "members-{$t}", $USER, "blur()", null, 0, "font-size:18px;") . "</td>\n</tr>\n<tr>\n\t<td {$stylelegend} class=legend>{members} {search}:</td>\n\t<td style='vertical-align:top;font-size:18px;'>" . Field_text("members-search-{$t}", "{$searchuser}", "font-size:18px;width:350px") . "</td>\n</tr>\n<tr>\n\t<td {$stylelegend} class=legend>{websites} {search}:</td>\n\t<td style='vertical-align:top;font-size:18px;'>" . Field_text("websites-search-{$t}", "{$searchsites}", "font-size:18px;width:350px") . "</td>\n</tr>\n<tr style='height:50px'>\n\t<td style='vertical-align:top;font-size:18px;' colspan=2 align='right'>" . button("{apply}", "Run{$t}()", 36) . "</td>\n</tr>\n</table>\n</div>\n<script>\nvar xRun{$t}=function (obj) {\n\tvar results=obj.responseText;\n\tif(results.length>0){alert(results);}\n\tLoadjs('squid.statistics.progress.php?zmd5={$_GET["zmd5"]}&NextFunction={$nextFunction_encoded}&t={$t}');\n}\n\nfunction Run{$t}(){\n\tvar date1=document.getElementById('from-date-{$t}').value;\n\tvar time1=document.getElementById('from-time-{$t}').value;\n\tvar date2=document.getElementById('to-date-{$t}').value\n\tvar time2=document.getElementById('to-time-{$t}').value;\n\tvar user=document.getElementById('members-{$t}').value;\n\tvar searchuser=encodeURIComponent(document.getElementById('members-search-{$t}').value);\n\tvar searchsites=encodeURIComponent(document.getElementById('websites-search-{$t}').value);\n\tvar title=encodeURIComponent(document.getElementById('title-{$t}').value);\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('zmd5','{$_GET["zmd5"]}');\n\tXHR.appendData('date1',date1+' '+time1+':00');\n\tXHR.appendData('USER',user);\n\tXHR.appendData('date2',date2+' '+time2+':00');\n\tXHR.appendData('searchuser',searchuser);\n\tXHR.appendData('searchsites',searchsites);\n\tXHR.appendData('title',title);\n\tXHR.sendAndLoad('{$page}', 'POST',xRun{$t});\n\n}\n</script>\n";
    echo $tpl->_ENGINE_parse_body($html);
}
コード例 #3
0
function requeteur_popup()
{
    $page = CurrentPageName();
    $tpl = new templates();
    squid_stats_default_values();
    $t = time();
    $per["1m"] = "{minute}";
    $per["5m"] = "5 {minutes}";
    $per["10m"] = "10 {minutes}";
    $per["1h"] = "{hour}";
    $per["1d"] = "{day}";
    $Maxlines[50] = 50;
    $Maxlines[100] = 100;
    $Maxlines[150] = 150;
    $Maxlines[200] = 200;
    $q = new postgres_sql();
    $Selectore = $q->fieldSelectore();
    $members["MAC"] = "{MAC}";
    $members["USERID"] = "{uid}";
    $members["IPADDR"] = "{ipaddr}";
    $stylelegend = "style='vertical-align:top;font-size:18px;padding-top:5px' nowrap";
    $html = "<div style='width:98%;margin-bottom:20px' class=form>\n\t<table style='width:100%'>\n\t<tr>\n\t\t\t\t\t\n\t\t<td {$stylelegend} class=legend>{members}:</td>\n\t\t<td style='vertical-align:top;font-size:18px;'>" . Field_array_Hash($members, "members-{$t}", $_SESSION["SQUID_STATS_MEMBER"], "blur()", null, 0, "font-size:18px;") . "</td>\t\t\n\t</tr>\n\t<tr>\t\n\t\t<td {$stylelegend} class=legend>{max_lines}:</td>\n\t\t<td style='vertical-align:top;font-size:18px;'>" . Field_array_Hash($Maxlines, "Maxlines-{$t}", $_SESSION["SQUID_STATS_MAX_LINES"], "blur()", null, 0, "font-size:18px;") . "</td>\t\t\t\t\n\t</tr>\n\t<tr>\t\t\t\t\t\n\t\t<td {$stylelegend} class=legend nowrap>{from_date}:</td>\n\t\t<td style='vertical-align:top;font-size:18px'>" . field_date("from-date-{$t}", $_SESSION["SQUID_STATS_DATE1"], ";font-size:18px;width:160px", $Selectore) . "\n\t\t&nbsp;" . Field_text("from-time-{$t}", $_SESSION["SQUID_STATS_TIME1"], ";font-size:18px;width:82px") . "</td>\n\t</tr>\n\t<tr>\t\t\n\t\t\n\t\t<td {$stylelegend} class=legend nowrap>{to_date}:</td>\n\t\t<td style='vertical-align:top;font-size:18px'>" . field_date("to-date-{$t}", $_SESSION["SQUID_STATS_DATE2"], ";font-size:18px;width:160px", $Selectore) . "\n\t\t&nbsp;" . Field_text("to-time-{$t}", $_SESSION["SQUID_STATS_TIME2"], ";font-size:18px;width:82px") . "</td>\n\t</tr>\n\t<tr>\n\t</tr>\n\t<tr>\n\t\t<td {$stylelegend} class=legend>{search}:</td>\n\t\t<td colspan=2 style='vertical-align:top;font-size:18px'>" . Field_text("search-{$t}", $_SESSION["SQUID_STATS_MEMBER_SEARCH"], ";font-size:18px;width:99%") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td style='vertical-align:top;font-size:18px;text-align:right' colspan=2>" . button("{search}", "Run{$t}()", 26) . "</td>\n\t</tr>\n\t</table>\n\t</div>\n<script>\nfunction Run{$t}(){\n\tvar date1=document.getElementById('from-date-{$t}').value;\n\tvar time1=document.getElementById('from-time-{$t}').value;\n\tvar date2=document.getElementById('to-date-{$t}').value\n\tvar time2=document.getElementById('to-time-{$t}').value;\n\tvar user=document.getElementById('members-{$t}').value;\n\tvar Maxlines=document.getElementById('Maxlines-{$t}').value;\n\tvar search=encodeURIComponent(document.getElementById('search-{$t}').value);\n\tvar interval=0;\n\t\n\tLoadAjax('table-squid-stats-requests','{$page}?query-js=yes&container=graph-{$t}&Maxlines='+Maxlines+'&date1='+date1+'&time1='+time1+'&date2='+date2+'&time2='+time2+'&interval='+interval+'&user='******'&search='+search);\n\t\n\t\n}\n</script>\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n";
    echo $tpl->_ENGINE_parse_body($html);
}
コード例 #4
0
function requeteur_popup()
{
    $page = CurrentPageName();
    $tpl = new templates();
    squid_stats_default_values();
    $t = $_GET["t"];
    $per["10m"] = "10 {minutes}";
    $per["1h"] = "1 {hour}";
    $per["1d"] = "1 {day}";
    $per["1w"] = "1 {week}";
    $per["30d"] = "1 {month}";
    $members["MAC"] = "{MAC}";
    $members["USERID"] = "{uid}";
    $members["IPADDR"] = "{ipaddr}";
    $q = new postgres_sql();
    $Selectore = $q->fieldSelectore();
    $stylelegend = "style='vertical-align:top;font-size:18px;padding-top:5px' nowrap";
    $html = "<div style='width:98%;margin-bottom:20px' class=form>\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td {$stylelegend} class=legend>{from_date}:</td>\n\t\t<td style='vertical-align:top;font-size:18px'>" . field_date("from-date-{$t}", $_SESSION["SQUID_STATS_DATE1"], ";font-size:18px;width:160px", $Selectore) . "\n\t\t&nbsp;" . Field_text("from-time-{$t}", $_SESSION["SQUID_STATS_TIME1"], ";font-size:18px;width:82px") . "</td>\n\t\t\n\t</tr>\n\t\t<td {$stylelegend} class=legend>{to_date}:</td>\n\t\t<td style='vertical-align:top;font-size:18px'>" . field_date("to-date-{$t}", $_SESSION["SQUID_STATS_DATE2"], ";font-size:18px;width:160px", $Selectore) . "\n\t\t&nbsp;" . Field_text("to-time-{$t}", $_SESSION["SQUID_STATS_TIME2"], ";font-size:18px;width:82px") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td {$stylelegend} class=legend>{interval}:</td>\n\t\t<td style='vertical-align:top;font-size:18px;'>" . Field_array_Hash($per, "interval-{$t}", "10m", "blur()", null, 0, "font-size:18px;") . "</td>\n\t</tr>\t\n\t\t\t\t\n\t\t\t\t\n\t<tr>\n\t\t<td {$stylelegend} class=legend>{member}:</td>\n\t\t<td style='vertical-align:top;font-size:18px;'>" . Field_text("members-search-{$t}", "*", "font-size:18px;") . "</td>\n\t</tr>\t\t\t\t\n\t<tr style='height:50px'>\t\n\t\t<td style='vertical-align:top;font-size:18px;' colspan=2 align='right'>" . button("{generate_statistics}", "Run{$t}()", 22) . "</td>\n\t</tr>\n\t</table>\n\t</div>\n<script>\nfunction Run{$t}(){\n\tvar date1=document.getElementById('from-date-{$t}').value;\n\tvar time1=document.getElementById('from-time-{$t}').value;\n\tvar date2=document.getElementById('to-date-{$t}').value\n\tvar time2=document.getElementById('to-time-{$t}').value;\n\tvar user='';\n\tvar interval=document.getElementById('interval-{$t}').value;\n\tvar searchuser=encodeURIComponent(document.getElementById('members-search-{$t}').value);\n\tvar categories='';\n\tLoadjs('{$page}?query-js=yes&t={$t}&container=graph-{$t}&categories='+categories+'&searchuser='******'&date1='+date1+'&time1='+time1+'&date2='+date2+'&time2='+time2+'&interval='+interval+'&user='+user);\n\n}\n</script>\n";
    echo $tpl->_ENGINE_parse_body($html);
}