Файл: sys/core/admin_log.php
Строк: 17
<?php
# запись действий администрации
function admin_log($mod,$act,$opis)
{
global $user;
$sql = query("SELECT * FROM `admin_log_mod` WHERE `name` = '".my_esc($mod)."' LIMIT 1");
if (mysql_num_rows($sql)==0)
{
query("INSERT INTO `admin_log_mod` (`name`) VALUES ('". my_esc($mod) ."')");
$id_mod=mysql_insert_id();
}
else
$id_mod = mysql_result($sql, 0);
$sqls = query("SELECT * FROM `admin_log_act` WHERE `name` = '".my_esc($act)."' AND `id_mod` = '$id_mod' LIMIT 1");
if (mysql_num_rows($sqls)==0)
{
query("INSERT INTO `admin_log_act` (`name`, `id_mod`) VALUES ('".my_esc($act)."', '$id_mod')");
$id_act = mysql_insert_id();
}
else
$id_act = mysql_result($sqls, 0);
query("INSERT INTO `admin_log` (`time`, `id_user`, `mod`, `act`, `opis`) VALUES
('".time()."','$user[id]', '$id_mod', '$id_act', '".my_esc($opis)."')");
}