<?php
header("Content-type: text/html; charset=UTF-8");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Cache-Control" content="max-age=600" forua="true" />
<meta http-equiv="Content-Type" content="application/vnd.wap.xhtml+xml; charset=UTF-8"/>
<meta name="description" content="Сайт с бесплатными играми, приложениями, мелодиями для вашего мобильного телефона" />
<link rel="stylesheet" type="text/css" href="stylesheet.css" />
<title>Контроль панель!</title>
<div class="header"><span style="color: #fff; font-size: 15px"><b>waplog.us</b></span> <sup><span style="color: #cccccc; font-size: 9px">beta</span></sup></div>
<?
include "../config.php";
include '../inc/config.inc.php';
include '../inc/wap_tags.inc.php';
include '../inc/functions.inc.php';
connect_to_db();
if (empty($_GET['login']) or empty($_GET['p'])){
$result = mysql_query("SELECT count(*) FROM `superadmin` WHERE 1");
$row=mysql_fetch_row($result);
$button = "Войти";
$input_type = "password";
// прелог
echo '[meta]';
echo '[body]';
echo "<html><head>\n";
echo "<title>Вход</title></head>";
echo "<body>";
echo "<small>";
echo "<p mode='nowrap'>";
echo "Вход в зону супер админа!";
echo "</p>";
if ($row[0] == 0){
echo "В базе не обнаруженно суперадминов!<br/> \n";
echo "Сейчас Вы можете создать учетную запись, и использовать ее в дальнейшем для управления рейтингом!<br/> \n";
$button = "Создать";
$input_type = "text";
}
echo "<form action='index.php'>";
echo "Логин: <br/> <input type='text' name='login' id='login'/><br/>";
echo "Пароль: <br/> <input type='$input_type' name='p' id='p' /><br/>";
echo "<input type='submit' value='$button' />";
echo "</form>";
echo "</small>";
echo "</body></html>";
exit;
}
$login = northwest($_GET['login']);
$pass = northwest($_GET['p']);
$result = mysql_query("SELECT count(*) FROM `superadmin` WHERE 1");
$row=mysql_fetch_row($result);
if($row[0] == 0){
$pass = md5($pass);
$sql="INSERT INTO `superadmin` VALUES ('','$login','$pass')";
@mysql_query($sql);
$uid = mysql_insert_id();
if ($uid == 0){
echo "<html><head>\n";
echo "<title>Созданно</title>";
echo "<meta http-equiv=\"refresh\" content=\"1;url=index.php\"/>";
echo "</head>";
echo "<body>";
echo "<small>";
echo "Не созданно!";
echo "</small>";
echo "</body></html>";
exit;
}
echo "<html><head>\n";
echo "<title>Созданно</title>";
echo "<meta http-equiv=\"refresh\" content=\"1;url=index.php?login=$login&p=$pass\"/>";
echo "</head>";
echo "<body>";
echo "<small>";
echo "Учетная запись созданна!";
echo "</small>";
echo "</body></html>";
exit;
}
$result = mysql_query("SELECT `pass` FROM `superadmin` WHERE `login`='$login';");
$row=mysql_fetch_row($result);
if(!empty($row))
{
$truepass = $row[0];
if ($truepass == $pass || $truepass == md5($pass))
{
// вход осуществлен
$today = date("Ymd");
//проверка ввода act
if (empty($_GET['act'])) $action = "";
else $action=$_GET['act'];
switch ($action){
//Удаление и бан
case "del":
if (empty($_GET['uid'])){
echo "<html><head>\n";
echo "<title>Удаление</title>";
echo "</head>";
echo "<body>";
echo "Не указан пользователь!";
echo "</body></html>";
exit;
}
$uid = (int)$_GET['uid'];
// проверка существования учетной записи
$result = mysql_query("SELECT * FROM `users` WHERE `uid`=$uid");
$row = mysql_fetch_array($result);
if (empty($row)) {
echo "<html><head>\n";
echo "<title>Удаление</title>";
echo "</head>";
echo "<body>";
echo "Отсутствует пользователь!";
echo "</body></html>";
exit;
}
if (!empty($_GET['ban']))
{
// баним пользователя
$ban_link = parse_url($row['link']);
$ban_link = $ban_link['host'];
@mysql_query("INSERT INTO `ban_user` VALUES ('$uid','$ban_link');");
}
// удаляем данные
@mysql_query("DELETE FROM `users` WHERE `uid` = $uid LIMIT 1");
@mysql_query("DELETE FROM `hits_ip` WHERE `uid` = $uid;");
@mysql_query("DELETE FROM `hits_time` WHERE `uid` = $uid;");
@mysql_query("DELETE FROM `months` WHERE `uid` = $uid;");
@mysql_query("DELETE FROM `online_ip` WHERE `uid` = $uid;");
@mysql_query("DELETE FROM `online_time` WHERE `uid` = $uid;");
@mysql_query("DELETE FROM `weeks` WHERE `uid` = $uid;");
@mysql_query("DELETE FROM `count_24` WHERE `uid` = $uid;");
echo "<html><head>\n";
echo "<meta http-equiv=\"refresh\" content=\"1;url=index.php?login=$login&p=$truepass\"/>";
echo "<title>Удаление</title>";
echo "</head>";
echo "<body>";
echo "<small>";
echo "Удалено!";
echo "</small>";
echo "</body></html>";
break;
////////////////////////////////////////////////
case 'editname':
$uid = htmlspecialchars(stripslashes(trim($_GET['uid'])));
$qt = @mysql_query("select * from `users` where `uid`='$uid';");
$qa = @mysql_fetch_array($qt);
print "<div align=\"left\">Изменить название:";
print "<form method=\"post\" action=\"index.php?login=$login&p=$pass&act=editnamego&uid=$uid\">
<input name=\"name\" class=\"do_button\" maxlength=\"40\" value=\"".$qa['site_name']."\"><br>
<input value=\"Изменить\" name=\"do\" class=\"button\" type=\"submit\"></form>";
print "[<a href=\"index.php?login=$login&p=$pass\">Назад</a>]<br/>";
echo "<div style=\"text-align: center\"><div class=\"rh\">(c) eXpert</div></div>";
break;
////////////////////////////////////////////////
case 'editnamego':
$name = htmlspecialchars(stripslashes(trim($_POST['name'])));
$uid = htmlspecialchars(stripslashes(trim($_GET['uid'])));
if(@mysql_query("update `users` set `site_name`='$name' where `uid`='$uid';"))
print "<font color=\"#FF0000\">Название сайта успешно отредактирована!</font><br/>";
echo "<meta http-equiv=\"refresh\" content=\"1;url=index.php?login=$login&p=$truepass\"/>";
echo "<div style=\"text-align: center\"><div class=\"rh\">(c) eXpert</div></div>";
break;
////////////////////////////////////////////////
case 'edithost':
$uid = htmlspecialchars(stripslashes(trim($_GET['uid'])));
$qt = @mysql_query("select * from `weeks` where `uid`='$uid';");
$qa = @mysql_fetch_array($qt);
print "<div align=\"left\">Изменить хосты:";
print "<form method=\"post\" action=\"index.php?login=$login&p=$pass&act=edithostgo&uid=$uid\">
<input name=\"name\" class=\"do_button\" maxlength=\"40\" value=\"".$qa['host']."\"><br>
<input value=\"Изменить\" name=\"do\" class=\"button\" type=\"submit\"></form>";
print "[<a href=\"index.php?login=$login&p=$pass\">Назад</a>]<br/>";
echo "<div style=\"text-align: center\"><div class=\"rh\">(c) eXpert</div></div>";
break;
////////////////////////////////////////////////
case 'editnamego':
$name = htmlspecialchars(stripslashes(trim($_POST['name'])));
$uid = htmlspecialchars(stripslashes(trim($_GET['uid'])));
if(@mysql_query("update `users` set `site_name`='$name' where `uid`='$uid';"))
print "<font color=\"#FF0000\">Название сайта успешно отредактирована!</font><br/>";
echo "<meta http-equiv=\"refresh\" content=\"1;url=index.php?login=$login&p=$truepass\"/>";
echo "<div style=\"text-align: center\"><div class=\"rh\">(c) eXpert</div></div>";
break;
////////////////////////////////////////////////
case 'edithost':
$uid = htmlspecialchars(stripslashes(trim($_GET['uid'])));
$qt = @mysql_query("select * from `weeks` where `uid`='$uid';");
$qa = @mysql_fetch_array($qt);
print "<div align=\"left\">Изменить хосты:";
print "<form method=\"post\" action=\"index.php?login=$login&p=$pass&act=edithostgo&uid=$uid\">
<input name=\"name\" class=\"do_button\" maxlength=\"40\" value=\"".$qa['host']."\"><br>
<input value=\"Изменить\" name=\"do\" class=\"button\" type=\"submit\"></form>";
print "[<a href=\"index.php?login=$login&p=$pass\">Назад</a>]<br/>";
echo "<div style=\"text-align: center\"><div class=\"rh\">(c) eXpert</div></div>";
break;
////////////////////////////////////////////////
case 'edithostgo':
$name = htmlspecialchars(stripslashes(trim($_POST['name'])));
$uid = htmlspecialchars(stripslashes(trim($_GET['uid'])));
if(@mysql_query("update `weeks` set `host`='$name' where `uid`='$uid';"))
print "<font color=\"#FF0000\">Хосты сайта успешно отредактирована!</font><br/>";
echo "<meta http-equiv=\"refresh\" content=\"1;url=index.php?login=$login&p=$truepass\"/>";
echo "<div style=\"text-align: center\"><div class=\"rh\">(c) eXpert</div></div>";
break;
////////////////////////////////////////////////
case 'edithit':
$uid = htmlspecialchars(stripslashes(trim($_GET['uid'])));
$qt = @mysql_query("select * from `weeks` where `uid`='$uid';");
$qa = @mysql_fetch_array($qt);
print "<div align=\"left\">Изменить хиты:";
print "<form method=\"post\" action=\"index.php?login=$login&p=$pass&act=edithitgo&uid=$uid\">
<input name=\"name\" class=\"do_button\" maxlength=\"40\" value=\"".$qa['count']."\"><br>
<input value=\"Изменить\" name=\"do\" class=\"button\" type=\"submit\"></form>";
print "[<a href=\"index.php?login=$login&p=$pass\">Назад</a>]<br/>";
echo "<div style=\"text-align: center\"><div class=\"rh\">(c) eXpert</div></div>";
break;
////////////////////////////////////////////////
case 'edithitgo':
$name = htmlspecialchars(stripslashes(trim($_POST['name'])));
$uid = htmlspecialchars(stripslashes(trim($_GET['uid'])));
if(@mysql_query("update `weeks` set `count`='$name' where `uid`='$uid';"))
print "<font color=\"#FF0000\">Хиты сайта успешно отредактирована!</font><br/>";
echo "<meta http-equiv=\"refresh\" content=\"1;url=index.php?login=$login&p=$truepass\"/>";
echo "<div style=\"text-align: center\"><div class=\"rh\">(c) eXpert</div></div>";
break;
////////////////////////////////////////////////
case 'editopis':
$uid = htmlspecialchars(stripslashes(trim($_GET['uid'])));
$qt = @mysql_query("select * from `users` where `uid`='$uid';");
$qa = @mysql_fetch_array($qt);
print "<div align=\"left\">Изменить описание:";
print "<form method=\"post\" action=\"index.php?login=$login&p=$pass&act=editopisgo&uid=$uid\">
<input name=\"name\" class=\"do_button\" maxlength=\"40\" value=\"".$qa['info']."\"><br>
<input value=\"Изменить\" name=\"do\" class=\"button\" type=\"submit\"></form>";
print "[<a href=\"index.php?login=$login&p=$pass\">Назад</a>]<br/>";
echo "<div style=\"text-align: center\"><div class=\"rh\">(c) eXpert</div></div>";
break;
////////////////////////////////////////////////
case 'editopisgo':
$name = htmlspecialchars(stripslashes(trim($_POST['name'])));
$uid = htmlspecialchars(stripslashes(trim($_GET['uid'])));
if(@mysql_query("update `users` set `info`='$name' where `uid`='$uid';"))
print "<font color=\"#FF0000\">Описание сайта успешно отредактирована!</font><br/>";
echo "<meta http-equiv=\"refresh\" content=\"1;url=index.php?login=$login&p=$truepass\"/>";
echo "<div style=\"text-align: center\"><div class=\"rh\">(c) eXpert</div></div>";
break;
////////////////////////////////////////////////
case 'editout':
$uid = htmlspecialchars(stripslashes(trim($_GET['uid'])));
$qt = @mysql_query("select * from `weeks` where `uid`='$uid';");
$qa = @mysql_fetch_array($qt);
print "<div align=\"left\">Изменить уход:";
print "<form method=\"post\" action=\"index.php?login=$login&p=$pass&act=editingo&uid=$uid\">
<input name=\"name\" class=\"do_button\" maxlength=\"40\" value=\"".$qa['out']."\"><br>
<input value=\"Изменить\" name=\"do\" class=\"button\" type=\"submit\"></form>";
print "[<a href=\"index.php?login=$login&p=$pass\">Назад</a>]<br/>";
echo "<div style=\"text-align: center\"><div class=\"rh\">(c) eXpert</div></div>";
break;
////////////////////////////////////////////////
case 'editoutgo':
$name = htmlspecialchars(stripslashes(trim($_POST['name'])));
$uid = htmlspecialchars(stripslashes(trim($_GET['uid'])));
if(@mysql_query("update `weeks` set `out`='$name' where `uid`='$uid';"))
print "<font color=\"#FF0000\">Уход сайта успешно отредактирована!</font><br/>";
echo "<meta http-equiv=\"refresh\" content=\"1;url=index.php?login=$login&p=$truepass\"/>";
echo "<div style=\"text-align: center\"><div class=\"rh\">(c) eXpert</div></div>";
break;
////////////////////////////////////////////////
case 'editin':
$uid = htmlspecialchars(stripslashes(trim($_GET['uid'])));
$qt = @mysql_query("select * from `weeks` where `uid`='$uid';");
$qa = @mysql_fetch_array($qt);
print "<div align=\"left\">Изменить приход:";
print "<form method=\"post\" action=\"index.php?login=$login&p=$pass&act=editingo&uid=$uid\">
<input name=\"name\" class=\"do_button\" maxlength=\"40\" value=\"".$qa['in']."\"><br>
<input value=\"Изменить\" name=\"do\" class=\"button\" type=\"submit\"></form>";
print "[<a href=\"index.php?login=$login&p=$pass\">Назад</a>]<br/>";
echo "<div style=\"text-align: center\"><div class=\"rh\">(c) eXpert</div></div>";
break;
////////////////////////////////////////////////
case 'editingo':
$name = htmlspecialchars(stripslashes(trim($_POST['name'])));
$uid = htmlspecialchars(stripslashes(trim($_GET['uid'])));
if(@mysql_query("update `weeks` set `in`='$name' where `uid`='$uid';"))
print "<font color=\"#FF0000\">Приход сайта успешно отредактирована!</font><br/>";
echo "<meta http-equiv=\"refresh\" content=\"1;url=index.php?login=$login&p=$truepass\"/>";
echo "<div style=\"text-align: center\"><div class=\"rh\">(c) eXpert</div></div>";
break;
////////////////////////////////////////////////
case 'editlink':
$uid = htmlspecialchars(stripslashes(trim($_GET['uid'])));
$qt = @mysql_query("select * from `users` where `uid`='$uid';");
$qa = @mysql_fetch_array($qt);
print "<div align=\"left\">Изменить адрес:";
print "<form method=\"post\" action=\"index.php?login=$login&p=$pass&act=editlinkgo&uid=$uid\">
<input name=\"link\" class=\"do_button\" maxlength=\"40\" value=\"".$qa['link']."\"><br>
<input value=\"Изменить\" name=\"do\" class=\"button\" type=\"submit\"></form>";
print "[<a href=\"index.php?login=$login&p=$pass\">Назад</a>]<br/>";
echo "<div style=\"text-align: center\"><div class=\"rh\">(c) eXpert</div></div>";
break;
////////////////////////////////////////////////
case 'editlinkgo':
$link = htmlspecialchars(stripslashes(trim($_POST['link'])));
$uid = htmlspecialchars(stripslashes(trim($_GET['uid'])));
if(@mysql_query("update `users` set `link`='$link' where `uid`='$uid';"))
print "<font color=\"#FF0000\">Адрес сайта успешно отредактирована!</font><br/>";
echo "<meta http-equiv=\"refresh\" content=\"1;url=index.php?login=$login&p=$truepass\"/>";
echo "<div style=\"text-align: center\"><div class=\"rh\">(c) eXpert</div></div>";
break;
////////////////////////////////////////////////
//Каталог
case "cat":
if($ok=="1"){
if($uid==""){
$ins_str = "Insert into cat set name='".$name."', pvt='".$privat."'";
if (mysql_query ($ins_str)) {
@mysql_query("OPTIMIZE TABLE cat");
@mysql_query("ANALYZE TABLE cat");
$uid="";
} else {
$msg = " ".mysql_error()." ";
}
}else{
mysql_query ("Update cat set name='".$name."', pvt='".$privat."' where id='".$uid."'");
$uid="";
}
}
echo "<html><head>\n";
echo "<title>Каталог</title>";
echo "</head>";
echo "<body>";
echo "<small>";
echo "Каталог<br/>";
$zend=20;
$query = "SELECT * FROM cat ORDER BY id";
$result = mysql_query($query)
or die("Query failed");
for ($i=0; $i <= mysql_num_rows($result) - 1; $i++) {
if (!mysql_data_seek($result, $i)) {
echo "Cannot seek to row $i\n";
continue;
}
if(!($row = mysql_fetch_object($result)))
continue;
$zend--;
if($zend==0) break;
$idcat = $row->id;
$name = $row->name;
$pvt = $row->pvt;
if($pvt=="1") $pvt="приватный раздел"; else $pvt="";
if($uid==$idcat) $nnn=$name;
$txt="<p>$idcat - <a class=\"icolink\" href=\"./index.php?login=$login&p=$truepass&uid=$idcat&act=cat\">$name</a> $pvt</p>";
print"
$txt";
}
echo "Новая категория:<br/><form action=\"index.php\" method=\"get\"> \n";
echo "Имя: <input type=\"text\" name=\"name\" value=\"$nnn\" /> \n
<select size=\"1\" name=\"privat\">
<option value=\"0\">Открытая</option>
<option value=\"1\">Приватная</option>
</select><br/>";
echo "<input type=\"hidden\" name=\"login\" value=\"$login\" /> \n";
echo "<input type=\"hidden\" name=\"p\" value=\"$truepass\" /> \n";
echo "<input type=\"hidden\" name=\"uid\" value=\"$uid\" /> \n";
echo "<input type=\"hidden\" name=\"ok\" value=\"1\" /> \n";
echo "<input type=\"hidden\" name=\"act\" value=\"cat\" /> \n";
echo "<input type=\"submit\" value=\"Готово\" />\n";
echo "</form> \n";
echo "<p><a class=\"icolink\" href=\"./index.php?login=$login&p=$truepass&act=\">Назад</a></p>";
echo "</small>";
echo "</body></html>";
break;
//Добавление отсосов
case "opi":
if($ok=="1"){
$ips = split("\.", $ip1);
@$ipnum1 = $ips[3] + $ips[2] * 256 + $ips[1] * 256 * 256 + $ips[0] * 256 * 256 * 256;
$ips = split("\.", $ip2);
@$ipnum2 = $ips[3] + $ips[2] * 256 + $ips[1] * 256 * 256 + $ips[0] * 256 * 256 * 256;
$reza = mysql_query ("select * from top_operators where name='".$name."' and country='".$str."'");
if (mysql_affected_rows()==0){
$ins_str = "Insert into `top_operators`(`id`,`name`,`country`) values(0,'$name','$str');";
if (mysql_query ($ins_str)) {
$ida=mysql_insert_id();
@mysql_query("OPTIMIZE TABLE top_operators");
@mysql_query("ANALYZE TABLE top_operators");
$uid="";
} else {
$msg = " ".mysql_error()." ";
}
}else{
$row = mysql_fetch_array ($reza);
$ida = $row["id"];}
$ins_str = "Insert into `top_ip` values('$ida','$ipnum1','$ipnum2');";
if (mysql_query ($ins_str)) {
$ida=mysql_insert_id();
@mysql_query("OPTIMIZE TABLE top_ip");
@mysql_query("ANALYZE TABLE top_ip");
$uid="";
} else {
$msg = " ".mysql_error()." ";
}
}
echo "<html><head>\n";
echo "<title>Операторы</title>";
echo "</head>";
echo "<body>";
echo "<small>";
echo "Операторы<br/>";
echo "Новый оператор:<br/><form action=\"index.php\" method=\"get\"> \n";
echo "Имя: <input type=\"text\" name=\"name\" value=\"\" /> <br/>\n";
echo "Страна: <input type=\"text\" name=\"str\" value=\"\" /> <br/>\n";
echo "ip1: <input type=\"text\" name=\"ip1\" value=\"\" /> <br/>\n";
echo "ip2: <input type=\"text\" name=\"ip2\" value=\"\" /> <br/>\n";
echo "<input type=\"hidden\" name=\"login\" value=\"$login\" /> \n";
echo "<input type=\"hidden\" name=\"p\" value=\"$truepass\" /> \n";
echo "<input type=\"hidden\" name=\"ok\" value=\"1\" /> \n";
echo "<input type=\"hidden\" name=\"act\" value=\"opi\" /> \n";
echo "<input type=\"submit\" value=\"Готово\" />\n";
echo "</form> \n";
echo "<p><a class=\"icolink\" href=\"./index.php?login=$login&p=$truepass&act=\">Назад</a></p>";
echo "</small>";
echo "</body></html>";
break;
//Сортировка отсосов
case "opisort":
if($ok=="1"){
if($del=="1"){
mysql_query ("DELETE from new_operators where name_not=''");
}else{
mysql_query ("Update new_operators set name_not='".$name."' where id='".$uid."'");
}}
echo "<html><head>\n";
echo "<title>отсосы</title>";
echo "</head>";
echo "<body>";
echo "<small>";
echo "отсосы<br/>";
$zend=20;
$query = "SELECT * FROM new_operators where name_not='' ORDER BY id DESC";
$result = mysql_query($query)
or die("Query failed");
for ($i=0; $i <= mysql_num_rows($result) - 1; $i++) {
if (!mysql_data_seek($result, $i)) {
echo "Cannot seek to row $i\n";
continue;
}
if(!($row = mysql_fetch_object($result)))
continue;
$zend--;
if($zend==0) break;
$idcat = $row->id;
$name_not = $row->name_not;
$ip_new = $row->ip_new;
if($uid==$idcat) $nnn=$ip_new;
$txt="<p>$idcat - <a class=\"icolink\" href=\"./index.php?login=$login&p=$truepass&uid=$idcat&act=opisort\">$ip_new</a> </p>";
print"
$txt";
}
echo "Название опсоса:<br/><form action=\"index.php\" method=\"get\"> \n";
echo "Имя: <input type=\"text\" name=\"name\" value=\"$nnn\" /> \n
<br/>";
echo "<input type=\"hidden\" name=\"login\" value=\"$login\" /> \n";
echo "<input type=\"hidden\" name=\"p\" value=\"$truepass\" /> \n";
echo "<input type=\"hidden\" name=\"uid\" value=\"$uid\" /> \n";
echo "<input type=\"hidden\" name=\"ok\" value=\"1\" /> \n";
echo "<input type=\"hidden\" name=\"act\" value=\"opisort\" /> \n";
echo "<input type=\"submit\" value=\"Готово\" />\n";
echo "</form> \n";
echo "<p><a class=\"icolink\" href=\"./index.php?login=$login&p=$truepass&act=opisort&ok=1&del=1\">Чистка рядов</a></p>";
echo "<p><a class=\"icolink\" href=\"./index.php?login=$login&p=$truepass&act=\">Назад</a></p>";
echo "</small>";
echo "</body></html>";
break;
default:
//проверка ввода page
if (empty($_GET['page'])) $page = 1;
else $page = (int)$_GET['page'];
// получаем кол во участников
$result=mysql_query("SELECT count(`uid`) FROM `users` WHERE 1");
$cntData = mysql_fetch_row($result);
$count_users = $cntData[0];
// максимальная страница
$max_page = ceil($count_users/$count_top);
// проверка правильности страницы
if ($page > $max_page) $page = $max_page;
if ($page <= 0) $page = 1;
$start=$count_top*($page-1);
$end=$count_top;
// получаем uid участников
$result=mysql_query("SELECT * FROM `users` WHERE 1 ORDER BY `uid` ASC LIMIT $start,$end");
$count_users_on_page = mysql_num_rows($result);
echo "<html><head>\n";
echo "<title>Пользователи</title>";
echo "</head>";
echo "<body>";
echo "<small>";
for($i = 0;$i < $count_users_on_page;$i++)
{
$user_data_row = mysql_fetch_array($result);
// данные участника
$uid = $user_data_row['uid'];
$site_name = $user_data_row['site_name'];
$link = $user_data_row['link'];
$info = $user_data_row['info'];
// посещения сегодня
$count_result=mysql_query("SELECT `count`,`host` FROM `weeks` WHERE `uid`=$uid AND `date`=$today LIMIT 1");
$count_data_row = mysql_fetch_array($count_result);
$count = $count_data_row['count'];
$host = $count_data_row['host'];
// ============ ВЫВОД =============
echo "<div>\n";
echo "<b>$site_name</b>[<a href=\"index.php?login=$login&p=$truepass&uid=$uid&act=editname\">edit</a>] uid=$uid <br/>\n";
echo "$link [<a href=\"index.php?login=$login&p=$truepass&uid=$uid&act=editlink\">edit</a>]<br/>\n";
echo "$info [<a href=\"index.php?login=$login&p=$truepass&uid=$uid&act=editopis\">edit</a>]<br/>\n";
echo "Хит $count [<a href=\"index.php?login=$login&p=$truepass&uid=$uid&act=edithit\">edit</a>]<br/>\n";
echo "Хост $host [<a href=\"index.php?login=$login&p=$truepass&uid=$uid&act=edithost\">edit</a>]<br/>\n";
echo "<a href=\"index.php?login=$login&p=$truepass&uid=$uid&act=del\">Удалить</a> <br/>\n";
echo "<a href=\"index.php?login=$login&p=$truepass&uid=$uid&act=del&ban=1\">Удалить и банить</a> <br/>\n";
echo "</div>\n";
echo "<hr/>\n";
}
// навигатор страниц
$next_p = $page + 1;
$prev_p = $page -1;
if ($prev_p > 0)
echo "<a href=\"index.php?login=$login&p=$truepass&page=$prev_p\">Пред.</a>";
else
echo "Пред.";
echo " | ";
if ($next_p <= $max_page)
echo "<a href=\"index.php?login=$login&p=$truepass&page=$next_p\">След.</a>\n";
else
echo "След.";
// форма перехода на произвольную страницу
$max_len_digits = strlen($max_page);
echo "<form action=\"index.php\" method=\"get\"> \n";
echo "Страница ном: <input type=\"text\" name=\"page\" size=\"$max_len_digits\" maxlength=\"$max_len_digits\" format=\"".str_repeat("N",$max_len_digits)."\" emptyok=\"true\" /> \n";
echo "<input type=\"hidden\" name=\"login\" value=\"$login\" /> \n";
echo "<input type=\"hidden\" name=\"p\" value=\"$truepass\" /> \n";
echo "<input type=\"submit\" value=\"Идти\" />\n";
echo "</form> \n";
echo "<a href=\"index.php?login=$login&p=$truepass&act=opisort\">Сортировка опсосов</a><br/>\n";
echo "<a href=\"index.php?login=$login&p=$truepass&act=cat\">Управлять каталогом</a><br/>\n";
echo "<a href=\"index.php?login=$login&p=$truepass&act=opi\">Добавить оперов</a><br/>\n";
echo "</small>";
echo "<div style=\"text-align: center\"><div class=\"rh\">(c) eXpert</div></div>";
echo "</body></html>";
}
} else {
echo "<html><head>\n";
echo "<title>Ошибка</title>";
echo "</head>";
echo "<body>";
echo "<small>";
echo "Пароль неверный!";
echo "</small>";
echo "</body></html>";
exit;
}
} else {
echo "<html><head>\n";
echo "<title>Ошибка</title>";
echo "</head>";
echo "<body>";
echo "<small>";
echo "Пароль неверный!";
echo "</small>";
echo "</body></html>";
exit;
}
?>
</body></html>