File size: 3.13Kb
<?
error_reporting(0);include "config.php";include "head.php";if ($accept=="on"){echo '<b>Список пользователей</b><br/>';include "infa.php";$num_sep =$messages;$preview="users.dat";$preview = file($preview);$count = count($preview);$num_page=1;if (isset($HTTP_GET_VARS['page'])){if (($HTTP_GET_VARS['page']>0) and ($HTTP_GET_VARS['page']<=ceil($count/$num_sep))) $num_page=$HTTP_GET_VARS['page'];}for ( $i=($num_page-1)*$num_sep; $i<=(($num_page*$num_sep<$count) ? $num_page*$num_sep-1: $count-1); $i++) {$vm = file("users.dat");$vm = explode("||", $vm[$i]);$usf=file("users/$vm[0].$antihack.dat");$usnumb=trim($usf[0]);$user=trim($usf[1]);$uspass=trim($usf[2]);$statusus=trim($usf[3]);$timereg=trim($usf[4]);echo '</center>
ID: <font color="'.$mtcolor.'">'.$usnumb.'</font><br/>Имя: <font color="'.$mtcolor.'">'.$user.'</font> ';if ($status=="admin"){if ($task=="edit"){echo '[<a href="deluser.php?usnumb='.$usnumb.'&str='.$i.'&pass='.$pass.'&rum='.$rum.'&n='.$n.'&task='.$task.'">x</a>]<br/>';}else{echo '<br/>';}}else{echo '<br/>';}if ($stus=="ban"){$st="Забанен";}if ($statusus=="user"){$st="Пользователь";}if ($statusus=="admin"){$st="Админ";}echo 'Статус: <font color="'.$mtcolor.'">'.$st.'</font><br/>Дата регистрации: <font color="'.$mtcolor.'">'.date("d.m.Y", $timereg-3600).'</font><center><font color="'.$dividercolor.'">* * *<br/></font>';}echo "Зарегистрованных: $count<br/>";echo "<center>";if ($count>$num_sep)
nav_page(ceil($count/$num_sep),(isset($HTTP_GET_VARS['page']) ? $HTTP_GET_VARS['page']: 1),"users.php?pass=$pass&n=$n&rum=$rum&task=$task&page=");echo "<a href=\"index.php?pass=$pass&n=$n&rum=$rum&task=$task\">Назад</a><br/>";}else{echo '<b>Привет!</b><br/></center><font color="'.$mtcolor.'">Это мини чат с регистрацией. Называется Light-Chat.</font><br/><center><a href="regs.php">Регистрация</a><br/><a href="auth.php">Авторизация</a><br/>';}echo $end;function nav_page($count,$num_page,$url){$page_nav=3;$begin_loop=1;$end_loop=$count;if ($num_page>$count or $num_page<1)$num_page=1; echo "Страницы: ";if ($num_page>$page_nav) {echo "<a href=\"$url".($page_nav*(floor($num_page/$page_nav)-($num_page%$page_nav==0 ? 1: 0)))."\">".($page_nav*(floor($num_page/$page_nav)-1-($num_page%$page_nav==0 ? 1: 0))+1)."-".($page_nav*(floor($num_page/$page_nav)-($num_page%$page_nav==0 ? 1: 0)))."</a>";
$begin_loop=$page_nav*(floor($num_page/$page_nav)-($num_page%$page_nav==0 ? 1: 0))+1;}if ($count>$page_nav*(floor($num_page/$page_nav)-($num_page%$page_nav==0 ? 1: 0)+1)){$end_loop=$page_nav*ceil($num_page/$page_nav);}for ($i = $begin_loop; $i <= $end_loop; $i++){if ($i==$num_page)echo " <b>$i</b>";else echo " <a href=\"$url$i\">$i</a>";}if ($count>$page_nav*(floor($num_page/$page_nav)-($num_page%$page_nav==0 ? 1: 0)+1)){echo " <a href=\"$url".($page_nav*ceil($num_page/$page_nav)+1)."\">".($page_nav*ceil($num_page/$page_nav)+1);if ($page_nav*ceil($num_page/$page_nav)+1<$count){echo "-".($count<=$page_nav*(ceil($num_page/$page_nav)+1) ? $count: $page_nav*(ceil($num_page/$page_nav)+1));}echo "</a>";}echo "<br/>";}
?>