<?
$show_all=true;
include_once 'sys/inc/start.php';
include_once 'sys/inc/shif.php';
if($set['web'])$set[set_them]='';
$set['title']='Ro`yhatdan o`tish';
include_once 'sys/inc/thead.php';
title();
aut();
if ((!isset($_SESSION['refer']) || $_SESSION['refer']==NULL)
&& isset($_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_REFERER']!=NULL &&
!ereg('/mail/index\.php',$_SERVER['HTTP_REFERER']))
$_SESSION['refer']=str_replace('&','&',ereg_replace('^http://[^/]*/','/', $_SERVER['HTTP_REFERER']));
if ($set['reg_select']=='close')
{
$err='Ro`yhatdan o`tish vaqtincha to`xtatilgan';
err();
echo "<a href='/aut.php'>Kirish</a><br />\n";
echo "</div><div class='pfoot'></div>\n";
echo "<center><a href='http://mtop.info/click.php?1904'><img src='http://mtop.info/image.php?1904' alt='mtop.info' /></a><a href='http://waplog.net/c.shtml?518575'><img src='http://c.waplog.net/518575.cnt' alt='waplog' /></a></center>";
echo "<center>© Super Portal</br>";
echo "<a href='/'><font color='gren'><b>Gulim.Net 2015</b></font></a>";
echo " Group of Uzbekistan</br></td></center></tbody></table>";
echo "<center>Created by ";
echo "<a href='/u1'><b><font color='blue'>Husniddin Rahmonov</font></b></a>";
}
if (isset($_SESSION['step']) && $_SESSION['step']==1 && mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `nick` = '".$_SESSION['reg_nick']."'"),0)==0 && isset($_POST['pass1']) && $_POST['pass1']!=NULL && $_POST['pass2'] && $_POST['pass2']!=NULL)
{
####---------- Ismi
if ($_POST['ank_name']==null) {
$err[]='Ismingizni kiritishingiz shart';
}
elseif (strlen2($_POST['ank_name'])<2) {
$err[]='Ismingiz judayam qisqa';
}
elseif (strlen2($_POST['ank_name'])>32) {
$err[]='Ismingiz 32 belgidan oshmasligi kerak';
}
elseif (preg_match("#[a-z]+#ui", $_POST['nick']) && preg_match("#[а-я]+#ui", $_POST['nick'])) {
$err[]='Ismingizda taqiqlangan belgilar bor';
}
$_SESSION['ank_name']=$_POST['ank_name'];
####---------- Tug'ilgan kuni
if ($_POST['ank_d_r']==null) {
$err[]='Tug\'ilgan kuningizni kiritishingiz shart';
}
elseif (is_numeric($_POST['ank_d_r']) && $_POST['ank_d_r']>0 && $_POST['ank_d_r']<=31) {}
else {
$err[]='Tug\'ilgan kuningiz noto\'g\'ri formatda kiritildi';
}
$_SESSION['ank_d_r']=$_POST['ank_d_r'];
####---------- Tug'ilgan oyi
if ($_POST['ank_m_r']==null) {
$err[]='Tug\'ilgan oyingizni kiritishingiz shart';
}
elseif (is_numeric($_POST['ank_m_r']) && $_POST['ank_m_r']>0 && $_POST['ank_m_r']<=12) {}
else {
$err[]='Tug\'ilgan oyingizni kiritishda xatolik yuz berdi';
}
$_SESSION['ank_m_r']=$_POST['ank_m_r'];
####---------- Tug'ilgan yili
if ($_POST['ank_g_r']==null) {
$err[]='Tug\'ilgan yilingizni kiritishingiz shart';
}
elseif (is_numeric($_POST['ank_g_r']) && $_POST['ank_g_r']>1949 && $_POST['ank_g_r']<=2005) {}
else {
$err[]='Tug\'ilgan yilingizni kiritishda xatolik yuz berdi';
}
$_SESSION['ank_g_r']=$_POST['ank_g_r'];
if (strlen2($_POST['pass1'])<6)$err[]='Parol 6 yoki undan ortiq belgidan bo`lish kerak';
if (strlen2($_POST['pass1'])>32)$err[]='Parol 32 belgidan oshmasin';
if ($_POST['pass1']!=$_POST['pass2'])$err[]='Parolni qaytarishda hato';
if (!isset($err)) {
mysql_query("INSERT INTO `user` (`nick`, `pass`, `date_reg`, `date_last`, `pol`, `ank_name`, `ank_d_r`, `ank_m_r`, `ank_g_r`) values('".$_SESSION['reg_nick']."', '".shif($_POST['pass1'])."', '$time', '$time', '".intval($_POST['pol'])."', '".my_esc($_POST['ank_name'])."', '".intval($_POST['ank_d_r'])."', '".intval($_POST['ank_m_r'])."', '".intval($_POST['ank_g_r'])."')",$db);
//mysql_query("INSERT INTO `user` (`nick`, `pass`, `date_reg`, `date_last`, `pol`) values('".$_SESSION['reg_nick']."', '".shif($_POST['pass1'])."', '$time', '$time', '".intval($_POST['pol'])."')",$db);
$user=mysql_fetch_assoc(mysql_query("SELECT * FROM `user` WHERE `nick` = '".my_esc($_SESSION['reg_nick'])."' AND `pass` = '".shif($_POST['pass1'])."' LIMIT 1"));
if (isset($_SESSION['http_referer']))
mysql_query("INSERT INTO `user_ref` (`time`, `id_user`, `type_input`, `url`) VALUES ('$time', '$user[id]', 'reg', '".my_esc($_SESSION['http_referer'])."')");
$_SESSION['id_user']=$user['id'];
setcookie('id_user', $user['id'], time()+60*60*24*365);
setcookie('pass', cookie_encrypt($_POST['pass1'],$user['id']), time()+60*60*24*365);
msg('Ro`yhatdan o`tish muvaffaqiyatli bajarildi, OMAD');
mysql_query("INSERT INTO `gb_jurnal` (`id_user`, `time`, `id_kont`) values('$user[id]', '$time', '$user[id]')");
mysql_query("INSERT INTO `mail` (`id_user`, `id_kont`, `msg`, `time`) values('0', '$user[id]', '$mess1', '$time')");
mysql_query("UPDATE `user` SET `balls` = '".($user['balls']+3000)."' WHERE `id` = '$user[id]' LIMIT 1");
echo "<div class='menu'>Avtokirish uchun ushbu manzilni saqlab oling!<br />";
echo "<form method='post' action='/?$passgen' id='login'>\n";
echo "<input style='border-radius:25px;border:1px solid gray;width:99%;height:20px;'type='text' value='http://$_SERVER[SERVER_NAME]/?id=$user[id]&pass=".htmlspecialchars($_POST['pass1'])."' /><br />\n";
echo "<input style='border-radius:15px;border:px solid #228B22;width:36%;height:27px;' type='submit' value='Davom etish' />\n";
echo "</form></div>\n";
echo "\n";
include_once 'sys/inc/tfoot.php';
}
}
if (isset($_POST['ok']))$_SESSION['step']=1; else if (isset($_POST['no'])){header ("Location: /aut.php?".SID);
exit;
}
elseif (isset($_POST['nick']) && $_POST['nick']!=NULL )
{
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `nick` = '".my_esc($_POST['nick'])."'"),0)==0)
{
$nick=my_esc($_POST['nick']);
if (!eregi('^[a-z]{1}[a-z0-9]{1,19}[-]{0,1}[_]{0,2}[a-z0-9]{1,20}$',$_POST['nick']))$err[]='Loginda taqiqlangan belgilar ishlatilgan';
if (ereg("\=|\]|\[|\^|\Adm|\Sistem|\Moder|\System|\adm|\sistem|\moder|\system|\ <|>",$nick)){$err='Logindada taqiqlangan so`zlar ishlatilgan!';}
if (strlen2($nick)<3)$err[]='Login juda qisqa';
if (strlen2($nick)>32)$err[]='Loginda ko`pi bilan 32 ta belgi bo`lish kerak';
}
else $err[]='Nik: "'.stripcslashes(htmlspecialchars($_POST['nick'])).'" ro`yhatga olingan, iltimos boshqa nik tanlang';
if (!isset($err)){
$_SESSION['reg_nick']=$nick;
$_SESSION['step']=1;
msg ("Login \"$nick\" ro`yhatga olinish mumkin");
}
}
err();
if (isset($_SESSION['step']) && $_SESSION['step']==1){
echo "<div class='menu'>";
echo "<form method='post' action='/reg.php?$passgen'>\n";
echo "Loginingiz:<br /><input style='border-radius:25px;border:1px solid gray;width:99%;height:20px;'type='text' name='nick' maxlength='32' value='$_SESSION[reg_nick]' /> <span style=\"color:red\"></span><br />\n";
echo "<input style='border-radius:15px;border:1px solid #228B22;width:30%;height:27px;' type='submit' value='O`zgartirish' />\n";
echo "</form><br />\n";
echo "<form method='post' action='/reg.php?$passgen'>\n";
echo "Ismingiz: (3-32 belgi)<br />\n";
echo "<input style='border-radius:25px;border:1px solid gray;width:99%;height:20px;'type=\"text\" name=\"ank_name\" value=\"$_SESSION[ank_name]\" maxlength=\"32\" /> <span style=\"color:red\"></span><br />\n";
//echo "Familiyangiz: (<a href=\"#\" title=\"Ma'lumot\" onclick=\"alert('Familiyangiz 3-32 belgidan iborat bo\'lishi kerak.')\">?</a>)<br />\n";
//echo "<input type=\"text\" name=\"ank_surname\" value=\"$_SESSION[ank_surname]\" maxlength=\"32\" /> <span style=\"color:red\">*</span><br />\n";
echo "Tug'ilgan sanangiz:<br />\n";
echo "<select name=\"ank_d_r\">\n";
echo "<option value=''>---</option>\n";
$ank_d_r=1;
while ($ank_d_r < 32) {
echo "<option ".(($_SESSION['ank_d_r']==$ank_d_r)?"selected=\"selected\" ":null)."value='$ank_d_r'>$ank_d_r</option>\n";
$ank_d_r++;
}
echo "</select>\n";
echo "<select name=\"ank_m_r\">\n";
echo "<option ".(($_SESSION['ank_m_r']==0)?"selected=\"selected\" ":null)."value=''>---</option>\n";
echo "<option ".(($_SESSION['ank_m_r']==1)?"selected=\"selected\" ":null)."value='1'>Yanvar</option>\n";
echo "<option ".(($_SESSION['ank_m_r']==2)?"selected=\"selected\" ":null)."value='2'>Fevral</option>\n";
echo "<option ".(($_SESSION['ank_m_r']==3)?"selected=\"selected\" ":null)."value='3'>Mart</option>\n";
echo "<option ".(($_SESSION['ank_m_r']==4)?"selected=\"selected\" ":null)."value='4'>Aprel</option>\n";
echo "<option ".(($_SESSION['ank_m_r']==5)?"selected=\"selected\" ":null)."value='5'>May</option>\n";
echo "<option ".(($_SESSION['ank_m_r']==6)?"selected=\"selected\" ":null)."value='6'>Iyun</option>\n";
echo "<option ".(($_SESSION['ank_m_r']==7)?"selected=\"selected\" ":null)."value='7'>Iyul</option>\n";
echo "<option ".(($_SESSION['ank_m_r']==8)?"selected=\"selected\" ":null)."value='8'>Avgust</option>\n";
echo "<option ".(($_SESSION['ank_m_r']==9)?"selected=\"selected\" ":null)."value='9'>Sentabr</option>\n";
echo "<option ".(($_SESSION['ank_m_r']==10)?"selected=\"selected\" ":null)."value='10'>Oktyabr</option>\n";
echo "<option ".(($_SESSION['ank_m_r']==11)?"selected=\"selected\" ":null)."value='11'>Noyabr</option>\n";
echo "<option ".(($_SESSION['ank_m_r']==12)?"selected=\"selected\" ":null)."value='12'>Dekabr</option>\n";
echo "</select>\n";
echo "<select name=\"ank_g_r\">\n";
echo "<option value=''>---</option>\n";
$ank_g_r=1950;
while ($ank_g_r < 2006) {
echo "<option ".(($_SESSION['ank_g_r']==$ank_g_r)?"selected=\"selected\" ":null)."value='$ank_g_r'>$ank_g_r</option>\n";
$ank_g_r++;
}
echo "</select>\n";
echo "<span style=\"color:red\">*</span><br />\n";
echo "Jinsingiz:<br /><select name='pol'><option value='1'>Erkak</option><option value='0'>Ayol</option></select><br />\n";
echo "Parolni kiriting (6-32 belgi):<br /><input style='border-radius:25px;border:1px solid gray;width:99%;height:20px;'type='password' name='pass1' maxlength='32' /> <span style=\"color:red\"></span><br />\n";
echo "Parolni takrorlang:<br /><input style='border-radius:25px;border:1px solid gray;width:99%;height:20px;'type='password' name='pass2' maxlength='32' /> <span style=\"color:red\"></span><br />\n";
//echo "<img src='/captcha.php?$passgen&SESS=$sess' width='100' height='30' alt='Tekshiruv kodi' /><br />\n<input name='chislo' size='5' maxlength='5' value='' type='text' /> <span style=\"color:red\">*</span><br/>\n";
echo "<input style='border-radius:15px;border:1px solid #228B22;width:36%;height:27px;' type='submit' value='Davom etish' />\n";
echo "</form></div>\n";
}
else
{
echo "<div class='menu'>";
echo "<form method='post' action='/reg.php?$passgen'>\n";
echo "Saytimizda login faqat saytga kirish uchun ishlaydi.<br/>";
echo "<b>Login:</b></b> Faqat lotin alifbosi va \"-\", \"_\" belgilaridan foydalaning!<br /><input style='border-radius:35px;border:2px solid gray;width:99%;height:13px;'type='text' name='nick' maxlength='32' /><br />\n";
echo "<input style='border-radius:15px;border:0px solid #228B22;width:36%;height:27px;' type='submit' value='Davom etish' />\n";
echo "</form></div>\n";
}
echo "</div><div class='pfoot'></div>\n";
include_once 'style/themes/wap/foot.php';
?>