Файл: user/red_ank1.php
Строк: 113
<?php
$title = 'Редактировать анкету';
require_once ('../system/function.php');
require_once ('../system/header.php');
# закрываем от гостей
if(!$user['id']) exit(header('Location: '.$HOME));
echo '<div class="title"><a href="'.$HOME.'/user/cab.php">Личный кабинет</a> | Редактировать анкету</div>';
if(isset($_REQUEST['submit'])) {
$name = strong($_POST['name']);
$strana = strong($_POST['strana']);
$gorod = strong($_POST['gorod']);
$osebe = strong($_POST['osebe']);
$skype = strong($_POST['skype']);
$icq = strong($_POST['icq']);
$url = strong($_POST['url']);
$name = strong($_POST['name']);
$rating = $user['rating'];
if(!empty($_POST['name'])) {
if (($rating + 0.01) <= 0.01) {
$rating = $rating + 0.01;
mysql_query("UPDATE `users` SET `rating` = '".$rating."' WHERE `id` = '".$user['id']."'");
}
}
$strana = strong($_POST['strana']);
if(!empty($_POST['strana'])) {
if (($rating + 0.01) <= 0.02) {
$rating = $rating + 0.01;
mysql_query("UPDATE `users` SET `rating` = '".$rating."' WHERE `id` = '".$user['id']."'");
}
}
$gorod = strong($_POST['gorod']);
if(!empty($_POST['gorod'])) {
if (($rating + 0.01) <= 0.03) {
$rating = $rating + 0.01;
mysql_query("UPDATE `users` SET `rating` = '".$rating."' WHERE `id` = '".$user['id']."'");
}
}
$osebe = strong($_POST['osebe']);
if(!empty($_POST['osebe'])) {
if (($rating + 0.01) <= 0.04) {
$rating = $rating + 0.01;
mysql_query("UPDATE `users` SET `rating` = '".$rating."' WHERE `id` = '".$user['id']."'");
}
}
$stat = strong($_POST['stat']);
if(!empty($_POST['stat'])) {
if (($rating + 0.01) <= 0.05) {
$rating = $rating + 0.01;
mysql_query("UPDATE `users` SET `rating` = '".$rating."' WHERE `id` = '".$user['id']."'");
}
}
$skype = strong($_POST['skype']);
if(!empty($_POST['skype'])) {
if (($rating + 0.01) <= 0.06) {
$rating = $rating + 0.01;
mysql_query("UPDATE `users` SET `rating` = '".$rating."' WHERE `id` = '".$user['id']."'");
}
}
$icq = strong($_POST['icq']);
if(!empty($_POST['icq'])) {
if (($rating + 0.01) <= 0.07) {
$rating = $rating + 0.01;
mysql_query("UPDATE `users` SET `rating` = '".$rating."' WHERE `id` = '".$user['id']."'");
}
}
$url = strong($_POST['url']);
if(!empty($_POST['url'])) {
if (($rating + 0.01) <= 0.08) {
$rating = $rating + 0.01;
mysql_query("UPDATE `users` SET `rating` = '".$rating."' WHERE `id` = '".$user['id']."'");
}
}
mysql_query("UPDATE `users` SET `name` = '".$name."', `strana` = '".$strana."', `gorod` = '".$gorod."', `osebe` = '".$osebe."', `sex` = '".$sex."', `skype` = '".$skype."', `icq` = '".$icq."', `url` = '".$url."' WHERE `id` = '".$user['id']."'");
echo '<div class="podmenu"><b><center>Данные сохранены!</center></b></div>';
echo '<div class="menudiv"><a href="'.$HOME.'/user/cab.php" class="k_menu">Назад в кабинет</div></a>';
require_once ('../system/footer.php'); exit;
}
echo '<div class="podmenu"><form action="" method="POST">
Имя:<br/> <input type="text" name="name" value="'.$user['name'].'"/> <br />
Страна:<br/> <input type="text" name="strana" value="'.$user['strana'].'"/> <br />
Город:<br/> <input type="text" name="gorod" value="'.$user['gorod'].'"/> <br />
О себе:<br/> <input type="text" name="osebe" value="'.$user['osebe'].'"/> <br />
Ваш пол:<br /><select name="sex"><option value="1">Мужской</option><option value="2">Женский</option></select><br/>
Skype:<br/> <input type="text" name="skype" value="'.$user['skype'].'"/> <br />
ICQ:<br/> <input type="text" name="icq" value="'.$user['icq'].'"/> <br />
Сайт:<br/> <input type="text" name="url" value="'.$user['url'].'"/> <br />
<input type="submit" name="submit" value="Редактировать" />
</form></div>
<div class="menudiv"><a href="'.$HOME.'/user/cab.php" class="k_menu">Назад в кабинет</div></a>';
//-----Подключаем низ-----//
require_once ('../system/footer.php');
?>