View file modules/admin/set.php

File size: 2.29Kb
<?php

if ($user['level']<2)
{
header('Location: /'); 
}


# Шапка модуля
require_once(HOME .'/incfiles/header.php');

switch($_GET['act'])
{
default:


echo' 
<div class="title">Основные настройки</div>';
echo '<div class="menu">
<form action="/admin/set.php?act=save" method="post"><div id="form">
Название сайта: <br /><textarea class="block" cols="20" rows="2" name="name">'.$Core_Name.'</textarea><br>
Описание сайта: <br /><textarea class="block" cols="20" rows="2" name="opis">'.$Core_Opis.'</textarea><br>
Копирайт: <br /><textarea class="block" cols="20" rows="2" name="copy">'.$Core_Copy.'</textarea><br>
Title: <br /><textarea class="block" cols="20" rows="2" name="title">'.$Core_Browsers_Name.'</textarea><br>
Description: <br /><textarea class="block" cols="20" rows="2" name="description">'.$Core_Description.'</textarea><br>
Keywords: <br /><textarea class="block" cols="20" rows="2" name="keywords">'.$Core_Keywords.'</textarea><br>
<input name="submit_quote" type="submit" value=" Сохранить! " /><br />
</form>





</form>
</div>';



echo '<div class="block">
<a href="/admin/index.php">В админку</a><br />
<a href="../index.php">На главную</a>
</div>';

#Ноги страницы
require_once(HOME .'/incfiles/footer.php');
break;
case'save':
require_once(HOME .'/incfiles/header.php');






mysql_query("UPDATE `core` SET `value` = '".($_POST['name'])."' WHERE `name` = 'name';");
mysql_query("UPDATE `core` SET `value` = '".($_POST['copy'])."' WHERE `name` = 'copy';");
mysql_query("UPDATE `core` SET `value` = '".($_POST['title'])."' WHERE `name` = 'browse';");
mysql_query("UPDATE `core` SET `value` = '".($_POST['opis'])."' WHERE `name` = 'opis';");
mysql_query("UPDATE `core` SET `value` = '".($_POST['description'])."' WHERE `name` = 'description';");
mysql_query("UPDATE `core` SET `value` = '".($_POST['keywords'])."' WHERE `name` = 'keywords';");
echo '<div class="menu">
Изменения сохранены!
</div>';
echo '<div class="block">
<a href="/admin/index.php">В админку</a><br />
<a href="../index.php">На главную</a>
</div>';
require_once(HOME .'/incfiles/footer.php');
break;
}





# Ноги модуля
require_once(HOME .'/incfiles/footer.php');

?>