Add: maestro DB - AvailableActivateDateTime
This commit is contained in:
@@ -1,20 +1,13 @@
|
||||
<?php
|
||||
header('Content-Type: application/json');
|
||||
|
||||
include "./../lib/send_reply_json.php";
|
||||
include "./../setup/connect_db.php";
|
||||
|
||||
$maestroName = $_POST["maestro_name"];
|
||||
$name = $_POST["name"];
|
||||
$enterCode = $_POST["enter_code"];
|
||||
/*
|
||||
if(!is_numeric($enterCode)) {
|
||||
send_error_code('생년월일이 숫자가 아닙니다. : '.$enterCode);
|
||||
exit;
|
||||
} else if(strlen($enterCode) != 6) {
|
||||
send_error_code('6자리 숫자값을 정확히 입력하세요 : YYMMDD (예 : 120131) : '.$enterCode);
|
||||
exit;
|
||||
}
|
||||
*/
|
||||
|
||||
include "./../setup/connect_db.php";
|
||||
|
||||
$maestroID = get_maestro_id($maestroName);
|
||||
if($maestroID === null) {
|
||||
@@ -23,21 +16,27 @@ if($maestroID === null) {
|
||||
exit;
|
||||
}
|
||||
|
||||
$replyJSON = get_login_data($maestroID, $name, $enterCode);
|
||||
if($replyJSON["PlayerID"] === null) {
|
||||
$playerID = get_login_data($maestroID, $name, $enterCode);
|
||||
if($playerID === null) {
|
||||
send_error_message($replyJSON, "입력한 이름/입장번호와 일치하는 계정이 없습니다");
|
||||
$db_conn->close();
|
||||
exit;
|
||||
}
|
||||
|
||||
echo json_encode($replyJSON, JSON_UNESCAPED_UNICODE);
|
||||
$db_conn->close();
|
||||
|
||||
set_data("PlayerID", $playerID);
|
||||
send_result_success();
|
||||
exit;
|
||||
|
||||
|
||||
function get_maestro_id($maestroName) {
|
||||
global $db_conn;
|
||||
|
||||
$query = "SELECT MaestroID FROM moty_maestro WHERE Name=?";
|
||||
$query = "
|
||||
SELECT MaestroID
|
||||
FROM moty_maestro
|
||||
WHERE Name = ?
|
||||
";
|
||||
$stmt = $db_conn->prepare($query);
|
||||
$stmt->bind_param('s', $maestroName);
|
||||
$stmt->execute();
|
||||
@@ -54,19 +53,23 @@ function get_maestro_id($maestroName) {
|
||||
function get_login_data($maestroID, $name, $enterCode) {
|
||||
global $db_conn;
|
||||
|
||||
$query = "SELECT PlayerID FROM moty_player WHERE MaestroID=? AND Name=? AND EnterCode=?";
|
||||
$query = "
|
||||
SELECT PlayerID
|
||||
FROM moty_player
|
||||
WHERE MaestroID = ? AND Name = ? AND EnterCode = ?
|
||||
";
|
||||
$stmt = $db_conn->prepare($query);
|
||||
$stmt->bind_param('iss', $maestroID, $name, $enterCode);
|
||||
$stmt->execute();
|
||||
$stmt->bind_result($player_id);
|
||||
$stmt->bind_result($playerID);
|
||||
// while($stmt->fetch())
|
||||
$stmt->fetch();
|
||||
$stmt->close();
|
||||
|
||||
$replyJSON["MaestroID"] = $maestroID;
|
||||
$replyJSON["PlayerID"] = $player_id;
|
||||
// $replyJSON["MaestroID"] = $maestroID;
|
||||
// $replyJSON["PlayerID"] = $playerID;
|
||||
|
||||
return $replyJSON;
|
||||
return $playerID;
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user