function left_status() { $page = CurrentPageName(); $tpl = new templates(); $q = new mysql_squid_builder(); $day = $_GET["day"]; $time = strtotime("{$day} 00:00:00"); $table = date("YW", $time) . "_week"; if ($q->TABLE_EXISTS($table)) { $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT COUNT(sitename) as tcount FROM `{$table}` WHERE LENGTH(category)=0")); $notcategorized = $ligne["tcount"]; if (!$q->ok) { $err1 = icon_mysql_error($q->mysql_error); } $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT COUNT(sitename) as tcount FROM `{$table}` WHERE LENGTH(category)>2")); $categorized = $ligne["tcount"]; if (!$q->ok) { $err2 = icon_mysql_error($q->mysql_error); } $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT COUNT(sitename) as tcount FROM `{$table}`")); $visited = $ligne["tcount"]; if (!$q->ok) { $err3 = icon_mysql_error($q->mysql_error); } $notcategorized = texthref($notcategorized, "Loadjs('squid.visited.php?week={$day}&onlyNot=yes')"); $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT COUNT(hostname) as tcount FROM \n\t\t(SELECT client,hostname,MAC,uid FROM {$table} GROUP BY client,hostname,MAC,uid) as t")); if (!$q->ok) { $err4 = icon_mysql_error($q->mysql_error); } $members = texthref($ligne["tcount"], "Loadjs('{$page}?members-query=yes&day={$day}&t=week')"); $html = "\n\t\t<table style='width:99%' class=form>\n\t\t<tbody>\n\t\t<tr>\n\t\t\t<td class=legend>{not_categorized}:</td>\n\t\t\t<td style='font-size:14px;font-weight:bold'>{$notcategorized}</td>\n\t\t\t<td width=1%>{$err1}</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend>{categorized}:</td>\n\t\t\t<td style='font-size:14px;font-weight:bold'>{$categorized}</td>\n\t\t\t<td width=1%>{$err2}</td>\n\t\t</tr>\t\n\t\t<tr>\n\t\t\t<td class=legend>{visited}:</td>\n\t\t\t<td style='font-size:14px;font-weight:bold'>{$visited}</td>\n\t\t\t<td width=1%>{$err3}</td>\n\t\t</tr>\t\n\t\t<tr>\n\t\t\t<td class=legend>{members}:</td>\n\t\t\t<td style='font-size:14px;font-weight:bold'>{$members}</td>\n\t\t\t<td width=1%>{$err4}</td>\n\t\t</tr>\t\t\t\t\n\t\t</tbody>\n\t\t</table>\n\t\t"; } echo $tpl->_ENGINE_parse_body($html); }
function left_status(){ $page=CurrentPageName(); $tpl=new templates(); $q=new mysql_squid_builder(); $day=$_GET["day"]; $time=strtotime("$day 00:00:00"); $table=date("Ymd",$time)."_hour"; if($q->TABLE_EXISTS($table)){ $ligne=mysql_fetch_array($q->QUERY_SQL("SELECT COUNT(sitename) as tcount FROM `$table` WHERE LENGTH(category)=0")); $notcategorized=$ligne["tcount"]; if(!$q->ok){$err1=icon_mysql_error($q->mysql_error);} $ligne=mysql_fetch_array($q->QUERY_SQL("SELECT COUNT(sitename) as tcount FROM `$table` WHERE LENGTH(category)>2")); $categorized=$ligne["tcount"]; if(!$q->ok){$err2=icon_mysql_error($q->mysql_error);} $ligne=mysql_fetch_array($q->QUERY_SQL("SELECT COUNT(sitename) as tcount FROM `$table`")); $visited=$ligne["tcount"]; if(!$q->ok){$err3=icon_mysql_error($q->mysql_error);} $notcategorized=texthref($notcategorized, "Loadjs('squid.visited.php?day=$day&onlyNot=yes')"); $html=" <table style='width:97%' class=form> <tbody> <tr> <td class=legend>{not_categorized}:</td> <td style='font-size:14px;font-weight:bold'>$notcategorized</td> <td width=1%>$err1</td> </tr> <tr> <td class=legend>{categorized}:</td> <td style='font-size:14px;font-weight:bold'>$categorized</td> <td width=1%>$err2</td> </tr> <tr> <td class=legend>{visited}:</td> <td style='font-size:14px;font-weight:bold'>$visited</td> <td width=1%>$err2</td> </tr> </tbody> </table>"; } $html=$html."<table style='width:97%' class=form> <tbody> <tr> <td width=1%><img src='img/arrow-right-16.png'></td> <td style='font-size:14px;font-weight:bold'> <a href=\"javascript:blur();\" OnClick=\"javascript:Loadjs('squid.traffic.statistics.days.calendar.php');\" style='font-size:14px;font-weight:bold;text-decoration:underline'>{calendar}</a> </td> </tr> <tr> <td width=1%><img src='img/arrow-right-16.png'></td> <td style='font-size:14px;font-weight:bold'> <a href=\"javascript:blur();\" OnClick=\"javascript:Loadjs('squid.visited.php?recategorize-day-js={$_GET["day"]}');\" style='font-size:14px;font-weight:bold;text-decoration:underline'>{recategorize_schedule}</a> </td> </tr> <tr><td colspan=2><hr></td></tr> <tr> <td width=1%><img src='img/arrow-right-16.png'></td> <td style='font-size:14px;font-weight:bold'> <a href=\"javascript:blur();\" OnClick=\"javascript:Loadjs('squid.stats.repair.day.php?time=$time');\" style='font-size:14px;font-weight:bold;text-decoration:underline'>{rescan_database}</a> </td> </tr> </tbody> </table> "; echo $tpl->_ENGINE_parse_body($html); }