<?php
   #####################################
   ##                                 ##
 ####     Powered by (YoSH-MaSTeR)    ####
 ####         UZMASTER.RU             ####
   ##                                 ##
   #####################################

define('_IN_JOHNCMS', 1);
$textl = 'Anketa yopish va ochish';
$headmod = "anketay";
require_once ("../incfiles/core.php");
require_once ("../incfiles/head.php");

$yosh=mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id`='$user_id'"));
if ($user['id'] != $user_id) {
switch($mod){
default:
echo'<div class="menu">Bizning saytimizda siz anketangizni yopish va ochish funksiyasini yoqishingiz mumkin.
<br/>Xizmatni faollashtirish narxi: 500 ball.<br/>
Sizning hisobingizda <b>'.$yosh['balans'].'</b> ball bor.<br/>';
if($yosh['eas']==0){
echo 'Sizning anketangiz: <b>Ochiq</b>';
} else {
echo 'Sizning anketangiz: <b>Yopiq</b>';
}
echo '</div>';
if($yosh['balans']>=500){
if($yosh['eas']==0){
echo '<div class="menu"><a href="?mod=1"><span class="but">Anketani yopish</span></a></div>';
} else {
echo '<div class="menu"><a href="?mod=2"><span class="but">Anketani ochish</span></a></div>';
}}else {
echo '<div class="menu"><font color="red">Afsuski bu xizmatni faollashtirishga ballaringiz yetarli emas.</font></div>';
}
break;

case'1':
$bale=$yosh['balans']-500;
mysql_query("UPDATE `users` SET `balans`='$bale' WHERE `id`='$user_id'");
mysql_query("UPDATE `users` SET `eas`='1' WHERE `id`='$user_id'");
echo'<div class="menu"><font color="red">Xizmat muvaffaqiyatli faollashtirildi! Sizning <a href="/users/profile.php">Anketangiz</a> boshqalar uchun yopildi!</font></div>';
break;

case'2':
$bale=$yosh['balans']-500;
mysql_query("UPDATE `users` SET `balans`='$bale' WHERE `id`='$user_id'");
mysql_query("UPDATE `users` SET `eas`='0' WHERE `id`='$user_id'");
echo'<div class="menu"><font color="red">Xizmat muvaffaqiyatli faollashtirildi! Sizning <a href="/users/profile.php">Anketangiz</a> endi xama uchun ochiq!</font></div>';
break;

}} else {
echo'<div class="menu"> Xato! Siz ro\'yhatdan o\'tmagansiz!<br></div>';
}
require_once ("../incfiles/end.php");

?>








