#!/usr/bin/perl

require "set.pl";
$in{referer} = "rudean";
&getinput;
&printhead;
open(FILE, "config.dat"); $a = @config = <FILE>; close FILE; for ($i=0; $i<$a; $i++) { chomp($config[$i]); }
if (($in{password} eq "") || ($in{username} eq "")) {
&showlogin;
}
if (-e "$config[7]/$in{username}") {
@USER = getfile("$config[7]/$in{username}");
open(FILE, "$config[7]/$in{username}.list") or dienice("Couldnt open $filename: $!");
@URLz = <FILE>;
close FILE;
}
else { &showlogin; }
if ($in{password} ne $USER[1]) {
&showlogin;
}
if ($in{a} eq "edit") {
@user = ($in{username}, $in{pword}, "-", $USER[3], $USER[4], $USER[5], $USER[6], $USER[7], $USER[8], $in{email}, $USER[10], $USER[11], $USER[12], $USER[13], $USER[14], $USER[15], $USER[16], $USER[17], $in{pause});
writefile("$config[7]/$in{username}", @user);
writefile("$config[7]/$in{username}.list", $in{urlz});
if ($in{password} ne $in{pword}) {
$in{referer} = $in{username};
}
}
$left=$USER[3]-$USER[4];
$text=<<d00der;
<H1 align="center"><font size="3">Статистика пользователя<font color="#800000">
</font><font size="4" color="#0000FF"> $in{username}</font></font></H1>
<div align="center"><center><TABLE><TR><TD><b>Всего заработано (начислено):</b></TD>
<TD><b><font color="#008080">$USER[3]</font></b></TD></tr>
<TR><TD><b>Всего потрачено кредитов:</b></TD><TD><b><font color="#008080">$USER[4]</font></b></TD></tr><TR><TD><b>Остаток
кредитов на счету:</b></TD><TD><b><font color="#008080">$left</font></b></TD></tr>
</TABLE></center></div><H3 align="center"><font size="3">Ваши рефералы:</font></H3>
<div align="center"><center><TABLE BORDER="1"><TR><TD>Уровень</TD>
<TD>Всего рефералов</TD><TD>Ими заработано</TD></tr><TR><TD>1</TD>
<TD>$USER[10]</TD><TD>$USER[14]</TD></tr><TR><TD>2</TD><TD>$USER[11]</TD>
<TD>$USER[15]</TD></tr><TR><TD>3</TD><TD>$USER[12]</TD><TD>$USER[16]</TD></tr>
<TR><TD>4</TD><TD>$USER[13]</TD><TD>$USER[17]</TD></tr></TABLE></center></div>
<form METHOD="POST" ACTION="downline.cgi"><p align="center">
<INPUT TYPE=HIDDEN NAME="a" VALUE="search">
<INPUT TYPE=HIDDEN NAME="password" VALUE="$in{password}">
<INPUT TYPE=HIDDEN NAME="username" VALUE="$in{username}">
<INPUT TYPE="Submit" NAME="Submit" VALUE="Список ваших рефералов">
</FORM><H3 align="center"><font size="3">Ссылка для привлечения
рефералов<br></font><font color="#0000FF" size="3">$config[14]newuser.cgi?referer=$in{username}
</font></H3><FORM METHOD=POST ACTION=member.cgi>
<p align="center"><INPUT TYPE=HIDDEN NAME="password" VALUE="$in{password}">
<INPUT TYPE=HIDDEN NAME="username" VALUE="$in{username}">
<INPUT TYPE="Submit" NAME="Submit" VALUE="Главное меню"></FORM>
d00der
reptem($text);
sub showlogin {
$text=<<d00der;
<h1 align="center"><font size="3">Вход в систему</font></h1>
<form METHOD="POST" ACTION="member.cgi"><div align="center">
<center><table><tr><td>Логин</td><td><input TYPE="TEXT" NAME="username" size="20"></td>
</tr><tr><td>Пароль</td><td><input TYPE="PASSWORD" NAME="password" size="20"></td>
</tr><tr><td></td><td><input TYPE="Submit" NAME="Submit" VALUE="В о й т и"></td>
</tr></table></center></div>
<h6 align="center"><font size="3">Забыли пароль? Нажмите</font>
<a HREF="forgot.cgi"><font size="3">здесь</font></a></h6>
</form>
d00der
reptem($text);
}
sub reptem {
my($text) = @_;
open(TEMP, "html.txt");
@TE = <TEMP>;
close TEMP;
$temp = join('',@TE);
$temp =~ s/%PLACE%/$text/;
print "$temp";
exit;
}
