diff --git a/src/web/server/admin/add_user.php b/src/web/server/admin/add_user.php deleted file mode 100644 index 1411296..0000000 --- a/src/web/server/admin/add_user.php +++ /dev/null @@ -1,31 +0,0 @@ -prepare($query); -$stmt->bind_param('ss', $name, $birthday); -$stmt->execute(); - -if($stmt->affected_rows > 0) { - echo("succeed"); -} else { - echo "fail"; -} - -$db_conn->close(); - -?> \ No newline at end of file diff --git a/src/web/server/admin/delete_test_user_data.php b/src/web/server/admin/delete_test_user_data.php deleted file mode 100644 index 80b4c35..0000000 --- a/src/web/server/admin/delete_test_user_data.php +++ /dev/null @@ -1,11 +0,0 @@ -query($query); - -$db_conn->close(); - -?> \ No newline at end of file diff --git a/src/web/server/admin/login.php b/src/web/server/admin/login.php index ecf4dd3..cba3ce3 100644 --- a/src/web/server/admin/login.php +++ b/src/web/server/admin/login.php @@ -48,7 +48,7 @@ function get_admin_id($adminName) { $query = " SELECT AdminID - FROM moty_admin + FROM admin WHERE Name = ? "; $stmt = $db_conn->prepare($query); @@ -69,7 +69,7 @@ function login($adminName, $password) { $query = " SELECT AdminID, AccountType, ActivateStatus - FROM moty_admin + FROM admin WHERE Name = ? AND Password = PASSWORD(?) "; $stmt = $db_conn->prepare($query); diff --git a/src/web/server/admin/maestro_registered_list.php b/src/web/server/admin/maestro_registered_list.php index ec5a63f..6d5bf53 100644 --- a/src/web/server/admin/maestro_registered_list.php +++ b/src/web/server/admin/maestro_registered_list.php @@ -30,7 +30,7 @@ function get_maestro_list() { $query = " SELECT MaestroID, Name, AccountType - FROM moty_maestro + FROM maestro WHERE ActivateStatus=0 ORDER BY MaestroID DESC "; @@ -56,7 +56,7 @@ function get_maestro_list_by_name($maestroName) { $query = " SELECT MaestroID, Name, AccountType - FROM moty_maestro + FROM maestro WHERE Name LIKE CONCAT('%', ?, '%') AND ActivateStatus=0 ORDER BY MaestroID DESC "; diff --git a/src/web/server/admin/maestro_upgrade_list.php b/src/web/server/admin/maestro_upgrade_list.php index 2c6f080..894d652 100644 --- a/src/web/server/admin/maestro_upgrade_list.php +++ b/src/web/server/admin/maestro_upgrade_list.php @@ -30,7 +30,7 @@ function get_maestro_upgrade_list() { $query = " SELECT U.MaestroUpgradeID, U.MaestroID, M.Name, U.RegisteredAccountType, U.RequestedAccountType, U.RequestedDateTime, U.Status - FROM moty_maestro_upgrade U, moty_maestro M + FROM maestro_upgrade U, maestro M WHERE U.Status < 2 AND U.MaestroID = M.MaestroID ORDER BY U.MaestroUpgradeID DESC "; @@ -60,7 +60,7 @@ function get_maestro_update_list_by_name($searchMaestroName) { $query = " SELECT U.MaestroUpgradeID, U.MaestroID, M.Name, U.RegisteredAccountType, U.RequestedAccountType, U.RequestedDateTime, U.Status - FROM moty_maestro_upgrade U, moty_maestro M + FROM maestro_upgrade U, maestro M WHERE M.Name LIKE CONCAT('%', ?, '%') AND U.MaestroID = M.MaestroID ORDER BY U.MaestroUpgradeID DESC "; diff --git a/src/web/server/admin/register_maestro.php b/src/web/server/admin/register_maestro.php index 503e9d9..1fb275e 100644 --- a/src/web/server/admin/register_maestro.php +++ b/src/web/server/admin/register_maestro.php @@ -38,7 +38,7 @@ function register_maestro($maestroID) { global $db_conn; $query = " - UPDATE moty_maestro + UPDATE maestro SET ActivateStatus = 1, AvailableActivateDateTime = DATE_ADD(NOW(), INTERVAL 1 YEAR) WHERE MaestroID = ? "; @@ -53,7 +53,7 @@ function add_maestro_test_player($maestroID) { global $db_conn; $query = " - INSERT INTO moty_player (MaestroID, Name, EnterCode, AccountType) + INSERT INTO player (MaestroID, Name, EnterCode, AccountType) VALUES (?, '마에스트로', '', 1) "; $stmt = $db_conn->prepare($query); @@ -66,7 +66,7 @@ function get_maestro_test_player($maestroID) { $query = " SELECT PlayerID - FROM moty_player + FROM player WHERE MaestroID = ? AND AccountType = 1 "; $stmt = $db_conn->prepare($query); @@ -83,7 +83,7 @@ function set_maestro_test_player($maestroID, $playerID) { global $db_conn; $query = " - UPDATE moty_maestro + UPDATE maestro SET MaestroTestID = ? WHERE MaestroID = ? "; diff --git a/src/web/server/admin/upgrade_maestro.php b/src/web/server/admin/upgrade_maestro.php index 3bbd86f..613559d 100644 --- a/src/web/server/admin/upgrade_maestro.php +++ b/src/web/server/admin/upgrade_maestro.php @@ -26,7 +26,7 @@ function upgrade_maestro($maestroID, $newAccountType) { global $db_conn; $query = " - UPDATE moty_maestro + UPDATE maestro SET AccountType = ?, ActivateStatus = 1, AvailableActivateDateTime = DATE_ADD(NOW(), INTERVAL 1 YEAR) WHERE MaestroID = ?; "; @@ -39,7 +39,7 @@ function change_upgrade_request_status_to_close($maestroID) { global $db_conn; $query = " - UPDATE moty_maestro_upgrade + UPDATE maestro_upgrade SET Status = 2 WHERE MaestroID = ? AND Status = 1; "; @@ -52,7 +52,7 @@ function change_upgrade_request_status_to_applied($maestroUpgradeID) { global $db_conn; $query = " - UPDATE moty_maestro_upgrade + UPDATE maestro_upgrade SET Status = 3 WHERE MaestroUpgradeID = ? "; diff --git a/src/web/server/app/activate_app.php b/src/web/server/app/activate_app.php index d15b8ef..af804ab 100644 --- a/src/web/server/app/activate_app.php +++ b/src/web/server/app/activate_app.php @@ -21,7 +21,7 @@ function activate_app($maestroID, $appID) { global $db_conn; $query = " - INSERT INTO moty_active_app (MaestroID, AppID) + INSERT INTO active_app (MaestroID, AppID) VALUES (?, ?); "; $stmt = $db_conn->prepare($query); @@ -35,7 +35,7 @@ function get_app_name($appID) { $query = " SELECT AppName, KoreanName - FROM moty_app + FROM app WHERE AppID = ? "; $stmt = $db_conn->prepare($query); diff --git a/src/web/server/app/deactivate_app.php b/src/web/server/app/deactivate_app.php index 8b19977..2eec443 100644 --- a/src/web/server/app/deactivate_app.php +++ b/src/web/server/app/deactivate_app.php @@ -21,7 +21,7 @@ function deactivate_app($maestroID, $appID) { global $db_conn; $query = " - DELETE FROM moty_active_app + DELETE FROM active_app WHERE MaestroID = ? AND AppID = ?; "; $stmt = $db_conn->prepare($query); @@ -35,7 +35,7 @@ function get_app_name($appID) { $query = " SELECT AppName, KoreanName - FROM moty_app + FROM app WHERE AppID = ? "; $stmt = $db_conn->prepare($query); diff --git a/src/web/server/app/how_to_play.php b/src/web/server/app/how_to_play.php index e8c019f..2ce27b1 100644 --- a/src/web/server/app/how_to_play.php +++ b/src/web/server/app/how_to_play.php @@ -23,7 +23,7 @@ function get_how_to_play($app_id) { $query = " SELECT HowToPlay - FROM moty_app + FROM app WHERE AppID = ?; "; $stmt = $db_conn->prepare($query); diff --git a/src/web/server/app/menu_active_app_list.php b/src/web/server/app/menu_active_app_list.php index 16110c8..20fa630 100644 --- a/src/web/server/app/menu_active_app_list.php +++ b/src/web/server/app/menu_active_app_list.php @@ -28,8 +28,8 @@ function get_mouse_app_list($maestro_id) { $query = " SELECT A.AppID, A.AppName, A.KoreanName, A.AppType - FROM moty_app AS A - INNER JOIN moty_active_app AS AA ON A.AppID = AA.AppID AND A.AppType = 100 AND AA.MaestroID=?"; + FROM app AS A + INNER JOIN active_app AS AA ON A.AppID = AA.AppID AND A.AppType = 100 AND AA.MaestroID=?"; $stmt = $db_conn->prepare($query); $stmt->bind_param("i", $maestro_id); $stmt->execute(); @@ -53,8 +53,8 @@ function get_typing_practice_app_count($maestro_id) { $query = " SELECT COUNT(*) - FROM moty_app AS A - INNER JOIN moty_active_app AS AA ON A.AppID = AA.AppID AND A.AppType <= 2 AND AA.MaestroID=?"; + FROM app AS A + INNER JOIN active_app AS AA ON A.AppID = AA.AppID AND A.AppType <= 2 AND AA.MaestroID=?"; $stmt = $db_conn->prepare($query); $stmt->bind_param("i", $maestro_id); $stmt->execute(); @@ -70,8 +70,8 @@ function get_typing_test_app_count($maestro_id) { $query = " SELECT COUNT(*) - FROM moty_app AS A - INNER JOIN moty_active_app AS AA ON A.AppID = AA.AppID AND A.AppType > 10 AND A.AppType <= 12 AND AA.MaestroID=?"; + FROM app AS A + INNER JOIN active_app AS AA ON A.AppID = AA.AppID AND A.AppType > 10 AND A.AppType <= 12 AND AA.MaestroID=?"; $stmt = $db_conn->prepare($query); $stmt->bind_param("i", $maestro_id); $stmt->execute(); @@ -87,8 +87,8 @@ function get_typing_app_list($maestro_id) { $query = " SELECT A.AppID, A.AppName, A.KoreanName, A.AppType - FROM moty_app AS A - INNER JOIN moty_active_app AS AA ON A.AppID = AA.AppID AND A.AppType = 50 AND AA.MaestroID=?"; + FROM app AS A + INNER JOIN active_app AS AA ON A.AppID = AA.AppID AND A.AppType = 50 AND AA.MaestroID=?"; $stmt = $db_conn->prepare($query); $stmt->bind_param("i", $maestro_id); $stmt->execute(); diff --git a/src/web/server/app/menu_active_typing_practice_app_list.php b/src/web/server/app/menu_active_typing_practice_app_list.php index 12e837a..cc1345c 100644 --- a/src/web/server/app/menu_active_typing_practice_app_list.php +++ b/src/web/server/app/menu_active_typing_practice_app_list.php @@ -26,8 +26,8 @@ function get_active_typing_practice_app_list($maestro_id, $type) { $query = " SELECT A.AppID, A.AppName, A.KoreanName - FROM moty_app AS A - INNER JOIN moty_active_app AS AA + FROM app AS A + INNER JOIN active_app AS AA ON A.AppID = AA.AppID AND AA.MaestroID = ? AND A.AppType = ? ORDER BY A.AppID ASC"; $stmt = $db_conn->prepare($query); diff --git a/src/web/server/app/menu_active_typing_test_app_list.php b/src/web/server/app/menu_active_typing_test_app_list.php index d1200b4..901db8e 100644 --- a/src/web/server/app/menu_active_typing_test_app_list.php +++ b/src/web/server/app/menu_active_typing_test_app_list.php @@ -26,8 +26,8 @@ function get_active_typing_practice_app_list($maestro_id, $type) { $query = " SELECT A.AppID, A.AppName, A.KoreanName - FROM moty_app AS A - INNER JOIN moty_active_app AS AA + FROM app AS A + INNER JOIN active_app AS AA ON A.AppID = AA.AppID AND AA.MaestroID = ? AND A.AppType = ? ORDER BY A.AppID ASC"; $stmt = $db_conn->prepare($query); diff --git a/src/web/server/app/mouse_app_list.php b/src/web/server/app/mouse_app_list.php index 6297e9c..3ae1d1e 100644 --- a/src/web/server/app/mouse_app_list.php +++ b/src/web/server/app/mouse_app_list.php @@ -27,7 +27,7 @@ function get_mouse_app_list() { global $db_conn; $query = " - SELECT AppID, AppName, KoreanName FROM moty_app + SELECT AppID, AppName, KoreanName FROM app WHERE AppType=100 ORDER BY AppID ASC "; @@ -51,8 +51,8 @@ function get_activated_mouse_app_list($maestroID) { $query = " SELECT A.AppID - FROM moty_app AS A - INNER JOIN moty_active_app AS AA ON A.AppID = AA.AppID AND A.AppType = 100 AND AA.MaestroID=?" + FROM app AS A + INNER JOIN active_app AS AA ON A.AppID = AA.AppID AND A.AppType = 100 AND AA.MaestroID=?" ; $stmt = $db_conn->prepare($query); $stmt->bind_param("i", $maestroID); diff --git a/src/web/server/app/typing_app_list.php b/src/web/server/app/typing_app_list.php index 0e98ed7..3f13db0 100644 --- a/src/web/server/app/typing_app_list.php +++ b/src/web/server/app/typing_app_list.php @@ -27,7 +27,7 @@ function get_typing_app_list() { global $db_conn; $query = " - SELECT AppID, AppName, KoreanName FROM moty_app + SELECT AppID, AppName, KoreanName FROM app WHERE AppType < 100 ORDER BY AppID ASC "; @@ -51,8 +51,8 @@ function get_activated_typing_app_list($maestroID) { $query = " SELECT A.AppID - FROM moty_app AS A - INNER JOIN moty_active_app AS AA ON A.AppID = AA.AppID AND A.AppType < 100 AND AA.MaestroID=?" + FROM app AS A + INNER JOIN active_app AS AA ON A.AppID = AA.AppID AND A.AppType < 100 AND AA.MaestroID=?" ; $stmt = $db_conn->prepare($query); $stmt->bind_param("i", $maestroID); diff --git a/src/web/server/maestro/add_maestro.php b/src/web/server/maestro/add_maestro.php index 83b7d93..2351dd6 100644 --- a/src/web/server/maestro/add_maestro.php +++ b/src/web/server/maestro/add_maestro.php @@ -46,7 +46,7 @@ function has_maestro_name($maestroName) { $query = " SELECT MaestroID - FROM moty_maestro + FROM maestro WHERE Name = ? "; $stmt = $db_conn->prepare($query); @@ -64,7 +64,7 @@ function add_maestro($maestro_name, $password, $email, $account_type) { global $db_conn; $query = " - INSERT INTO moty_maestro (Name, Password, Email, AccountType, ActivateStatus, PlayerCount, AcceptClausesDateTime, MaestroTestID) + INSERT INTO maestro (Name, Password, Email, AccountType, ActivateStatus, PlayerCount, AcceptClausesDateTime, MaestroTestID) VALUES (?, PASSWORD(?), ?, ?, 0, 0, NOW(), -1)"; $stmt = $db_conn->prepare($query); $stmt->bind_param("sssi", $maestro_name, $password, $email, $account_type); diff --git a/src/web/server/maestro/check_id.php b/src/web/server/maestro/check_id.php index f4eca21..e174fcd 100644 --- a/src/web/server/maestro/check_id.php +++ b/src/web/server/maestro/check_id.php @@ -23,7 +23,7 @@ exit; function get_maestro_id($maestro_name) { global $db_conn; - $query = "SELECT MaestroID FROM moty_maestro WHERE Name=?"; + $query = "SELECT MaestroID FROM maestro WHERE Name=?"; $stmt = $db_conn->prepare($query); $stmt->bind_param("s", $maestro_name); $stmt->execute(); diff --git a/src/web/server/maestro/delete_test_player_record.php b/src/web/server/maestro/delete_test_player_record.php index 0e23617..b226422 100644 --- a/src/web/server/maestro/delete_test_player_record.php +++ b/src/web/server/maestro/delete_test_player_record.php @@ -27,7 +27,7 @@ function get_maestro_test_player_id($maestro_id) { $query = " SELECT MaestroTestID - FROM moty_maestro + FROM maestro WHERE MaestroID = ? "; $stmt = $db_conn->prepare($query); @@ -48,7 +48,7 @@ function delete_maestro_test_player_record($player_id) { $query = " DELETE - FROM moty_best_record + FROM best_record WHERE PlayerID = ? "; $stmt = $db_conn->prepare($query); diff --git a/src/web/server/maestro/login.php b/src/web/server/maestro/login.php index 99c8ae7..5878cdc 100644 --- a/src/web/server/maestro/login.php +++ b/src/web/server/maestro/login.php @@ -57,7 +57,7 @@ function get_maestro_id($maestroName) { $query = " SELECT MaestroID - FROM moty_maestro + FROM maestro WHERE Name = ? "; $stmt = $db_conn->prepare($query); @@ -78,7 +78,7 @@ function login($maestroName, $password) { $query = " SELECT MaestroID, AccountType, ActivateStatus, AvailableActivateDateTime - FROM moty_maestro + FROM maestro WHERE Name = ? AND Password = PASSWORD(?) "; $stmt = $db_conn->prepare($query); diff --git a/src/web/server/maestro/maestro_experience_account.php b/src/web/server/maestro/maestro_experience_account.php index 4fb6edb..b436354 100644 --- a/src/web/server/maestro/maestro_experience_account.php +++ b/src/web/server/maestro/maestro_experience_account.php @@ -38,7 +38,7 @@ function get_maestro_experience_id() { $query = " SELECT MaestroID - FROM moty_maestro + FROM maestro WHERE AccountType = 101 "; $stmt = $db_conn->prepare($query); @@ -59,7 +59,7 @@ function get_maestro_test_player_id($maestro_id) { $query = " SELECT MaestroTestID - FROM moty_maestro + FROM maestro WHERE MaestroID = ? "; $stmt = $db_conn->prepare($query); @@ -80,7 +80,7 @@ function get_maestro_test_player_name($player_id) { $query = " SELECT Name - FROM moty_player + FROM player WHERE PlayerID = ? "; $stmt = $db_conn->prepare($query); @@ -106,7 +106,7 @@ function remove_maestro_sample_player_data($maestro_id) { $query = " DELETE - FROM moty_player + FROM player WHERE MaestroID = ? AND AccountType = 0 "; $stmt = $db_conn->prepare($query); @@ -127,7 +127,7 @@ function insert_maestro_sample_player_data($i, $maestro_id, $player) { global $db_conn; $query = " - INSERT INTO moty_player (MaestroID, Name, EnterCode, AccountType) + INSERT INTO player (MaestroID, Name, EnterCode, AccountType) VALUES (?, ?, ?, ?) "; $stmt = $db_conn->prepare($query); @@ -172,7 +172,7 @@ function count_registered_player($maestroID) { $query = " SELECT COUNT(PlayerID) - FROM moty_player + FROM player WHERE MaestroID = ? AND AccountType = 0 "; $stmt = $db_conn->prepare($query); @@ -190,7 +190,7 @@ function update_count_registered_player($maestroID, $countPlayer) { global $db_conn; $query = " - UPDATE moty_maestro + UPDATE maestro SET PlayerCount = ? WHERE MaestroID = ? "; diff --git a/src/web/server/maestro/maestro_info.php b/src/web/server/maestro/maestro_info.php index 29fea0d..c43d399 100644 --- a/src/web/server/maestro/maestro_info.php +++ b/src/web/server/maestro/maestro_info.php @@ -27,7 +27,7 @@ function get_maestro_info($maestroID) { $query = " SELECT Name, Email, AccountType, PlayerCount - FROM moty_maestro + FROM maestro WHERE MaestroID = ? "; $stmt = $db_conn->prepare($query); diff --git a/src/web/server/maestro/maestro_test_player.php b/src/web/server/maestro/maestro_test_player.php index 1fdb8e4..efdc439 100644 --- a/src/web/server/maestro/maestro_test_player.php +++ b/src/web/server/maestro/maestro_test_player.php @@ -30,7 +30,7 @@ function get_maestro_test_player_id($maestro_id) { $query = " SELECT AccountType, MaestroTestID - FROM moty_maestro + FROM maestro WHERE MaestroID = ? "; $stmt = $db_conn->prepare($query); @@ -53,7 +53,7 @@ function get_maestro_test_player_info($player_id) { $query = " SELECT Name, AccountType - FROM moty_player + FROM player WHERE PlayerID = ? "; $stmt = $db_conn->prepare($query); diff --git a/src/web/server/maestro/request_upgrade_maestro.php b/src/web/server/maestro/request_upgrade_maestro.php index 3596af7..f4ddf53 100644 --- a/src/web/server/maestro/request_upgrade_maestro.php +++ b/src/web/server/maestro/request_upgrade_maestro.php @@ -35,7 +35,7 @@ function count_maestro_upgrade($maestroID) { $query = " SELECT COUNT(MaestroID) - FROM moty_maestro_upgrade + FROM maestro_upgrade WHERE MaestroID = ? "; $stmt = $db_conn->prepare($query); @@ -53,7 +53,7 @@ function add_maestro_update($maestroID, $registeredAcountType, $newAccountType) global $db_conn; $query = " - INSERT INTO moty_maestro_upgrade (RegisteredAccountType, RequestedAccountType, RequestedDateTime, Status, MaestroID) + INSERT INTO maestro_upgrade (RegisteredAccountType, RequestedAccountType, RequestedDateTime, Status, MaestroID) VALUES (?, ?, NOW(), 1, ?); "; $stmt = $db_conn->prepare($query); diff --git a/src/web/server/maestro/update_maestro_info.php b/src/web/server/maestro/update_maestro_info.php index b0d5478..5cb1d18 100644 --- a/src/web/server/maestro/update_maestro_info.php +++ b/src/web/server/maestro/update_maestro_info.php @@ -19,7 +19,7 @@ function update_maestro_info($maestroID, $maestroName, $email) { global $db_conn; $query = " - UPDATE moty_maestro + UPDATE maestro SET Name = ?, Email = ? WHERE MaestroID = ? "; diff --git a/src/web/server/maestro/update_maestro_password.php b/src/web/server/maestro/update_maestro_password.php index 38387f3..254d565 100644 --- a/src/web/server/maestro/update_maestro_password.php +++ b/src/web/server/maestro/update_maestro_password.php @@ -27,7 +27,7 @@ function maestro_registered_password($maestro_id, $registeredPW) { $query = " SELECT COUNT(MaestroID) - FROM moty_maestro + FROM maestro WHERE MaestroID = ? AND Password = PASSWORD(?) "; $stmt = $db_conn->prepare($query); @@ -45,7 +45,7 @@ function update_maestro_password($maestroID, $newPW) { global $db_conn; $query = " - UPDATE moty_maestro + UPDATE maestro SET Password = PASSWORD(?) WHERE MaestroID = ? "; diff --git a/src/web/server/player/add_player.php b/src/web/server/player/add_player.php index 3f4615f..28d0686 100644 --- a/src/web/server/player/add_player.php +++ b/src/web/server/player/add_player.php @@ -57,7 +57,7 @@ function has_player_name($maestroID, $playerName, $enterCode) { $query = " SELECT PlayerID - FROM moty_player + FROM player WHERE MaestroID = ? AND Name = ? AND EnterCode = ? "; $stmt = $db_conn->prepare($query); @@ -76,7 +76,7 @@ function get_maestro_account_type($maestroID) { $query = " SELECT AccountType - FROM moty_maestro + FROM maestro WHERE MaestroID = ? "; $stmt = $db_conn->prepare($query); @@ -95,7 +95,7 @@ function get_player_count($maestroID) { $query = " SELECT PlayerCount - FROM moty_maestro + FROM maestro WHERE MaestroID = ? "; $stmt = $db_conn->prepare($query); @@ -113,7 +113,7 @@ function add_player($maestroID, $playerName, $enterCode) { global $db_conn; $query = " - INSERT INTO moty_player (MaestroID, Name, EnterCode) + INSERT INTO player (MaestroID, Name, EnterCode) VALUES (?, ?, ?) "; $stmt = $db_conn->prepare($query); @@ -125,7 +125,7 @@ function increase_player_count($maestroID, $count) { global $db_conn; $query = " - UPDATE moty_maestro + UPDATE maestro SET PlayerCount = PlayerCount + ? WHERE MaestroID = ? "; @@ -139,7 +139,7 @@ function count_registered_player($maestroID) { $query = " SELECT COUNT(PlayerID) - FROM moty_player + FROM player WHERE MaestroID = ? AND AccountType = 0 "; $stmt = $db_conn->prepare($query); @@ -157,7 +157,7 @@ function update_count_registered_player($maestroID, $countPlayer) { global $db_conn; $query = " - UPDATE moty_maestro + UPDATE maestro SET PlayerCount = ? WHERE MaestroID = ? "; diff --git a/src/web/server/player/delete_player.php b/src/web/server/player/delete_player.php index c32facb..0936633 100644 --- a/src/web/server/player/delete_player.php +++ b/src/web/server/player/delete_player.php @@ -37,7 +37,7 @@ function deletePlayer($maestroID, $playerID) { global $db_conn; $query = " - DELETE FROM moty_best_record + DELETE FROM best_record WHERE MaestroID = ? AND PlayerID = ? "; $stmt = $db_conn->prepare($query); @@ -50,7 +50,7 @@ function deletePlayer($maestroID, $playerID) { // } $query = " - DELETE FROM moty_player + DELETE FROM player WHERE MaestroID = ? AND PlayerID = ? "; $stmt = $db_conn->prepare($query); @@ -68,7 +68,7 @@ function countPlayerID($maestroID, $playerID) { $query = " SELECT COUNT(PlayerID) - FROM moty_player + FROM player WHERE MaestroID = ? AND PlayerID = ? "; $stmt = $db_conn->prepare($query); @@ -87,7 +87,7 @@ function countPlayerRecord($maestroID, $playerID) { $query = " SELECT COUNT(PlayerID) - FROM moty_best_record + FROM best_record WHERE MaestroID = ? AND PlayerID = ? "; $stmt = $db_conn->prepare($query); @@ -105,7 +105,7 @@ function decrease_player_count($maestroID, $count) { global $db_conn; $query = " - UPDATE moty_maestro + UPDATE maestro SET PlayerCount = PlayerCount - ? WHERE MaestroID = ? "; @@ -119,7 +119,7 @@ function count_registered_player($maestroID) { $query = " SELECT COUNT(PlayerID) - FROM moty_player + FROM player WHERE MaestroID = ? AND AccountType = 0 "; $stmt = $db_conn->prepare($query); @@ -137,7 +137,7 @@ function update_count_registered_player($maestroID, $countPlayer) { global $db_conn; $query = " - UPDATE moty_maestro + UPDATE maestro SET PlayerCount = ? WHERE MaestroID = ? "; diff --git a/src/web/server/player/edit_player.php b/src/web/server/player/edit_player.php index bcaed48..fa3e571 100644 --- a/src/web/server/player/edit_player.php +++ b/src/web/server/player/edit_player.php @@ -42,7 +42,7 @@ exit; function hasSamePlayerData($maestroID, $playerID, $playerName, $enterCode) { global $db_conn; - $query = "SELECT COUNT(PlayerID) FROM moty_player WHERE MaestroID=? AND PlayerID<>? AND Name=? AND EnterCode=?"; + $query = "SELECT COUNT(PlayerID) FROM player WHERE MaestroID=? AND PlayerID<>? AND Name=? AND EnterCode=?"; $stmt = $db_conn->prepare($query); $stmt->bind_param("iiss", $maestroID, $playerID, $playerName, $enterCode); $stmt->execute(); @@ -57,7 +57,7 @@ function hasSamePlayerData($maestroID, $playerID, $playerName, $enterCode) { function editPlayer($maestroID, $playerID, $playerName, $enterCode) { global $db_conn; - $query = "UPDATE moty_player SET Name=?, EnterCode=? WHERE MaestroID=? AND PlayerID=?"; + $query = "UPDATE player SET Name=?, EnterCode=? WHERE MaestroID=? AND PlayerID=?"; $stmt = $db_conn->prepare($query); $stmt->bind_param("ssii", $playerName, $enterCode, $maestroID, $playerID); $stmt->execute(); @@ -66,7 +66,7 @@ function editPlayer($maestroID, $playerID, $playerName, $enterCode) { function hasPlayerName($maestroID, $playerName, $enterCode) { global $db_conn; - $query = "SELECT PlayerID FROM moty_player WHERE MaestroID=? AND Name=? AND EnterCode=?"; + $query = "SELECT PlayerID FROM player WHERE MaestroID=? AND Name=? AND EnterCode=?"; $stmt = $db_conn->prepare($query); $stmt->bind_param("iss", $maestroID, $playerName, $enterCode); $stmt->execute(); diff --git a/src/web/server/player/login.php b/src/web/server/player/login.php index d7b58c5..8b63a7a 100644 --- a/src/web/server/player/login.php +++ b/src/web/server/player/login.php @@ -44,7 +44,7 @@ function get_maestro_id($maestroName) { $query = " SELECT MaestroID, AccountType - FROM moty_maestro + FROM maestro WHERE Name = ? "; $stmt = $db_conn->prepare($query); @@ -67,7 +67,7 @@ function get_login_data($maestroID, $name, $enterCode) { $query = " SELECT PlayerID, AccountType - FROM moty_player + FROM player WHERE MaestroID = ? AND Name = ? AND EnterCode = ? "; $stmt = $db_conn->prepare($query); diff --git a/src/web/server/player/player_experience_account.php b/src/web/server/player/player_experience_account.php index dc688df..c9df23a 100644 --- a/src/web/server/player/player_experience_account.php +++ b/src/web/server/player/player_experience_account.php @@ -30,7 +30,7 @@ function get_experience_maestro_info() { $query = " SELECT MaestroID, MaestroTestID - FROM moty_maestro + FROM maestro WHERE AccountType = 100 "; $stmt = $db_conn->prepare($query); @@ -53,7 +53,7 @@ function get_maestro_test_player_info($maestro_id) { $query = " SELECT PlayerID, Name, AccountType - FROM moty_player + FROM player WHERE MaestroID = ? "; $stmt = $db_conn->prepare($query); diff --git a/src/web/server/player/registered_player_count.php b/src/web/server/player/registered_player_count.php index 4664b44..e4b0e9b 100644 --- a/src/web/server/player/registered_player_count.php +++ b/src/web/server/player/registered_player_count.php @@ -24,7 +24,7 @@ function getPlayerCount($maestroID) { $query = " SELECT COUNT(PlayerID) - FROM moty_player + FROM player WHERE MaestroID = ? AND AccountType <> 1 "; $stmt = $db_conn->prepare($query); diff --git a/src/web/server/player/registered_player_list.php b/src/web/server/player/registered_player_list.php index 696dcb3..cf609e3 100644 --- a/src/web/server/player/registered_player_list.php +++ b/src/web/server/player/registered_player_list.php @@ -25,7 +25,7 @@ function get_player_list_page($maestroID, $startNo, $endNo) { global $db_conn; $query = " - SELECT PlayerID, Name, EnterCode FROM moty_player + SELECT PlayerID, Name, EnterCode FROM player WHERE MaestroID = ? AND AccountType <> 1 ORDER BY PlayerID DESC LIMIT ?, 10; diff --git a/src/web/server/player/search_player_count.php b/src/web/server/player/search_player_count.php index eebc992..a24430c 100644 --- a/src/web/server/player/search_player_count.php +++ b/src/web/server/player/search_player_count.php @@ -24,7 +24,7 @@ function getPlayerCount($maestroID, $playerName) { $query = " SELECT COUNT(PlayerID) - FROM moty_player + FROM player WHERE MaestroID = ? AND AccountType <> 1 AND Name LIKE CONCAT('%', ?, '%') "; $stmt = $db_conn->prepare($query); diff --git a/src/web/server/player/search_player_list.php b/src/web/server/player/search_player_list.php index 6d50cc5..4e2a1a0 100644 --- a/src/web/server/player/search_player_list.php +++ b/src/web/server/player/search_player_list.php @@ -26,7 +26,7 @@ function get_player_list_page($maestroID, $playerName, $startNo, $endNo) { global $db_conn; $query = " - SELECT PlayerID, Name, EnterCode FROM moty_player + SELECT PlayerID, Name, EnterCode FROM player WHERE MaestroID = ? AND AccountType <> 1 AND Name LIKE CONCAT('%', ?, '%') ORDER BY PlayerID DESC LIMIT ?, 10; diff --git a/src/web/server/record/history_record.php b/src/web/server/record/history_record.php index 97260c5..9afee7e 100644 --- a/src/web/server/record/history_record.php +++ b/src/web/server/record/history_record.php @@ -25,8 +25,8 @@ function get_history_record($maestro_id, $app_id, $player_id, $date) { $query = " SELECT DATE(BR.RecordDateTime) AS Date, MAX(BR.BestRecord) AS HighScore, AA.AppName AS AppName - FROM moty_best_record BR - INNER JOIN moty_app AS AA + FROM best_record BR + INNER JOIN app AS AA ON BR.MaestroID = ? AND BR.PlayerID = ? AND DATE(BR.RecordDateTime) <= ? AND BR.AppID = ? AND BR.AppID = AA.AppID GROUP BY DATE(BR.RecordDateTime) ORDER BY BR.RecordDateTime DESC diff --git a/src/web/server/record/ranking_record_day.php b/src/web/server/record/ranking_record_day.php index 273d1b6..2afb2b5 100644 --- a/src/web/server/record/ranking_record_day.php +++ b/src/web/server/record/ranking_record_day.php @@ -25,7 +25,7 @@ function get_ranking_record_day($maestro_id, $date, $app_id) { $query = " SELECT BR.playerID As PlayerID, U.Name AS Name, MAX(BR.BestRecord) AS HighScore - FROM moty_best_record BR, moty_player U + FROM best_record BR, player U WHERE BR.MaestroID = ? AND BR.playerID = U.playerID AND DATE(BR.RecordDateTime) = ? AND AppID = ? GROUP BY BR.playerID ORDER BY max(BR.BestRecord) DESC; diff --git a/src/web/server/record/ranking_record_hour.php b/src/web/server/record/ranking_record_hour.php index 2f998da..9623f62 100644 --- a/src/web/server/record/ranking_record_hour.php +++ b/src/web/server/record/ranking_record_hour.php @@ -24,7 +24,7 @@ function get_ranking_record_hour($maestro_id, $date, $time, $app_id) { $query = " SELECT BR.playerID As PlayerID, U.Name AS Name, MAX(BR.BestRecord) AS HighScore - FROM moty_best_record BR, moty_player U + FROM best_record BR, player U WHERE BR.MaestroID = ? AND BR.playerID = U.playerID AND DATE(BR.RecordDateTime) = ? AND HOUR(BR.RecordDateTime) = HOUR(?) AND AppID = ? GROUP BY BR.playerID ORDER BY max(BR.BestRecord) DESC; diff --git a/src/web/server/record/ranking_record_month.php b/src/web/server/record/ranking_record_month.php index b89a705..1abcd07 100644 --- a/src/web/server/record/ranking_record_month.php +++ b/src/web/server/record/ranking_record_month.php @@ -25,7 +25,7 @@ function get_ranking_record_month($maestro_id, $date, $time, $app_id) { $query = " SELECT BR.playerID As PlayerID, U.Name AS Name, MAX(BR.BestRecord) AS HighScore - FROM moty_best_record BR, moty_player U + FROM best_record BR, player U WHERE BR.MaestroID = ? AND BR.playerID = U.playerID AND MONTH(BR.RecordDateTime) = MONTH(?) AND AppID = ? GROUP BY BR.playerID ORDER BY max(BR.BestRecord) DESC; diff --git a/src/web/server/record/request_best_record.php b/src/web/server/record/request_best_record.php index fc7c726..045f05d 100644 --- a/src/web/server/record/request_best_record.php +++ b/src/web/server/record/request_best_record.php @@ -25,7 +25,7 @@ function get_best_record($maestro_id, $app_id, $player_id) { $query = " SELECT BestRecord - FROM moty_best_record + FROM best_record WHERE MaestroID = ? AND AppID = ? AND PlayerID = ? AND DATE(RecordDateTime) = DATE(NOW()) "; $stmt = $db_conn->prepare($query); diff --git a/src/web/server/record/update_best_record.php b/src/web/server/record/update_best_record.php index 375ef1e..a28ab9b 100644 --- a/src/web/server/record/update_best_record.php +++ b/src/web/server/record/update_best_record.php @@ -35,7 +35,7 @@ function get_best_record($maestro_id, $app_id, $player_id) { $query = " SELECT BestRecordID, BestRecord - FROM moty_best_record + FROM best_record WHERE MaestroID = ? AND AppID = ? AND PlayerID = ? AND DATE(RecordDateTime) = DATE(NOW()) /*AND HOUR(RecordDateTime) = HOUR(NOW())*/ "; @@ -57,7 +57,7 @@ function insert_best_record($maestro_id, $app_id, $player_id, $best_record) { global $db_conn; $query = " - INSERT INTO moty_best_record (MaestroID, PlayerID, AppID, BestRecord, RecordDateTime) + INSERT INTO best_record (MaestroID, PlayerID, AppID, BestRecord, RecordDateTime) VALUES (?, ?, ?, ?, NOW()); "; $stmt = $db_conn->prepare($query); @@ -69,7 +69,7 @@ function update_best_record($prev_best_record_id, $best_record) { global $db_conn; $query = " - UPDATE moty_best_record + UPDATE best_record SET BestRecord = ?, RecordDateTime = NOW() WHERE BestRecordID = ? AND DATE(RecordDateTime) = DATE(NOW()) /* AND HOUR(RecordDateTime) = HOUR(NOW()) */ diff --git a/src/web/server/setup/connect_db.php b/src/web/server/setup/connect_db.php index fd45821..a5e382d 100644 --- a/src/web/server/setup/connect_db.php +++ b/src/web/server/setup/connect_db.php @@ -6,9 +6,9 @@ if($hasServiceDBSetting == true) { include("./../setup/service_db_setting.php"); } else { $db_host = "localhost"; - $db_user = "afterschool"; + $db_user = "moty"; $db_passwd = "sEobMPuJ2A8KTfwU"; - $db_name = "jisangs"; + $db_name = "moty"; } @@ -19,7 +19,7 @@ if ($db_conn->connect_error) { send_result_fail(); exit; } else { - $query = "USE jisangs"; + $query = "USE moty"; $result = mysqli_query($db_conn, $query); } diff --git a/src/web/sql/insert_active_app.sql b/src/web/sql/insert_active_app.sql index 2266ca6..ff4202f 100644 --- a/src/web/sql/insert_active_app.sql +++ b/src/web/sql/insert_active_app.sql @@ -1,6 +1,6 @@ -USE jisangs; +USE moty; -INSERT INTO `moty_active_app` (`ActiveAppID`, `MaestroID`, `AppID`) VALUES +INSERT INTO `active_app` (`ActiveAppID`, `MaestroID`, `AppID`) VALUES (1, 1, 101), (2, 1, 102), (3, 1, 1), @@ -21,23 +21,23 @@ INSERT INTO `moty_active_app` (`ActiveAppID`, `MaestroID`, `AppID`) VALUES (18, 1, 30), (19, 1, 39), (20, 1, 40), -(21, 3, 101), -(22, 3, 102), -(23, 3, 1), -(24, 3, 2), -(25, 3, 3), -(26, 3, 4), -(27, 3, 5), -(28, 3, 6), -(29, 3, 7), -(30, 3, 8), -(31, 3, 11), -(32, 3, 12), -(33, 3, 13), -(34, 3, 14), -(35, 3, 15), -(36, 3, 16), -(37, 3, 29), -(38, 3, 30), -(39, 3, 39), -(40, 3, 40); +(21, 2, 101), +(22, 2, 102), +(23, 2, 1), +(24, 2, 2), +(25, 2, 3), +(26, 2, 4), +(27, 2, 5), +(28, 2, 6), +(29, 2, 7), +(30, 2, 8), +(31, 2, 11), +(32, 2, 12), +(33, 2, 13), +(34, 2, 14), +(35, 2, 15), +(36, 2, 16), +(37, 2, 29), +(38, 2, 30), +(39, 2, 39), +(40, 2, 40); diff --git a/src/web/sql/insert_app.sql b/src/web/sql/insert_app.sql index e1687a7..36158ea 100644 --- a/src/web/sql/insert_app.sql +++ b/src/web/sql/insert_app.sql @@ -1,6 +1,6 @@ -USE jisangs; +USE moty; -INSERT INTO `moty_app` (`AppID`, `AppName`, `KoreanName`, `AppType`, `HowToPlay`) VALUES +INSERT INTO `app` (`AppID`, `AppName`, `KoreanName`, `AppType`, `HowToPlay`) VALUES (1, 'practice_korean_basic', '기본 자리', 1, ''), (2, 'practice_korean_left_upper', '왼손 윗글쇠', 1, ''), (3, 'practice_korean_second_finger', '검지 글쇠', 1, ''), diff --git a/src/web/sql/insert_maestro_player.sql b/src/web/sql/insert_maestro_player.sql index 6f441ab..85927e9 100644 --- a/src/web/sql/insert_maestro_player.sql +++ b/src/web/sql/insert_maestro_player.sql @@ -1,13 +1,13 @@ -USE jisangs; +USE moty; -INSERT INTO `moty_maestro` (`MaestroID`, `Name`, `Password`, `Email`, `AccountType`, `ActivateStatus`, `AvailableActivateDateTime`, `PlayerCount`, `AcceptClausesDateTime`, `MaestroTestID`) VALUES +INSERT INTO `maestro` (`MaestroID`, `Name`, `Password`, `Email`, `AccountType`, `ActivateStatus`, `AvailableActivateDateTime`, `PlayerCount`, `AcceptClausesDateTime`, `MaestroTestID`) VALUES (1, 'testplayer', '', 'test@jinaju.com', 100, 1, '2100-12-31 00:00:00', 0, '2018-05-27 17:13:35', 1), (2, '마에스트로 체험', '', 'test@jinaju.com', 101, 1, '2100-12-31 00:00:00', 0, '2018-07-08 00:00:00', 2); -INSERT INTO `moty_player` (`PlayerID`, `MaestroID`, `Name`, `EnterCode`, `AccountType`) VALUES +INSERT INTO `player` (`PlayerID`, `MaestroID`, `Name`, `EnterCode`, `AccountType`) VALUES (1, 1, '학생 체험', '', 0), (2, 2, '마에스트로', '', 0); -INSERT INTO `moty_admin` (`AdminID`, `Name`, `Password`, `Email`, `AccountType`, `ActivateStatus`) VALUES +INSERT INTO `admin` (`AdminID`, `Name`, `Password`, `Email`, `AccountType`, `ActivateStatus`) VALUES (1, 'jisangs', '*F2012B4E7A22EED437B79FB53DBF79C8AAC5034B', 'jisangs@gmail.com', 1, 1); diff --git a/src/web/sql/make_db.sql b/src/web/sql/make_db.sql index 294d68e..4df8c66 100644 --- a/src/web/sql/make_db.sql +++ b/src/web/sql/make_db.sql @@ -1,4 +1,4 @@ -CREATE TABLE moty_admin ( +CREATE TABLE admin ( AdminID INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, Name CHAR(50) NOT NULL, Password CHAR(50) NOT NULL, @@ -7,7 +7,7 @@ CREATE TABLE moty_admin ( ActivateStatus INT UNSIGNED NOT NULL ); -CREATE TABLE moty_maestro ( +CREATE TABLE maestro ( MaestroID INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, Name CHAR(50) NOT NULL, Password CHAR(50) NOT NULL, @@ -20,7 +20,7 @@ CREATE TABLE moty_maestro ( MaestroTestID INT UNSIGNED ); -CREATE TABLE moty_maestro_upgrade ( +CREATE TABLE maestro_upgrade ( MaestroUpgradeID INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, RegisteredAccountType INT UNSIGNED NOT NULL, RequestedAccountType INT UNSIGNED NOT NULL, @@ -28,22 +28,22 @@ CREATE TABLE moty_maestro_upgrade ( Status INT UNSIGNED NOT NULL, MaestroID INT UNSIGNED NOT NULL, - FOREIGN KEY (MaestroID) REFERENCES moty_maestro(MaestroID) + FOREIGN KEY (MaestroID) REFERENCES maestro(MaestroID) ); -CREATE TABLE moty_player ( +CREATE TABLE player ( PlayerID INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, MaestroID INT UNSIGNED NOT NULL, Name CHAR(50) NOT NULL, EnterCode CHAR(6) NOT NULL, AccountType INT UNSIGNED NOT NULL, - FOREIGN KEY (MaestroID) REFERENCES moty_maestro(MaestroID) + FOREIGN KEY (MaestroID) REFERENCES maestro(MaestroID) ); -CREATE TABLE moty_app ( +CREATE TABLE app ( AppID INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, AppName CHAR(40) NOT NULL, KoreanName CHAR(40) NOT NULL, @@ -51,18 +51,18 @@ CREATE TABLE moty_app ( HowToPlay TEXT NOT NULL ); -CREATE TABLE moty_active_app ( +CREATE TABLE active_app ( ActiveAppID INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, MaestroID INT UNSIGNED NOT NULL, AppID INT UNSIGNED NOT NULL, - FOREIGN KEY (MaestroID) REFERENCES moty_maestro(MaestroID), - FOREIGN KEY (AppID) REFERENCES moty_app(AppID) + FOREIGN KEY (MaestroID) REFERENCES maestro(MaestroID), + FOREIGN KEY (AppID) REFERENCES app(AppID) ); -CREATE TABLE moty_best_record ( +CREATE TABLE best_record ( BestRecordID INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, MaestroID INT UNSIGNED NOT NULL, AppID INT UNSIGNED NOT NULL, @@ -70,12 +70,12 @@ CREATE TABLE moty_best_record ( BestRecord FLOAT NOT NULL, RecordDateTime DATETIME NOT NULL, - FOREIGN KEY (MaestroID) REFERENCES moty_maestro(MaestroID), - FOREIGN KEY (AppID) REFERENCES moty_app(AppID), - FOREIGN KEY (PlayerID) REFERENCES moty_player(PlayerID) + FOREIGN KEY (MaestroID) REFERENCES maestro(MaestroID), + FOREIGN KEY (AppID) REFERENCES app(AppID), + FOREIGN KEY (PlayerID) REFERENCES player(PlayerID) ); -CREATE TABLE moty_ranking ( +CREATE TABLE ranking ( RankingID INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, MaestroID INT UNSIGNED NOT NULL, AppID INT UNSIGNED NOT NULL, @@ -83,7 +83,7 @@ CREATE TABLE moty_ranking ( Rank INT UNSIGNED NOT NULL, PlayerID INT UNSIGNED NOT NULL, - FOREIGN KEY (MaestroID) REFERENCES moty_maestro(MaestroID), - FOREIGN KEY (AppID) REFERENCES moty_app(AppID), - FOREIGN KEY (PlayerID) REFERENCES moty_player(PlayerID) + FOREIGN KEY (MaestroID) REFERENCES maestro(MaestroID), + FOREIGN KEY (AppID) REFERENCES app(AppID), + FOREIGN KEY (PlayerID) REFERENCES player(PlayerID) );