Файл: in4at/profile.php
Строк: 213
<?php
##################################################################################################
## Script name : In4at ##
## Version : Final ##
## Made by : XPYCT(Сергей Мищенко) ##
## E-mail : bce-ok@bk.ru ##
## ICQ : 447-50-50-62 ##
## Site : http://vkontakte.ru/id31604521 ##
## Внимание! Скрипт распространяется бесплатно! Модификация W4at by XPYCT ##
##################################################################################################
define('REQ_2_chat', true);
require('4at_set.php');
if (isset($rm)) $rum = "&rm=$rm";
require('db_con.php');
require('style.php');
if ($py !== spy_code) require('us_info.php');
require('func.php');
$id = intval($id);
$level=str_replace("'", "", $level);
$pass=str_replace("'", "", $pass);
$name=str_replace("'", "", $name);
$trunsname=str_replace("'", "", $trunsname);
$sex=str_replace("'", "", $sex);
$day=str_replace("'", "", $day);
$month=str_replace("'", "", $month);
$year=str_replace("'", "", $year);
$city=str_replace("'", "", $city);
$trunscity=str_replace("'", "", $trunscity);
$op=str_replace("'", "", $op);
$trunsop=str_replace("'", "", $trunsop);
$mob=str_replace("'", "", $mob);
$trunsmob=str_replace("'", "", $trunsmob);
$mail=str_replace("'", "", $mail);
$infa=str_replace("'", "", $infa);
$trunsinfa=str_replace("'", "", $trunsinfa);
$us=$row['user'];
if(!@$go){
echo head;
if ($vv!=0) echo '<div class="d0"><b>Анкета '.$us.'</b></div>';
else echo '<card id="profile" title="Анкета '.$us.'"><p>';
if ($vv!=0) echo "<form action="profile.php?$wp&go=rew" method="post">";
echo $fsize1;
echo '*Ваш пароль:<br/>';
echo $fsize2;
echo "<input name="pass" maxlength="12" value="$row[pass]" title="pass" emptyok="false"/><br/>n";
echo $fsize1;
echo '*Ваше имя:<br/>';
echo $fsize2;
echo "<input name="name" maxlength="15" value="$row[name]" title="name" emptyok="false"/><br/>n";
@list( $day, $month, $year ) = split( '-', $row["birth"] );
echo $fsize1;
echo '*Дата рождения:<br/>';
echo $fsize2;
echo "<input size="2" name="day" value="$day" maxlength="2" format="*N" emptyok="false"/>-<input size="2" name="month" value="$month" maxlength="2" format="*N" emptyok="false"/>-<input size="4" name="year" value="$year" maxlength="4" format="*N" emptyok="false"/><br/>n";
echo $fsize1;
echo '*Город:<br/>';
echo $fsize2;
echo "<input name="city" maxlength="20" value="$row[city]" title="city" emptyok="false"/><br/>n";
echo $fsize1;
echo 'Сотовый оператор:<br/>';
echo $fsize2;
echo "<input name="op" maxlength="20" value="$row[op]" title="op" emptyok="true"/><br/>n";
echo $fsize1;
echo 'Модель телефона:<br/>';
echo $fsize2;
echo "<input name="mob" maxlength="20" value="$row[mob]" title="mob" emptyok="true"/><br/>n";
echo $fsize1;
echo 'Номер телефона:<br/>';
echo $fsize2;
echo "+<input size="11" name="number" maxlength="11" value="$row[number]" format="*N" title="number" emptyok="false"/><br/>n";
echo $fsize1;
echo 'E-mail:<br/>';
echo $fsize2;
echo "<input name="mail" maxlength="30" value="$row[mail]" title="mail" emptyok="true"/><br/>n";
echo $fsize1;
echo 'ICQ:<br/>';
echo $fsize2;
echo "<input size="9" name="icq" maxlength="9" value="$row[icq]" format="*N" title="icq" emptyok="true"/><br/>n";
echo $fsize1;
echo '*О себе:<br/>';
echo $fsize2;
echo "<input name="infa" maxlength="100" value="$row[infa]" title="infa" emptyok="false"/><br/>n";
echo $fsize1;
echo 'Текст автоответчика(записки):<br/>';
echo $fsize2;
echo "<input name="avtootvet" maxlength="50" value="$row[avtootvet]" title="avtootvet" emptyok="true"/><br/>n";
if ($row['translit']==1){
echo "<select name="trun" multiple="true">";
echo "<option value="1">Транслит</option></select><br/>";
}
if ($vv!=0){
echo "<input class="ibutton" type="submit" value="Сохранить"/></form>";
echo $fsize1;
} else {
echo $fsize1;
echo divide;
echo "<anchor title="go">Сохранить<go href="profile.php?$wp&go=rew$rum" method="post">n";
echo "<postfield name="pass" value="$(pass)"/>n";
echo "<postfield name="name" value="$(name)"/>n";
echo "<postfield name="day" value="$(day)"/>n";
echo "<postfield name="month" value="$(month)"/>n";
echo "<postfield name="year" value="$(year)"/>n";
echo "<postfield name="city" value="$(city)"/>n";
echo "<postfield name="op" value="$(op)"/>n";
echo "<postfield name="mob" value="$(mob)"/>n";
echo "<postfield name="number" value="$(number)"/>n";
echo "<postfield name="mail" value="$(mail)"/>n";
echo "<postfield name="icq" value="$(icq)"/>n";
echo "<postfield name="infa" value="$(infa)"/>n";
echo "<postfield name="avtootvet" value="$(avtootvet)"/>n";
if ($row['translit']==1) echo "<postfield name="trun" value="$(trun)"/>";
echo '</go></anchor><br/>';
}
echo divide;
if (isset($rm)) echo "<a href="chat.php?$wp&rm=$rm">В чат</a><br/>";
echo "<a href="cabinet.php?$wp">Кабинет</a><br/>";
echo '<a href="enter.php?'.$wp.'">Пpuxoжaя</a><br/>';
echo $fsize2;
echo foot;
mysql_close ($link);
} else {
$error = true;
$emp = 'Не заполнены обязательные поля!';
$emp2 = 'Heпpaвuльнo зaпoлнeнo oднo uз пoлeй!';
$wrongdate = 'Не верно указана дата рождения! Oна должна иметь формат дд-мм-гггг, и быть реальной!';
$god=date("Y")-10;
if ($trun==1){
$name=trun_to_rus($name);
$city=trun_to_rus($city);
$op=trun_to_rus($op);
$infa=trun_to_rus($infa);
$avtootvet=trun_to_rus($avtootvet);
}
if (!$pass) {
$msg = "$emp (Пароль)";
} elseif(!preg_match("!^[a-z0-9]+$!i",$pass)) {
$msg = 'В пароле обнаружены запрешенные знаки!';
} elseif (!$name) {
$msg = "$emp (Имя)";
} elseif (!$day) {
$msg = "$emp (День)";
} elseif (!$month) {
$msg = "$emp (Месяц)";
} elseif (!$year) {
$msg = "$emp (Год)";
} elseif (!is_numeric($day)) {
$msg = "$emp2 (День)";
} elseif (!is_numeric($month)) {
$msg = "$emp2 (Месяц)";
} elseif (!is_numeric($year)) {
$msg = "$emp2 (Год)";
} elseif (strlen($pass) < 4) {
$msg = 'Пароль не должен быть короче четырёх символов!';
} elseif ((strlen($day) < 1)||($day>31)||($day <=0)){
$msg = "$wrongdate (День)";
} elseif ((strlen($month) < 1)||($month>12)||($month <=0)){
$msg = "$wrongdate (Месяц)";
} elseif ((strlen($year) !== 4)||($year>=$god)||($year<1950)){
$msg = "$wrongdate (Год)";
} elseif (!$city) {
$msg = "$emp (Город)";
} elseif (!$infa) {
$msg = "$emp (Инфа)";
} else {
$pass = substr(check($pass),0,20);
$name = substr(check($name),0,30);
$day = intval($day);
$month = intval($month);
$year = intval($year);
$city = substr(check($city),0,40);
$mail = substr(check($mail),0,30);
$site = substr(check($site),0,30);
$icq = substr(intval($icq),0,9);
$number = substr(preg_replace("[^0-9]","", $number),0,11);
$infa = substr(check($infa),0,200);
$op = substr(check($op),0,40);
$mob = substr(check($mob),0,40);
$avtootvet = substr(check($avtootvet),0,100);
if ($day < 10 and $day > 0) $day = '0'.$day;
if ($month < 10 and $month > 0) $month = '0'.$month;
if (!eregi("^[a-z0-9._-]+@[a-z0-9._-]+.[a-z]{2,4}$", $mail))$mail="";
$result = mysql_query("Select * users where id = '".$id."' LIMIT 1;");
if (mysql_affected_rows() == 0) {
$msg = 'database error...';
} else {
$birth = "$day-$month-$year";
$ins_str = "Update users set pass='".$pass."', name='".$name."', birth='".$birth."', city='".$city."', mail='".$mail."', icq='".$icq."', infa='".$infa."', op='".$op."', mob='".$mob."', number='".$number."', avtootvet='".$avtootvet."' where id ='".$id."' LIMIT 1;";
if (mysql_query($ins_str)) {
$msg = 'Ваш профайл изменён';
$error = False;
} else {
$msg = 'database error...';
}
}
mysql_close($link);
}
if ($error) {
echo head;
if ($vv!=0) {echo '<div class="d0"><b>Ошибка</b></div>';}
else echo "<card id="error" title="Ошибка" ontimer="profile.php?$wp"><timer value="15"/><p align="center">";
echo $fsize1;
echo '<b>'.$msg.'</b><br/>';
echo "<a href="profile.php?$wp">Назад</a><br/>";
echo $fsize2;
echo foot;
} else {
echo head;
if ($vv!=0) {echo '<div class="d0"><b>Ok!</b></div>';}
else {
if (isset($rm)) echo "<card id="done" title="OK" ontimer="chat.php?$wp&rm=$rm"><timer value="30"/><p align="center">";
else echo "<card id="ok" title="OK" ontimer="enter.php?$wp"><timer value="30"/><p align="center">";
}
echo $fsize1;
echo '<b>'.$msg.'</b><br/>';
if (isset($rm)) echo "<a href="chat.php?$wp&rm=$rm">В чат</a><br/>";
else echo "<a href="cabinet.php?$wp">Кабинет</a><br/>";
echo $fsize2;
echo foot;
}
}
?>