Fix: DB jisangs -> moty

This commit is contained in:
2018-08-22 17:25:07 +09:00
parent 5c0e823980
commit 6fcb459550
45 changed files with 141 additions and 183 deletions
-31
View File
@@ -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();
?>
+2 -2
View File
@@ -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);
@@ -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
";
@@ -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
";
+4 -4
View File
@@ -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 = ?
";
+3 -3
View File
@@ -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 = ?
";