<?



switch ((isset($_GET['m'])) ? htmlspecialchars($_GET['m']) : null){
default:

//break;

case 'settings':

if (isset($_POST['check'])){

if (isset($_POST['panel_vid']) && ($_POST['panel_vid']==0 || $_POST['panel_vid']==1))mysql_query("UPDATE `kolhoz_user` SET `panel_vid` = '".intval($_POST['panel_vid'])."' WHERE `id` = '$ku[id]' LIMIT 1");
if (isset($_POST['verxgr']) && ($_POST['verxgr']==0 || $_POST['verxgr']==1))mysql_query("UPDATE `kolhoz_user` SET `verxgr` = '".intval($_POST['verxgr'])."' WHERE `id` = '$ku[id]' LIMIT 1");
if (isset($_POST['evange']) && ($_POST['evange']==0 || $_POST['evange']==1))mysql_query("UPDATE `kolhoz_user` SET `evange` = '".intval($_POST['evange'])."' WHERE `id` = '$ku[id]' LIMIT 1");

header('Location: ?navig&m=settings');
}
echo "<div class='event'><h1>Настройки</h1></div>";
echo "<div class='block'><b>Навигация</b> | <a href='?navig&m=style'>Стиль панели</a></div><div class='block'>";
echo '<form method="post" action="?navig&m=settings&amp;'.$passgen.'">
<div class="p_m">

Версия:
<select name="evange">
<option value="0" '.($ku['evange']==0?' selected="selected"':null).'>Новая</option>
<option value="1" '.($ku['evange']==1?' selected="selected"':null).'>Старая</option>
</select><br />

Вид:
<select name="panel_vid">
<option value="0" '.($ku['panel_vid']==0?' selected="selected"':null).'>Иконки</option>
<option value="1" '.($ku['panel_vid']==1?' selected="selected"':null).'>Слова</option>
</select><br />

Доступность:
<select name="verxgr">
<option value="0" '.($ku['verxgr']==0?' selected="selected"':null).'>Включена</option>
<option value="1" '.($ku['verxgr']==1?' selected="selected"':null).'>Выключена</option>
</select><br />
<input type="submit" name="check" value="Сохранить"/></form></a></div>';
break;

case 'style':
$style=array(
'b26767','b28067','b29967','b2b267','99b267','80b267','67b267','67b280','67b299','67b2b2','6799b2','6780b2','6767b2','8067b2','9967b2','b267b2','b26799','b26780',
'4c4c4c','666666','7f7f7f','754444','755444','756444','757544','647544','547544','447544','447554','447564','447575','446475','445475','444475','544475','644475',
'754475','754464','754454','000000','191919','333333','00FF00'
);
if (isset($_GET['ok']) && isset($_GET['color']) && $_GET['color']<43)
{
$st=intval($_GET['color']);
$ku['panel_style']=$style[$st];
mysql_query("UPDATE `kolhoz_user` SET `panel_style` = '".$ku['panel_style']."', `panel` = '".$st."' WHERE `id` = '$ku[id]' LIMIT 1");
header('Location: ?navig&m=style');
}
echo "<div class='event'><h1>Настройки</h1></div>";
?> 
<style>
.ovs{overflow: hidden;}
.panels {padding: 11px 10px;}
.panel_u{float:left}
</style>
<div class="block"><a href="?navig">Навигация</a> | <b>Стиль панели</b></div><div class="block">
<div class="panels" style="padding-bottom:0;"> <img src="/img/icons/str.gif" alt="*"> Выберите цвет панели:</div>
<div class="panels ovs light_border_bottom">
<div class="panel_u" style="width:50%;">

<div style="padding-right:5px;">
<? for ($i = 0; $i <= 42; $i++) echo '<div style="-webkit-border-radius: 4px; border-radius: 4px; background-color:#'.$style[$i].'; margin-bottom: 10px; " class="ovs"><a href="?navig&m=style&amp;color='.$i.'&amp;ok" class="arrow_link" style="display:block; text-decoration:none; padding:5px;"><div class="ovs" style="height:19px; '.($ku['panel_style']==$style[$i]?'background: url(/img/icons/img_p.png) center no-repeat;':null).' "></div></a></div>'.($i==20?'</div></div><div class="panel_u" style="width:50%;"><div style="padding-right:5px;">':null).''.($i==42?'</div></div>':null);?>
</div></div>
<?

break;
}

include_once 'inc/foot.php';