<h2> </h2>
<?php

$count=10;
if (isset($_GET['lim'])) $lim=preg_replace("/[^0-9]/i","",$_GET['lim']); else $lim=0;
if (isset($_GET['ord'])) $ord=preg_replace("/[^0-9]/i","",$_GET['ord']); else $ord='edtime';
$scount=mysql_num_rows(mysql_query("select * from styles"));
$sql=mysql_query("select * from styles order by `$ord` limit $lim,$count");
echo " ",$scount,"<br>";
if ($scount>$count) {
	echo " :";
	for ($i=0;$i<$scount;$i+=10) echo "<a href=index.php?page=styles&lim=$i>",$i/10+1,"</a> ";
}
echo "<table border=1 width=100%><tr align=center><td width=5%>ID</td><td width=25%></td><td width=25%></td><td width=5%></td><td width=15%> .</td><td width=15%> .</td><td colspan=2 width=10%></td></tr>";
	for ($i=0;$i<($scount<10?$scount:10);$i++)
		if ($line=mysql_fetch_array($sql,MYSQL_ASSOC)) {
			echo "<tr align=center><td>$line[id]</td><td>$line[name]</td><td>$line[link]</td><td>$line[used]</td><td>",date("d.m H:i",$line['edtime']),"</td><td>$line[edfrom]</td>";
			if ($line['edfrom']!='System') echo "<td width=15 height=15><a href='index.php?page=edstyles&sform=edit&styleid=$line[id]' title='edit menu #$line[id]'><img src='img/edit.gif' width=15 height=15 alt=e></a></td>
			<td width=15 height=15><a href='index.php?page=edstyles&apl=del&styleid=$line[id]' title='delete menu #$line[id]'><img src='img/delete.gif' width=15 height=15 alt=d></a></td></tr>";
			else echo "
			<td width=15 height=15><img src='img/editdenied.gif' width=15 height=15 alt=e></td>
			<td width=15 height=15><img src='img/deletedenied.gif' width=15 height=15 alt=d></td>";
		}
echo "</table><input type=button value=' ' onClick=location.href='index.php?page=edstyles&sform=new'>";