Fix: revise php filename

This commit is contained in:
2019-07-18 08:10:14 +09:00
parent bc2b8cd00e
commit 031be3ad1b
6 changed files with 146 additions and 30 deletions
+53 -26
View File
@@ -11,39 +11,66 @@ function HistoryBoard(dataType) {
return;
}
this.date = null;
this.todayBestRecord = 0;
this.dbConnectManager = new DBConnectManager();
this.dbService = new DBService();
this.dbService.setMaestroID(sessionStorageManager.getMaestroID());
this.dbService.setPlayerID(sessionStorageManager.getPlayerID());
setTimeout(
(function() {
var today = new Date();
var date = DateUtil.getYYYYMMDD(today);
this.dbConnectManager.requestPlayerHistory(
sessionStorageManager.getMaestroID(),
date,
(function(historyRecordManager) {
if(historyRecordManager.getCount() == 0) {
console.log("history board - no data");
return;
}
this.date = DateUtil.getYYYYMMDD(today);
for(var i = 0; i < historyRecordManager.getCount(); i++) {
var data = historyRecordManager.getAt(i);
this.printRecord(i, data.date, data.bestRecord);
if(date == data.date)
this.todayBestRecord = data.bestRecord;
}
}).bind(this)
);
if(isTypingExamApp()) {
this.dbService.requestWritingPlayerHistory(
sessionStorageManager.getWritingID(),
this.date,
(function(historyRecordManager) {
this.parseHistoryRecordManagerData(historyRecordManager);
}).bind(this),
(function() {
console.log("player history board - no data");
})
);
} else {
this.dbConnectManager.requestPlayerHistory(
this.date,
(function(historyRecordManager) {
this.parseHistoryRecordManagerData(historyRecordManager);
}).bind(this),
(function() {
console.log("player history board - no data");
})
);
}
}).bind(this),
RecordBoard.DELAY_UPDATING_RESULT_RECORD_MS
);
}
HistoryBoard.prototype.calcDate = function(daysBefore) {
HistoryBoard.prototype.parseHistoryRecordManagerData = function(historyRecordManager) {
console.log(historyRecordManager);
if(historyRecordManager.getCount() == 0) {
console.log("history board - no data");
return;
}
for(var i = 0; i < historyRecordManager.getCount(); i++) {
var data = historyRecordManager.getAt(i);
this.printRecord(i, data.date, data.bestRecord);
if(this.date == data.date)
this.todayBestRecord = data.bestRecord;
}
}
HistoryBoard.prototype.daySubtract = function(daysBefore) {
var date = new Date();
date.setDate(date.getDate() - daysBefore);
return date;
@@ -55,13 +82,13 @@ HistoryBoard.prototype.printRecord = function(index, date, bestRecord) {
}
HistoryBoard.prototype.printSample = function() {
this.printRecord(0, DateUtil.getYYYYMMDD(this.calcDate(2)), 1270);
this.printRecord(1, DateUtil.getYYYYMMDD(this.calcDate(3)), 1150);
this.printRecord(2, DateUtil.getYYYYMMDD(this.calcDate(5)), 1080);
this.printRecord(3, DateUtil.getYYYYMMDD(this.calcDate(7)), 960);
this.printRecord(4, DateUtil.getYYYYMMDD(this.calcDate(10)), 1020);
this.printRecord(5, DateUtil.getYYYYMMDD(this.calcDate(15)), 840);
this.printRecord(6, DateUtil.getYYYYMMDD(this.calcDate(20)), 760);
this.printRecord(0, DateUtil.getYYYYMMDD(this.daySubtract(2)), 1270);
this.printRecord(1, DateUtil.getYYYYMMDD(this.daySubtract(3)), 1150);
this.printRecord(2, DateUtil.getYYYYMMDD(this.daySubtract(5)), 1080);
this.printRecord(3, DateUtil.getYYYYMMDD(this.daySubtract(7)), 960);
this.printRecord(4, DateUtil.getYYYYMMDD(this.daySubtract(10)), 1020);
this.printRecord(5, DateUtil.getYYYYMMDD(this.daySubtract(15)), 840);
this.printRecord(6, DateUtil.getYYYYMMDD(this.daySubtract(20)), 760);
}
HistoryBoard.prototype.todayBestRecord = function() {