<?php
define('_IN_JOHNCMS', 1);
$headmod = 'color';
$textl = 'Ragli nik sotib olish';
require ("../incfiles/core.php");
require ("../incfiles/head.php");
$user = functions::get_user($user);
$user = $datauser;
if (!$user_id) {
    display_error('Faqat sayt azolari uchun ruhsat berilgan!');
    require_once ('../incfiles/end.php');
    exit;
}

switch($act){
case 'gradient' :
echo '<div class="phdr">Boshlang`ich rang:</div>';
if($user['balans']>=1000){
echo '<div class="menu"><form action="nik.php?act=gradientbuy" name="color" method="post">
<input type="radio" name="color" value="006400"/><font color="#006400"> Темно-зеленый</font><br />
<input type="radio" name="color" value="0000FF"/><font color="#0000FF"> Синий</font><br />
<input type="radio" name="color" value="000080"/><font color="#000080"> Темно-синий</font><br />
<input type="radio" name="color" value="00FFFF"/><font color="#00FFFF"> Голубой</font><br />
<input type="radio" name="color" value="FFFF00"/><font color="#FFFF00"> Желтый</font><br />
<input type="radio" name="color" value="808080"/><font color="#808080"> Серый</font><br />
<input type="radio" name="color" value="C0C0C0"/><font color="#C0C0C0"> Светло-серый</font><br />
<input type="radio" name="color" value="9ACD32"/><font color="#9ACD32"> Желто-зеленый</font><br />
<input type="radio" name="color" value="7FFF00"/><font color="#7FFF00"> Салатовый</font><br />
<input type="radio" name="color" value="90EE90"/><font color="#90EE90"> Светло-зеленый</font><br />
<input type="radio" name="color" value="D1E231"/><font color="#D1E231"> Грушевый</font><br/>
<input type="radio" name="color" value="4B0082"/><font color="#4B0082"> Индиго</font><br />
<input type="radio" name="color" value="8A2BE2"/><font color="#8A2BE2"> Фиолетовый</font><br />
<input type="radio" name="color" value="991199"/><font color="#991199"> Фиолетово-баклажанный</font><br />
<input type="radio" name="color" value="008B8B"/><font color="#008B8B"> Темно-голубой</font><br />
<input type="radio" name="color" value="4682B4"/><font color="#4682B4"> Голубая сталь</font><br />
<input type="radio" name="color" value="87CEEB"/><font color="#87CEEB"> Светло-голубой</font><br />
<input type="radio" name="color" value="FF7F50"/><font color="#FF7F50"> Кораловый</font><br />
<input type="radio" name="color" value="8B4513"/><font color="#8B4513"> Коричневый</font><br />
<input type="radio" name="color" value="FF2400"/><font color="#FF2400"> Алый</font><br />
<input type="radio" name="color" value="DC143C"/><font color="#DC143C"> Малиновый</font><br />
<input type="radio" name="color" value="FF1493"/><font color="#FF1493"> Ярко-розовый</font><br />
<input type="radio" name="color" value="FF69B4"/><font color="#FF69B4"> Розовый</font><br />
<input type="radio" name="color" value="FF8C00"/><font color="#FF8C00"> Оранжевый</font><br />
<input type="radio" name="color" value="FFD700"/><font color="#FFD700"> Золото</font><br />
<input type="radio" name="color" value="BDB76B"/><font color="#BDB76B"> Хаки</font><br />
<input type="radio" name="color" value="FFA07A"/><font color="#FFA07A"> Оранжево-розовый</font><br />
<input type="radio" name="color" value="008080"/><font color="#008080"> Мурена</font><br />
<input type="radio" name="color" value="FFDB58"/><font color="#FFDB58"> Горчичный</font><br />
<input type="radio" name="color" value="40826D"/><font color="#40826D"> Ядовито-зелёный</font><br />
<input type="radio" name="color" value="1E90FF"/><font color="#1E90FF"> Защитно-синий</font><br />
<input type="radio" name="color" value="808000"/><font color="#808000"> Оливковый</font><br />
<input type="radio" name="color" value="660000"/><font color="#660000"> Коричнево-малиновый</font><br />
<input type="radio" name="color" value="D2B48C"/><font color="#D2B48C"> Желто-коричневый</font><br /></div>

<div class="phdr">Yakuniy rang:</div>
<div class="menu"><input type="radio" name="color2" value="006400"/><font color="#006400"> Темно-зеленый</font><br />
<input type="radio" name="color2" value="0000FF"/><font color="#0000FF"> Синий</font><br />
<input type="radio" name="color2" value="000080"/><font color="#000080"> Темно-синий</font><br />
<input type="radio" name="color2" value="00FFFF"/><font color="#00FFFF"> Голубой</font><br />
<input type="radio" name="color2" value="FFFF00"/><font color="#FFFF00"> Желтый</font><br />
<input type="radio" name="color2" value="808080"/><font color="#808080"> Серый</font><br />
<input type="radio" name="color2" value="C0C0C0"/><font color="#C0C0C0"> Светло-серый</font><br />
<input type="radio" name="color2" value="9ACD32"/><font color="#9ACD32"> Желто-зеленый</font><br />
<input type="radio" name="color2" value="7FFF00"/><font color="#7FFF00"> Салатовый</font><br />
<input type="radio" name="color2" value="90EE90"/><font color="#90EE90"> Светло-зеленый</font><br />
<input type="radio" name="color2" value="D1E231"/><font color="#D1E231"> Грушевый</font><br/>
<input type="radio" name="color2" value="4B0082"/><font color="#4B0082"> Индиго</font><br />
<input type="radio" name="color2" value="8A2BE2"/><font color="#8A2BE2"> Фиолетовый</font><br />
<input type="radio" name="color2" value="991199"/><font color="#991199"> Фиолетово-баклажанный</font><br />
<input type="radio" name="color2" value="008B8B"/><font color="#008B8B"> Темно-голубой</font><br />
<input type="radio" name="color2" value="4682B4"/><font color="#4682B4"> Голубая сталь</font><br />
<input type="radio" name="color2" value="87CEEB"/><font color="#87CEEB"> Светло-голубой</font><br />
<input type="radio" name="color2" value="FF7F50"/><font color="#FF7F50"> Кораловый</font><br />
<input type="radio" name="color2" value="8B4513"/><font color="#8B4513"> Коричневый</font><br />
<input type="radio" name="color2" value="FF2400"/><font color="#FF2400"> Алый</font><br />
<input type="radio" name="color2" value="DC143C"/><font color="#DC143C"> Малиновый</font><br />
<input type="radio" name="color2" value="FF1493"/><font color="#FF1493"> Ярко-розовый</font><br />
<input type="radio" name="color2" value="FF69B4"/><font color="#FF69B4"> Розовый</font><br />
<input type="radio" name="color2" value="FF8C00"/><font color="#FF8C00"> Оранжевый</font><br />
<input type="radio" name="color2" value="FFD700"/><font color="#FFD700"> Золото</font><br />
<input type="radio" name="color2" value="BDB76B"/><font color="#BDB76B"> Хаки</font><br />
<input type="radio" name="color2" value="FFA07A"/><font color="#FFA07A"> Оранжево-розовый</font><br />
<input type="radio" name="color2" value="008080"/><font color="#008080"> Мурена</font><br />
<input type="radio" name="color2" value="FFDB58"/><font color="#FFDB58"> Горчичный</font><br />
<input type="radio" name="color2" value="40826D"/><font color="#40826D"> Ядовито-зелёный</font><br />
<input type="radio" name="color2" value="1E90FF"/><font color="#1E90FF"> Защитно-синий</font><br />
<input type="radio" name="color2" value="808000"/><font color="#808000"> Оливковый</font><br />
<input type="radio" name="color2" value="660000"/><font color="#660000"> Коричнево-малиновый</font><br />
<input type="radio" name="color2" value="D2B48C"/><font color="#D2B48C"> Желто-коричневый</font><br/>


<input type="submit" name="submit" value="Sotib olish"/></form></div>';
echo '<div class="rmenu"><a href="nik.php?act=entergradient">Qolda terish</a></div>';
}else{
echo '<div class="phdr"><b>Balansingiz yetmadi</b></div>';
echo '<div class="menu">Sizda '.$user['balans'].', а kerak 1000. Yana ozroq ball yig`ib keling!</div>';
}
break;
case 'gradientbuy' :
if($user['balans']>=1000){
$color = ($_POST['color']); 
$color2 = ($_POST['color2']); 
mysql_query("UPDATE `users` SET `colornick` = '$color', `colornick2` = '$color2' ,`balans`=`balans`-1000  WHERE `id` = '$user_id' LIMIT 1");
echo '<div class="menu">Xarid uchun tabriklaymiz!, Endi nikingiz bu ko`rinishda: '.functions::gradient(''.$login.'', '' .$color. '',''.$color2.'').'. Xisobingizdan 1000 FCBCoins yechib olindi!</div>';
}else{
echo '<div class="menu">Sizda '.$user['balans'].', а kerak 1000. Yana ozroq ball yig`ib keling!</div>';
}
break;




case 'color' :
if($user['balans']>=500){
echo '<div class="phdr"><b>Bittalik rang</b></div>';
echo '<div class="menu"><form action="nik.php?act=colorbuy" name="color" method="post">
<input type="radio" name="color" value="006400"/><font color="#006400"> Темно-зеленый</font><br />
<input type="radio" name="color" value="0000FF"/><font color="#0000FF"> Синий</font><br />
<input type="radio" name="color" value="000080"/><font color="#000080"> Темно-синий</font><br />
<input type="radio" name="color" value="00FFFF"/><font color="#00FFFF"> Голубой</font><br />
<input type="radio" name="color" value="FFFF00"/><font color="#FFFF00"> Желтый</font><br />
<input type="radio" name="color" value="808080"/><font color="#808080"> Серый</font><br />
<input type="radio" name="color" value="C0C0C0"/><font color="#C0C0C0"> Светло-серый</font><br />
<input type="radio" name="color" value="9ACD32"/><font color="#9ACD32"> Желто-зеленый</font><br />
<input type="radio" name="color" value="7FFF00"/><font color="#7FFF00"> Салатовый</font><br />
<input type="radio" name="color" value="90EE90"/><font color="#90EE90"> Светло-зеленый</font><br />
<input type="radio" name="color" value="D1E231"/><font color="#D1E231"> Грушевый</font><br/>
<input type="radio" name="color" value="4B0082"/><font color="#4B0082"> Индиго</font><br />
<input type="radio" name="color" value="8A2BE2"/><font color="#8A2BE2"> Фиолетовый</font><br />
<input type="radio" name="color" value="991199"/><font color="#991199"> Фиолетово-баклажанный</font><br />
<input type="radio" name="color" value="008B8B"/><font color="#008B8B"> Темно-голубой</font><br />
<input type="radio" name="color" value="4682B4"/><font color="#4682B4"> Голубая сталь</font><br />
<input type="radio" name="color" value="87CEEB"/><font color="#87CEEB"> Светло-голубой</font><br />
<input type="radio" name="color" value="FF7F50"/><font color="#FF7F50"> Кораловый</font><br />
<input type="radio" name="color" value="8B4513"/><font color="#8B4513"> Коричневый</font><br />
<input type="radio" name="color" value="FF2400"/><font color="#FF2400"> Алый</font><br />
<input type="radio" name="color" value="DC143C"/><font color="#DC143C"> Малиновый</font><br />
<input type="radio" name="color" value="FF1493"/><font color="#FF1493"> Ярко-розовый</font><br />
<input type="radio" name="color" value="FF69B4"/><font color="#FF69B4"> Розовый</font><br />
<input type="radio" name="color" value="FF8C00"/><font color="#FF8C00"> Оранжевый</font><br />
<input type="radio" name="color" value="FFD700"/><font color="#FFD700"> Золото</font><br />
<input type="radio" name="color" value="BDB76B"/><font color="#BDB76B"> Хаки</font><br />
<input type="radio" name="color" value="FFA07A"/><font color="#FFA07A"> Оранжево-розовый</font><br />
<input type="radio" name="color" value="008080"/><font color="#008080"> Мурена</font><br />
<input type="radio" name="color" value="FFDB58"/><font color="#FFDB58"> Горчичный</font><br />
<input type="radio" name="color" value="40826D"/><font color="#40826D"> Ядовито-зелёный</font><br />
<input type="radio" name="color" value="1E90FF"/><font color="#1E90FF"> Защитно-синий</font><br />
<input type="radio" name="color" value="808000"/><font color="#808000"> Оливковый</font><br />
<input type="radio" name="color" value="660000"/><font color="#660000"> Коричнево-малиновый</font><br />
<input type="radio" name="color" value="D2B48C"/><font color="#D2B48C"> Желто-коричневый</font><br />

<input type="submit" name="submit" value="Sotib olish"/></form></div>';
echo '<div class="rmenu"><a href="nik.php?act=entercolor">Qo`lda terish</a></div>';
}else{
echo '<div class="menu">Sizda '.$user['balans'].', а kerak 500. Yana ozroq ball yig`ib keling!</div>';

}
break;
case 'colorbuy' :
if($user['balans']>=500){
$color = ($_POST['color']); 
mysql_query("UPDATE `users` SET `colornick` = '$color', `colornick2` = '$color' ,`balans`=`balans`-500  WHERE `id` = '$user_id' LIMIT 1");
echo '<div class="menu">Xarid uchun tabriklaymiz! , endi nikingiz bu ko`rinishda:  '.functions::gradient(''.$login.'', '' .$color. '',''.$color.'').'. Xisobingizdan 500 FCBCoins yechib olindi!</div>';
}else{
echo '<div class="menu">Sizda '.$user['balans'].', а kerak 500. Yana ozroq ball yig`ib keling!</div>';
}
break;



case 'entercolor' :

if($user['balans']>=500){
echo'<div class="phdr"><b>Qo`lda terish</b></div>';
echo '<div class="menu"><span style="color:red"><b>Rangni # siz kiriting!<br/>Misol: FF0000</b></span><br/>';
echo'<a href="?act=tablcolors">Ranglar jadvali</a>';
echo'<div><form action="nik.php?act=entercolorbuy" name="color" method="post">
Rang: # <textarea name="color" rows="1"></textarea><br/>
<input type="submit" name="submit" value="Sotib olish"/></form></div></div>';
echo '<div class="rmenu"><a href="nik.php?act=color">Jadvaldan kiritish</a></div>';
}else{
echo '<div class="menu">Sizda  '.$user['balans'].', а kerak 500. Yana ozroq ball yig`ib keling!</div>';
}
break;

case 'entercolorbuy' :
if($user['balans']>=500){
$color = ($_POST['color']); 
if ($color && mb_strlen($color) > 6  || $color && mb_strlen($color) < 6 ){
echo '<div class="bmenu">Taqiqlangan belgilar soni!</div>';
echo '<div class="menu"><a href="../users/color.php?act=entercolor">Orqaga</a></div>';
 require_once ('../incfiles/end.php');
    exit;
}
if (preg_match("/[^a-z,A-Z,0-9]/", mb_strtolower($color))){
echo '<div class="bmenu">Taqiqlangan belgilar!</div>';
echo '<div class="menu"><a href="../users/color.php?act=entercolor">Orqaga</a></div>';
 require_once ('../incfiles/end.php');
    exit;
}
mysql_query("UPDATE `users` SET `colornick` = '$color', `colornick2` = '$color' ,`balans`=`balans`-500  WHERE `id` = '$user_id' LIMIT 1");
echo '<div class="menu"> Xaridingiz bilan tabriklaymiz! endi nikingiz shunday: ko\'rinishda:'.functions::gradient(''.$login.'', '' .$color. '',''.$color.'').'.Sizning xisobingizdan 500  FCBCoins jechib olindi!</div>';
echo '<div class="menu"><a href="../users/nik.php">Tanlashga</a></div>';
}else{
echo '<div class="menu">Sizda  '.$user['balans'].', а kerak 500 Yana ozroq ball yig\'ib keling!</div>';
}
break;


case 'entergradient' :

if($user['balans']>=1000){
echo'<div class="phdr"><b>Qo\'lda terish</b></div>';
echo '<div class="menu"><span style="color:red"><b> Rangni# siz kiriting <br/>Misol: FF0000</b></span><br/>';
echo'<a href="?act=tablcolors">Ranglar jadvali</a>';
echo'<div><form action="nik.php?act=entergradientbuy" name="color" method="post">
Boshlang`ich rang: # <textarea name="color"  rows="1"></textarea><br/>
Yakuniy rang: # <textarea name="color2"  rows="1"></textarea><br/>
<input type="submit" name="submit" value="Sotib olish"/></form></div>
</div>';
echo '<div class="rmenu"><a href="nik.php?act=gradient">Jadvaldan tanlash</a></div>';
}else{
echo '<div class="menu">Sizda '.$user['balans'].', а kerak 1000. Yana ozroq ball yig`ib keling!</div>';
}
break;

case 'entergradientbuy' :
if($user['balans']>=1000){
$color = ($_POST['color']); 
$color2 = ($_POST['color2']); 
if ($color && mb_strlen($color) > 6 || $color2 &&  mb_strlen($color2) > 6 || $color && mb_strlen($color) < 6 || $color2 &&  mb_strlen($color2) < 6){
echo '<div class="bmenu">Taqiqlangan belgilar!</div>';
echo '<div class="menu"><a href="../users/color.php?act=entergradient">Orqaga</a></div>';
 require_once ('../incfiles/end.php');
    exit;
}
if (preg_match("/[^a-z,A-Z,0-9]/", mb_strtolower($color)) || preg_match("/[^a-z,A-Z,0-9]/", mb_strtolower($color2))){
echo '<div class="bmenu">Taqiqlangan belgilar!</div>';
echo '<div class="menu"><a href="../users/color.php?act=entergradient">Orqaga</a></div>';
 require_once ('../incfiles/end.php');
    exit;
}
mysql_query("UPDATE `users` SET `colornick` = '$color', `colornick2` = '$color2' ,`balans`=`balans`-1000  WHERE `id` = '$user_id' LIMIT 1");

echo '<div class="menu"> Xaridingiz bilan tabriklaymiz! endi nikingiz shunday: ko\'rinishda'.functions::gradient(''.$login.'', '' .$color. '',''.$color2.'').'.Sizning hisobingizdan1000 FCBCoins ishlatdingiz</div>';
}else{
echo '<div class="menu">Sizda  '.$user['balans'].', a kerak 1000. Yana ozroq ball yig`ib keling!</div>';
}
break;




case 'tablcolors' :
            include ('colors.inc');
            break;  
            

default :
echo '<div class="phdr"><b>Rang tanlash</b></div>';
echo '<div class="menu">';
echo '<li><a href="nik.php?act=color"><span style="color:#' . $colornick['colornick'] . '">Bir hil rangli</span></a> 500 FCBCoins</li>';
echo'<li><a href="nik.php?act=gradient">'.functions::gradient('Градиент', ''.$colornick['colornick'].'',''.$colornick['colornick2'].'').'</a> 1000 FCBCoins</li>';
echo'</div>';
}
require ("../incfiles/end.php");