Fix: load how to play from server
This commit is contained in:
@@ -10,7 +10,6 @@
|
||||
<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>
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
<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>
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
<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>
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
<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>
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
<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/lib/score_manager.js"></script>
|
||||
<script src="../../game/lib/heart_manager.js"></script>
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
<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>
|
||||
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
<?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);
|
||||
$db_conn->close();
|
||||
|
||||
if($replyJSON.length === 0) {
|
||||
send_error_message($replyJSON, "앱 목록 가져오기 실패");
|
||||
$db_conn->close();
|
||||
exit;
|
||||
}
|
||||
|
||||
echo json_encode($replyJSON, JSON_UNESCAPED_UNICODE);
|
||||
$db_conn->close();
|
||||
|
||||
|
||||
|
||||
function get_active_app_list($maestro_id) {
|
||||
global $db_conn;
|
||||
|
||||
$query = "
|
||||
SELECT A.AppID, 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_id, $app_name, $app_type);
|
||||
|
||||
$return_array = array();
|
||||
while($stmt->fetch()) {
|
||||
$row_array['AppID'] = $app_id;
|
||||
$row_array['AppName'] = $app_name;
|
||||
$row_array['AppType'] = $app_type;
|
||||
array_push($return_array, $row_array);
|
||||
}
|
||||
$stmt->close();
|
||||
|
||||
return $return_array;
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,72 +0,0 @@
|
||||
<?php
|
||||
header("Content-Type: application/json");
|
||||
|
||||
include "./../send_error_code.php";
|
||||
|
||||
$maestro_id = $_POST["maestro_id"];
|
||||
|
||||
include "./../setup/connect_db.php";
|
||||
|
||||
$replyJSON = array();
|
||||
$replyJSON["AppList"] = get_app_list();
|
||||
$replyJSON["ActiveAppList"] = get_active_app_list($maestro_id);
|
||||
$db_conn->close();
|
||||
|
||||
if($replyJSON.length === 0) {
|
||||
send_error_message($replyJSON, "앱 목록 가져오기 실패");
|
||||
$db_conn->close();
|
||||
exit;
|
||||
}
|
||||
|
||||
echo json_encode($replyJSON, JSON_UNESCAPED_UNICODE);
|
||||
$db_conn->close();
|
||||
|
||||
|
||||
|
||||
function get_app_list() {
|
||||
global $db_conn;
|
||||
|
||||
$query = "SELECT AppID, AppName, AppType FROM moty_app";
|
||||
$result = mysqli_query($db_conn, $query);
|
||||
|
||||
$return_array = array();
|
||||
if ($result) {
|
||||
// echo "조회된 행의 수 : ".mysqli_num_rows($result)."<br />";
|
||||
|
||||
$rows = array();
|
||||
while($row = mysqli_fetch_assoc($result)) {
|
||||
$row_array["AppID"] = $row["AppID"];
|
||||
$row_array["AppName"] = $row["AppName"];
|
||||
$row_array["AppType"] = $row["AppType"];
|
||||
array_push($return_array, $row_array);
|
||||
}
|
||||
}
|
||||
|
||||
return $return_array;
|
||||
}
|
||||
|
||||
function get_active_app_list($maestro_id) {
|
||||
global $db_conn;
|
||||
|
||||
$query = "
|
||||
SELECT A.AppID, 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_id, $app_name, $app_type);
|
||||
|
||||
$return_array = array();
|
||||
while($stmt->fetch()) {
|
||||
$row_array["AppID"] = $app_id;
|
||||
$row_array["AppName"] = $app_name;
|
||||
$row_array["AppType"] = $app_type;
|
||||
array_push($return_array, $row_array);
|
||||
}
|
||||
$stmt->close();
|
||||
|
||||
return $return_array;
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
header('Content-Type: application/json');
|
||||
|
||||
include "./../send_error_code.php";
|
||||
|
||||
$app_id = $_POST["AppID"];
|
||||
|
||||
include "./../setup/connect_db.php";
|
||||
|
||||
|
||||
$replyJSON = array();
|
||||
$replyJSON["HowToPlay"] = get_how_to_play($app_id);
|
||||
if($replyJSON.length === 0) {
|
||||
send_error_message($replyJSON, "히스토리 기록 없음");
|
||||
$db_conn->close();
|
||||
exit;
|
||||
}
|
||||
|
||||
echo json_encode($replyJSON, JSON_UNESCAPED_UNICODE);
|
||||
$db_conn->close();
|
||||
|
||||
|
||||
function get_how_to_play($app_id) {
|
||||
global $db_conn;
|
||||
|
||||
$query = "
|
||||
SELECT HowToPlay
|
||||
FROM moty_app
|
||||
WHERE AppID = ?;
|
||||
";
|
||||
$stmt = $db_conn->prepare($query);
|
||||
$stmt->bind_param('i', $app_id);
|
||||
$stmt->execute();
|
||||
$stmt->bind_result($how_to_play);
|
||||
$stmt->fetch();
|
||||
$stmt->close();
|
||||
|
||||
return $how_to_play;
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user