function master_table(){ $q=new mysql_squid_builder(); $tpl=new templates(); $page=CurrentPageName(); $hour=$_GET["hour"]; if(!is_numeric($_GET["hour"])){echo "<H1> NO Hour set</H1>";die();} if(strlen($hour)==1){$hour="0$hour";} $MasterTitle=$q->DAY_TITLE_FROM_TABLENAME($_GET["table"])." <span style='font-size:18px;color:#CF1717;'>«{$hour}h00»</span>"; $id=md5($_GET["table"].$_GET["hour"]); $html=" <div style='font-size:16px;font-weight:bold;width:100%;border-bottom:2px solid #CCCCCC;margin-bottom:8px'>$MasterTitle</div> <div id='master-$id'> <table style='width:100%'> <tbody> <tr> <td width='33.33%' valign='top'><div id='panel-left-$id'></div></td> <td width='33.33%' valign='top'><div id='panel-middle-$id'></div></td> <td width='33.33%' valign='top'><div id='panel-right-$id'></div></td> </tr> </tbody> </table> </div> <script> LoadAjax('panel-left-$id','$page?panel-categories=yes&time={$_GET["time"]}&hour={$_GET["hour"]}&table={$_GET["table"]}'); </script> "; echo $tpl->_ENGINE_parse_body($html); }
function master_table() { $q = new mysql_squid_builder(); $tpl = new templates(); $page = CurrentPageName(); if ($_GET["table"] == null) { $_GET["table"] = date('Ymd', strtotime($_GET["day"])) . "_hour"; } $MasterTitle = $q->DAY_TITLE_FROM_TABLENAME($_GET["table"]); $id = md5($_GET["table"]); $t = time(); $html = "\n\t<div style='font-size:16px;font-weight:bold;width:100%;border-bottom:2px solid #CCCCCC;margin-bottom:8px'>{$MasterTitle}</div>\n\t<div id='master-{$t}'>\n\t<table style='width:100%'>\n\t<tbody>\n\t<tr>\n\t\t<td width='33.33%' valign='top'><div id='panel-left-{$id}'></div></td>\n\t\t<td width='33.33%' valign='top'><div id='panel-middle-{$id}'></div></td>\n\t\t<td width='33.33%' valign='top'><div id='panel-right-{$id}'></div></td>\n\t</tr>\n\t</tbody>\n\t</table>\n\t</div>\n\t<script>\n\t\tLoadAjax('panel-left-{$id}','{$page}?panel-categories-day=yes&table={$_GET["table"]}');\n\t\t\n\t\tfunction ChangeWeekPanel(){\n\t\t\t\$('master-{$t}').remove();\t\n\t\t\t//var sdate=document.getElementById('table-query').value;\n\t\t\tLoadAjax('panel-start-point','{$page}?master=yes&table='+sdate);\n\t\t}\n\t</script>\n\t"; echo $tpl->_ENGINE_parse_body($html); }
function sitenames() { $page = CurrentPageName(); $tpl = new templates(); $field = $_GET["field"]; $value = $_GET["value"]; $MyTableMonth = date("Ym") . "_day"; $MyMonthText = date("{F}"); $q = new mysql_squid_builder(); $tableQuery = $_GET["table"]; if (isset($_GET["table"])) { $MyTableMonth = $_GET["table"]; } if (!$q->TABLE_EXISTS($MyTableMonth)) { echo FATAL_ERROR_SHOW_128("«{$MyTableMonth}» {table_does_not_exists}"); return; } if (preg_match("#_week#", $_GET["table"])) { $title_add = "»" . $tpl->_ENGINE_parse_body($q->WEEK_TITLE_FROM_TABLENAME($_GET["table"])); } if (preg_match("#_day\$#", $_GET["table"])) { $title_add = "»" . $tpl->_ENGINE_parse_body($q->MONTH_TITLE_FROM_TABLENAME($_GET["table"])); } if (preg_match("#_hour\$#", $_GET["table"])) { $title_add = "»" . $tpl->_ENGINE_parse_body($q->DAY_TITLE_FROM_TABLENAME($_GET["table"])); } if ($field == "ipaddr") { $field = "client"; } $title = $tpl->_ENGINE_parse_body("{where} ? »»{{$field}}::{$value} {$title_add}"); $t = time(); $sitename = $tpl->_ENGINE_parse_body("{sitename}"); $category = $tpl->_ENGINE_parse_body("{category}"); $hits = $tpl->_ENGINE_parse_body("{hits}"); $size = $tpl->_ENGINE_parse_body("{size}"); $sitename = $tpl->_ENGINE_parse_body("{sitename}"); $ipaddr = $tpl->_ENGINE_parse_body("{ipaddr}"); $members = $tpl->_ENGINE_parse_body("{members}"); $hostname = $tpl->_ENGINE_parse_body("{hostname}"); $mac = $tpl->_ENGINE_parse_body("{MAC}"); $week = $tpl->_ENGINE_parse_body("{week}"); $month = $tpl->_ENGINE_parse_body("{month}"); $TB_WIDTH = 550; $t = time(); $buttons = "\n\tbuttons : [\n\t{name: '<b>{$day}</b>', bclass: 'Calendar', onpress : ChangeDay{$t}},\n\t{name: '<b>{$week}</b>', bclass: 'Calendar', onpress : ChangeWeek{$t}},\n\t{name: '<b>{$month}</b>', bclass: 'Calendar', onpress : ChangeMonth{$t}},\n\t\n\t\t],"; $buttons = null; $html = "\n\t<table class='{$t}' style='display: none' id='{$t}' style='width:99%'></table>\n\n<script>\n\n\$(document).ready(function(){\n\$('#{$t}').flexigrid({\n\turl: '{$page}?sitenames-items=yes&field={$field}&value={$value}&table={$_GET["table"]}&familysite={$_GET["familysite"]}',\n\tdataType: 'json',\n\tcolModel : [\n\t\t{display: '{$sitename}', name : 'sitename', width : 181, sortable : true, align: 'left'},\n\t\t{display: '{$category}', name : 'category', width : 245, sortable : true, align: 'left'},\n\t\t{display: '{$size}', name : 'size', width : 109, sortable : true, align: 'left'},\n\t\t{display: '{$hits}', name : 'hits', width : 94, sortable : true, align: 'left'},\n\n\t\t\n\t\t\n\t],{$buttons}\n\tsearchitems : [\n\t\t{display: '{$sitename}', name : 'sitename'},\n\t\t{display: '{$category}', name : 'category'},\n\t\t],\n\tsortname: 'size',\n\tsortorder: 'desc',\n\tusepager: true,\n\ttitle: '{$title}',\n\tuseRp: true,\n\trp: 15,\n\tshowTableToggleBtn: false,\n\twidth: 700,\n\theight: 450,\n\tsingleSelect: true\n\t\n\t});\n});\n</script>"; echo $tpl->_ENGINE_parse_body($html); }
function what_popup() { $q = new mysql_squid_builder(); $tpl = new templates(); $tableQuery = $_GET["table"]; $tpl = new templates(); $page = 1; $FORCE_FILTER = null; $total = 0; $field = $_GET["field"]; $value = $_GET["value"]; if (preg_match("#quotamonth#", $tableQuery)) { $xtime = $q->TIME_FROM_QUOTAMONTH_TABLE($tableQuery); $tableQuery = date("Ym", $xtime) . "_day"; } if ($tableQuery == null) { $MyTableMonth = date("Ym") . "_day"; $tableQuery = $MyTableMonth; } if (preg_match("#_week#", $_GET["table"])) { $title_add = "»" . $tpl->_ENGINE_parse_body($q->WEEK_TITLE_FROM_TABLENAME($_GET["table"])); } if (preg_match("#_day\$#", $_GET["table"])) { $title_add = "»" . $tpl->_ENGINE_parse_body($q->MONTH_TITLE_FROM_TABLENAME($_GET["table"])); } if (preg_match("#_hour\$#", $_GET["table"])) { $title_add = "»" . $tpl->_ENGINE_parse_body($q->DAY_TITLE_FROM_TABLENAME($_GET["table"])); } if ($_GET["field"] == "ipaddr") { $_GET["field"] = "client"; } $sql = "SELECT familysite,{$_GET["field"]},SUM(hits) as hits,category FROM {$tableQuery}\n\tWHERE {$_GET["field"]}='{$_GET["value"]}' GROUP BY familysite,{$_GET["field"]} ORDER BY hits DESC LIMIT 0,10"; $results = $q->QUERY_SQL($sql); if (!$q->ok) { echo $q->mysql_error_html(); } if ($GLOBALS["VERBOSE"]) { echo mysql_num_rows($results) . " entries <br>"; } while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) { if (strpos($ligne["category"], ",") > 0) { $tp = explode(",", $ligne["category"]); while (list($index, $cat) = each($tp)) { if (isset($valsz[$cat])) { continue; } $valsz[$cat] = $ligne["hits"]; } continue; } $valsz[$cat] = $ligne["hits"]; } while (list($cat, $count) = each($valsz)) { $xdata[] = $count; $ydata[] = $cat; } $targetedfilePie = "ressources/logs/" . basename(__FILE__) . "." . __FUNCTION__ . "." . md5($sql) . ".pie.png"; $gp = new artica_graphs($targetedfilePie); $gp->xdata = $xdata; $gp->ydata = $ydata; $gp->width = 750; $gp->height = 550; $gp->ViewValues = true; $gp->x_title = $tpl->_ENGINE_parse_body("{what} ? {$MyMonthText}"); $gp->pie(); if (!is_file($targetedfilePie)) { $html = "<center>{$targetedfilePie} no such file</center>"; writelogs("Fatal \"{$targetedfilePie}\" no such file!", __FUNCTION__, __FILE__, __LINE__); } else { $html = $html . "\n\t\t<center>\n\t\t\t<div style='width:99%' class=form>\n\t\t\t\t<div style='font-size:18px;margin:8px'>«{$value}» {what} {$title_add}</div>\n\t\t\t\t<img src='{$targetedfilePie}'>\n\t\t\t</div>\n\t\t\t\n\t\t\t\n\t\t</center>\n\t\t\n\t\t"; } echo $tpl->_ENGINE_parse_body($html); }