23 lines
845 B
PHP
23 lines
845 B
PHP
<?php
|
|
include_once '_common.php';
|
|
if(!$_SESSION['user_id']) exit;
|
|
|
|
if ( isset($_POST['tname'])) {
|
|
$tname = trim($_POST['tname']);
|
|
// 데이터 입력
|
|
$query = "INSERT INTO {$fg['member_group_table']} (tname, tused) VALUES('{$tname}', '1') "; // 기본값은 활성
|
|
$result = sql_query($query);
|
|
if ($result) {
|
|
// log 기록
|
|
$work_detail = "부서명 : ".$tname.", 처리자 : ".$_SESSION['user_name'];
|
|
$time = date("Y-m-d H:i:s");
|
|
|
|
$logquery = "INSERT INTO {$fg['log_table']} (work, work_detail, id, date) VALUES ('부서추가', '{$work_detail}', '{$_SESSION['user_id']}', '{$time}')";
|
|
$result = sql_query($logquery);
|
|
//log 기록 완료
|
|
|
|
$data = array("isSuccess" => $result);
|
|
header("Content-Type: application/json");
|
|
echo json_encode($data);
|
|
}
|
|
} |