<h2> </h2>
<?php
$count=10;// $count   
if (isset($_GET['lim'])) $lim=preg_replace("/[^0-9]/i","",$_GET['lim']);else $lim=0;
if (isset($_GET['ord'])) $ord=preg_replace("/[^a-z]/i","",$_GET['ord']);else $ord='edtime';

$mcount=mysql_num_rows(mysql_query("select * from menu"));
$sql=mysql_query("select * from menu order by `$ord` limit $lim,$count");
echo " ",$mcount,"<br>";
if ($mcount>$count) {
	echo " :";
	for ($i=0;$i<$mcount;$i+=10) echo "<a href=index.php?page=code&lim=$i>",$i/10+1,"</a> ";
}
echo "<table border=1 width=100%><tr align=center><td width=5%>ID</td><td width=35%></td><td width=35%></td><td width=5%></td><td width=10%></td><td colspan=2 width=10%></td></tr>";
	for ($i=0;$i<($mcount<10?$mcount: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[lvl]</td><td>$line[size]</td>
			<td width=15 height=15><a href='index.php?page=edcode&sform=edit&pageid=$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=edcode&apl=del&pageid=$line[id]' title='delete menu #$line[id]'><img src='img/delete.gif' width=15 height=15 alt=d></a></td></tr>";
echo "</table><input type=button value=' ' onClick=location.href='index.php?page=edcode&sform=new'>";