<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='id';
if ($mcount=mysql_num_rows(mysql_query("select * from users"))) {
	$sql=mysql_query("select * from users 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=users&lim=$i>",$i/10,"</a> ";
	}
	echo "<table border=1 width=100%><tr align=center><td width=5%>ID</td><td width=35%></td><td width=45%> </td><td width=5%></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[login]</td><td>";if ($line['hdmail']) echo "[HIDDEN]";else echo $line['email'];echo "</td><td>$line[lvl]</td>";
				if ($_SESSION['lvl']>=3 || $_SESSION['login']==$line['login']) echo "
					<td width=15 height=15><a href='index.php?page=edusr&userid=$line[id]' title='edit profile #$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=dlusr&userid=$line[id]' title='delete user #$line[id]'><img src='img/delete.gif' width=15 height=15 alt=d></a></td>";
				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 "</tr>";
		}
		echo "</table><br>";
} else echo " !<br>";
?>
