diff --git a/call.cgi b/call.cgi index 9896697..cf9f93b 100755 --- a/call.cgi +++ b/call.cgi @@ -8,6 +8,7 @@ import sqlite3 from datetime import datetime from datetime import timedelta +import datetime as dt if sys.argv[-1] == "--test": logdir="./" @@ -92,7 +93,7 @@ # 5 6 dd[0], dd[1], # 7 8 - dd[2], dd[3], dd[4]]) + dd[2], dd[3], dd[4], "OK"]) else: candidate.append( # 0 1 2 3 4 @@ -100,7 +101,7 @@ # 5 6 "????", id_, # 7 8 - "--", "--", "--"]) + "--", "--", "--", "OK"]) elif action.startswith("reject") and candidate: # exclude double-login action, id_, host = action.split(":") @@ -124,8 +125,9 @@ if candidate[-1][1].startswith("?"): candidate[-1][1] = "?〜"+date.strftime(datefmt) else: - if date.time() > datetime.time(19,55): - candidate[-1][1] += "〜" + "ログアウト記録なし" + if date.time() > dt.time(19,55): + candidate[-1][1] += "〜" +date.strftime(datefmt) + candidate[-1][10] = "ログオフ記録無" else: candidate[-1][1] += "〜" + date.strftime(datefmt) elif fr < date and to > date: # no candidate @@ -140,7 +142,7 @@ # 5 6 dd[0], dd[1], # 7 8 - dd[2], dd[3], dd[4]]) + dd[2], dd[3], dd[4], "OK"]) else: candidate.append( # 0 1 2 3 4 @@ -148,7 +150,7 @@ # 5 6 "????", id_, # 7 8 - "--", "--", "--"]) + "--", "--", "--", "OK"]) lines.extend(candidate) diff --git a/index.html b/index.html index 8d3aa2b..f518aab 100644 --- a/index.html +++ b/index.html @@ -131,6 +131,11 @@ onclick='clicked()' id='dep' name='sort' value='所属'> + + + + @@ -302,6 +307,8 @@ db = db.sort(check(0)); }else if (s == "所属") { db = db.sort(check(8)); + }else if (s == "ステータス") { + db = db.sort(check(10)); } else return; filter(); @@ -354,7 +361,11 @@ if (accept) { if(!checkbox["uniq"] || prev != s[4]) { var tr = $("").appendTo(table); - [1,5,6,7,0,8].forEach(function(i) {$(""+s[i]+"").appendTo(tr); }); + if (s[10] !== "OK") { + s[1] = '
' + s[1] + "
"; + s[10] = '
' + s[10] + "
"; + } + [1,5,6,7,0,8,10].forEach(function(i) {$(""+s[i]+"").appendTo(tr); }); if (s[9] === "01") { n_student += 1; } else {