<?
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']='Margin/Padding'; // заголовок страницы
include_once '../sys/inc/thead.php';
title();
if (isset($_POST['add']) && $_POST['margin']!=NULL && $_POST['padding']!=NULL)
{
$margin=esc(stripcslashes(htmlspecialchars($_POST['margin'])));
$padding=esc(stripcslashes(htmlspecialchars($_POST['padding'])));
mysql_query("UPDATE `css6` SET `margin` = '$margin', `padding` = '$padding'  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 "Margin(px):<br />\n";
echo "<input type=\"text\" name=\"margin\" value=\"\"/><br />\n";
echo "Padding(px):<br />\n";
echo "<input type=\"text\" name=\"padding\" value=\"\"/><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 `css6`"));
if($css['margin']!=NULL)
{
echo "<div style='border: 2px solid red; margin: $css[margin]px; padding: $css[padding]px;'>";
echo "<center>margin: $css[margin]px;<br> padding: $css[padding]px;</center></div>";
}
else echo "";
mysql_query("UPDATE `css6` SET `padding` = '', `margin` = '' LIMIT 1");
include_once '../sys/inc/tfoot.php';
?>