<?
include_once("mysql.php");
include 'include/sesi.php';
Error_Reporting(E_ALL & ~E_NOTICE);
include_once("include/antixak.php");
include 'include/ini.php';
$_title = 'Linewap2';
include 'include/header.php';
$log = htmlspecialchars(stripslashes($log));
$pas = htmlspecialchars(stripslashes($pas));
$go = htmlspecialchars(stripslashes($go));
/////////////////////////////////////////////////////
$text = @file("MySql/base123/reg/$log.dat");
if ($text!=""){
$udata = explode(":||:",$text[0]);
$login=trim($udata[0]);
$password=trim($udata[1]);}
////////////////////////////////////////////////////////
if (isset($user)) {
include_once"include/up.php";
include_once("include/udata.php");
$col="10";
$mmm=$col;

//////////////////////////////////////////////////////////////////////////////////////
if(empty($go)){$go="1";}
$dir=opendir("MySql/base123/clan");
$n = "0";
while(($k=readdir($dir))!==false){
if ($k=='.'||$k=='..'||$k=='name'||$k=='tmp'||$k=='sklad'||$k=='zahvat'||$k=='desk'||$k=='chat'||$k=='logs'||$k=='bank') continue;
$n++;

}
closedir($dir);
////////////////////
$num=($n/$col);
if ($num!==(int)$num){$foo = (int) $num;

$fo = ($foo + 1);}   else  {$fo=$num;}

for ($i="1"; $i<=$fo; $i++)

if ($go == "") {$c="0";}   else     {$c=($col*($go-1));}
///////////////////////


$dir = opendir ("MySql/base123/clan");
while ($file = readdir ($dir))
{
if (( $file != ".") && ($file != "..") && ($file != "name") && ($file != "tmp") && ($file != "sklad") && ($file != "zahvat") && ($file != "chat") && ($file != "desk") && ($file != "logs") && ($file != "bank"))
{ $file= str_replace(".dat","",$file);

$file2= "$file";
$text = @file("MySql/base123/clan/$file2.dat");

$udat = explode(":||:",$text[0]);
$name=trim($udat[1]);


$la = $la + 1;
if($go=="1"){$col=round($mmm+1);}
if($la>$c-1 and $la<$c+$col){



if ($mode == "1"){$ee = strtr($e1,$tran);}else{$ee = $e1;}
$laa = $la + 1;

$file=@file("MySql/base123/clan/name/$file2.dat");
$total=count($file);

echo "$la. Клан: <b>$name</b><br/>
Глава: <b>$file2</b><br/>
В клане <b>$total</b> человек<br/><br/>";
}}
}
closedir ($dir);

if ($go == "") {$c="0";}   else{$c=($col*($go-1));}
$lis = $go + 1;
$lis1 = $go - 1;
echo"<br/>";
if ($lis1 < "1") {} else{print "<a href=\"clanlist.php?go=$lis1&$sd\">Назад</a> | ";}


if ($lis == "$i")  {} else { print "<a href=\"clanlist.php?go=$lis&$sd\">Вперед</a>";}

echo"<br/><br/>Перейти к: <form action=\"clanlist.php?$random&$sd\" method=\"get\"><input type=\"text\" name=\"go\"/> странице.<br/>";

echo"<anchor>
<input type=\"submit\" value=\"Перейти\" /></form>";
//</anchor></small><br/>";

echo"Кланов всего: $n.";

}else{echo"<small>Пароль или логин неверен!</small>";}

include_once"include/down.php";
?>
