diff --git a/src/web/server/app/menu_active_app_list.php b/src/web/server/app/menu_active_app_list.php index c05b695..8eede33 100644 --- a/src/web/server/app/menu_active_app_list.php +++ b/src/web/server/app/menu_active_app_list.php @@ -7,7 +7,7 @@ include "./../lib/send_reply_json.php"; include "./../setup/connect_db.php"; $mouseAppList = get_app_list(100); -$typingAppList = get_app_list(50); +$typingAppList = get_typing_app_list(); $mouseActiveAppList = get_active_mouse_app_list($maestro_id); $typingActiveAppList = get_active_typing_app_list($maestro_id); $typingPracticeAppCount = get_typing_practice_app_count($maestro_id); @@ -56,6 +56,31 @@ function get_app_list($appType) { return $return_array; } +function get_typing_app_list() { + global $db_conn; + + $query = " + SELECT AppID, AppName, KoreanName + FROM app + WHERE AppType > 50 AND AppType < 100 AND Status = 1 + ORDER BY AppID ASC"; + $stmt = $db_conn->prepare($query); + // $stmt->bind_param('i', $appType); + $stmt->execute(); + $stmt->bind_result($app_id, $app_name, $korean_name); + + $return_array = array(); + while($stmt->fetch()) { + $row_array['AppID'] = $app_id; + $row_array['AppName'] = $app_name; + $row_array['KoreanName'] = $korean_name; + array_push($return_array, $row_array); + } + $stmt->close(); + + return $return_array; +} + function get_active_mouse_app_list($maestro_id) { global $db_conn; @@ -87,7 +112,7 @@ function get_active_typing_app_list($maestro_id) { $query = " SELECT A.AppID, A.AppName, A.KoreanName, A.AppType FROM app AS A - INNER JOIN 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 A.AppType < 100 AND AA.MaestroID=?"; $stmt = $db_conn->prepare($query); $stmt->bind_param("i", $maestro_id); $stmt->execute();