Fix: typing app type 50 -> 51, 52
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user