File size: 2.66Kb
<?
include_once("files/zag.php");
if (md5($pas)==$password && $log==$login && $log!=="" && md5($pas)!=="") {
switch(@$go) {
default:
echo"<small>
<a href=\"userquest.php?log=$log&pas=$pas&go=active\">Активные</a><br/>
<a href=\"userquest.php?log=$log&pas=$pas&go=complete\">Завершенные</a>
</small>";
break;
case 'active':
$file = @file("data/userquest/$log.dat");
$total = count($file);
for ($i = 0; $i < $total; $i++){
$data = explode("||",$file[$i]);
if($data[2]=="active"){
$data_0[]=$data[0];
}}
if(empty($data_0)){echo"<small>Нет активных квестов.</small>"; include_once"files/down.php"; exit;}
foreach($data_0 as $k=>$v)
{
$dat_screen[]="<small>$data_0[$k]</small><br/>";
}
$total = count($dat_screen);
if (empty($_GET['start'])) $start = 0;
else $start = $_GET['start'];
if ($total < $start + 10){ $end = $total; }
else {$end = $start + 10; }
for ($i = $start; $i < $end; $i++){
echo"$dat_screen[$i]";
}
if ($start !== 0) {echo '<small><a href="userquest.php?start='.($start - 10).'&log='.$log.'&pas='.$pas.'&go=active">Назад</a> </small>';}
if ($total > $start + 10) {echo '<small> <a href="userquest.php?start='.($start + 10).'&log='.$log.'&pas='.$pas.'&go=active">Далее</a></small>';}
break;
case 'complete':
$file = @file("data/userquest/$log.dat");
$total = count($file);
for ($i = 0; $i < $total; $i++){
$data = explode("||",$file[$i]);
if($data[2]=="completeok"){
$data_0[]=$data[0];
}}
if(empty($data_0)){echo"<small>Нет завершенных квестов.</small>"; include_once"files/down.php"; exit;}
foreach($data_0 as $k=>$v)
{
$dat_screen[]="<small>$data_0[$k]</small><br/>";
}
$total = count($dat_screen);
if (empty($_GET['start'])) $start = 0;
else $start = $_GET['start'];
if ($total < $start + 10){ $end = $total; }
else {$end = $start + 10; }
for ($i = $start; $i < $end; $i++){
echo"$dat_screen[$i]";
}
if ($start !== 0) {echo '<small><a href="userquest.php?start='.($start - 10).'&log='.$log.'&pas='.$pas.'&go=active">Назад</a> </small>';}
if ($total > $start + 10) {echo '<small> <a href="userquest.php?start='.($start + 10).'&log='.$log.'&pas='.$pas.'&go=active">Далее</a></small>';}
break;
}
}else{echo"<small>Пароль или логин неверен!</small>";}
include_once"files/down.php";
?>