function page() { //dashboard_user_day $page = CurrentPageName(); $tpl = new templates(); $q = new mysql_squid_builder(); $html = "<div style='width:1490'>\n\t<div style='float:right'>" . imgtootltip("refresh-32.png", "{refresh}", "LoadAjaxRound('squid-top-stats','squid.statistics.top.php');") . "</div>\n\t<div style='font-size:30px'>{top_web}: " . DATE_START() . "</div>\n\t"; if ($q->COUNT_ROWS("dashboard_countwebsite_day") > 1) { $tr[] = "\n\t\t<tr>\n\t\t\t<td style='width:100%'>\n\t\t\t\t<div style='width:745;height:700px' id='top-web-site-size'></div>\n\t\t\t</td>\t\t\n\t\t\t<td style='width:100%'>\n\t\t\t\t<div style='width:745;height:700px' id='top-web-site-hits'></div>\n\t\t\t</td>\t\n\t\t</tr>\n\t\t"; $js[] = "Loadjs('{$page}?top-web-site-size=yes');"; $js[] = "Loadjs('{$page}?top-web-site-hits=yes');"; } if ($q->COUNT_ROWS("dashboard_user_day") > 1) { $tr[] = "\n\t\t<tr>\n\t\t\t<td colspan=2><hr></td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td style='width:100%'>\n\t\t\t\t<div style='width:745;height:700px' id='top-web-user-size'></div>\n\t\t\t</td>\n\t\t\t<td style='width:100%'>\n\t\t\t\t<div style='width:745;height:700px' id='top-web-user-hits'></div>\n\t\t\t</td>\n\t\t</tr>\n\t\t"; $js[] = "Loadjs('{$page}?top-web-user-size=yes');"; $js[] = "Loadjs('{$page}?top-web-user-hits=yes');"; } if ($q->COUNT_ROWS("dashboard_blocked_day") > 1) { $tr[] = "\n\t\t<tr>\n\t\t\t<td colspan=2><hr></td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td style='width:100%'>\n\t\t\t\t<div style='width:745;height:700px' id='top-web-blocked-site'></div>\n\t\t\t</td>\n\t\t\t<td style='width:100%'>\n\t\t\t\t<div style='width:745;height:700px' id='top-web-blocked-category'></div>\n\t\t\t</td>\n\t\t</tr>\n\t\t"; $js[] = "Loadjs('{$page}?top-web-blocked-site=yes');"; $js[] = "Loadjs('{$page}?top-web-blocked-category=yes');"; } $html = $html . "<table style='width:100%'>" . @implode("\n", $tr) . "</table></div>\n\t<script>\t\t\n\t\t\t\n\t" . @implode("\n", $js) . "</script>"; echo $tpl->_ENGINE_parse_body($html); }
function page() { $page = CurrentPageName(); $tpl = new templates(); $sock = new sockets(); $SquidPerformance = intval($sock->GET_INFO("SquidPerformance")); if ($SquidPerformance > 2) { echo $tpl->_ENGINE_parse_body(FATAL_ERROR_SHOW_128("{artica_statistics_disabled}")); return; } $t = time(); $events = $tpl->_ENGINE_parse_body("{events}"); $zdate = $tpl->_ENGINE_parse_body("{hour}"); $proto = $tpl->_ENGINE_parse_body("{proto}"); $uri = $tpl->_ENGINE_parse_body("{website}"); $member = $tpl->_ENGINE_parse_body("{member}"); if (function_exists("date_default_timezone_get")) { $timezone = " - " . date_default_timezone_get(); } $title = $tpl->_ENGINE_parse_body("{today}: {realtime_requests}"); $zoom = $tpl->_ENGINE_parse_body("{zoom}"); $button1 = "{name: 'Zoom', bclass: 'Search', onpress : ZoomSquidAccessLogs},"; $stopRefresh = $tpl->javascript_parse_text("{stop_refresh}"); $logs_container = $tpl->javascript_parse_text("{logs_container}"); $refresh = $tpl->javascript_parse_text("{refresh}"); $items = $tpl->_ENGINE_parse_body("{items}"); $size = $tpl->_ENGINE_parse_body("{size}"); $date = $tpl->_ENGINE_parse_body("{zDate}"); $run = $tpl->_ENGINE_parse_body("{run}"); $task = $tpl->_ENGINE_parse_body("{task}"); $size = $tpl->_ENGINE_parse_body("{size}"); $filename = $tpl->_ENGINE_parse_body("{filename}"); $graph = $tpl->_ENGINE_parse_body("{graph}"); $sitename = $tpl->javascript_parse_text("{sitename}"); $hits = $tpl->javascript_parse_text("{hits}"); $MAC = $tpl->_ENGINE_parse_body("{MAC}"); $members = $tpl->_ENGINE_parse_body("{members}"); $category = $tpl->_ENGINE_parse_body("{category}"); $q = new mysql_squid_builder(); $title = $tpl->_ENGINE_parse_body("{websites}:" . DATE_START()); $html = "\n<table class='SQUID_ALLWEBSITES_TABLE' style='display: none' id='SQUID_ALLWEBSITES_TABLE' style='width:99%'></table>\n<script>\n\tfunction StartLogsSquidTable{$t}(){\n\t\$('#SQUID_ALLWEBSITES_TABLE').flexigrid({\n\turl: '{$page}?events-list=yes',\n\tdataType: 'json',\n\tcolModel : [\n\t{display: '<span style=font-size:18px>{$uri}</span>', name : 'FAMILYSITE', width : 414, sortable : false, align: 'left'},\n\t{display: '<span style=font-size:18px>{$size}</span>', name : 'SIZE', width : 110, sortable : true, align: 'right'},\n\t{display: '<span style=font-size:18px>{$hits}</span>', name : 'RQS', width : 110, sortable : true, align: 'right'},\n\t{display: '<span style=font-size:18px>{$members}</span>', name : 'members', width : 110, sortable : false, align: 'center'},\n\t{display: '<span style=font-size:18px>{$graph}</span>', name : 'graph', width : 110, sortable : false, align: 'center'},\n\t],\n\t\t\n\n\tsearchitems : [\n\t{display: '{$sitename}', name : 'FAMILYSITE'},\n\t],\n\tsortname: 'SIZE',\n\tsortorder: 'DESC',\n\tusepager: true,\n\ttitle: '<span style=\"font-size:26px\">{$title}</span>',\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]\n\n});\n\n}\nsetTimeout('StartLogsSquidTable{$t}()',800);\n\n</script>\n"; echo $html; }
function table() { $t = time(); $page = CurrentPageName(); $tpl = new templates(); $users = new usersMenus(); $sock = new sockets(); $t = time(); $members = $tpl->_ENGINE_parse_body("{members}"); $add_member = $tpl->_ENGINE_parse_body("{add_member}"); $delete = $tpl->javascript_parse_text("{delete}"); $aliases = $tpl->javascript_parse_text("{aliases}"); $about2 = $tpl->_ENGINE_parse_body("{about2}"); $new_report = $tpl->javascript_parse_text("{new_report}"); $report = $tpl->javascript_parse_text("{report}"); $title = $tpl->javascript_parse_text("{current_members}") . " " . DATE_START(); $progress = $tpl->javascript_parse_text("{progress}"); $size = $tpl->javascript_parse_text("{size}"); $hits = $tpl->javascript_parse_text("{hits}"); $computers = $tpl->javascript_parse_text("{computers}"); $my_proxy_aliases = $tpl->javascript_parse_text("{my_proxy_aliases}"); $q = new mysql_squid_builder(); $graph = $tpl->javascript_parse_text("{graph}"); //current_members $t = time(); $buttons = "\n\tbuttons : [\n\t\t{name: '<strong style=font-size:22px>{$my_proxy_aliases}</strong>', bclass: 'link', onpress : GoToProxyAliases{$t}},\n\t\t{name: '<strong style=font-size:22px>{$computers}</strong>', bclass: 'link', onpress : GotoNetworkBrowseComputers{$t}},\n\t],"; $html = "\n\t<table class='SQUID_MYSQL_MEMBERS' style='display: none' id='SQUID_MYSQL_MEMBERS' style='width:100%'></table>\n\t<script>\n\t\$(document).ready(function(){\n\t\$('#SQUID_MYSQL_MEMBERS').flexigrid({\n\turl: '{$page}?search=yes&ID={$_GET["ID"]}',\n\tdataType: 'json',\n\tcolModel : [\n\t{display: '<strong style=font-size:18px>{$members}</strong>', name : 'USER', width : 418, sortable : true, align: 'left'},\n\t{display: '<strong style=font-size:18px>{$hits}</strong>', name : 'RQS', width : 228, sortable : true, align: 'right'},\n\t{display: '<strong style=font-size:18px>{$size}</strong>', name : 'SIZE', width : 228, sortable : true, align: 'right'},\n\t{display: '<strong style=font-size:18px>GRAPH</strong>', name : 'GRAPH', width : 70, sortable : false, align: 'center'},\n\t{display: '<strong style=font-size:18px>GRAPH</strong>', name : 'GRAPH', width : 70, sortable : false, align: 'center'},\n\t],\n\t{$buttons}\n\tsearchitems : [\n\t{display: '{$members}', name : 'USER'},\n\t\n\t],\n\tsortname: 'SIZE',\n\tsortorder: 'desc',\n\tusepager: true,\n\ttitle: '<span style=font-size:30px>{$title}</span>',\n\tuseRp: true,\n\trp: 50,\n\tshowTableToggleBtn: false,\n\twidth: '99%',\n\theight: '500',\n\tsingleSelect: true,\n\trpOptions: [10, 20, 30, 50,100,200]\n\n});\n});\n\n\nfunction NewReport{$t}(){\n\tLoadjs('squid.browse-users.php?callback=Addcategory{$t}');\n}\n\nfunction GoToProxyAliases{$t}(){\n\tGoToProxyAliases();\n}\n\nfunction GotoNetworkBrowseComputers{$t}(){\n\tGotoNetworkBrowseComputers();\n}\n\nvar xAddcategory{$t}=function (obj) {\n\tvar results=obj.responseText;\n\tif(results.length>0){alert(results);}\n\t\$('#SQUID_MAIN_REPORTS').flexReload();\n\t\$('#SQUID_MAIN_REPORTS_USERZ').flexReload();\n}\n\nfunction Addcategory{$t}(field,value){\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('ID','{$_GET["ID"]}');\n\tXHR.appendData('field',field);\n\tXHR.appendData('value',value);\n\tXHR.sendAndLoad('{$page}', 'POST',xAddcategory{$t});\n}\n</script>\n\t"; echo $tpl->_ENGINE_parse_body($html); }
function proxy_graph3_js() { $sock = new sockets(); $SquidPerformance = intval($sock->GET_INFO("SquidPerformance")); if ($SquidPerformance > 2) { header("content-type: application/x-javascript"); die; } $MAIN = unserialize(@file_get_contents("{$GLOBALS["BASEDIR"]}/MEMBERS_GRAPH")); $tpl = new templates(); $title = "{members} " . DATE_START(); $timetext = "{hours}"; $highcharts = new highcharts(); $highcharts->container = "graph3-dashboard"; $highcharts->xAxis = $MAIN["xdata"]; $highcharts->Title = $title; $highcharts->TitleFontSize = "22px"; $highcharts->AxisFontsize = "12px"; $highcharts->yAxisTtitle = " Users"; $highcharts->xAxis_labels = false; $highcharts->LegendPrefix = null; $highcharts->LegendSuffix = "{requests}"; $highcharts->xAxisTtitle = $timetext; $highcharts->datas = array("{members}" => $MAIN["ydata"]); echo $highcharts->BuildChart(); }
function page() { $page = CurrentPageName(); $tpl = new templates(); $sock = new sockets(); $SquidPerformance = intval($sock->GET_INFO("SquidPerformance")); if ($SquidPerformance > 2) { echo $tpl->_ENGINE_parse_body(FATAL_ERROR_SHOW_128("{artica_statistics_disabled}")); return; } $t = time(); $events = $tpl->_ENGINE_parse_body("{events}"); $zdate = $tpl->_ENGINE_parse_body("{hour}"); $proto = $tpl->_ENGINE_parse_body("{proto}"); $uri = $tpl->_ENGINE_parse_body("{website}"); $member = $tpl->_ENGINE_parse_body("{member}"); if (function_exists("date_default_timezone_get")) { $timezone = " - " . date_default_timezone_get(); } $title = $tpl->_ENGINE_parse_body("{today}: {realtime_requests}"); $zoom = $tpl->_ENGINE_parse_body("{zoom}"); $button1 = "{name: 'Zoom', bclass: 'Search', onpress : ZoomSquidAccessLogs},"; $stopRefresh = $tpl->javascript_parse_text("{stop_refresh}"); $logs_container = $tpl->javascript_parse_text("{logs_container}"); $refresh = $tpl->javascript_parse_text("{refresh}"); $items = $tpl->_ENGINE_parse_body("{items}"); $size = $tpl->_ENGINE_parse_body("{size}"); $SaveToDisk = $tpl->_ENGINE_parse_body("{SaveToDisk}"); $addCat = $tpl->_ENGINE_parse_body("{add} {category}"); $date = $tpl->_ENGINE_parse_body("{zDate}"); $task = $tpl->_ENGINE_parse_body("{task}"); $new_schedule = $tpl->_ENGINE_parse_body("{new_rotate}"); $explain = $tpl->_ENGINE_parse_body("{explain_squid_tasks}"); $run = $tpl->_ENGINE_parse_body("{run}"); $task = $tpl->_ENGINE_parse_body("{task}"); $size = $tpl->_ENGINE_parse_body("{size}"); $filename = $tpl->_ENGINE_parse_body("{filename}"); $empty = $tpl->_ENGINE_parse_body("{empty}"); $askdelete = $tpl->javascript_parse_text("{empty_store} ?"); $files = $tpl->_ENGINE_parse_body("{files}"); $ext = $tpl->_ENGINE_parse_body("{extension}"); $back_to_events = $tpl->_ENGINE_parse_body("{back_to_events}"); $Compressedsize = $tpl->_ENGINE_parse_body("{compressed_size}"); $realsize = $tpl->_ENGINE_parse_body("{realsize}"); $delete_file = $tpl->javascript_parse_text("{delete_file}"); $rotate_logs = $tpl->javascript_parse_text("{rotate_logs}"); $hits = $tpl->javascript_parse_text("{hits}"); $MAC = $tpl->_ENGINE_parse_body("{MAC}"); $members = $tpl->_ENGINE_parse_body("{members}"); $category = $tpl->_ENGINE_parse_body("{category}"); $table_size = 855; $url_row = 505; $member_row = 276; $table_height = 420; $distance_width = 230; $tableprc = "100%"; $margin = "-10"; $margin_left = "-15"; if (is_numeric($_GET["table-size"])) { $table_size = $_GET["table-size"]; } if (is_numeric($_GET["url-row"])) { $url_row = $_GET["url-row"]; } $q = new mysql_squid_builder(); $title = $tpl->_ENGINE_parse_body(DATE_START()); $ipaddr = $tpl->javascript_parse_text("{ipaddr}"); $error = $tpl->javascript_parse_text("{error}"); $sitename = $tpl->javascript_parse_text("{sitename}"); $button3 = "{name: '<strong style=font-size:18px>{$refresh}</strong>', bclass: 'Reload', onpress : SquidRotate{$t}},"; $html = "\n\t<div id='SQUID_INFLUDB_TABLE_DIV'>\n\t<table class='SQUID_INFLUDB_TABLE' style='display: none' id='SQUID_INFLUDB_TABLE' style='width:{$tableprc}'></table>\n\t</div>\n\t<script>\n\tvar mem{$t}='';\n\tfunction StartLogsSquidTable{$t}(){\n\t\$('#SQUID_INFLUDB_TABLE').flexigrid({\n\turl: '{$page}?events-list=yes',\n\tdataType: 'json',\n\tcolModel : [\n\t{display: '<span style=font-size:18px>{$zdate}</span>', name : 'TIME', width :160, sortable : true, align: 'left'},\n\t{display: '<span style=font-size:18px>{$members}</span>', name : 'USERID', width : 390, sortable : false, align: 'left'},\n\t{display: '<span style=font-size:18px>{$uri}</span>', name : 'FAMILYSITE', width : 414, sortable : false, align: 'left'},\n\t{display: '<span style=font-size:18px>{$category}</span>', name : 'CATEGORY', width : 185, sortable : false, align: 'left'},\n\t{display: '<span style=font-size:18px>{$size}</span>', name : 'SIZE', width : 110, sortable : true, align: 'right'},\n\t{display: '<span style=font-size:18px>{$hits}</span>', name : 'RQS', width : 110, sortable : true, align: 'right'},\n\t\n\t],\n\tbuttons : [\n\t{$button3}\n\t],\t\t\n\n\tsearchitems : [\n\t{display: '{$sitename}', name : 'FAMILYSITE'},\n\t{display: '{$category}', name : 'CATEGORY'},\n\t{display: '{$member}', name : 'USERID'},\n\t{display: '{$ipaddr}', name : 'IPADDR'},\n\t{display: '{$MAC}', name : 'MAC'},\n\t],\n\tsortname: 'TIME',\n\tsortorder: 'DESC',\n\tusepager: true,\n\ttitle: '<span style=\"font-size:26px\">{$title}</span>',\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]\n\n});\n\nif(document.getElementById('SQUID_ACCESS_LOGS_DIV')){\n\tdocument.getElementById('SQUID_ACCESS_LOGS_DIV').innerHTML='';\n}\n}\nsetTimeout('StartLogsSquidTable{$t}()',800);\n\nfunction SquidRotate{$t}(){\n\tLoadjs('squid.influx.log.progress.php');\n}\n\n</script>\n"; echo $html; }
function graph1() { $tpl = new templates(); $sock = new sockets(); $UpdateUtilityWebServername = $sock->GET_INFO("UpdateUtilityWebServername"); $q = new mysql_squid_builder(); $sql = "SELECT SUM(SIZE) as SIZE,TIME FROM dashboard_apache_sizes WHERE SITENAME='{$UpdateUtilityWebServername}' GROUP BY TIME ORDER BY TIME;"; $results = $q->QUERY_SQL($sql); while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) { $SIZE = $ligne["SIZE"] / 1024; $SIZE = $SIZE / 1024; $xdata[] = $ligne["TIME"]; $ydata[] = round($SIZE, 2); } $title = "{downloaded_flow} (MB) " . DATE_START(); $timetext = "{hours}"; $highcharts = new highcharts(); $highcharts->container = "freewebs-{$_GET["t"]}"; $highcharts->xAxis = $xdata; $highcharts->Title = $title; $highcharts->TitleFontSize = "22px"; $highcharts->AxisFontsize = "12px"; $highcharts->yAxisTtitle = "MB"; $highcharts->xAxis_labels = false; $highcharts->LegendPrefix = $tpl->javascript_parse_text('{date}: '); $highcharts->LegendSuffix = "MB"; $highcharts->xAxisTtitle = $timetext; $highcharts->datas = array("{size}" => $ydata); echo $highcharts->BuildChart(); }