Fix: delete player info - writing exam record
This commit is contained in:
@@ -16,6 +16,13 @@ if($maestro_test_player_id === null) {
|
|||||||
delete_maestro_test_player_best_record($maestro_test_player_id);
|
delete_maestro_test_player_best_record($maestro_test_player_id);
|
||||||
delete_maestro_test_player_app_highest_record($maestro_test_player_id);
|
delete_maestro_test_player_app_highest_record($maestro_test_player_id);
|
||||||
|
|
||||||
|
delete_maestro_test_typing_exam_highest_record($maestro_test_player_id);
|
||||||
|
delete_maestro_test_typing_exam_record($maestro_test_player_id);
|
||||||
|
|
||||||
|
delete_maestro_test_license_score_record($maestro_test_player_id);
|
||||||
|
delete_maestro_test_license_time($maestro_test_player_id);
|
||||||
|
|
||||||
|
|
||||||
$replyJSON["PlayerID"] = $maestro_test_player_id;
|
$replyJSON["PlayerID"] = $maestro_test_player_id;
|
||||||
$replyJSON["RESULT"] = "ok";
|
$replyJSON["RESULT"] = "ok";
|
||||||
echo json_encode($replyJSON, JSON_UNESCAPED_UNICODE);
|
echo json_encode($replyJSON, JSON_UNESCAPED_UNICODE);
|
||||||
@@ -44,6 +51,8 @@ function get_maestro_test_player_id($maestro_id) {
|
|||||||
return $maestro_test_player_id;
|
return $maestro_test_player_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function delete_maestro_test_player_best_record($player_id) {
|
function delete_maestro_test_player_best_record($player_id) {
|
||||||
global $db_conn;
|
global $db_conn;
|
||||||
|
|
||||||
@@ -55,10 +64,6 @@ function delete_maestro_test_player_best_record($player_id) {
|
|||||||
$stmt = $db_conn->prepare($query);
|
$stmt = $db_conn->prepare($query);
|
||||||
$stmt->bind_param('i', $player_id);
|
$stmt->bind_param('i', $player_id);
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
// $stmt->bind_result($maestro_test_player_id);
|
|
||||||
// while($stmt->fetch()) {
|
|
||||||
// ;
|
|
||||||
// }
|
|
||||||
$stmt->fetch();
|
$stmt->fetch();
|
||||||
$stmt->close();
|
$stmt->close();
|
||||||
}
|
}
|
||||||
@@ -74,10 +79,71 @@ function delete_maestro_test_player_app_highest_record($player_id) {
|
|||||||
$stmt = $db_conn->prepare($query);
|
$stmt = $db_conn->prepare($query);
|
||||||
$stmt->bind_param('i', $player_id);
|
$stmt->bind_param('i', $player_id);
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
// $stmt->bind_result($maestro_test_player_id);
|
$stmt->fetch();
|
||||||
// while($stmt->fetch()) {
|
$stmt->close();
|
||||||
// ;
|
}
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
|
function delete_maestro_test_typing_exam_highest_record($player_id) {
|
||||||
|
global $db_conn;
|
||||||
|
|
||||||
|
$query = "
|
||||||
|
DELETE
|
||||||
|
FROM typing_exam_highest_record
|
||||||
|
WHERE PlayerID = ?
|
||||||
|
";
|
||||||
|
$stmt = $db_conn->prepare($query);
|
||||||
|
$stmt->bind_param('i', $player_id);
|
||||||
|
$stmt->execute();
|
||||||
|
$stmt->fetch();
|
||||||
|
$stmt->close();
|
||||||
|
}
|
||||||
|
|
||||||
|
function delete_maestro_test_typing_exam_record($player_id) {
|
||||||
|
global $db_conn;
|
||||||
|
|
||||||
|
$query = "
|
||||||
|
DELETE
|
||||||
|
FROM typing_exam_record
|
||||||
|
WHERE PlayerID = ?
|
||||||
|
";
|
||||||
|
$stmt = $db_conn->prepare($query);
|
||||||
|
$stmt->bind_param('i', $player_id);
|
||||||
|
$stmt->execute();
|
||||||
|
$stmt->fetch();
|
||||||
|
$stmt->close();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function delete_maestro_test_license_score_record($player_id) {
|
||||||
|
global $db_conn;
|
||||||
|
|
||||||
|
$query = "
|
||||||
|
DELETE
|
||||||
|
FROM license_score
|
||||||
|
WHERE PlayerID = ?
|
||||||
|
";
|
||||||
|
$stmt = $db_conn->prepare($query);
|
||||||
|
$stmt->bind_param('i', $player_id);
|
||||||
|
$stmt->execute();
|
||||||
|
$stmt->fetch();
|
||||||
|
$stmt->close();
|
||||||
|
}
|
||||||
|
|
||||||
|
function delete_maestro_test_license_time($player_id) {
|
||||||
|
global $db_conn;
|
||||||
|
|
||||||
|
$query = "
|
||||||
|
DELETE
|
||||||
|
FROM license_time
|
||||||
|
WHERE PlayerID = ?
|
||||||
|
";
|
||||||
|
$stmt = $db_conn->prepare($query);
|
||||||
|
$stmt->bind_param('i', $player_id);
|
||||||
|
$stmt->execute();
|
||||||
$stmt->fetch();
|
$stmt->fetch();
|
||||||
$stmt->close();
|
$stmt->close();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,10 @@ $playerID = $_POST["player_id"];
|
|||||||
|
|
||||||
deleteAppHighestRecord($maestroID, $playerID);
|
deleteAppHighestRecord($maestroID, $playerID);
|
||||||
deleteBestRecord($maestroID, $playerID);
|
deleteBestRecord($maestroID, $playerID);
|
||||||
|
|
||||||
|
deleteTypingExamHighestRecord($maestroID, $playerID);
|
||||||
|
deleteTypingExamRecord($maestroID, $playerID);
|
||||||
|
|
||||||
deleteLicenseScore($maestroID, $playerID);
|
deleteLicenseScore($maestroID, $playerID);
|
||||||
deleteLicenseTime($maestroID, $playerID);
|
deleteLicenseTime($maestroID, $playerID);
|
||||||
|
|
||||||
@@ -65,6 +69,35 @@ function deleteBestRecord($maestroID, $playerID) {
|
|||||||
$stmt->close();
|
$stmt->close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function deleteTypingExamHighestRecord($maestroID, $playerID) {
|
||||||
|
global $db_conn;
|
||||||
|
|
||||||
|
$query = "
|
||||||
|
DELETE FROM typing_exam_highest_record
|
||||||
|
WHERE MaestroID = ? AND PlayerID = ?
|
||||||
|
";
|
||||||
|
$stmt = $db_conn->prepare($query);
|
||||||
|
$stmt->bind_param("ii", $maestroID, $playerID);
|
||||||
|
$result = $stmt->execute();
|
||||||
|
$stmt->close();
|
||||||
|
}
|
||||||
|
|
||||||
|
function deleteTypingExamRecord($maestroID, $playerID) {
|
||||||
|
global $db_conn;
|
||||||
|
|
||||||
|
$query = "
|
||||||
|
DELETE FROM typing_exam_record
|
||||||
|
WHERE MaestroID = ? AND PlayerID = ?
|
||||||
|
";
|
||||||
|
$stmt = $db_conn->prepare($query);
|
||||||
|
$stmt->bind_param("ii", $maestroID, $playerID);
|
||||||
|
$result = $stmt->execute();
|
||||||
|
$stmt->close();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function deleteLicenseScore($maestroID, $playerID) {
|
function deleteLicenseScore($maestroID, $playerID) {
|
||||||
global $db_conn;
|
global $db_conn;
|
||||||
|
|
||||||
|
|||||||
+14
-12
@@ -155,9 +155,10 @@ QUnit.test( "AppList", function( assert ) {
|
|||||||
language,
|
language,
|
||||||
(function(jsonData) {
|
(function(jsonData) {
|
||||||
assert.equal(jsonData.appGroup, appGroup, "#2 appGroup : typing exam, Korean");
|
assert.equal(jsonData.appGroup, appGroup, "#2 appGroup : typing exam, Korean");
|
||||||
assert.equal(jsonData.appData.appList.length, 5, "appList");
|
// console.log(jsonData.appData);
|
||||||
assert.equal(jsonData.appData.activeAppList.length, 5, "activeAppList");
|
assert.equal(jsonData.appData.appList.length, 7, "appList");
|
||||||
assert.equal(jsonData.appData.highestRecordList.length, 5, "highestRecordList");
|
assert.equal(jsonData.appData.activeAppList.length, 7, "activeAppList");
|
||||||
|
assert.equal(jsonData.appData.highestRecordList.length, 7, "highestRecordList");
|
||||||
asyncExamKorean();
|
asyncExamKorean();
|
||||||
}).bind(this),
|
}).bind(this),
|
||||||
(function(jsonData) {
|
(function(jsonData) {
|
||||||
@@ -177,9 +178,9 @@ QUnit.test( "AppList", function( assert ) {
|
|||||||
(function(jsonData) {
|
(function(jsonData) {
|
||||||
assert.equal(jsonData.appGroup, appGroup, "#2 appGroup : typing exam, English");
|
assert.equal(jsonData.appGroup, appGroup, "#2 appGroup : typing exam, English");
|
||||||
// console.log(jsonData.appData);
|
// console.log(jsonData.appData);
|
||||||
assert.equal(jsonData.appData.appList.length, 4, "appList");
|
assert.equal(jsonData.appData.appList.length, 6, "appList");
|
||||||
assert.equal(jsonData.appData.activeAppList.length, 4, "activeAppList");
|
assert.equal(jsonData.appData.activeAppList.length, 6, "activeAppList");
|
||||||
assert.equal(jsonData.appData.highestRecordList.length, 4, "highestRecordList");
|
assert.equal(jsonData.appData.highestRecordList.length, 6, "highestRecordList");
|
||||||
asyncExamEnglish();
|
asyncExamEnglish();
|
||||||
}).bind(this),
|
}).bind(this),
|
||||||
(function(jsonData) {
|
(function(jsonData) {
|
||||||
@@ -240,9 +241,10 @@ QUnit.test( "AppList", function( assert ) {
|
|||||||
language,
|
language,
|
||||||
(function(jsonData) {
|
(function(jsonData) {
|
||||||
assert.equal(jsonData.appGroup, appGroup, "#4 appGroup : mouse play");
|
assert.equal(jsonData.appGroup, appGroup, "#4 appGroup : mouse play");
|
||||||
assert.equal(jsonData.appData.appList.length, 5, "appList");
|
// console.log(jsonData.appData);
|
||||||
assert.equal(jsonData.appData.activeAppList.length, 4, "activeAppList");
|
assert.equal(jsonData.appData.appList.length, 6, "appList");
|
||||||
assert.equal(jsonData.appData.highestRecordList.length, 5, "highestRecordList");
|
assert.equal(jsonData.appData.activeAppList.length, 6, "activeAppList");
|
||||||
|
assert.equal(jsonData.appData.highestRecordList.length, 6, "highestRecordList");
|
||||||
asyncMousePlay();
|
asyncMousePlay();
|
||||||
}).bind(this),
|
}).bind(this),
|
||||||
(function(jsonData) {
|
(function(jsonData) {
|
||||||
@@ -488,7 +490,7 @@ QUnit.test( "TypingExamDB - minus record", function( assert ) {
|
|||||||
|
|
||||||
function addPrevHourTypingExamRecord()
|
function addPrevHourTypingExamRecord()
|
||||||
{
|
{
|
||||||
console.log("record : " + RECORD);
|
// console.log("record : " + RECORD);
|
||||||
dbService.addPrevHourTypingExamRecord(
|
dbService.addPrevHourTypingExamRecord(
|
||||||
WRITING_ID, //writingRecord
|
WRITING_ID, //writingRecord
|
||||||
RECORD, // record : -117.89
|
RECORD, // record : -117.89
|
||||||
@@ -505,7 +507,7 @@ QUnit.test( "TypingExamDB - minus record", function( assert ) {
|
|||||||
// add this hour record + 10
|
// add this hour record + 10
|
||||||
function updateTypingExamRecord()
|
function updateTypingExamRecord()
|
||||||
{
|
{
|
||||||
console.log("record : " + (RECORD + 20));
|
// console.log("record : " + (RECORD + 20));
|
||||||
dbService.updateTypingExamRecord(
|
dbService.updateTypingExamRecord(
|
||||||
WRITING_ID, //writingRecord
|
WRITING_ID, //writingRecord
|
||||||
RECORD + 20, // record
|
RECORD + 20, // record
|
||||||
@@ -579,7 +581,7 @@ QUnit.test( "TypingExamDB - minus record", function( assert ) {
|
|||||||
// update this hour record
|
// update this hour record
|
||||||
function updateTypingExamRecord3()
|
function updateTypingExamRecord3()
|
||||||
{
|
{
|
||||||
console.log("record : " + (RECORD - 10));
|
// console.log("record : " + (RECORD - 10));
|
||||||
dbService.updateTypingExamRecord(
|
dbService.updateTypingExamRecord(
|
||||||
WRITING_ID, //writingRecord
|
WRITING_ID, //writingRecord
|
||||||
RECORD - 10, // record
|
RECORD - 10, // record
|
||||||
|
|||||||
Reference in New Issue
Block a user