Fix: DB jisangs -> moty
This commit is contained in:
@@ -1,31 +0,0 @@
|
|||||||
<?php
|
|
||||||
// header('Content-Type: application/json');
|
|
||||||
|
|
||||||
$name = $_POST["name"];
|
|
||||||
|
|
||||||
$birthday = $_POST["birthday"];
|
|
||||||
if(!is_numeric($birthday)) {
|
|
||||||
echo '생년월일이 숫자가 아닙니다.';
|
|
||||||
return;
|
|
||||||
} else if(strlen($birthday) != 6) {
|
|
||||||
echo '6자리 숫자값을 정확히 입력하세요 : YYMMDD (예 : 120131)';
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
include "./connect_db.php";
|
|
||||||
|
|
||||||
$query = "INSERT INTO afterschool_user(UserID, Name, Birthday) values (null,?,?)";
|
|
||||||
$stmt = $db_conn->prepare($query);
|
|
||||||
$stmt->bind_param('ss', $name, $birthday);
|
|
||||||
$stmt->execute();
|
|
||||||
|
|
||||||
if($stmt->affected_rows > 0) {
|
|
||||||
echo("succeed");
|
|
||||||
} else {
|
|
||||||
echo "fail";
|
|
||||||
}
|
|
||||||
|
|
||||||
$db_conn->close();
|
|
||||||
|
|
||||||
?>
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
<?php
|
|
||||||
// header('Content-Type: application/json');
|
|
||||||
|
|
||||||
include "./connect_db.php";
|
|
||||||
|
|
||||||
$query = "DELETE FROM afterschool_record WHERE UserID=31;";
|
|
||||||
$result = $db_conn->query($query);
|
|
||||||
|
|
||||||
$db_conn->close();
|
|
||||||
|
|
||||||
?>
|
|
||||||
@@ -48,7 +48,7 @@ function get_admin_id($adminName) {
|
|||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
SELECT AdminID
|
SELECT AdminID
|
||||||
FROM moty_admin
|
FROM admin
|
||||||
WHERE Name = ?
|
WHERE Name = ?
|
||||||
";
|
";
|
||||||
$stmt = $db_conn->prepare($query);
|
$stmt = $db_conn->prepare($query);
|
||||||
@@ -69,7 +69,7 @@ function login($adminName, $password) {
|
|||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
SELECT AdminID, AccountType, ActivateStatus
|
SELECT AdminID, AccountType, ActivateStatus
|
||||||
FROM moty_admin
|
FROM admin
|
||||||
WHERE Name = ? AND Password = PASSWORD(?)
|
WHERE Name = ? AND Password = PASSWORD(?)
|
||||||
";
|
";
|
||||||
$stmt = $db_conn->prepare($query);
|
$stmt = $db_conn->prepare($query);
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ function get_maestro_list() {
|
|||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
SELECT MaestroID, Name, AccountType
|
SELECT MaestroID, Name, AccountType
|
||||||
FROM moty_maestro
|
FROM maestro
|
||||||
WHERE ActivateStatus=0
|
WHERE ActivateStatus=0
|
||||||
ORDER BY MaestroID DESC
|
ORDER BY MaestroID DESC
|
||||||
";
|
";
|
||||||
@@ -56,7 +56,7 @@ function get_maestro_list_by_name($maestroName) {
|
|||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
SELECT MaestroID, Name, AccountType
|
SELECT MaestroID, Name, AccountType
|
||||||
FROM moty_maestro
|
FROM maestro
|
||||||
WHERE Name LIKE CONCAT('%', ?, '%') AND ActivateStatus=0
|
WHERE Name LIKE CONCAT('%', ?, '%') AND ActivateStatus=0
|
||||||
ORDER BY MaestroID DESC
|
ORDER BY MaestroID DESC
|
||||||
";
|
";
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ function get_maestro_upgrade_list() {
|
|||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
SELECT U.MaestroUpgradeID, U.MaestroID, M.Name, U.RegisteredAccountType, U.RequestedAccountType, U.RequestedDateTime, U.Status
|
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
|
WHERE U.Status < 2 AND U.MaestroID = M.MaestroID
|
||||||
ORDER BY U.MaestroUpgradeID DESC
|
ORDER BY U.MaestroUpgradeID DESC
|
||||||
";
|
";
|
||||||
@@ -60,7 +60,7 @@ function get_maestro_update_list_by_name($searchMaestroName) {
|
|||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
SELECT U.MaestroUpgradeID, U.MaestroID, M.Name, U.RegisteredAccountType, U.RequestedAccountType, U.RequestedDateTime, U.Status
|
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
|
WHERE M.Name LIKE CONCAT('%', ?, '%') AND U.MaestroID = M.MaestroID
|
||||||
ORDER BY U.MaestroUpgradeID DESC
|
ORDER BY U.MaestroUpgradeID DESC
|
||||||
";
|
";
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ function register_maestro($maestroID) {
|
|||||||
global $db_conn;
|
global $db_conn;
|
||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
UPDATE moty_maestro
|
UPDATE maestro
|
||||||
SET ActivateStatus = 1, AvailableActivateDateTime = DATE_ADD(NOW(), INTERVAL 1 YEAR)
|
SET ActivateStatus = 1, AvailableActivateDateTime = DATE_ADD(NOW(), INTERVAL 1 YEAR)
|
||||||
WHERE MaestroID = ?
|
WHERE MaestroID = ?
|
||||||
";
|
";
|
||||||
@@ -53,7 +53,7 @@ function add_maestro_test_player($maestroID) {
|
|||||||
global $db_conn;
|
global $db_conn;
|
||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
INSERT INTO moty_player (MaestroID, Name, EnterCode, AccountType)
|
INSERT INTO player (MaestroID, Name, EnterCode, AccountType)
|
||||||
VALUES (?, '마에스트로', '', 1)
|
VALUES (?, '마에스트로', '', 1)
|
||||||
";
|
";
|
||||||
$stmt = $db_conn->prepare($query);
|
$stmt = $db_conn->prepare($query);
|
||||||
@@ -66,7 +66,7 @@ function get_maestro_test_player($maestroID) {
|
|||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
SELECT PlayerID
|
SELECT PlayerID
|
||||||
FROM moty_player
|
FROM player
|
||||||
WHERE MaestroID = ? AND AccountType = 1
|
WHERE MaestroID = ? AND AccountType = 1
|
||||||
";
|
";
|
||||||
$stmt = $db_conn->prepare($query);
|
$stmt = $db_conn->prepare($query);
|
||||||
@@ -83,7 +83,7 @@ function set_maestro_test_player($maestroID, $playerID) {
|
|||||||
global $db_conn;
|
global $db_conn;
|
||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
UPDATE moty_maestro
|
UPDATE maestro
|
||||||
SET MaestroTestID = ?
|
SET MaestroTestID = ?
|
||||||
WHERE MaestroID = ?
|
WHERE MaestroID = ?
|
||||||
";
|
";
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ function upgrade_maestro($maestroID, $newAccountType) {
|
|||||||
global $db_conn;
|
global $db_conn;
|
||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
UPDATE moty_maestro
|
UPDATE maestro
|
||||||
SET AccountType = ?, ActivateStatus = 1, AvailableActivateDateTime = DATE_ADD(NOW(), INTERVAL 1 YEAR)
|
SET AccountType = ?, ActivateStatus = 1, AvailableActivateDateTime = DATE_ADD(NOW(), INTERVAL 1 YEAR)
|
||||||
WHERE MaestroID = ?;
|
WHERE MaestroID = ?;
|
||||||
";
|
";
|
||||||
@@ -39,7 +39,7 @@ function change_upgrade_request_status_to_close($maestroID) {
|
|||||||
global $db_conn;
|
global $db_conn;
|
||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
UPDATE moty_maestro_upgrade
|
UPDATE maestro_upgrade
|
||||||
SET Status = 2
|
SET Status = 2
|
||||||
WHERE MaestroID = ? AND Status = 1;
|
WHERE MaestroID = ? AND Status = 1;
|
||||||
";
|
";
|
||||||
@@ -52,7 +52,7 @@ function change_upgrade_request_status_to_applied($maestroUpgradeID) {
|
|||||||
global $db_conn;
|
global $db_conn;
|
||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
UPDATE moty_maestro_upgrade
|
UPDATE maestro_upgrade
|
||||||
SET Status = 3
|
SET Status = 3
|
||||||
WHERE MaestroUpgradeID = ?
|
WHERE MaestroUpgradeID = ?
|
||||||
";
|
";
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ function activate_app($maestroID, $appID) {
|
|||||||
global $db_conn;
|
global $db_conn;
|
||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
INSERT INTO moty_active_app (MaestroID, AppID)
|
INSERT INTO active_app (MaestroID, AppID)
|
||||||
VALUES (?, ?);
|
VALUES (?, ?);
|
||||||
";
|
";
|
||||||
$stmt = $db_conn->prepare($query);
|
$stmt = $db_conn->prepare($query);
|
||||||
@@ -35,7 +35,7 @@ function get_app_name($appID) {
|
|||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
SELECT AppName, KoreanName
|
SELECT AppName, KoreanName
|
||||||
FROM moty_app
|
FROM app
|
||||||
WHERE AppID = ?
|
WHERE AppID = ?
|
||||||
";
|
";
|
||||||
$stmt = $db_conn->prepare($query);
|
$stmt = $db_conn->prepare($query);
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ function deactivate_app($maestroID, $appID) {
|
|||||||
global $db_conn;
|
global $db_conn;
|
||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
DELETE FROM moty_active_app
|
DELETE FROM active_app
|
||||||
WHERE MaestroID = ? AND AppID = ?;
|
WHERE MaestroID = ? AND AppID = ?;
|
||||||
";
|
";
|
||||||
$stmt = $db_conn->prepare($query);
|
$stmt = $db_conn->prepare($query);
|
||||||
@@ -35,7 +35,7 @@ function get_app_name($appID) {
|
|||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
SELECT AppName, KoreanName
|
SELECT AppName, KoreanName
|
||||||
FROM moty_app
|
FROM app
|
||||||
WHERE AppID = ?
|
WHERE AppID = ?
|
||||||
";
|
";
|
||||||
$stmt = $db_conn->prepare($query);
|
$stmt = $db_conn->prepare($query);
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ function get_how_to_play($app_id) {
|
|||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
SELECT HowToPlay
|
SELECT HowToPlay
|
||||||
FROM moty_app
|
FROM app
|
||||||
WHERE AppID = ?;
|
WHERE AppID = ?;
|
||||||
";
|
";
|
||||||
$stmt = $db_conn->prepare($query);
|
$stmt = $db_conn->prepare($query);
|
||||||
|
|||||||
@@ -28,8 +28,8 @@ function get_mouse_app_list($maestro_id) {
|
|||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
SELECT A.AppID, A.AppName, A.KoreanName, A.AppType
|
SELECT A.AppID, A.AppName, A.KoreanName, A.AppType
|
||||||
FROM moty_app AS A
|
FROM app AS A
|
||||||
INNER JOIN moty_active_app AS AA ON A.AppID = AA.AppID AND A.AppType = 100 AND AA.MaestroID=?";
|
INNER JOIN active_app AS AA ON A.AppID = AA.AppID AND A.AppType = 100 AND AA.MaestroID=?";
|
||||||
$stmt = $db_conn->prepare($query);
|
$stmt = $db_conn->prepare($query);
|
||||||
$stmt->bind_param("i", $maestro_id);
|
$stmt->bind_param("i", $maestro_id);
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
@@ -53,8 +53,8 @@ function get_typing_practice_app_count($maestro_id) {
|
|||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
SELECT COUNT(*)
|
SELECT COUNT(*)
|
||||||
FROM moty_app AS A
|
FROM app AS A
|
||||||
INNER JOIN moty_active_app AS AA ON A.AppID = AA.AppID AND A.AppType <= 2 AND AA.MaestroID=?";
|
INNER JOIN active_app AS AA ON A.AppID = AA.AppID AND A.AppType <= 2 AND AA.MaestroID=?";
|
||||||
$stmt = $db_conn->prepare($query);
|
$stmt = $db_conn->prepare($query);
|
||||||
$stmt->bind_param("i", $maestro_id);
|
$stmt->bind_param("i", $maestro_id);
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
@@ -70,8 +70,8 @@ function get_typing_test_app_count($maestro_id) {
|
|||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
SELECT COUNT(*)
|
SELECT COUNT(*)
|
||||||
FROM moty_app AS A
|
FROM 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=?";
|
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 = $db_conn->prepare($query);
|
||||||
$stmt->bind_param("i", $maestro_id);
|
$stmt->bind_param("i", $maestro_id);
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
@@ -87,8 +87,8 @@ function get_typing_app_list($maestro_id) {
|
|||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
SELECT A.AppID, A.AppName, A.KoreanName, A.AppType
|
SELECT A.AppID, A.AppName, A.KoreanName, A.AppType
|
||||||
FROM moty_app AS A
|
FROM app AS A
|
||||||
INNER JOIN moty_active_app AS AA ON A.AppID = AA.AppID AND A.AppType = 50 AND AA.MaestroID=?";
|
INNER JOIN active_app AS AA ON A.AppID = AA.AppID AND A.AppType = 50 AND AA.MaestroID=?";
|
||||||
$stmt = $db_conn->prepare($query);
|
$stmt = $db_conn->prepare($query);
|
||||||
$stmt->bind_param("i", $maestro_id);
|
$stmt->bind_param("i", $maestro_id);
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
|
|||||||
@@ -26,8 +26,8 @@ function get_active_typing_practice_app_list($maestro_id, $type) {
|
|||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
SELECT A.AppID, A.AppName, A.KoreanName
|
SELECT A.AppID, A.AppName, A.KoreanName
|
||||||
FROM moty_app AS A
|
FROM app AS A
|
||||||
INNER JOIN moty_active_app AS AA
|
INNER JOIN active_app AS AA
|
||||||
ON A.AppID = AA.AppID AND AA.MaestroID = ? AND A.AppType = ?
|
ON A.AppID = AA.AppID AND AA.MaestroID = ? AND A.AppType = ?
|
||||||
ORDER BY A.AppID ASC";
|
ORDER BY A.AppID ASC";
|
||||||
$stmt = $db_conn->prepare($query);
|
$stmt = $db_conn->prepare($query);
|
||||||
|
|||||||
@@ -26,8 +26,8 @@ function get_active_typing_practice_app_list($maestro_id, $type) {
|
|||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
SELECT A.AppID, A.AppName, A.KoreanName
|
SELECT A.AppID, A.AppName, A.KoreanName
|
||||||
FROM moty_app AS A
|
FROM app AS A
|
||||||
INNER JOIN moty_active_app AS AA
|
INNER JOIN active_app AS AA
|
||||||
ON A.AppID = AA.AppID AND AA.MaestroID = ? AND A.AppType = ?
|
ON A.AppID = AA.AppID AND AA.MaestroID = ? AND A.AppType = ?
|
||||||
ORDER BY A.AppID ASC";
|
ORDER BY A.AppID ASC";
|
||||||
$stmt = $db_conn->prepare($query);
|
$stmt = $db_conn->prepare($query);
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ function get_mouse_app_list() {
|
|||||||
global $db_conn;
|
global $db_conn;
|
||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
SELECT AppID, AppName, KoreanName FROM moty_app
|
SELECT AppID, AppName, KoreanName FROM app
|
||||||
WHERE AppType=100
|
WHERE AppType=100
|
||||||
ORDER BY AppID ASC
|
ORDER BY AppID ASC
|
||||||
";
|
";
|
||||||
@@ -51,8 +51,8 @@ function get_activated_mouse_app_list($maestroID) {
|
|||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
SELECT A.AppID
|
SELECT A.AppID
|
||||||
FROM moty_app AS A
|
FROM app AS A
|
||||||
INNER JOIN moty_active_app AS AA ON A.AppID = AA.AppID AND A.AppType = 100 AND AA.MaestroID=?"
|
INNER JOIN active_app AS AA ON A.AppID = AA.AppID AND A.AppType = 100 AND AA.MaestroID=?"
|
||||||
;
|
;
|
||||||
$stmt = $db_conn->prepare($query);
|
$stmt = $db_conn->prepare($query);
|
||||||
$stmt->bind_param("i", $maestroID);
|
$stmt->bind_param("i", $maestroID);
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ function get_typing_app_list() {
|
|||||||
global $db_conn;
|
global $db_conn;
|
||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
SELECT AppID, AppName, KoreanName FROM moty_app
|
SELECT AppID, AppName, KoreanName FROM app
|
||||||
WHERE AppType < 100
|
WHERE AppType < 100
|
||||||
ORDER BY AppID ASC
|
ORDER BY AppID ASC
|
||||||
";
|
";
|
||||||
@@ -51,8 +51,8 @@ function get_activated_typing_app_list($maestroID) {
|
|||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
SELECT A.AppID
|
SELECT A.AppID
|
||||||
FROM moty_app AS A
|
FROM app AS A
|
||||||
INNER JOIN moty_active_app AS AA ON A.AppID = AA.AppID AND A.AppType < 100 AND AA.MaestroID=?"
|
INNER JOIN active_app AS AA ON A.AppID = AA.AppID AND A.AppType < 100 AND AA.MaestroID=?"
|
||||||
;
|
;
|
||||||
$stmt = $db_conn->prepare($query);
|
$stmt = $db_conn->prepare($query);
|
||||||
$stmt->bind_param("i", $maestroID);
|
$stmt->bind_param("i", $maestroID);
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ function has_maestro_name($maestroName) {
|
|||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
SELECT MaestroID
|
SELECT MaestroID
|
||||||
FROM moty_maestro
|
FROM maestro
|
||||||
WHERE Name = ?
|
WHERE Name = ?
|
||||||
";
|
";
|
||||||
$stmt = $db_conn->prepare($query);
|
$stmt = $db_conn->prepare($query);
|
||||||
@@ -64,7 +64,7 @@ function add_maestro($maestro_name, $password, $email, $account_type) {
|
|||||||
global $db_conn;
|
global $db_conn;
|
||||||
|
|
||||||
$query = "
|
$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)";
|
VALUES (?, PASSWORD(?), ?, ?, 0, 0, NOW(), -1)";
|
||||||
$stmt = $db_conn->prepare($query);
|
$stmt = $db_conn->prepare($query);
|
||||||
$stmt->bind_param("sssi", $maestro_name, $password, $email, $account_type);
|
$stmt->bind_param("sssi", $maestro_name, $password, $email, $account_type);
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ exit;
|
|||||||
function get_maestro_id($maestro_name) {
|
function get_maestro_id($maestro_name) {
|
||||||
global $db_conn;
|
global $db_conn;
|
||||||
|
|
||||||
$query = "SELECT MaestroID FROM moty_maestro WHERE Name=?";
|
$query = "SELECT MaestroID FROM maestro WHERE Name=?";
|
||||||
$stmt = $db_conn->prepare($query);
|
$stmt = $db_conn->prepare($query);
|
||||||
$stmt->bind_param("s", $maestro_name);
|
$stmt->bind_param("s", $maestro_name);
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ function get_maestro_test_player_id($maestro_id) {
|
|||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
SELECT MaestroTestID
|
SELECT MaestroTestID
|
||||||
FROM moty_maestro
|
FROM maestro
|
||||||
WHERE MaestroID = ?
|
WHERE MaestroID = ?
|
||||||
";
|
";
|
||||||
$stmt = $db_conn->prepare($query);
|
$stmt = $db_conn->prepare($query);
|
||||||
@@ -48,7 +48,7 @@ function delete_maestro_test_player_record($player_id) {
|
|||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
DELETE
|
DELETE
|
||||||
FROM moty_best_record
|
FROM best_record
|
||||||
WHERE PlayerID = ?
|
WHERE PlayerID = ?
|
||||||
";
|
";
|
||||||
$stmt = $db_conn->prepare($query);
|
$stmt = $db_conn->prepare($query);
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ function get_maestro_id($maestroName) {
|
|||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
SELECT MaestroID
|
SELECT MaestroID
|
||||||
FROM moty_maestro
|
FROM maestro
|
||||||
WHERE Name = ?
|
WHERE Name = ?
|
||||||
";
|
";
|
||||||
$stmt = $db_conn->prepare($query);
|
$stmt = $db_conn->prepare($query);
|
||||||
@@ -78,7 +78,7 @@ function login($maestroName, $password) {
|
|||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
SELECT MaestroID, AccountType, ActivateStatus, AvailableActivateDateTime
|
SELECT MaestroID, AccountType, ActivateStatus, AvailableActivateDateTime
|
||||||
FROM moty_maestro
|
FROM maestro
|
||||||
WHERE Name = ? AND Password = PASSWORD(?)
|
WHERE Name = ? AND Password = PASSWORD(?)
|
||||||
";
|
";
|
||||||
$stmt = $db_conn->prepare($query);
|
$stmt = $db_conn->prepare($query);
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ function get_maestro_experience_id() {
|
|||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
SELECT MaestroID
|
SELECT MaestroID
|
||||||
FROM moty_maestro
|
FROM maestro
|
||||||
WHERE AccountType = 101
|
WHERE AccountType = 101
|
||||||
";
|
";
|
||||||
$stmt = $db_conn->prepare($query);
|
$stmt = $db_conn->prepare($query);
|
||||||
@@ -59,7 +59,7 @@ function get_maestro_test_player_id($maestro_id) {
|
|||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
SELECT MaestroTestID
|
SELECT MaestroTestID
|
||||||
FROM moty_maestro
|
FROM maestro
|
||||||
WHERE MaestroID = ?
|
WHERE MaestroID = ?
|
||||||
";
|
";
|
||||||
$stmt = $db_conn->prepare($query);
|
$stmt = $db_conn->prepare($query);
|
||||||
@@ -80,7 +80,7 @@ function get_maestro_test_player_name($player_id) {
|
|||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
SELECT Name
|
SELECT Name
|
||||||
FROM moty_player
|
FROM player
|
||||||
WHERE PlayerID = ?
|
WHERE PlayerID = ?
|
||||||
";
|
";
|
||||||
$stmt = $db_conn->prepare($query);
|
$stmt = $db_conn->prepare($query);
|
||||||
@@ -106,7 +106,7 @@ function remove_maestro_sample_player_data($maestro_id) {
|
|||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
DELETE
|
DELETE
|
||||||
FROM moty_player
|
FROM player
|
||||||
WHERE MaestroID = ? AND AccountType = 0
|
WHERE MaestroID = ? AND AccountType = 0
|
||||||
";
|
";
|
||||||
$stmt = $db_conn->prepare($query);
|
$stmt = $db_conn->prepare($query);
|
||||||
@@ -127,7 +127,7 @@ function insert_maestro_sample_player_data($i, $maestro_id, $player) {
|
|||||||
global $db_conn;
|
global $db_conn;
|
||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
INSERT INTO moty_player (MaestroID, Name, EnterCode, AccountType)
|
INSERT INTO player (MaestroID, Name, EnterCode, AccountType)
|
||||||
VALUES (?, ?, ?, ?)
|
VALUES (?, ?, ?, ?)
|
||||||
";
|
";
|
||||||
$stmt = $db_conn->prepare($query);
|
$stmt = $db_conn->prepare($query);
|
||||||
@@ -172,7 +172,7 @@ function count_registered_player($maestroID) {
|
|||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
SELECT COUNT(PlayerID)
|
SELECT COUNT(PlayerID)
|
||||||
FROM moty_player
|
FROM player
|
||||||
WHERE MaestroID = ? AND AccountType = 0
|
WHERE MaestroID = ? AND AccountType = 0
|
||||||
";
|
";
|
||||||
$stmt = $db_conn->prepare($query);
|
$stmt = $db_conn->prepare($query);
|
||||||
@@ -190,7 +190,7 @@ function update_count_registered_player($maestroID, $countPlayer) {
|
|||||||
global $db_conn;
|
global $db_conn;
|
||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
UPDATE moty_maestro
|
UPDATE maestro
|
||||||
SET PlayerCount = ?
|
SET PlayerCount = ?
|
||||||
WHERE MaestroID = ?
|
WHERE MaestroID = ?
|
||||||
";
|
";
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ function get_maestro_info($maestroID) {
|
|||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
SELECT Name, Email, AccountType, PlayerCount
|
SELECT Name, Email, AccountType, PlayerCount
|
||||||
FROM moty_maestro
|
FROM maestro
|
||||||
WHERE MaestroID = ?
|
WHERE MaestroID = ?
|
||||||
";
|
";
|
||||||
$stmt = $db_conn->prepare($query);
|
$stmt = $db_conn->prepare($query);
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ function get_maestro_test_player_id($maestro_id) {
|
|||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
SELECT AccountType, MaestroTestID
|
SELECT AccountType, MaestroTestID
|
||||||
FROM moty_maestro
|
FROM maestro
|
||||||
WHERE MaestroID = ?
|
WHERE MaestroID = ?
|
||||||
";
|
";
|
||||||
$stmt = $db_conn->prepare($query);
|
$stmt = $db_conn->prepare($query);
|
||||||
@@ -53,7 +53,7 @@ function get_maestro_test_player_info($player_id) {
|
|||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
SELECT Name, AccountType
|
SELECT Name, AccountType
|
||||||
FROM moty_player
|
FROM player
|
||||||
WHERE PlayerID = ?
|
WHERE PlayerID = ?
|
||||||
";
|
";
|
||||||
$stmt = $db_conn->prepare($query);
|
$stmt = $db_conn->prepare($query);
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ function count_maestro_upgrade($maestroID) {
|
|||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
SELECT COUNT(MaestroID)
|
SELECT COUNT(MaestroID)
|
||||||
FROM moty_maestro_upgrade
|
FROM maestro_upgrade
|
||||||
WHERE MaestroID = ?
|
WHERE MaestroID = ?
|
||||||
";
|
";
|
||||||
$stmt = $db_conn->prepare($query);
|
$stmt = $db_conn->prepare($query);
|
||||||
@@ -53,7 +53,7 @@ function add_maestro_update($maestroID, $registeredAcountType, $newAccountType)
|
|||||||
global $db_conn;
|
global $db_conn;
|
||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
INSERT INTO moty_maestro_upgrade (RegisteredAccountType, RequestedAccountType, RequestedDateTime, Status, MaestroID)
|
INSERT INTO maestro_upgrade (RegisteredAccountType, RequestedAccountType, RequestedDateTime, Status, MaestroID)
|
||||||
VALUES (?, ?, NOW(), 1, ?);
|
VALUES (?, ?, NOW(), 1, ?);
|
||||||
";
|
";
|
||||||
$stmt = $db_conn->prepare($query);
|
$stmt = $db_conn->prepare($query);
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ function update_maestro_info($maestroID, $maestroName, $email) {
|
|||||||
global $db_conn;
|
global $db_conn;
|
||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
UPDATE moty_maestro
|
UPDATE maestro
|
||||||
SET Name = ?, Email = ?
|
SET Name = ?, Email = ?
|
||||||
WHERE MaestroID = ?
|
WHERE MaestroID = ?
|
||||||
";
|
";
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ function maestro_registered_password($maestro_id, $registeredPW) {
|
|||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
SELECT COUNT(MaestroID)
|
SELECT COUNT(MaestroID)
|
||||||
FROM moty_maestro
|
FROM maestro
|
||||||
WHERE MaestroID = ? AND Password = PASSWORD(?)
|
WHERE MaestroID = ? AND Password = PASSWORD(?)
|
||||||
";
|
";
|
||||||
$stmt = $db_conn->prepare($query);
|
$stmt = $db_conn->prepare($query);
|
||||||
@@ -45,7 +45,7 @@ function update_maestro_password($maestroID, $newPW) {
|
|||||||
global $db_conn;
|
global $db_conn;
|
||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
UPDATE moty_maestro
|
UPDATE maestro
|
||||||
SET Password = PASSWORD(?)
|
SET Password = PASSWORD(?)
|
||||||
WHERE MaestroID = ?
|
WHERE MaestroID = ?
|
||||||
";
|
";
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ function has_player_name($maestroID, $playerName, $enterCode) {
|
|||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
SELECT PlayerID
|
SELECT PlayerID
|
||||||
FROM moty_player
|
FROM player
|
||||||
WHERE MaestroID = ? AND Name = ? AND EnterCode = ?
|
WHERE MaestroID = ? AND Name = ? AND EnterCode = ?
|
||||||
";
|
";
|
||||||
$stmt = $db_conn->prepare($query);
|
$stmt = $db_conn->prepare($query);
|
||||||
@@ -76,7 +76,7 @@ function get_maestro_account_type($maestroID) {
|
|||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
SELECT AccountType
|
SELECT AccountType
|
||||||
FROM moty_maestro
|
FROM maestro
|
||||||
WHERE MaestroID = ?
|
WHERE MaestroID = ?
|
||||||
";
|
";
|
||||||
$stmt = $db_conn->prepare($query);
|
$stmt = $db_conn->prepare($query);
|
||||||
@@ -95,7 +95,7 @@ function get_player_count($maestroID) {
|
|||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
SELECT PlayerCount
|
SELECT PlayerCount
|
||||||
FROM moty_maestro
|
FROM maestro
|
||||||
WHERE MaestroID = ?
|
WHERE MaestroID = ?
|
||||||
";
|
";
|
||||||
$stmt = $db_conn->prepare($query);
|
$stmt = $db_conn->prepare($query);
|
||||||
@@ -113,7 +113,7 @@ function add_player($maestroID, $playerName, $enterCode) {
|
|||||||
global $db_conn;
|
global $db_conn;
|
||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
INSERT INTO moty_player (MaestroID, Name, EnterCode)
|
INSERT INTO player (MaestroID, Name, EnterCode)
|
||||||
VALUES (?, ?, ?)
|
VALUES (?, ?, ?)
|
||||||
";
|
";
|
||||||
$stmt = $db_conn->prepare($query);
|
$stmt = $db_conn->prepare($query);
|
||||||
@@ -125,7 +125,7 @@ function increase_player_count($maestroID, $count) {
|
|||||||
global $db_conn;
|
global $db_conn;
|
||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
UPDATE moty_maestro
|
UPDATE maestro
|
||||||
SET PlayerCount = PlayerCount + ?
|
SET PlayerCount = PlayerCount + ?
|
||||||
WHERE MaestroID = ?
|
WHERE MaestroID = ?
|
||||||
";
|
";
|
||||||
@@ -139,7 +139,7 @@ function count_registered_player($maestroID) {
|
|||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
SELECT COUNT(PlayerID)
|
SELECT COUNT(PlayerID)
|
||||||
FROM moty_player
|
FROM player
|
||||||
WHERE MaestroID = ? AND AccountType = 0
|
WHERE MaestroID = ? AND AccountType = 0
|
||||||
";
|
";
|
||||||
$stmt = $db_conn->prepare($query);
|
$stmt = $db_conn->prepare($query);
|
||||||
@@ -157,7 +157,7 @@ function update_count_registered_player($maestroID, $countPlayer) {
|
|||||||
global $db_conn;
|
global $db_conn;
|
||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
UPDATE moty_maestro
|
UPDATE maestro
|
||||||
SET PlayerCount = ?
|
SET PlayerCount = ?
|
||||||
WHERE MaestroID = ?
|
WHERE MaestroID = ?
|
||||||
";
|
";
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ function deletePlayer($maestroID, $playerID) {
|
|||||||
global $db_conn;
|
global $db_conn;
|
||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
DELETE FROM moty_best_record
|
DELETE FROM best_record
|
||||||
WHERE MaestroID = ? AND PlayerID = ?
|
WHERE MaestroID = ? AND PlayerID = ?
|
||||||
";
|
";
|
||||||
$stmt = $db_conn->prepare($query);
|
$stmt = $db_conn->prepare($query);
|
||||||
@@ -50,7 +50,7 @@ function deletePlayer($maestroID, $playerID) {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
DELETE FROM moty_player
|
DELETE FROM player
|
||||||
WHERE MaestroID = ? AND PlayerID = ?
|
WHERE MaestroID = ? AND PlayerID = ?
|
||||||
";
|
";
|
||||||
$stmt = $db_conn->prepare($query);
|
$stmt = $db_conn->prepare($query);
|
||||||
@@ -68,7 +68,7 @@ function countPlayerID($maestroID, $playerID) {
|
|||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
SELECT COUNT(PlayerID)
|
SELECT COUNT(PlayerID)
|
||||||
FROM moty_player
|
FROM player
|
||||||
WHERE MaestroID = ? AND PlayerID = ?
|
WHERE MaestroID = ? AND PlayerID = ?
|
||||||
";
|
";
|
||||||
$stmt = $db_conn->prepare($query);
|
$stmt = $db_conn->prepare($query);
|
||||||
@@ -87,7 +87,7 @@ function countPlayerRecord($maestroID, $playerID) {
|
|||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
SELECT COUNT(PlayerID)
|
SELECT COUNT(PlayerID)
|
||||||
FROM moty_best_record
|
FROM best_record
|
||||||
WHERE MaestroID = ? AND PlayerID = ?
|
WHERE MaestroID = ? AND PlayerID = ?
|
||||||
";
|
";
|
||||||
$stmt = $db_conn->prepare($query);
|
$stmt = $db_conn->prepare($query);
|
||||||
@@ -105,7 +105,7 @@ function decrease_player_count($maestroID, $count) {
|
|||||||
global $db_conn;
|
global $db_conn;
|
||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
UPDATE moty_maestro
|
UPDATE maestro
|
||||||
SET PlayerCount = PlayerCount - ?
|
SET PlayerCount = PlayerCount - ?
|
||||||
WHERE MaestroID = ?
|
WHERE MaestroID = ?
|
||||||
";
|
";
|
||||||
@@ -119,7 +119,7 @@ function count_registered_player($maestroID) {
|
|||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
SELECT COUNT(PlayerID)
|
SELECT COUNT(PlayerID)
|
||||||
FROM moty_player
|
FROM player
|
||||||
WHERE MaestroID = ? AND AccountType = 0
|
WHERE MaestroID = ? AND AccountType = 0
|
||||||
";
|
";
|
||||||
$stmt = $db_conn->prepare($query);
|
$stmt = $db_conn->prepare($query);
|
||||||
@@ -137,7 +137,7 @@ function update_count_registered_player($maestroID, $countPlayer) {
|
|||||||
global $db_conn;
|
global $db_conn;
|
||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
UPDATE moty_maestro
|
UPDATE maestro
|
||||||
SET PlayerCount = ?
|
SET PlayerCount = ?
|
||||||
WHERE MaestroID = ?
|
WHERE MaestroID = ?
|
||||||
";
|
";
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ exit;
|
|||||||
function hasSamePlayerData($maestroID, $playerID, $playerName, $enterCode) {
|
function hasSamePlayerData($maestroID, $playerID, $playerName, $enterCode) {
|
||||||
global $db_conn;
|
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 = $db_conn->prepare($query);
|
||||||
$stmt->bind_param("iiss", $maestroID, $playerID, $playerName, $enterCode);
|
$stmt->bind_param("iiss", $maestroID, $playerID, $playerName, $enterCode);
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
@@ -57,7 +57,7 @@ function hasSamePlayerData($maestroID, $playerID, $playerName, $enterCode) {
|
|||||||
function editPlayer($maestroID, $playerID, $playerName, $enterCode) {
|
function editPlayer($maestroID, $playerID, $playerName, $enterCode) {
|
||||||
global $db_conn;
|
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 = $db_conn->prepare($query);
|
||||||
$stmt->bind_param("ssii", $playerName, $enterCode, $maestroID, $playerID);
|
$stmt->bind_param("ssii", $playerName, $enterCode, $maestroID, $playerID);
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
@@ -66,7 +66,7 @@ function editPlayer($maestroID, $playerID, $playerName, $enterCode) {
|
|||||||
function hasPlayerName($maestroID, $playerName, $enterCode) {
|
function hasPlayerName($maestroID, $playerName, $enterCode) {
|
||||||
global $db_conn;
|
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 = $db_conn->prepare($query);
|
||||||
$stmt->bind_param("iss", $maestroID, $playerName, $enterCode);
|
$stmt->bind_param("iss", $maestroID, $playerName, $enterCode);
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ function get_maestro_id($maestroName) {
|
|||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
SELECT MaestroID, AccountType
|
SELECT MaestroID, AccountType
|
||||||
FROM moty_maestro
|
FROM maestro
|
||||||
WHERE Name = ?
|
WHERE Name = ?
|
||||||
";
|
";
|
||||||
$stmt = $db_conn->prepare($query);
|
$stmt = $db_conn->prepare($query);
|
||||||
@@ -67,7 +67,7 @@ function get_login_data($maestroID, $name, $enterCode) {
|
|||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
SELECT PlayerID, AccountType
|
SELECT PlayerID, AccountType
|
||||||
FROM moty_player
|
FROM player
|
||||||
WHERE MaestroID = ? AND Name = ? AND EnterCode = ?
|
WHERE MaestroID = ? AND Name = ? AND EnterCode = ?
|
||||||
";
|
";
|
||||||
$stmt = $db_conn->prepare($query);
|
$stmt = $db_conn->prepare($query);
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ function get_experience_maestro_info() {
|
|||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
SELECT MaestroID, MaestroTestID
|
SELECT MaestroID, MaestroTestID
|
||||||
FROM moty_maestro
|
FROM maestro
|
||||||
WHERE AccountType = 100
|
WHERE AccountType = 100
|
||||||
";
|
";
|
||||||
$stmt = $db_conn->prepare($query);
|
$stmt = $db_conn->prepare($query);
|
||||||
@@ -53,7 +53,7 @@ function get_maestro_test_player_info($maestro_id) {
|
|||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
SELECT PlayerID, Name, AccountType
|
SELECT PlayerID, Name, AccountType
|
||||||
FROM moty_player
|
FROM player
|
||||||
WHERE MaestroID = ?
|
WHERE MaestroID = ?
|
||||||
";
|
";
|
||||||
$stmt = $db_conn->prepare($query);
|
$stmt = $db_conn->prepare($query);
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ function getPlayerCount($maestroID) {
|
|||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
SELECT COUNT(PlayerID)
|
SELECT COUNT(PlayerID)
|
||||||
FROM moty_player
|
FROM player
|
||||||
WHERE MaestroID = ? AND AccountType <> 1
|
WHERE MaestroID = ? AND AccountType <> 1
|
||||||
";
|
";
|
||||||
$stmt = $db_conn->prepare($query);
|
$stmt = $db_conn->prepare($query);
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ function get_player_list_page($maestroID, $startNo, $endNo) {
|
|||||||
global $db_conn;
|
global $db_conn;
|
||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
SELECT PlayerID, Name, EnterCode FROM moty_player
|
SELECT PlayerID, Name, EnterCode FROM player
|
||||||
WHERE MaestroID = ? AND AccountType <> 1
|
WHERE MaestroID = ? AND AccountType <> 1
|
||||||
ORDER BY PlayerID DESC
|
ORDER BY PlayerID DESC
|
||||||
LIMIT ?, 10;
|
LIMIT ?, 10;
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ function getPlayerCount($maestroID, $playerName) {
|
|||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
SELECT COUNT(PlayerID)
|
SELECT COUNT(PlayerID)
|
||||||
FROM moty_player
|
FROM player
|
||||||
WHERE MaestroID = ? AND AccountType <> 1 AND Name LIKE CONCAT('%', ?, '%')
|
WHERE MaestroID = ? AND AccountType <> 1 AND Name LIKE CONCAT('%', ?, '%')
|
||||||
";
|
";
|
||||||
$stmt = $db_conn->prepare($query);
|
$stmt = $db_conn->prepare($query);
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ function get_player_list_page($maestroID, $playerName, $startNo, $endNo) {
|
|||||||
global $db_conn;
|
global $db_conn;
|
||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
SELECT PlayerID, Name, EnterCode FROM moty_player
|
SELECT PlayerID, Name, EnterCode FROM player
|
||||||
WHERE MaestroID = ? AND AccountType <> 1 AND Name LIKE CONCAT('%', ?, '%')
|
WHERE MaestroID = ? AND AccountType <> 1 AND Name LIKE CONCAT('%', ?, '%')
|
||||||
ORDER BY PlayerID DESC
|
ORDER BY PlayerID DESC
|
||||||
LIMIT ?, 10;
|
LIMIT ?, 10;
|
||||||
|
|||||||
@@ -25,8 +25,8 @@ function get_history_record($maestro_id, $app_id, $player_id, $date) {
|
|||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
SELECT DATE(BR.RecordDateTime) AS Date, MAX(BR.BestRecord) AS HighScore, AA.AppName AS AppName
|
SELECT DATE(BR.RecordDateTime) AS Date, MAX(BR.BestRecord) AS HighScore, AA.AppName AS AppName
|
||||||
FROM moty_best_record BR
|
FROM best_record BR
|
||||||
INNER JOIN moty_app AS AA
|
INNER JOIN app AS AA
|
||||||
ON BR.MaestroID = ? AND BR.PlayerID = ? AND DATE(BR.RecordDateTime) <= ? AND BR.AppID = ? AND BR.AppID = AA.AppID
|
ON BR.MaestroID = ? AND BR.PlayerID = ? AND DATE(BR.RecordDateTime) <= ? AND BR.AppID = ? AND BR.AppID = AA.AppID
|
||||||
GROUP BY DATE(BR.RecordDateTime)
|
GROUP BY DATE(BR.RecordDateTime)
|
||||||
ORDER BY BR.RecordDateTime DESC
|
ORDER BY BR.RecordDateTime DESC
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ function get_ranking_record_day($maestro_id, $date, $app_id) {
|
|||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
SELECT BR.playerID As PlayerID, U.Name AS Name, MAX(BR.BestRecord) AS HighScore
|
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 = ?
|
WHERE BR.MaestroID = ? AND BR.playerID = U.playerID AND DATE(BR.RecordDateTime) = ? AND AppID = ?
|
||||||
GROUP BY BR.playerID
|
GROUP BY BR.playerID
|
||||||
ORDER BY max(BR.BestRecord) DESC;
|
ORDER BY max(BR.BestRecord) DESC;
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ function get_ranking_record_hour($maestro_id, $date, $time, $app_id) {
|
|||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
SELECT BR.playerID As PlayerID, U.Name AS Name, MAX(BR.BestRecord) AS HighScore
|
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 = ?
|
WHERE BR.MaestroID = ? AND BR.playerID = U.playerID AND DATE(BR.RecordDateTime) = ? AND HOUR(BR.RecordDateTime) = HOUR(?) AND AppID = ?
|
||||||
GROUP BY BR.playerID
|
GROUP BY BR.playerID
|
||||||
ORDER BY max(BR.BestRecord) DESC;
|
ORDER BY max(BR.BestRecord) DESC;
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ function get_ranking_record_month($maestro_id, $date, $time, $app_id) {
|
|||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
SELECT BR.playerID As PlayerID, U.Name AS Name, MAX(BR.BestRecord) AS HighScore
|
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 = ?
|
WHERE BR.MaestroID = ? AND BR.playerID = U.playerID AND MONTH(BR.RecordDateTime) = MONTH(?) AND AppID = ?
|
||||||
GROUP BY BR.playerID
|
GROUP BY BR.playerID
|
||||||
ORDER BY max(BR.BestRecord) DESC;
|
ORDER BY max(BR.BestRecord) DESC;
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ function get_best_record($maestro_id, $app_id, $player_id) {
|
|||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
SELECT BestRecord
|
SELECT BestRecord
|
||||||
FROM moty_best_record
|
FROM best_record
|
||||||
WHERE MaestroID = ? AND AppID = ? AND PlayerID = ? AND DATE(RecordDateTime) = DATE(NOW())
|
WHERE MaestroID = ? AND AppID = ? AND PlayerID = ? AND DATE(RecordDateTime) = DATE(NOW())
|
||||||
";
|
";
|
||||||
$stmt = $db_conn->prepare($query);
|
$stmt = $db_conn->prepare($query);
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ function get_best_record($maestro_id, $app_id, $player_id) {
|
|||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
SELECT BestRecordID, BestRecord
|
SELECT BestRecordID, BestRecord
|
||||||
FROM moty_best_record
|
FROM best_record
|
||||||
WHERE MaestroID = ? AND AppID = ? AND PlayerID = ? AND DATE(RecordDateTime) = DATE(NOW())
|
WHERE MaestroID = ? AND AppID = ? AND PlayerID = ? AND DATE(RecordDateTime) = DATE(NOW())
|
||||||
/*AND HOUR(RecordDateTime) = HOUR(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;
|
global $db_conn;
|
||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
INSERT INTO moty_best_record (MaestroID, PlayerID, AppID, BestRecord, RecordDateTime)
|
INSERT INTO best_record (MaestroID, PlayerID, AppID, BestRecord, RecordDateTime)
|
||||||
VALUES (?, ?, ?, ?, NOW());
|
VALUES (?, ?, ?, ?, NOW());
|
||||||
";
|
";
|
||||||
$stmt = $db_conn->prepare($query);
|
$stmt = $db_conn->prepare($query);
|
||||||
@@ -69,7 +69,7 @@ function update_best_record($prev_best_record_id, $best_record) {
|
|||||||
global $db_conn;
|
global $db_conn;
|
||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
UPDATE moty_best_record
|
UPDATE best_record
|
||||||
SET BestRecord = ?, RecordDateTime = NOW()
|
SET BestRecord = ?, RecordDateTime = NOW()
|
||||||
WHERE BestRecordID = ? AND DATE(RecordDateTime) = DATE(NOW())
|
WHERE BestRecordID = ? AND DATE(RecordDateTime) = DATE(NOW())
|
||||||
/* AND HOUR(RecordDateTime) = HOUR(NOW()) */
|
/* AND HOUR(RecordDateTime) = HOUR(NOW()) */
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ if($hasServiceDBSetting == true) {
|
|||||||
include("./../setup/service_db_setting.php");
|
include("./../setup/service_db_setting.php");
|
||||||
} else {
|
} else {
|
||||||
$db_host = "localhost";
|
$db_host = "localhost";
|
||||||
$db_user = "afterschool";
|
$db_user = "moty";
|
||||||
$db_passwd = "sEobMPuJ2A8KTfwU";
|
$db_passwd = "sEobMPuJ2A8KTfwU";
|
||||||
$db_name = "jisangs";
|
$db_name = "moty";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -19,7 +19,7 @@ if ($db_conn->connect_error) {
|
|||||||
send_result_fail();
|
send_result_fail();
|
||||||
exit;
|
exit;
|
||||||
} else {
|
} else {
|
||||||
$query = "USE jisangs";
|
$query = "USE moty";
|
||||||
$result = mysqli_query($db_conn, $query);
|
$result = mysqli_query($db_conn, $query);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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),
|
(1, 1, 101),
|
||||||
(2, 1, 102),
|
(2, 1, 102),
|
||||||
(3, 1, 1),
|
(3, 1, 1),
|
||||||
@@ -21,23 +21,23 @@ INSERT INTO `moty_active_app` (`ActiveAppID`, `MaestroID`, `AppID`) VALUES
|
|||||||
(18, 1, 30),
|
(18, 1, 30),
|
||||||
(19, 1, 39),
|
(19, 1, 39),
|
||||||
(20, 1, 40),
|
(20, 1, 40),
|
||||||
(21, 3, 101),
|
(21, 2, 101),
|
||||||
(22, 3, 102),
|
(22, 2, 102),
|
||||||
(23, 3, 1),
|
(23, 2, 1),
|
||||||
(24, 3, 2),
|
(24, 2, 2),
|
||||||
(25, 3, 3),
|
(25, 2, 3),
|
||||||
(26, 3, 4),
|
(26, 2, 4),
|
||||||
(27, 3, 5),
|
(27, 2, 5),
|
||||||
(28, 3, 6),
|
(28, 2, 6),
|
||||||
(29, 3, 7),
|
(29, 2, 7),
|
||||||
(30, 3, 8),
|
(30, 2, 8),
|
||||||
(31, 3, 11),
|
(31, 2, 11),
|
||||||
(32, 3, 12),
|
(32, 2, 12),
|
||||||
(33, 3, 13),
|
(33, 2, 13),
|
||||||
(34, 3, 14),
|
(34, 2, 14),
|
||||||
(35, 3, 15),
|
(35, 2, 15),
|
||||||
(36, 3, 16),
|
(36, 2, 16),
|
||||||
(37, 3, 29),
|
(37, 2, 29),
|
||||||
(38, 3, 30),
|
(38, 2, 30),
|
||||||
(39, 3, 39),
|
(39, 2, 39),
|
||||||
(40, 3, 40);
|
(40, 2, 40);
|
||||||
|
|||||||
@@ -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, ''),
|
(1, 'practice_korean_basic', '기본 자리', 1, ''),
|
||||||
(2, 'practice_korean_left_upper', '왼손 윗글쇠', 1, ''),
|
(2, 'practice_korean_left_upper', '왼손 윗글쇠', 1, ''),
|
||||||
(3, 'practice_korean_second_finger', '검지 글쇠', 1, ''),
|
(3, 'practice_korean_second_finger', '검지 글쇠', 1, ''),
|
||||||
|
|||||||
@@ -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),
|
(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);
|
(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),
|
(1, 1, '학생 체험', '', 0),
|
||||||
(2, 2, '마에스트로', '', 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);
|
(1, 'jisangs', '*F2012B4E7A22EED437B79FB53DBF79C8AAC5034B', 'jisangs@gmail.com', 1, 1);
|
||||||
|
|||||||
+18
-18
@@ -1,4 +1,4 @@
|
|||||||
CREATE TABLE moty_admin (
|
CREATE TABLE admin (
|
||||||
AdminID INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
AdminID INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||||
Name CHAR(50) NOT NULL,
|
Name CHAR(50) NOT NULL,
|
||||||
Password CHAR(50) NOT NULL,
|
Password CHAR(50) NOT NULL,
|
||||||
@@ -7,7 +7,7 @@ CREATE TABLE moty_admin (
|
|||||||
ActivateStatus INT UNSIGNED NOT NULL
|
ActivateStatus INT UNSIGNED NOT NULL
|
||||||
);
|
);
|
||||||
|
|
||||||
CREATE TABLE moty_maestro (
|
CREATE TABLE maestro (
|
||||||
MaestroID INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
MaestroID INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||||
Name CHAR(50) NOT NULL,
|
Name CHAR(50) NOT NULL,
|
||||||
Password CHAR(50) NOT NULL,
|
Password CHAR(50) NOT NULL,
|
||||||
@@ -20,7 +20,7 @@ CREATE TABLE moty_maestro (
|
|||||||
MaestroTestID INT UNSIGNED
|
MaestroTestID INT UNSIGNED
|
||||||
);
|
);
|
||||||
|
|
||||||
CREATE TABLE moty_maestro_upgrade (
|
CREATE TABLE maestro_upgrade (
|
||||||
MaestroUpgradeID INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
MaestroUpgradeID INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||||
RegisteredAccountType INT UNSIGNED NOT NULL,
|
RegisteredAccountType INT UNSIGNED NOT NULL,
|
||||||
RequestedAccountType INT UNSIGNED NOT NULL,
|
RequestedAccountType INT UNSIGNED NOT NULL,
|
||||||
@@ -28,22 +28,22 @@ CREATE TABLE moty_maestro_upgrade (
|
|||||||
Status INT UNSIGNED NOT NULL,
|
Status INT UNSIGNED NOT NULL,
|
||||||
MaestroID 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,
|
PlayerID INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||||
MaestroID INT UNSIGNED NOT NULL,
|
MaestroID INT UNSIGNED NOT NULL,
|
||||||
Name CHAR(50) NOT NULL,
|
Name CHAR(50) NOT NULL,
|
||||||
EnterCode CHAR(6) NOT NULL,
|
EnterCode CHAR(6) NOT NULL,
|
||||||
AccountType INT UNSIGNED 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,
|
AppID INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||||
AppName CHAR(40) NOT NULL,
|
AppName CHAR(40) NOT NULL,
|
||||||
KoreanName CHAR(40) NOT NULL,
|
KoreanName CHAR(40) NOT NULL,
|
||||||
@@ -51,18 +51,18 @@ CREATE TABLE moty_app (
|
|||||||
HowToPlay TEXT NOT NULL
|
HowToPlay TEXT NOT NULL
|
||||||
);
|
);
|
||||||
|
|
||||||
CREATE TABLE moty_active_app (
|
CREATE TABLE active_app (
|
||||||
ActiveAppID INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
ActiveAppID INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||||
MaestroID INT UNSIGNED NOT NULL,
|
MaestroID INT UNSIGNED NOT NULL,
|
||||||
AppID INT UNSIGNED NOT NULL,
|
AppID INT UNSIGNED NOT NULL,
|
||||||
|
|
||||||
FOREIGN KEY (MaestroID) REFERENCES moty_maestro(MaestroID),
|
FOREIGN KEY (MaestroID) REFERENCES maestro(MaestroID),
|
||||||
FOREIGN KEY (AppID) REFERENCES moty_app(AppID)
|
FOREIGN KEY (AppID) REFERENCES app(AppID)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE moty_best_record (
|
CREATE TABLE best_record (
|
||||||
BestRecordID INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
BestRecordID INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||||
MaestroID INT UNSIGNED NOT NULL,
|
MaestroID INT UNSIGNED NOT NULL,
|
||||||
AppID INT UNSIGNED NOT NULL,
|
AppID INT UNSIGNED NOT NULL,
|
||||||
@@ -70,12 +70,12 @@ CREATE TABLE moty_best_record (
|
|||||||
BestRecord FLOAT NOT NULL,
|
BestRecord FLOAT NOT NULL,
|
||||||
RecordDateTime DATETIME NOT NULL,
|
RecordDateTime DATETIME NOT NULL,
|
||||||
|
|
||||||
FOREIGN KEY (MaestroID) REFERENCES moty_maestro(MaestroID),
|
FOREIGN KEY (MaestroID) REFERENCES maestro(MaestroID),
|
||||||
FOREIGN KEY (AppID) REFERENCES moty_app(AppID),
|
FOREIGN KEY (AppID) REFERENCES app(AppID),
|
||||||
FOREIGN KEY (PlayerID) REFERENCES moty_player(PlayerID)
|
FOREIGN KEY (PlayerID) REFERENCES player(PlayerID)
|
||||||
);
|
);
|
||||||
|
|
||||||
CREATE TABLE moty_ranking (
|
CREATE TABLE ranking (
|
||||||
RankingID INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
RankingID INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||||
MaestroID INT UNSIGNED NOT NULL,
|
MaestroID INT UNSIGNED NOT NULL,
|
||||||
AppID INT UNSIGNED NOT NULL,
|
AppID INT UNSIGNED NOT NULL,
|
||||||
@@ -83,7 +83,7 @@ CREATE TABLE moty_ranking (
|
|||||||
Rank INT UNSIGNED NOT NULL,
|
Rank INT UNSIGNED NOT NULL,
|
||||||
PlayerID INT UNSIGNED NOT NULL,
|
PlayerID INT UNSIGNED NOT NULL,
|
||||||
|
|
||||||
FOREIGN KEY (MaestroID) REFERENCES moty_maestro(MaestroID),
|
FOREIGN KEY (MaestroID) REFERENCES maestro(MaestroID),
|
||||||
FOREIGN KEY (AppID) REFERENCES moty_app(AppID),
|
FOREIGN KEY (AppID) REFERENCES app(AppID),
|
||||||
FOREIGN KEY (PlayerID) REFERENCES moty_player(PlayerID)
|
FOREIGN KEY (PlayerID) REFERENCES player(PlayerID)
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user