|
<?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']);
$stat = strong($_POST['stat']);
$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."', `stat` = '".$stat."', `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">
Имя:
<input type="text" name="name" value="'.$user['name'].'"/>
Страна:
<input type="text" name="strana" value="'.$user['strana'].'"/>
Город:
<input type="text" name="gorod" value="'.$user['gorod'].'"/>
О себе:
<input type="text" name="osebe" value="'.$user['osebe'].'"/>
Статус:
<input type="text" name="stat" value="'.$user['stat'].'"/>
Skype:
<input type="text" name="skype" value="'.$user['skype'].'"/>
ICQ:
<input type="text" name="icq" value="'.$user['icq'].'"/>
Сайт:
<input type="text" name="url" value="'.$user['url'].'"/>
<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');
?>