26 lines
982 B
PHP
26 lines
982 B
PHP
<?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);
|
|
}
|
|
} |