View file users.php

File size: 2.67Kb
<?php

$m = "m";

if($_GET['pages']==$m)
{
include ("conf.php");
include ("lock.php");

if ($user == $myrow["user"] && $pass == $myrow["pass"])
{
include ("head.php");



$at_page=10;
$count=mysql_result(mysql_query("SELECT COUNT(`id`) FROM `userlist`"), 0);

$pages=ceil($count/$at_page);

$page=abs(intval(@$_REQUEST['page']));
if($page==0) $page=1;
define('PAGE', $page);
unset($page);

$from=(PAGE-1)*$at_page;
$result=mysql_query("SELECT * FROM userlist WHERE pol='Мужской' ORDER BY `id` DESC LIMIT $from, $at_page");
$myrow = mysql_fetch_array($result);


do
{
echo "<div class='nav'>";
echo "Ник: <a href='info.php?user=$user&pass=$pass&id=".$myrow['id']."'>".$myrow['user']."</a>";
echo " ".$myrow['name']."<br />";
echo "</div>";
}
while ($myrow = mysql_fetch_array($result));

echo "<div class='nav'>";
if(PAGE>1) echo "<a href='users.php?pages=m&page=".(PAGE-1)."&user=$user&pass=$pass'>Назад</a>";
if(PAGE<$pages) echo " <a href='users.php?pages=m&page=".(PAGE+1)."&user=$user&pass=$pass'>Вперед</a>";
if($pages>1) echo "";
echo "</div>";

echo "<div class='nav'>";
echo "• <a href=menu.php?user=$user&pass=$pass>В меню</a>";
echo "</div>";
include ("foot.php");
exit();
}
else
{
echo "Ошибка! Неверный <b>Ник</b> или <b>Пароль</b><br />";
echo <<<sss
<a href="index.php">На главную</a>
sss;
}

}


$w = "w";
if($_GET['pages']==$w)
{
include ("conf.php");
include ("lock.php");

if ($user == $myrow["user"] && $pass == $myrow["pass"])
{
include ("head.php");



$at_page=10;
$count=mysql_result(mysql_query("SELECT COUNT(`id`) FROM `userlist`"), 0);

$pages=ceil($count/$at_page);

$page=abs(intval(@$_REQUEST['page']));
if($page==0) $page=1;
define('PAGE', $page);
unset($page);

$from=(PAGE-1)*$at_page;
$result=mysql_query("SELECT * FROM userlist WHERE pol='Женский' ORDER BY `id` DESC LIMIT $from, $at_page");
$myrow = mysql_fetch_array($result);


do
{
echo "<div class='nav'>";
echo "Ник: <a href='info.php?user=$user&pass=$pass&id=".$myrow['id']."'>".$myrow['user']."</a>";
echo " ".$myrow['name']."<br />";
echo "</div>";
}
while ($myrow = mysql_fetch_array($result));

echo "<div class='nav'>";
if(PAGE>1) echo "<a href='users.php?pages=w&page=".(PAGE-1)."&user=$user&pass=$pass'>Назад</a>";
if(PAGE<$pages) echo " <a href='users.php?pages=w&page=".(PAGE+1)."&user=$user&pass=$pass'>Вперед</a>";
if($pages>1) echo "";
echo "</div>";

echo "<div class='nav'>";
echo "• <a href=menu.php?user=$user&pass=$pass>В меню</a>";
echo "</div>";
include ("foot.php");
exit();
}
else
{
echo "Ошибка! Неверный <b>Ник</b> или <b>Пароль</b><br />";
echo <<<sss
<a href="index.php">На главную</a>
sss;
}
}


?>