Fix: go home button

This commit is contained in:
2018-07-12 14:54:45 +09:00
parent a0e0702370
commit a549a63491
10 changed files with 174 additions and 91 deletions
+14 -26
View File
@@ -1,42 +1,30 @@
<?php
header('Content-Type: application/json');
/*
if(!is_numeric($enterCode)) {
send_error_code('생년월일이 숫자가 아닙니다. : '.$enterCode);
exit;
} else if(strlen($enterCode) != 6) {
send_error_code('6자리 숫자값을 정확히 입력하세요 : YYMMDD (예 : 120131) : '.$enterCode);
exit;
}
*/
header("Content-Type: application/json");
include "./../lib/send_reply_json.php";
include "./../setup/connect_db.php";
$maestro_test_account_id = get_maestro_test_account_id("test");
if($maestro_test_account_id === null) {
$replyJSON["ERROR"] = "등록된 마에스트로 관리자 계정이 없습니다. (".$maestro_test_account_id.")";
echo json_encode($replyJSON, JSON_UNESCAPED_UNICODE);
$db_conn->close();
set_error_message("등록된 마에스트로 관리자 계정이 없습니다. (".$maestro_test_account_id.")");
send_result_fail();
exit;
}
$maestro_test_player_id = get_maestro_test_player_id($maestro_test_account_id);
if($maestro_test_player_id === null) {
$replyJSON["ERROR"] = "등록된 마에스트로 테스트 계정이 없습니다. (".$maestro_test_player_id.")";
echo json_encode($replyJSON, JSON_UNESCAPED_UNICODE);
$db_conn->close();
set_error_message("등록된 마에스트로 관리자 계정이 없습니다. (".$maestro_test_account_id.")");
send_result_fail();
exit;
}
$maestro_test_player_name = get_maestro_test_player_name($maestro_test_player_id);
$replyJSON["maestroID"] = $maestro_test_account_id;
$replyJSON["playerID"] = $maestro_test_player_id;
$replyJSON["playerName"] = $maestro_test_player_name;
$replyJSON["RESULT"] = "ok";
echo json_encode($replyJSON, JSON_UNESCAPED_UNICODE);
$db_conn->close();
set_data("maestroID", $maestro_test_account_id);
set_data("playerID", $maestro_test_player_id);
set_data("playerName", $maestro_test_player_name);
send_result_success();
exit;
@@ -45,7 +33,7 @@ function get_maestro_test_account_id($maestro_name) {
$query = "SELECT MaestroID FROM moty_maestro WHERE Name=?";
$stmt = $db_conn->prepare($query);
$stmt->bind_param('s', $maestro_name);
$stmt->bind_param("s", $maestro_name);
$stmt->execute();
$stmt->bind_result($maestro_test_account_id);
// while($stmt->fetch()) {
@@ -62,7 +50,7 @@ function get_maestro_test_player_id($maestro_id) {
$query = "SELECT MaestroTestID FROM moty_maestro WHERE MaestroID=?";
$stmt = $db_conn->prepare($query);
$stmt->bind_param('i', $maestro_id);
$stmt->bind_param("i", $maestro_id);
$stmt->execute();
$stmt->bind_result($maestro_test_player_id);
// while($stmt->fetch()) {
@@ -79,7 +67,7 @@ function get_maestro_test_player_name($player_id) {
$query = "SELECT Name FROM moty_player WHERE PlayerID=?";
$stmt = $db_conn->prepare($query);
$stmt->bind_param('i', $player_id);
$stmt->bind_param("i", $player_id);
$stmt->execute();
$stmt->bind_result($maestro_test_player_name);
// while($stmt->fetch()) {