Файл: sozd_dolgl_/dolg.php
Строк: 62
<?
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/adm_check.php';
include_once '../sys/inc/user.php';
user_access('sozd_dolg',null,'index.php?'.SID);
adm_check();
$set['title']='Создание должности';
include_once '../sys/inc/thead.php';
title();
err();
aut();
?>
<? $act=htmlspecialchars(trim($_GET['act']));
switch($act){
default: ?>
<div class="p_m">Введите информацию в поля ниже</div>
<form method="post" action="?act=add">
Название должности:<br>
<input type="text" name="name"><br>
Уроень доступа(от 0 до 10):<br>
<input type="text" name="level"><br>
<input type="submit" value="Создать">
</form>
<? break; ?>
<? case'add':
$name=mysql_real_escape_string(trim($_POST['name']));
$level=intval(trim(abs($_POST['level'])));
if( $name!='' && $level!='' ){
mysql_query("INSERT INTO `user_group` (`name`, `level`) VALUES ('$name', '$level');"); ?>
<div class="p_m">Должность <?=$name?> успешно создана!</div>
<? } else{ ?>
<div class="err">Одно из полей не было заполнено!</div>
<? } break;
}//switch ?>
<? if (user_access('adm_panel_show'))
echo "«<a href='/adm_panel/'>В админку</a><br />n";
echo "</div>n";
include_once '../sys/inc/tfoot.php';
?>