name,$hidden_columns))
{
array_push($cols,$tmp->name);
$i++;
}
else
{
$col_count--;
}
}
//get the selected cols
$selected_cols = implode(', ',$cols);
//get the sort string
$sort_string = getSortString($s,$cols);
//create the page links
$pagelinks="
.";
for($i=1;$i<=($count/100)+1;$i++)
{
if($p!=$i)
$pagelinks .=":
$i :";
else
$pagelinks .=": $i :";
}
$pagelinks.=".
";
//create the query
$query="SELECT $selected_cols FROM $gi ORDER BY $sort_string, timestamp ASC, name DESC LIMIT " . ($p-1)*100 . ', 100';
$result = mysql_query($query);
//start renderung html
$data = "
$pagelinks
\n";
//create the table header
$data.="# | ";
for($i=0;$i<$col_count;$i++)
{
$data.=''.$cols[$i].' (+/-) | ';
}
$data.="
";
$entry=($p-1)*100+1;
while ($dat = mysql_fetch_array($result)) {
//012345678901234567890
//YYYY-MM-DD HH:SS:mmhh
//2005-08-21 18:13:5121
if ($entry%2==0)
$style="b1";
else
$style="b2";
switch ($entry)
{
case 1:
$style="first";
break;
case 2:
$style="second";
break;
case 3:
$style="third";
break;
}
$t = trim($dat["timestamp"]);
$mydate = substr($t,11,8)." " . substr($t,8,2).".".substr($t,5,2)."." . substr($t,0,4);
$data .= ''.$entry.' | ';
for($i=0;$i<$col_count;$i++)
{
$data.=''.$dat[$cols[$i]].' | ';
}
$data.="
\n";
$entry++;
}
$data.="
$pagelinks
\n";
include("disconnect.php");
echo $data;
?>