Attendance/templates/admin.html

267 lines
No EOL
13 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Admin 管理員 - Attendance 點名</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-F3w7mX95PdgyTmZZMECAngseQB83DfGTowi0iMjiWaeVhAn4FJkqJByhZMI3AhiU" crossorigin="anonymous">
<link rel="stylesheet" href="/static/allpages.css">
<link rel="stylesheet" href="/static/homeroom.css">
<link rel="shortcut icon" type="image/x-icon" href="/static/favicon.ico" />
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-H6D61RSBHR"></script>
<script src="/static/gtag.js"></script>
</head>
<body>
<div class="showTime"><span id="showTime"></span></div>
<div class="container">
<h1 class="margin-top">Admin View | 管理頁面</h1>
<h2 class="margin-top">{{homeroomCode[0]}} {{homeroomCode[1]}}</h2>
<h2>[{{currDate}}]</h2>
{% if 'confirm' in absData[currDate] %}
<h2 style="color: rgb(61, 194, 0); text-align: center;">Homeroom Confirmed 班導已確認</h2>
{% else %}
<h2 style="color: red; text-align: center;">Homeroom NOT Confirmed 班導尚未確認</h2>
{% endif %}
<a href="/logout"><button class="btn btn-primary logout margin-top">Logout 登出</button></a>
<div class="container margin-bottom">
<div class="row">
<div class="col">
<select name="grade" id="sel-grade" class="form-select" onchange="getHR()" required>
<option value="">選擇年級</option>
{% for grade in homerooms %}
<option value="{{grade}}">{{grade}}</option>
{% endfor %}
</select>
</div>
<div class="col">
<select name="room" id="sel-room" class="form-select" disabled required>
<option value="">請先選擇年級</option>
</select>
</div>
<div class="col">
<select name="date" id="date" class="form-select">
{% for date in absData %}
{% if date == currDate %}
<option value="{{date}}" selected="selected">{{date}} ★</option>
{% else %}
<option value="{{date}}">{{date}}</option>
{% endif %}
{% endfor %}
</select>
</div>
<div class="col-1">
<button type="button" class="btn btn-primary" onclick="redirAdmin()">查詢</button>
</div>
</div>
</div>
<div class="col">
<div class="sticky-top" style="background-color:white;">
<div class="row title">
<div class="col">班級</div>
<div class="col">座號</div>
<div class="col">姓名</div>
<div class="col">英文姓名</div>
{% for i in periods %}
<div class="col">{{i}}</div>
{% endfor %}
</div>
<div class="row title">
<div class="col"></div>
<div class="col"></div>
<div class="col"></div>
<div class="col"></div>
{% for i in periods %}
<div class="col">
{{absData[currDate][i]['name']}}</div>
{% endfor %}
</div>
<div class="row title">
<div class="col"></div>
<div class="col"></div>
<div class="col"></div>
<div class="col"></div>
{% for i in periods %}
<div class="col">{{absData[currDate][i]['teacher']}}</div>
{% endfor %}
</div>
</div>
{% for i in homeroomData %}
<div class="row">
<div class="col">{{homeroomCode[0]}}{{homeroomCode[1]}}</div>
<div class="col">{{i}}</div>
<div class="col">{{ homeroomData[i]['name'] }}</div>
<div class="col">{{ homeroomData[i]['eng_name'] }}</div>
{% for j in periods %}
<div class="col view-{{j}}">
{% if 'signature' in absData[currDate][j] %}
{% if i in absData[currDate][j] %}
{% if absData[currDate][j][i] == 1 %}
<p class="highlightAbs n-2 view-n-{{i}}">X</p>
{% else %}
<p class="highlightAbs n-3 view-n-{{i}}">𝜑</p>
{% endif %}
{% else %}
{% if absData[currDate][j]['name'] != 'GP' %}
<p class="highlightAbs n-1 view-n-{{i}}">V</p>
{% else %}
{% if (homeroomData[i]['GP_Class'][absData[currDate][j]['teacher']] in
absData[currDate][j]['signature'] or 'STUD_AFFAIR_OFFICE' in absData[currDate][j]['signature'])%}
<p class="highlightAbs n-1 view-n-{{i}}">V</p>
{% else %}
<p class="highlightAbs n-2 view-n-{{i}}"></p>
{% endif %}
{% endif %}
{% endif %}
{% elif absData[currDate][j]['name'] == 'GP' %}
<p class="highlightAbs"></p>
{% else %}
{% if 'confirm' in absData[currDate] %}
<p class="highlightAbs"></p>
{% else %}
<p class="highlightAbs"></p>
{% endif %}
<!-- <input type="checkbox" class="tobeform {{j}}^{{i}}"> -->
{% endif %}
</div>
{% endfor %}
</div>
{% endfor %}
{% if showUpload == '1' %}
<div class="row">
<div class="col"></div>
<div class="col"></div>
<div class="col"></div>
<div class="col"></div>
{% for i in periods %}
<div id="btns-{{i}}" class="col">
{% if ('signature' in absData[currDate][i] or 'confirm' in absData[currDate][i]) %}
<button class="btn btn-danger afterSelButton" onclick="edit('{{i|string}}')">編輯
<br>{{absData[currDate][i]['name']}}</button>
{% endif %}
</div>
{% endfor %}
</div>
{% endif %}
<form action="/manage/edit_abs" id="postHomeroomAbs" hidden="hidden" method="post">
<input type="text" id="HR-date" name="date" value="{{currDate}}">
<input type="text" id="HR-period" name="period" value="">
<input type="text" id="HR-notes" name="notes" value="">
<input type="text" id="HR-homeroom" name="homeroom" value="{{homeroomCode[0]}}^{{homeroomCode[1]}}">
</form>
{% for c in range(periods|length + 1) %}
{% if c % 4 == 0 %}
<div class="row signatures">
{% endif %}
<div class="col half">
{% if c == 0 %}
<div class="row needborder">Homeroom Teacher 導師</div>
{% if 'confirm' in absData[currDate] %}
<div class="row"><img src="{{absData[currDate]['confirm']}}" alt=""></div>
<div class="row">備註: {{absData[currDate]['notes']}}</div>
{% else %}
<div class="row"><span style="color:red;">No Signature 導師尚未簽名</span></div>
{% endif %}
{% else %}
{% if absData[currDate][periods[c-1]]['name'] == 'GP' %}
{% if 'signature' in absData[currDate][periods[c-1]] %}
{% for i in absData[currDate][periods[c-1]]['signature'] %}
<div class="row needborder">{{periods[c-1]}}:
{{absData[currDate][periods[c-1]]['teacher']}}: {{i}}:
{{absData[currDate][periods[c-1]]['names'][i]}}</div>
<div class="row"><img src="{{absData[currDate][periods[c-1]]['signature'][i]}}" alt="">
{% if loop.index == loop.length %}
<br>備註: {{absData[currDate][periods[c-1]]['notes']}}
{% endif %}
</div>
{% endfor %}
{% else %}
<div class="row needborder">{{periods[c-1]}}:
{{absData[currDate][periods[c-1]]['teacher']}}: No
Signature
</div>
<div class="row"></div>
{% endif %}
{% else %}
<div class="row needborder">{{periods[c-1]}}: {{absData[currDate][periods[c-1]]['name']}}:
{{absData[currDate][periods[c-1]]['teacher']}}
</div>
<div class="row"><img src="{{absData[currDate][periods[c-1]]['signature']}}" alt=""><br>備註:
{{absData[currDate][periods[c-1]]['notes']}}</div>
{% endif %}
{% endif %}
</div>
{% if c % 4 == 3 %}
</div>
{% endif %}
{% endfor %}
</div>
<div id="finalCheck" class="modal fade" id="staticBackdrop" data-bs-backdrop="static" data-bs-keyboard="false"
tabindex="-1" aria-labelledby="staticBackdropLabel" aria-hidden="true">
<div class="modal-dialog modal-xl">
<form onsubmit="return false;">
<div class="modal-content">
<div class="modal-body">
<div class="alert alert-danger margin-top" id="allPresentWarning" role="alert">
<h4 class="alert-heading">請確認更改Please confirm that you are editting records!</h4>
</div>
<h3 class="margin-top">Notes 備註欄</h3>
<input type="textarea" class="form-control" name="notes" id="subjectNotes"
placeholder="Enter Notes 請輸入備註" style="width: 80%; margin-left: 10%;" row="3">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-danger" onclick="location.reload();">Cancel
取消</button>
<button type="submit" class="btn btn-primary submitButton" onclick="submitForm()">Submit
提交</button>
</div>
</div>
</form>
</div>
</div>
{% if showUpload == '1' %}
<div class="row margin-top">
<div class="col">
<h3 style="color: red;">此排 [請勿] 隨意點選</h3>
</div>
<div class="col">
<a href="/upload/1"><button class="btn btn-danger">1. Add Homeroom</button></a>
</div>
<div class="col">
<a href="/upload/2"><button class="btn btn-danger">2. Add GP Classes</button></a>
</div>
<div class="col">
<a href="/upload/3"><button class="btn btn-danger">3. Add GP Student List</button></a>
</div>
<div class="col">
<a href="/upload/4"><button class="btn btn-danger">4. Period List</button></a>
</div>
<div class="col">
<a href="/upload/dates"><button class="btn btn-warning">[WEEKLY] Dates</button></a>
</div>
</div>
{% endif %}
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"
integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p"
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
{% include 'footer.html' %}
<script>
var homerooms = {};
{% for i in homerooms %}
homerooms['{{i}}'] = [];
{% for j in homerooms[i] %}
homerooms['{{i}}'].push({{ j }});
{% endfor %}
{% endfor %}
</script>
<script src="/static/pagejs/admin.js"></script>
<script src="/static/time.js"></script>
</body>
</html>