29 lines
955 B
PHP
29 lines
955 B
PHP
<?php
|
|
include_once ('./_common.php');
|
|
if(!$_SESSION['user_id']) exit;
|
|
|
|
// 변수 선언
|
|
$user_id = trim($_POST['user_id']);
|
|
$user_pw = password_hash(trim($_POST['user_pw']), PASSWORD_DEFAULT); // 패스워드 암호화
|
|
$tid = trim($_POST['tid']);
|
|
$user_name = trim($_POST['user_name']);
|
|
$memo = trim($_POST['memo']);
|
|
$user_lv = trim($_POST['user_lv']);
|
|
$time = date("Y-m-d H:i:s");
|
|
|
|
// 쿼리
|
|
$query = "INSERT INTO {$fg['member_table']} (user_id, user_pw, tid, user_name, user_lv, join_datetime, used, memo)";
|
|
$query .= "VALUES('{$user_id}', '{$user_pw}', '{$tid}', '{$user_name}', '{$user_lv}', '{$time}', 1, '{$memo}') ";
|
|
|
|
$result = sql_query($query);
|
|
|
|
// log 기록
|
|
$work = "사용자등록";
|
|
$work_detail = "ID : ".$user_id.", 처리자 : ".$_SESSION['user_name'];
|
|
|
|
log_update($work, $work_detail, $_SESSION['user_id'], $time);
|
|
|
|
$data = array("isSuccess" => $result);
|
|
header("Content-Type: application/json");
|
|
echo json_encode($data);
|