Add: active_app.php
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 1.9 KiB |
@@ -1,6 +1,6 @@
|
|||||||
class AppButton {
|
class AppButton {
|
||||||
|
|
||||||
constructor(type, iconName, clickEvent) {
|
constructor(x, y, type, iconName, clickEvent) {
|
||||||
let setting = new RoundRectButtonSetting(150, 150);
|
let setting = new RoundRectButtonSetting(150, 150);
|
||||||
setting.fontStyle.boundsAlignH = "center"; // left, center. right
|
setting.fontStyle.boundsAlignH = "center"; // left, center. right
|
||||||
setting.fontStyle.boundsAlignV = "middle"; // top, middle, bottom
|
setting.fontStyle.boundsAlignV = "middle"; // top, middle, bottom
|
||||||
@@ -52,6 +52,8 @@ class AppButton {
|
|||||||
|
|
||||||
this.button = new RoundRectButton(setting, "", clickEvent);
|
this.button = new RoundRectButton(setting, "", clickEvent);
|
||||||
this.button.setIcon(icon_fullscreen);
|
this.button.setIcon(icon_fullscreen);
|
||||||
|
|
||||||
|
this.move(x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
move(x, y) {
|
move(x, y) {
|
||||||
|
|||||||
@@ -53,17 +53,34 @@ class DBConnectManager {
|
|||||||
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
|
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
|
||||||
xhr.onreadystatechange = function() {
|
xhr.onreadystatechange = function() {
|
||||||
if(xhr.readyState == 4 && xhr.status == 200) {
|
if(xhr.readyState == 4 && xhr.status == 200) {
|
||||||
let jsonData = JSON.parse(xhr.responseText);
|
let replyJSON = JSON.parse(xhr.responseText);
|
||||||
|
|
||||||
if(jsonData != null && jsonData["UserID"] != null)
|
if(replyJSON != null && replyJSON["UserID"] != null)
|
||||||
onSucceededListener(jsonData);
|
onSucceededListener(replyJSON);
|
||||||
else
|
else
|
||||||
onFailedListener(jsonData);
|
onFailedListener(replyJSON);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
xhr.send("maestro_name=" + maestroName + "&name=" + userName + "&enter_code=" + enterCode);
|
xhr.send("maestro_name=" + maestroName + "&name=" + userName + "&enter_code=" + enterCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
requestActiveAppList(maestroID, onSucceededListener, onFailedListener) {
|
||||||
|
let xhr = new XMLHttpRequest();
|
||||||
|
xhr.open("POST", this.phpPath + "server/app/active_app.php", true);
|
||||||
|
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
|
||||||
|
xhr.onreadystatechange = function() {
|
||||||
|
if(xhr.readyState == 4 && xhr.status == 200) {
|
||||||
|
let replyJSON = JSON.parse(xhr.responseText);
|
||||||
|
|
||||||
|
if(replyJSON != null && replyJSON.length > 0)
|
||||||
|
onSucceededListener(replyJSON);
|
||||||
|
else
|
||||||
|
onFailedListener(replyJSON);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
xhr.send("maestro_id=" + maestroID);
|
||||||
|
}
|
||||||
|
|
||||||
requestPlayerHistory(date, listener) {
|
requestPlayerHistory(date, listener) {
|
||||||
let historyRecordManager = new HistoryRecordManager();
|
let historyRecordManager = new HistoryRecordManager();
|
||||||
|
|
||||||
@@ -85,13 +102,13 @@ class DBConnectManager {
|
|||||||
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
|
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
|
||||||
xhr.onreadystatechange = function() {
|
xhr.onreadystatechange = function() {
|
||||||
if(xhr.readyState == 4 && xhr.status == 200) {
|
if(xhr.readyState == 4 && xhr.status == 200) {
|
||||||
let jsonData = JSON.parse(xhr.responseText);
|
let replyJSON = JSON.parse(xhr.responseText);
|
||||||
|
|
||||||
if(jsonData != null) {
|
if(replyJSON != null) {
|
||||||
listener(self.parseJSONtoHistoryRecord(jsonData));
|
listener(self.parseJSONtoHistoryRecord(replyJSON));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
onFailedListener(jsonData);
|
onFailedListener(replyJSON);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
let params = "UserID=" + sessionStorageManager.playerUserID
|
let params = "UserID=" + sessionStorageManager.playerUserID
|
||||||
@@ -164,13 +181,13 @@ class DBConnectManager {
|
|||||||
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
|
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
|
||||||
xhr.onreadystatechange = function() {
|
xhr.onreadystatechange = function() {
|
||||||
if(xhr.readyState == 4 && xhr.status == 200) {
|
if(xhr.readyState == 4 && xhr.status == 200) {
|
||||||
let jsonData = JSON.parse(xhr.responseText);
|
let replyJSON = JSON.parse(xhr.responseText);
|
||||||
|
|
||||||
if(jsonData != null) {
|
if(replyJSON != null) {
|
||||||
listener(type, self.parseJSONtoRankingRecord(type, jsonData));
|
listener(type, self.parseJSONtoRankingRecord(type, replyJSON));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
onFailedListener(jsonData);
|
onFailedListener(replyJSON);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
let params = "UserID=" + sessionStorageManager.playerUserID
|
let params = "UserID=" + sessionStorageManager.playerUserID
|
||||||
@@ -209,34 +226,34 @@ class DBConnectManager {
|
|||||||
if(typeof json === "undefined")
|
if(typeof json === "undefined")
|
||||||
return rankingRecordManager;
|
return rankingRecordManager;
|
||||||
|
|
||||||
let jsonData = null;
|
let replyJSON = null;
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case DBConnectManager.TYPE_MY_RANKING_HOUR:
|
case DBConnectManager.TYPE_MY_RANKING_HOUR:
|
||||||
case DBConnectManager.TYPE_ALL_RANKING_HOUR:
|
case DBConnectManager.TYPE_ALL_RANKING_HOUR:
|
||||||
jsonData = json.rankingHour;
|
replyJSON = json.rankingHour;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DBConnectManager.TYPE_MY_RANKING_DAY:
|
case DBConnectManager.TYPE_MY_RANKING_DAY:
|
||||||
case DBConnectManager.TYPE_ALL_RANKING_DAY:
|
case DBConnectManager.TYPE_ALL_RANKING_DAY:
|
||||||
jsonData = json.rankingDay;
|
replyJSON = json.rankingDay;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DBConnectManager.TYPE_MY_RANKING_MONTH:
|
case DBConnectManager.TYPE_MY_RANKING_MONTH:
|
||||||
case DBConnectManager.TYPE_ALL_RANKING_MONTH:
|
case DBConnectManager.TYPE_ALL_RANKING_MONTH:
|
||||||
jsonData = json.rankingMonth;
|
replyJSON = json.rankingMonth;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(jsonData === null)
|
if(replyJSON === null)
|
||||||
return rankingRecordManager;
|
return rankingRecordManager;
|
||||||
|
|
||||||
let count = jsonData.length;
|
let count = replyJSON.length;
|
||||||
for(let i = 0; i < count; i++) {
|
for(let i = 0; i < count; i++) {
|
||||||
let record = new RankingRecord(
|
let record = new RankingRecord(
|
||||||
i + 1,
|
i + 1,
|
||||||
jsonData[i]["UserID"],
|
replyJSON[i]["UserID"],
|
||||||
jsonData[i]["Name"],
|
replyJSON[i]["Name"],
|
||||||
jsonData[i]["HighScore"]
|
replyJSON[i]["HighScore"]
|
||||||
);
|
);
|
||||||
rankingRecordManager.push(record);
|
rankingRecordManager.push(record);
|
||||||
}
|
}
|
||||||
@@ -253,12 +270,12 @@ class DBConnectManager {
|
|||||||
makeXHRWithParam(url, param, onSucceededListener, onFailedListener) {
|
makeXHRWithParam(url, param, onSucceededListener, onFailedListener) {
|
||||||
xhr.onreadystatechange = function() {
|
xhr.onreadystatechange = function() {
|
||||||
if(xhr.readyState == 4 && xhr.status == 200) {
|
if(xhr.readyState == 4 && xhr.status == 200) {
|
||||||
let jsonData = JSON.parse(xhr.responseText);
|
let replyJSON = JSON.parse(xhr.responseText);
|
||||||
|
|
||||||
if(jsonData != null && jsonData["UserID"] != null)
|
if(replyJSON != null && replyJSON["UserID"] != null)
|
||||||
onSucceededListener(jsonData);
|
onSucceededListener(replyJSON);
|
||||||
else
|
else
|
||||||
onFailedListener(jsonData);
|
onFailedListener(replyJSON);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+52
-73
@@ -5,38 +5,21 @@ class MenuApp {
|
|||||||
|
|
||||||
preload() {
|
preload() {
|
||||||
game.load.image('icon_fullscreen', '../../../resources/image/icon/fullscreen_white.png');
|
game.load.image('icon_fullscreen', '../../../resources/image/icon/fullscreen_white.png');
|
||||||
|
game.load.image('space_invaders', '../../../resources/image/icon/space_invaders.png');
|
||||||
}
|
}
|
||||||
|
|
||||||
create() {
|
create() {
|
||||||
|
self = this;
|
||||||
this.game.stage.backgroundColor = '#4d4d4d';
|
this.game.stage.backgroundColor = '#4d4d4d';
|
||||||
|
|
||||||
// top
|
// top
|
||||||
let backButton = new BackButton( () => {
|
let backButton = new BackButton( () => {
|
||||||
sessionStorageManager.clear();
|
sessionStorageManager.clear();
|
||||||
|
|
||||||
location.href = '../../web/client/login.html';
|
location.href = '../../web/client/login.html';
|
||||||
});
|
});
|
||||||
|
|
||||||
let fullscreenButton = new FullscreenButton(this.game);
|
let fullscreenButton = new FullscreenButton(this.game);
|
||||||
|
|
||||||
|
|
||||||
// app icons
|
|
||||||
let space_invaders = new AppButton(AppButton.TYPE_MOUSE, "icon_fullscreen",
|
|
||||||
() => {
|
|
||||||
sessionStorageManager.playingAppName = "space_invaders";
|
|
||||||
location.href = '../../web/client/start.html';
|
|
||||||
}
|
|
||||||
);
|
|
||||||
space_invaders.move(400, 400);
|
|
||||||
|
|
||||||
let typing_practice = new AppButton(AppButton.TYPE_TYPING, "icon_fullscreen",
|
|
||||||
() => {
|
|
||||||
console.log("typing practice");
|
|
||||||
}
|
|
||||||
);
|
|
||||||
typing_practice.move(600, 400);
|
|
||||||
|
|
||||||
|
|
||||||
// bottom
|
// bottom
|
||||||
let screenBottom = new ScreenBottom();
|
let screenBottom = new ScreenBottom();
|
||||||
screenBottom.makeBottomLine();
|
screenBottom.makeBottomLine();
|
||||||
@@ -45,77 +28,73 @@ class MenuApp {
|
|||||||
screenBottom.printBottomCenterText(playingAppName);
|
screenBottom.printBottomCenterText(playingAppName);
|
||||||
screenBottom.printBottomRightText(sessionStorageManager.playerName);
|
screenBottom.printBottomRightText(sessionStorageManager.playerName);
|
||||||
|
|
||||||
// this.loadTypingStageData();
|
|
||||||
|
this.makeActiveAppButtons();
|
||||||
}
|
}
|
||||||
|
|
||||||
loadTypingStageData() {
|
|
||||||
var self = this;
|
|
||||||
|
|
||||||
xhr = new XMLHttpRequest();
|
makeActiveAppButtons() {
|
||||||
xhr.onreadystatechange = function() {
|
let dbConnectManager = new DBConnectManager();
|
||||||
// console.log("onreadystatechange : " + xhr);
|
dbConnectManager.requestActiveAppList(
|
||||||
// console.log("xhr.readyState : " + xhr.readyState);
|
sessionStorageManager.maestroID,
|
||||||
// console.log("xhr.status : " + xhr.status);
|
self.loginSucceeded,
|
||||||
if(xhr.readyState == 4 && xhr.status == 200) {
|
self.loginFailed
|
||||||
// console.log(xhr.responseText);
|
);
|
||||||
var jsonData = JSON.parse(xhr.responseText);
|
|
||||||
self.updateStageButton(jsonData);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
xhr.open('GET', 'activated_stage_list.php', true);
|
|
||||||
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
|
|
||||||
xhr.send();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
updateStageButton(jsonData) {
|
loginSucceeded(replyJSON) {
|
||||||
// console.log(JSON.stringify(jsonData));
|
// console.log(replyJSON);
|
||||||
|
|
||||||
for(var i = 0; i < jsonData.length; i++) {
|
let mouseAppCount = self.getAppCount(replyJSON, AppButton.TYPE_MOUSE);
|
||||||
// console.log(jsonData[i]["StageName"] + " : " + jsonData[i]["Activated"]);
|
let typingAppCount = self.getAppCount(replyJSON, AppButton.TYPE_TYPING);
|
||||||
|
|
||||||
this.activateStageButton(
|
let startX = game.world.width / 2 - (150 * mouseAppCount / 2) - (150 / 2);
|
||||||
// jsonData[i]["Language"],
|
let mouseAppIndex = 0;
|
||||||
jsonData[i]["StageName"],
|
for(let i = 0; i < replyJSON.length; i++) {
|
||||||
jsonData[i]["Activated"]
|
let activeApp = replyJSON[i];
|
||||||
|
if(self.isMouseApp(activeApp)) {
|
||||||
|
mouseAppIndex++;
|
||||||
|
new AppButton(startX + 150 * mouseAppIndex, 300, AppButton.TYPE_MOUSE, activeApp.AppName,
|
||||||
|
() => {
|
||||||
|
sessionStorageManager.playingAppName = activeApp.AppName;
|
||||||
|
location.href = '../../web/client/start.html';
|
||||||
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
activateStageButton(stageName, isActivated) {
|
if(typingAppCount > 0) {
|
||||||
for(var i = 0; i < this.stageButtonArray.length; i++) {
|
new AppButton(game.world.width / 2, 500, AppButton.TYPE_TYPING, "icon_fullscreen",
|
||||||
var buttonName = this.stageButtonArray[i].name;
|
() => {
|
||||||
var buttonLanguage = buttonName.charAt(0) == "k" ? "korean" : "english";
|
location.href = '../../web/client/menu_typing_app.html';
|
||||||
var buttonStageName = getStageCodeByStageNo(buttonName.substring(1));
|
|
||||||
var buttonNewName = buttonLanguage + "_" + buttonStageName;
|
|
||||||
// console.log("buttonNewName : " + buttonNewName);
|
|
||||||
|
|
||||||
if(buttonNewName == stageName) {
|
|
||||||
if(isActivated == true) {
|
|
||||||
// console.log("stageName : " + stageName);
|
|
||||||
|
|
||||||
this.stageButtonArray[i].startButton.alpha = 1;
|
|
||||||
this.stageButtonArray[i].startButton.inputEnabled = true;
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
// console.log("this.stageButtonArray[" + i + "].name : " + this.stageButtonArray[i].name);
|
|
||||||
// console.log("buttonNewName : " + buttonNewName);
|
|
||||||
|
|
||||||
this.stageButtonArray[i].startButton.alpha = 0.3;
|
|
||||||
this.stageButtonArray[i].startButton.inputEnabled = false;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
startStage() {
|
isMouseApp(app) {
|
||||||
var language = this.name.substring(0, 1) == "k" ? LANGUAGE_KOREAN : LANGUAGE_ENGLISH;
|
if(app.AppType > 100)
|
||||||
var level = this.name.substring(1);
|
return true;
|
||||||
|
|
||||||
playingStageData = new StageData(language, level);
|
return false;
|
||||||
// console.log(playingStageData);
|
}
|
||||||
|
|
||||||
this.startState('TypingTestStage');
|
getAppCount(replyJSON, type) {
|
||||||
|
let appCount = 0;
|
||||||
|
for(let i = 0; i < replyJSON.length; i++) {
|
||||||
|
let activeApp = replyJSON[i];
|
||||||
|
if(type == AppButton.TYPE_TYPING && activeApp.AppType <= 100)
|
||||||
|
appCount++;
|
||||||
|
else if(type == AppButton.TYPE_MOUSE && activeApp.AppType > 100)
|
||||||
|
appCount++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return appCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
loginFailed(replyJSON) {
|
||||||
|
console.log('login failed, jsonData : ' + JSON.stringify(replyJSON));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -21,6 +21,7 @@
|
|||||||
<script src="../../game/lib/fullscreen_button.js"></script>
|
<script src="../../game/lib/fullscreen_button.js"></script>
|
||||||
<script src="../../game/lib/app_button.js"></script>
|
<script src="../../game/lib/app_button.js"></script>
|
||||||
<script src="../../game/lib/screen_bottom.js"></script>
|
<script src="../../game/lib/screen_bottom.js"></script>
|
||||||
|
<script src="../../game/lib/db_connect_manager.js"></script>
|
||||||
|
|
||||||
<!-- source files -->
|
<!-- source files -->
|
||||||
<script src="../../game/menu/menu_app.js"></script>
|
<script src="../../game/menu/menu_app.js"></script>
|
||||||
|
|||||||
@@ -0,0 +1,46 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>메뉴</title>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"></script> -->
|
||||||
|
<!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/phaser/2.6.2/phaser.js"></script> -->
|
||||||
|
<script src="../../../resources/js/phaser.min.js"></script>
|
||||||
|
|
||||||
|
<!-- global source files -->
|
||||||
|
<script src="../../game/lib/app_info_manager.js"></script>
|
||||||
|
<script src="../../game/lib/session_storage_manager.js"></script>
|
||||||
|
<script src="../../game/global/global_variables.js"></script>
|
||||||
|
|
||||||
|
<!-- library source files -->
|
||||||
|
<script src="../../game/lib/input_type_text.js"></script>
|
||||||
|
<script src="../../game/lib/round_rect_button.js"></script>
|
||||||
|
<script src="../../game/lib/back_button.js"></script>
|
||||||
|
<script src="../../game/lib/fullscreen_button.js"></script>
|
||||||
|
<script src="../../game/lib/app_button.js"></script>
|
||||||
|
<script src="../../game/lib/screen_bottom.js"></script>
|
||||||
|
<script src="../../game/lib/db_connect_manager.js"></script>
|
||||||
|
|
||||||
|
<!-- source files -->
|
||||||
|
<script src="../../game/menu/menu_app.js"></script>
|
||||||
|
<script src="../../game/menu/main_menu_app.js"></script>
|
||||||
|
|
||||||
|
|
||||||
|
<style>
|
||||||
|
body{
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
canvas{
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div id="MenuApp" style="text-align:center;" />
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
<?php
|
|
||||||
header('Content-Type: application/json');
|
|
||||||
|
|
||||||
include "send_error_code.php";
|
|
||||||
|
|
||||||
include "connect_db.php";
|
|
||||||
|
|
||||||
$return_array = array();
|
|
||||||
|
|
||||||
$query = "SELECT * FROM afterschool_activated_stage";
|
|
||||||
$result = mysqli_query($db_conn, $query);
|
|
||||||
|
|
||||||
$return_array = array();
|
|
||||||
|
|
||||||
if ( $result ) {
|
|
||||||
// echo "조회된 행의 수 : ".mysqli_num_rows($result)."<br />";
|
|
||||||
|
|
||||||
if($result) {
|
|
||||||
$rows = array();
|
|
||||||
while($row = mysqli_fetch_assoc($result)) {
|
|
||||||
// $row_array['Language'] = $row['Language'];
|
|
||||||
$row_array['StageName'] = $row['StageName'];
|
|
||||||
$row_array['Activated'] = $row['Activated'];
|
|
||||||
array_push($return_array, $row_array);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
send_error_code("Error : ".mysqli_error($db_conn));
|
|
||||||
}
|
|
||||||
|
|
||||||
echo json_encode($return_array, JSON_UNESCAPED_UNICODE);
|
|
||||||
|
|
||||||
// 결과 해제
|
|
||||||
mysqli_free_result($result);
|
|
||||||
|
|
||||||
$db_conn->close();
|
|
||||||
|
|
||||||
?>
|
|
||||||
@@ -0,0 +1,72 @@
|
|||||||
|
<?php
|
||||||
|
header('Content-Type: application/json');
|
||||||
|
|
||||||
|
include "./../send_error_code.php";
|
||||||
|
|
||||||
|
$maestro_id = $_POST["maestro_id"];
|
||||||
|
|
||||||
|
include "./../setup/connect_db.php";
|
||||||
|
|
||||||
|
|
||||||
|
$replyJSON = get_active_app_list($maestro_id);
|
||||||
|
if($replyJSON.length === 0) {
|
||||||
|
send_error_message($replyJSON, "앱 목록 가져오기 실패");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
echo json_encode($replyJSON, JSON_UNESCAPED_UNICODE);
|
||||||
|
$db_conn->close();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function get_active_app_list($maestro_id) {
|
||||||
|
global $db_conn;
|
||||||
|
|
||||||
|
$return_array = array();
|
||||||
|
|
||||||
|
$query = "
|
||||||
|
SELECT A.AppName, A.AppType
|
||||||
|
FROM moty_app AS A
|
||||||
|
INNER JOIN moty_active_app AS AA ON A.AppID = AA.AppID AND AA.MaestroID=?";
|
||||||
|
$stmt = $db_conn->prepare($query);
|
||||||
|
$stmt->bind_param('i', $maestro_id);
|
||||||
|
$stmt->execute();
|
||||||
|
$stmt->bind_result($app_name, $app_type);
|
||||||
|
|
||||||
|
while($stmt->fetch()) {
|
||||||
|
$row_array['AppName'] = $app_name;
|
||||||
|
$row_array['AppType'] = $app_type;
|
||||||
|
array_push($return_array, $row_array);
|
||||||
|
}
|
||||||
|
|
||||||
|
$stmt->close();
|
||||||
|
|
||||||
|
return $return_array;
|
||||||
|
|
||||||
|
/*
|
||||||
|
$result = mysqli_query($db_conn, $query);
|
||||||
|
|
||||||
|
if ( $result ) {
|
||||||
|
// echo "조회된 행의 수 : ".mysqli_num_rows($result)."<br />";
|
||||||
|
|
||||||
|
if($result) {
|
||||||
|
$rows = array();
|
||||||
|
while($row = mysqli_fetch_assoc($result)) {
|
||||||
|
// $row_array['Language'] = $row['Language'];
|
||||||
|
$row_array['AppName'] = $row['AppName'];
|
||||||
|
$row_array['AppType'] = $row['AppType'];
|
||||||
|
array_push($return_array, $row_array);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
send_error_code("Error : ".mysqli_error($db_conn));
|
||||||
|
}
|
||||||
|
|
||||||
|
$db_conn->close();
|
||||||
|
mysqli_free_result($result);
|
||||||
|
|
||||||
|
return $return_array;
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
@@ -24,6 +24,7 @@ $result = mysqli_query($db_conn, $query);
|
|||||||
|
|
||||||
function send_error_message($replyJSON, $error_message) {
|
function send_error_message($replyJSON, $error_message) {
|
||||||
$replyJSON["ERROR"] = $error_message;
|
$replyJSON["ERROR"] = $error_message;
|
||||||
|
$db_conn->close();
|
||||||
echo json_encode($replyJSON, JSON_UNESCAPED_UNICODE);
|
echo json_encode($replyJSON, JSON_UNESCAPED_UNICODE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ if($replyJSON["UserID"] == null) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
echo json_encode($replyJSON, JSON_UNESCAPED_UNICODE);
|
echo json_encode($replyJSON, JSON_UNESCAPED_UNICODE);
|
||||||
|
$db_conn->close();
|
||||||
|
|
||||||
|
|
||||||
function get_maestro_id($maestro_name) {
|
function get_maestro_id($maestro_name) {
|
||||||
@@ -62,7 +62,6 @@ function get_login_data($maestro_id, $name, $enterCode) {
|
|||||||
// while($stmt->fetch())
|
// while($stmt->fetch())
|
||||||
$stmt->fetch();
|
$stmt->fetch();
|
||||||
$stmt->close();
|
$stmt->close();
|
||||||
$db_conn->close();
|
|
||||||
|
|
||||||
$replyJSON["MaestroID"] = $maestro_id;
|
$replyJSON["MaestroID"] = $maestro_id;
|
||||||
$replyJSON["UserID"] = $user_id;
|
$replyJSON["UserID"] = $user_id;
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ INSERT INTO moty_app VALUES
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
INSERT INTO moty_activate_app VALUES
|
INSERT INTO moty_active_app VALUES
|
||||||
(1, 1, 1),
|
(1, 1, 1),
|
||||||
(2, 1, 9),
|
(2, 1, 9),
|
||||||
(3, 1, 10),
|
(3, 1, 10),
|
||||||
|
|||||||
@@ -27,8 +27,8 @@ CREATE TABLE moty_app (
|
|||||||
AppType INT UNSIGNED NOT NULL
|
AppType INT UNSIGNED NOT NULL
|
||||||
);
|
);
|
||||||
|
|
||||||
CREATE TABLE moty_activate_app (
|
CREATE TABLE moty_active_app (
|
||||||
ActivateAppID 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,
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user