<?php
include '../wap/config.php';
$login=htmlspecialchars(trim($_POST['login']),ENT_QUOTES);
$login_pat=htmlspecialchars(trim($_POST['login_pat']),ENT_QUOTES);
$email=htmlspecialchars(trim($_POST['email']),ENT_QUOTES);
if (!($conn=pg_connect("host=$dbhost port=$dbport dbname=$dbname user=$dbuser password=$dbpass"))) {
echo ("пЫЙВЛБ РПДЛМАЮЕОЙС Л вд!\n");
};
$p=$_GET['p'];
$ppp=100;
$offset=$p*$ppp;
pg_query($conn, "SET CLIENT_ENCODING TO 'KOI8';");
if ($login!='') {
$res=pg_query($conn,"select id from users where login='$login';");
if (pg_numrows($res)) {
$link=sprintf("Location: user_edit.php?id=%s",pg_result($res,0,0));
header($link);
} else {
print "оЕ ОБКДЕОП\n";
}
exit;
pg_close($conn);
}
if ($email!='') {
$res=pg_query($conn,"select id from users where email='$email';");
if (pg_numrows($res)) {
$link=sprintf("Location: user_edit.php?id=%s",pg_result($res,0,0));
header($link);
} else {
print "оЕ ОБКДЕОП\n";
}
exit;
pg_close($conn);
}
$res=pg_query($conn,"select v_num from site_var where id=2;");
$numrec=pg_result($res,0,0);
switch ($sb) {
case 1:
$res=pg_query($conn,"select id,login,email,name,bday,operator,moder,fr,phonenum,phonemod,web,info,access from users order by login limit $ppp offset $offset;");
break;
default:
if ($login_pat!='') {
$res=pg_query($conn,"select id,login,email,name,bday,operator,moder,fr,phonenum,phonemod,web,info,access from users where login like '$login_pat' order by id desc limit $ppp offset $offset;");
} else {
$res=pg_query($conn,"select id,login,email,name,bday,operator,moder,fr,phonenum,phonemod,web,info,access from users order by id desc limit $ppp offset $offset;");
}
}
pg_close($conn);
$mp=floor(($numrec-1)/$ppp);
?>
<html>
<head><title>хРТБЧМЕОЙЕ РПМШЪПЧБФЕМСНЙ</title></head>
<body>
<center><h1>рПМШЪПЧБФЕМЙ WAP УБКФБ</h1></center>
<?php
print "<center>уФТБОЙГЩ: ";
for ($i=0;$i<=$mp;$i++) if ($i==$p) print $i." "; else print "<a href=\"users.php?p=".$i."&sb=".$sb."\">".$i."</a>\n";
print "<font size=1 face=arial>(чЩЧПД РП ".$ppp." РПМШЪПЧБФЕМЕК ОБ УФТБОЙГХ)</font></center>\n";
?>
<table width="100%">
<tr align=center bgcolor="e0e0e0"><td><a href="users.php?sb=0">ID</a></td><td>DEL</td><td>BAN</td><td><a href="users.php?sb=1">Login</a></td><td>E-mail</td><td>Name</td><td>тПДЙМУС</td><td>пРЕТБФПТ</td><td>пФЛХДБ</td><td>оПНЕТ</td><td>нПДЕМШ</td><td>WWW</td><td>дПР.</td></tr>
<?php
for ($i=0; $i<pg_numrows($res); $i++) {
$email=pg_result($res,$i,2);
if ($email!='') $demail=sprintf("<a href=\"mailto:%s\">%s</a>", $email, $email);
else $demail='';
ereg ("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})", pg_result($res,$i,4), $regs);
if (($regs[1]==1970)&&($regs[2]==1)&&($regs[3]==1)) $bday='';
else $bday=sprintf("%d.%d.%d", $regs[3], $regs[2], $regs[1]);
$moder=pg_result($res,$i,6);
$access=pg_result($res,$i,12);
$color='f0f0f0';
if ($access) $color='c0ffc0';
if ($moder) $color='ffc0c0';
$id=pg_result($res,$i,0);
print "<tr align=center bgcolor=\"".$color."\"><td><a href=\"user_edit.php?id=".$id."&l=1\" title=\"тЕДБЛФЙТПЧБФШ ЪБРЙУШ\">".$id."</a></td><td><a href=\"user_del.php?id=".$id."&p=".$p."\" title=\"хДБМЙФШ\">X</a></td><td><a href=\"user_ban.php?id=".$id."&p=".$p."&l=1\" title=\"ъБВБОЙФШ\">+</a></td><td>".pg_result($res,$i,1)."</td><td>".$demail."</td><td>".pg_result($res,$i,3)."</td><td>".$bday."</td><td>".pg_result($res,$i,5)."</td><td>".pg_result($res,$i,7)."</td><td>".pg_result($res,$i,8)."</td><td>".pg_result($res,$i,9)."</td><td>".pg_result($res,$i,10)."</td><td>".pg_result($res,$i,11)."</td></tr>\n";
}
print "</table>\n";
print "<center>уФТБОЙГЩ: ";
for ($i=0;$i<=$mp;$i++) if ($i==$p) print $i." "; else print "<a href=\"users.php?p=".$i."&sb=".$sb."\">".$i."</a>\n";
print "<font size=1 face=arial>(чЩЧПД РП ".$ppp." РПМШЪПЧБФЕМЕК ОБ УФТБОЙГХ)</font></center>\n";
?>
</body>
</html>