<?

$ncol = (int) $_GET['init_color'];
if($ncol!=''){
if($ncol == 1){$color = 'El_1';}
elseif($ncol == 2){$color = 'El_2';}
elseif($ncol == 3){$color = 'El_3';}
elseif($ncol == 4){$color = 'El_4';}
elseif($ncol == 5){$color = 'El_5';}
elseif($ncol == 6){$color = 'El_6';}

elseif($ncol == 7){$color = 'El_7';}
elseif($ncol == 8){$color = 'El_8';}
elseif($ncol == 9){$color = 'El_9';}
elseif($ncol == 10){$color = 'El_10';}
elseif($ncol == 11){$color = 'El_11';}
elseif($ncol == 12){$color = 'El_12';}
elseif($ncol == 13){$color = 'El_13';}
elseif($ncol == 14){$color = 'El_14';}
elseif($ncol == 15){$color = 'El_15';}
elseif($ncol == 16){$color = 'El_16';}
elseif($ncol == 17){$color = 'El_17';}
elseif($ncol == 18){$color = 'El_18';}
elseif($ncol == 19){$color = 'El_19';}
elseif($ncol == 20){$color = 'El_20';}


else {$color = '';}

if($ku['zkl']>=1){
mysql_query('UPDATE `kolhoz_user` SET `color_nick`="'.$color.'" WHERE `id`="'.$ku['id'].'"');

mysql_query("UPDATE `kolhoz_user` SET `zkl` = '".($ku['zkl']-1)."' WHERE `id` = '$ku[id]'");
mysql_query("UPDATE `kolhoz_user` SET `color_nick`='".$color."' WHERE `id`='$ku[id]'");
$_SESSION['yas']=1;
header('location:?col_nik');
}else{$_SESSION['zkl']=1-$ku['zkl'];
$_SESSION['no']=1;
header("Location:?col_nik");}
exit;
}

if(isset($_SESSION['no'])){echo "<div class='block'><center><font color='tomato'>У вас нет ключей!</font></center></div>"; unset($_SESSION['no']);}
if(isset($_SESSION['yas'])){echo "<div class='block'><center><font color='violet'>Вы успешно сменили цвет ника!</font></center></div>"; unset($_SESSION['yas']);}


echo '<div class="event"><h1>Цвет вашего ника</h1></div>'."\n";
echo '<div class="content"><div class="block">'."\n";
echo '<li>Вид вашего ника: '.nc($ku['id']).'</li>'."\n";
echo '<li>Цена смены цвета: <b>1</b><img width="16" height="16" src="img/icons/zkl.png" alt="o"></li>'."\n";
echo '<div style="padding:3px;">'."\n";
echo '<style type="text/css">.color_nick{display:inline-block; border-radius:3px; padding:3px 6px;}</style>'."\n";
echo '<a href="?col_nik&init_color=1" class="color_nick" style="background:#FF00FF;">&nbsp;&nbsp;&nbsp;</a> '."\n";
echo '<a href="?col_nik&init_color=2" class="color_nick" style="background:#64C061;">&nbsp;&nbsp;&nbsp;</a> '."\n";
echo '<a href="?col_nik&init_color=3" class="color_nick" style="background:#7ECDED;">&nbsp;&nbsp;&nbsp;</a> '."\n";
echo '<a href="?col_nik&init_color=4" class="color_nick" style="background:#FACF0D;">&nbsp;&nbsp;&nbsp;</a> '."\n";
echo '<a href="?col_nik&init_color=5" class="color_nick" style="background:#20B2AA;">&nbsp;&nbsp;&nbsp;</a> <br/>'."\n";
echo '<a href="?col_nik&init_color=6" class="color_nick" style="background:#946A44;">&nbsp;&nbsp;&nbsp;</a> '."\n";
echo '<a href="?col_nik&init_color=7" class="color_nick" style="background:#7FFF00;">&nbsp;&nbsp;&nbsp;</a> '."\n";
echo '<a href="?col_nik&init_color=8" class="color_nick" style="background:#FFEBCD;">&nbsp;&nbsp;&nbsp;</a> '."\n";
echo '<a href="?col_nik&init_color=9" class="color_nick" style="background:#8A2BE2;">&nbsp;&nbsp;&nbsp;</a> '."\n";
echo '<a href="?col_nik&init_color=10" class="color_nick" style="background:#FF8C00;">&nbsp;&nbsp;&nbsp;</a> <br/>'."\n";
echo '<a href="?col_nik&init_color=11" class="color_nick" style="background:#00BFFF;">&nbsp;&nbsp;&nbsp;</a> '."\n";
echo '<a href="?col_nik&init_color=12" class="color_nick" style="background:#FF7F50;">&nbsp;&nbsp;&nbsp;</a> '."\n";
echo '<a href="?col_nik&init_color=13" class="color_nick" style="background:#008B8B;">&nbsp;&nbsp;&nbsp;</a> '."\n";
echo '<a href="?col_nik&init_color=14" class="color_nick" style="background:#ADFF2F;">&nbsp;&nbsp;&nbsp;</a> '."\n";
echo '<a href="?col_nik&init_color=15" class="color_nick" style="background:#F0E68C;">&nbsp;&nbsp;&nbsp;</a> <br/>'."\n";
echo '<a href="?col_nik&init_color=16" class="color_nick" style="background:#F08080;">&nbsp;&nbsp;&nbsp;</a> '."\n";
echo '<a href="?col_nik&init_color=17" class="color_nick" style="background:#F4A460;">&nbsp;&nbsp;&nbsp;</a> '."\n";
echo '<a href="?col_nik&init_color=18" class="color_nick" style="background:#008080;">&nbsp;&nbsp;&nbsp;</a> '."\n";
echo '<a href="?col_nik&init_color=19" class="color_nick" style="background:#FF7F24;">&nbsp;&nbsp;&nbsp;</a> '."\n";
echo '<a href="?col_nik&init_color=20" class="color_nick" style="background:#8B0000;">&nbsp;&nbsp;&nbsp;</a> '."\n";













echo '</div>'."\n";

echo '<li><a href="?col_nik&init_color=21">Восстановить</a> стандартный цвет ника!</li>'."\n";

echo '</div></div>'."\n";



include_once 'inc/foot.php';
?>