퍼스트가든에서 사용하는 사용자 함수 및 관련파일 추가
This commit is contained in:
26
manager/adm/adm_member_group.delete.php
Normal file
26
manager/adm/adm_member_group.delete.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
include_once '_common.php';
|
||||
if(!$_SESSION['user_id']) exit;
|
||||
|
||||
if ( isset($_POST['idx'] )) {
|
||||
$idx = trim($_POST['idx']);
|
||||
|
||||
// log 기록을 위한 데이터 불러오기
|
||||
$query = "SELECT * FROM {$fg['member_group_table']} WHERE tid='{$idx}'";
|
||||
$log = sql_fetch($query);
|
||||
|
||||
// 데이터 삭제
|
||||
$query = "DELETE FROM {$fg['member_group_table']} WHERE tid='{$idx}'";
|
||||
$result = sql_query($query);
|
||||
if ( $result ) { // 삭제가 성공하면 로그 기록함
|
||||
$time = date("Y-m-d H:i:s");
|
||||
$work_detail = "부서명 : ".$log['tname'].", 처리자 : ".$_SESSION['user_name'];
|
||||
$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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user