<?
include_once '../sys/inc/start.php';
include_once '../sys/inc/compress.php';
include_once '../sys/inc/sess.php';
include_once '../sys/inc/home.php';
include_once '../sys/inc/settings.php';
include_once '../sys/inc/db_connect.php';
include_once '../sys/inc/ipua.php';
include_once '../sys/inc/fnc.php';
include_once '../sys/inc/user.php';
$set['title']='Фон'; // заголовок страницы
include_once '../sys/inc/thead.php';
title();
if (isset($_POST['add']) && $_POST['color']!=NULL  && $_POST['attachment']!=NULL && $_POST['position_g']!=NULL  && $_POST['position_v']!=NULL && $_POST['repeat']!=NULL)
{
$image=esc(stripcslashes(htmlspecialchars($_POST['image'])));
$color=esc(stripcslashes(htmlspecialchars($_POST['color'])));
$attachment=esc(stripcslashes(htmlspecialchars($_POST['attachment'])));
$position_g=esc(stripcslashes(htmlspecialchars($_POST['position_g'])));
$position_v=esc(stripcslashes(htmlspecialchars($_POST['position_v'])));
$repeat=esc(stripcslashes(htmlspecialchars($_POST['repeat'])));
mysql_query("UPDATE `css2` SET `image` = '$image', `color` = '$color', `attachment` = '$attachment', `position_g` = '$position_g', `position_v` = '$position_v', `repeat` = '$repeat' LIMIT 1");
}
err();
aut();
echo "<div class='anton'><img src='/css/img/back.png'> <a href='/css/'>Назад</a></div>";
if (isset($_GET['add'])){
echo "<form action='?add=$passgen' method=\"post\">";
echo "Цвет(color)(Пример: FF00FF или 354638):<br />\n";
echo "<input type=\"text\" name=\"color\" value=\"\"/><br />\n";
echo "Image(Адрес картинки):<br />\n";
echo "<input type=\"text\" name=\"image\" value=\"\"/><br />\n";
echo "Рамка(attachment):<br />\n";
echo "<select name='attachment'>\n";
echo "<option value='scroll'>scroll</option>\n";
echo "<option value='fixed'>fixed</option>\n";
echo "</select><br />\n";
echo "Позиция(гориз.):<br />\n";
echo "<select name='position_g'>\n";
echo "<option value='left'>left</option>\n";
echo "<option value='center'>center</option>\n";
echo "<option value='right'>right</option>\n";
echo "</select><br />\n";
echo "Позиция(вертик.):<br />\n";
echo "<select name='position_v'>\n";
echo "<option value='top'>top</option>\n";
echo "<option value='center'>center</option>\n";
echo "<option value='bottom'>bottom</option>\n";
echo "</select><br />\n";
echo "Repeat(repeat):<br />\n";
echo "<select name='repeat'>\n";
echo "<option value='repeat'>repeat</option>\n";
echo "<option value='no-repeat'>no-repeat</option>\n";
echo "<option value='repeat-x'>repeat-x</option>\n";
echo "<option value='repeat-y'>repeat-y</option>\n";
echo "</select><br />\n";
echo "<input class='submit' name='add' type='submit' value='Создать' /><br />\n";
echo "</form>";
}
echo "<div class='menu_razd'>Результат</div>";
$css=mysql_fetch_assoc(mysql_query("SELECT * FROM `css2`"));
if($css['attachment']!=NULL)
{
echo "<div style='border: 1px solid green'>";
if($css['image']!=NULL)
echo "<center><font color='red'>Код:</font></center><center>background: $css[attachment] #$css[color] url($css[image]) $css[position_g] $css[position_v] $css[repeat]</center><br>";
else
echo "<center><font color='red'>Код:</font></center><center>background: $css[attachment] #$css[color] $css[position_g] $css[position_v] $css[repeat]</center><br>";
echo "</div>";
echo "<div style='background: $css[attachment] #$css[color] url($css[image]) $css[position_g] $css[position_v] $css[repeat]'>";
echo "<br><br><br><br>";
echo "</div>";
}
else echo "";
mysql_query("UPDATE `css2` SET `image` = '', `color` = '', `attachment` = '', `position_g` = '', `position_v` = '', `repeat` = '' LIMIT 1");
include_once '../sys/inc/tfoot.php';
?>