";
$res .= "
Show top 50 entries. List from the line: " .
"<<" .
" 0 " .
">> " .
" |
";
foreach($dump as $dm) {
if (!$dm[0] || !$dm[1]) continue;
# datetime
$dm[0] = date("d.m.Y H:i:s", strtotime($dm[0]));
$res .= "{$dm[0]} | ";
# col 1
$dm[1] = htmlentities($dm[1]);
$dm[1] = squidguard_html_autowrap($dm[1]);
$res .= "{$dm[1]} | ";
# for blocked rep
if (count($dm) > 2) {
$dm[2] = htmlentities($dm[2]);
$dm[2] = squidguard_html_autowrap($dm[2]);
$res .= "{$dm[2]} | ";
$res .= "{$dm[3]} | ";
}
$res .= "
";
}
$res .= "";
}
else $res = "{$dump}";
} else {
$res = "No data.";
}
$res = "el(\"reportarea\").innerHTML = \"{$res}\";";
return $res;
}
function squidguard_prepfor_JS($cont)
{
# replace for JS
$cont = str_replace("\n", "\\n", $cont);
$cont = str_replace("\r", "\\r", $cont);
$cont = str_replace("\t", "\\t", $cont);
$cont = str_replace("\"", "\'", $cont);
return $cont;
}
function squidguard_prep_textareacont($cont)
{
$cont = squidguard_prepfor_JS($cont);
return
"el('reportarea').innerHTML = \"
\";" .
"el('pconf').innerHTML = '$cont';";
}
function squidguard_html_autowrap($cont)
{
# split strings
$p = 0;
$pstep = 25;
$str = $cont;
$cont = '';
for ( $p = 0; $p < strlen($str); $p += $pstep ) {
$s = substr( $str, $p, $pstep );
if ( !$s ) break;
$cont .= $s . "";
}
return $cont;
}
# ------------------------------------------------------------------------------
# HTML Page
# ------------------------------------------------------------------------------
include("head.inc");
echo "\t\n";
?>