From b0d069b7c7bb53a581d5ea67201be99b55039cff Mon Sep 17 00:00:00 2001 From: tiennm99 Date: Mon, 10 Aug 2026 15:04:12 +0700 Subject: [PATCH] Clear and rewrite: Java implementation replaces the Python app --- .gitignore | 165 ------------------------ LICENSE | 201 ------------------------------ README.md | 21 ---- app.py | 193 ---------------------------- input.xlsx | Bin 8616 -> 0 bytes requirements.txt | 21 ---- run.bat | 9 -- setup.bat | 10 -- static/script.js | 64 ---------- templates/attendance_error.html | 16 --- templates/attendance_form.html | 22 ---- templates/attendance_success.html | 15 --- templates/index.html | 45 ------- 13 files changed, 782 deletions(-) delete mode 100644 .gitignore delete mode 100644 LICENSE delete mode 100644 README.md delete mode 100644 app.py delete mode 100644 input.xlsx delete mode 100644 requirements.txt delete mode 100644 run.bat delete mode 100644 setup.bat delete mode 100644 static/script.js delete mode 100644 templates/attendance_error.html delete mode 100644 templates/attendance_form.html delete mode 100644 templates/attendance_success.html delete mode 100644 templates/index.html diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 2cc90c1..0000000 --- a/.gitignore +++ /dev/null @@ -1,165 +0,0 @@ -.idea -output.xlsx - -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] -*$py.class - -# C extensions -*.so - -# Distribution / packaging -.Python -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -wheels/ -share/python-wheels/ -*.egg-info/ -.installed.cfg -*.egg -MANIFEST - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.nox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage.xml -*.cover -*.py,cover -.hypothesis/ -.pytest_cache/ -cover/ - -# Translations -*.mo -*.pot - -# Django stuff: -*.log -local_settings.py -db.sqlite3 -db.sqlite3-journal - -# Flask stuff: -instance/ -.webassets-cache - -# Scrapy stuff: -.scrapy - -# Sphinx documentation -docs/_build/ - -# PyBuilder -.pybuilder/ -target/ - -# Jupyter Notebook -.ipynb_checkpoints - -# IPython -profile_default/ -ipython_config.py - -# pyenv -# For a library or package, you might want to ignore these files since the code is -# intended to run in multiple environments; otherwise, check them in: -# .python-version - -# pipenv -# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. -# However, in case of collaboration, if having platform-specific dependencies or dependencies -# having no cross-platform support, pipenv may install dependencies that don't work, or not -# install all needed dependencies. -#Pipfile.lock - -# poetry -# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. -# This is especially recommended for binary packages to ensure reproducibility, and is more -# commonly ignored for libraries. -# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control -#poetry.lock - -# pdm -# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. -#pdm.lock -# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it -# in version control. -# https://pdm.fming.dev/latest/usage/project/#working-with-version-control -.pdm.toml -.pdm-python -.pdm-build/ - -# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm -__pypackages__/ - -# Celery stuff -celerybeat-schedule -celerybeat.pid - -# SageMath parsed files -*.sage.py - -# Environments -.env -.venv -env/ -venv/ -ENV/ -env.bak/ -venv.bak/ - -# Spyder project settings -.spyderproject -.spyproject - -# Rope project settings -.ropeproject - -# mkdocs documentation -/site - -# mypy -.mypy_cache/ -.dmypy.json -dmypy.json - -# Pyre type checker -.pyre/ - -# pytype static type analyzer -.pytype/ - -# Cython debug symbols -cython_debug/ - -# PyCharm -# JetBrains specific template is maintained in a separate JetBrains.gitignore that can -# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore -# and can be added to the global gitignore or merged into this file. For a more nuclear -# option (not recommended) you can uncomment the following to ignore the entire idea folder. -#.idea/ diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 261eeb9..0000000 --- a/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/README.md b/README.md deleted file mode 100644 index e3fc260..0000000 --- a/README.md +++ /dev/null @@ -1,21 +0,0 @@ -# QR-code-attendance - -Just a QR code attendance demo app for my sister's representation - -## How to use? - -1. Install python3: - Go to [python.org](https://www.python.org/downloads/) and download the latest version of python3. -2. Clone the repository - ```bash - git clone https://github.com/tiennm99/qr-code-attendance.git - ``` - Or download the zip file and extract it. -3. Run `setup.bat` to install the required packages. -4. Run `run.bat` to start the server. - -# Note - -**These code for educational purposes only. It is not secure and not optimized for production use.** - -_Good luck, sis!_ diff --git a/app.py b/app.py deleted file mode 100644 index 1767c18..0000000 --- a/app.py +++ /dev/null @@ -1,193 +0,0 @@ -from threading import Timer - -import psutil -import qrcode -from flask import Flask, render_template, request, jsonify, redirect, url_for, abort -import io -import base64 -import pandas as pd -from datetime import datetime -import os -from openpyxl import load_workbook -from openpyxl.styles import Font, PatternFill -import webbrowser -from collections import deque -from functools import wraps - -app = Flask(__name__) - -PORT = 31009 -INPUT_EXCEL = 'input.xlsx' -OUTPUT_EXCEL = 'output.xlsx' - -# Use a deque to store the last submissions -last_submissions = deque(maxlen=10) - - -def open_browser(): - webbrowser.open_new(f'http://localhost:{PORT}/private') - - -def get_ip_addresses(): - ip_addresses = [] - for interface, addrs in psutil.net_if_addrs().items(): - for addr in addrs: - if addr.family == 2: # AF_INET (IPv4) - ip_addresses.append((interface, addr.address)) - return ip_addresses - - -def generate_qr_code(data): - qr = qrcode.QRCode(version=1, box_size=10, border=5) - qr.add_data(data) - qr.make(fit=True) - img = qr.make_image(fill_color="black", back_color="white") - return img - - -def initialize_output_excel(): - if not os.path.exists(INPUT_EXCEL): - raise FileNotFoundError(f"{INPUT_EXCEL} not found. Please provide the input Excel file.") - - df = pd.read_excel(INPUT_EXCEL) - df['Attended'] = '' - df['Submit Time'] = '' - df['IP'] = '' - df['User Agent'] = '' - df.to_excel(OUTPUT_EXCEL, index=False) - - -def localhost_only(f): - @wraps(f) - def decorated_function(*args, **kwargs): - if request.remote_addr != '127.0.0.1': - abort(403) # Forbidden - return f(*args, **kwargs) - - return decorated_function - - -@app.route('/private') -@localhost_only -def index(): - ip_addresses = get_ip_addresses() - return render_template('index.html', ip_addresses=ip_addresses, last_submissions=list(last_submissions)) - - -@app.route('/private/generate_qr', methods=['POST']) -@localhost_only -def generate_qr(): - selected_ip = request.json.get('ip') - full_url = f"http://{selected_ip}:{PORT}/public/attendance" - qr_img = generate_qr_code(full_url) - img_buffer = io.BytesIO() - qr_img.save(img_buffer, format='PNG') - img_buffer.seek(0) - qr_code = base64.b64encode(img_buffer.getvalue()).decode() - return jsonify({'qr_code': qr_code, 'full_url': full_url}) - - -@app.route('/public/attendance', methods=['GET', 'POST']) -def attendance(): - if request.method == 'POST': - student_id = request.form['student_id'] - ip_address = request.remote_addr - user_agent = request.user_agent.string - timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S") - - result = update_attendance(student_id, timestamp, ip_address, user_agent) - if result == 'duplicate': - return redirect(url_for('attendance_error', error='duplicate')) - elif result == 'student_not_found': - return redirect(url_for('attendance_error', error='not_found')) - return redirect(url_for('attendance_success')) - return render_template('attendance_form.html') - - -@app.route('/attendance_success') -def attendance_success(): - return render_template('attendance_success.html') - - -@app.route('/attendance_error') -def attendance_error(): - error = request.args.get('error', 'unknown') - if error == 'duplicate': - message = "Your attendance has been recorded, but it appears to be a duplicate submission." - elif error == 'not_found': - message = "Student ID not found. Please check your ID and try again." - else: - message = "An unknown error occurred. Please try again later." - return render_template('attendance_error.html', message=message) - - -def update_attendance(student_id, timestamp, ip_address, user_agent): - wb = load_workbook(OUTPUT_EXCEL) - ws = wb.active - - student_row = None - for row in ws.iter_rows(min_row=2, max_row=ws.max_row): - if str(row[0].value) == str(student_id): - student_row = row - break - - if student_row is None: - wb.close() - return 'student_not_found' - - row_index = student_row[0].row - is_duplicate = False - duplicate_with = None - - # Check for duplicate IP or User Agent - for other_row in ws.iter_rows(min_row=2, max_row=ws.max_row, min_col=5, max_col=6): - if other_row[0].value == ip_address or other_row[1].value == user_agent: - is_duplicate = True - duplicate_with = ws.cell(row=other_row[0].row, column=1).value - break - - # Check if this student has already attended - if ws.cell(row=row_index, column=3).value: - is_duplicate = True - - # Always save submission details - ws.cell(row=row_index, column=4, value=timestamp) - ws.cell(row=row_index, column=5, value=ip_address) - ws.cell(row=row_index, column=6, value=user_agent) - - if is_duplicate: - duplicate_cell = ws.cell(row=row_index, column=3) - if duplicate_with: - duplicate_cell.value = f"Duplicated with {duplicate_with}" - else: - duplicate_cell.value = "Duplicate submission" - duplicate_cell.font = Font(color="FF0000") - duplicate_cell.fill = PatternFill(start_color="FFFF00", end_color="FFFF00", fill_type="solid") - else: - # Mark attendance - ws.cell(row=row_index, column=3, value='X') - - # Add to last 5 submissions - student_name = ws.cell(row=row_index, column=2).value - last_submissions.appendleft({ - 'Student ID': student_id, - 'Student Name': student_name, - 'Submit Time': timestamp - }) - - wb.save(OUTPUT_EXCEL) - wb.close() - return 'duplicate' if is_duplicate else 'success' - - -@app.route('/private/get_last_submissions') -@localhost_only -def get_last_submissions(): - return jsonify(list(last_submissions)) - - -if __name__ == '__main__': - if not os.path.exists(OUTPUT_EXCEL): - initialize_output_excel() - Timer(1, open_browser).start() - app.run(host='0.0.0.0', port=PORT, debug=True) diff --git a/input.xlsx b/input.xlsx deleted file mode 100644 index a63ce566bdf038747fcbf35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?6W7hZ2?Z!wx|iJZG+c)6T2tUIxD(<2Tte75l}>dokFNr_%yeh# zFf;X9&I>05R^u>*HOf+|KZvD?+nhoCEXbU#eIhPCcuXA=Qi@L#nB?1SKuZV2^lx+O zYdCm@_|0)h^y_)Z(e!^8*R8w~NqfS) z4|;7Gm^AoA1=D@XT^{qaj%gHTOIvb=VN5rZO1)5uK71{8P5n%0YBH(W)P-yn>sT z&4fdjUmU(`mOSDe(-Dmh`qL{*mTu&u)c*QET!PMRg+7_TS3c z671^i0_C)HcD4Sklk@McAGLHoNDYTTF4Ew6>`MZqhiYX7hZF}STYd9(e_2^g^vo0& z0{N!m`ciIM_)%ZFw5!_tRH$OPuy)QVaH`udhXo(!Kyu$uLFdgHhv}vAGG$+!nRPLp z+@0H%y-v==b6^t(&tW(8DJ8CSMv#nGY*tzouw!!Xj&?uBKxS%fv0F#c^ah$hlwTQ| zi)=TIo>{V4!WY^#0Y;*w;%Y0N${(`lhH9P@YSUOC*Y{nVc9sOtq{kZKHd_kfxMYw z_GCB-WKS-m7C0=%csg&qZ~BbJFAwU25wwanVwqNPAnxtiKfw~IaQo6~CsvRkk?-+P zn9m8(^~^5%U4jCwXut5`H1z~u1y`QzeR!wVB4sr5*NM&6(MH{7jG+sEFgJjzNHKCsgV)u)n=yU z+1U@`Q)}!U5TOsTH#_q*YbIT6K)KlSo{HT<=s@rP+6Ds}s%zwxW_U#q`=m;wMFaeo^B zKegar{rp-I{F5jA|GSC56$pRz@@w7X4=?nnUJdF|eyyVX>fqO;^$!OtWIrAJk;49J z`fGylhiN6M#)-N%^w)IZR}X)c(m(70fPP8<;BUhEtNC9;;GfO4X#QmWTR;RWW1`+J R0B{ra@kePl@!cQ4{sWyb^4kCa diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index ee61ca6..0000000 --- a/requirements.txt +++ /dev/null @@ -1,21 +0,0 @@ -blinker==1.8.2 -click==8.1.7 -colorama==0.4.6 -et-xmlfile==1.1.0 -Flask==3.1.3 -itsdangerous==2.2.0 -Jinja2==3.1.6 -MarkupSafe==2.1.5 -numpy==2.0.1 -openpyxl==3.1.5 -pandas==2.2.2 -pillow==12.2.0 -psutil==6.0.0 -pypng==0.20220715.0 -python-dateutil==2.9.0.post0 -pytz==2024.1 -qrcode==7.4.2 -six==1.16.0 -typing_extensions==4.12.2 -tzdata==2024.1 -Werkzeug==3.1.6 diff --git a/run.bat b/run.bat deleted file mode 100644 index 0bbbf73..0000000 --- a/run.bat +++ /dev/null @@ -1,9 +0,0 @@ -@echo off -echo Starting the application... -python app.py -if %errorlevel% neq 0 ( - echo Error: Failed to run the application. - pause - exit /b %errorlevel% -) -pause diff --git a/setup.bat b/setup.bat deleted file mode 100644 index 516b19c..0000000 --- a/setup.bat +++ /dev/null @@ -1,10 +0,0 @@ -@echo off -echo Installing requirements... -pip install -r requirements.txt -if %errorlevel% neq 0 ( - echo Error: Failed to install requirements. - pause - exit /b %errorlevel% -) -echo Requirements installed successfully. -pause diff --git a/static/script.js b/static/script.js deleted file mode 100644 index eb3db59..0000000 --- a/static/script.js +++ /dev/null @@ -1,64 +0,0 @@ -document.addEventListener('DOMContentLoaded', function() { - const form = document.getElementById('ip-form'); - const qrCodeContainer = document.getElementById('qr-code-container'); - const submissionsTable = document.getElementById('submissions-table'); - - form.addEventListener('submit', function(e) { - e.preventDefault(); - const formData = new FormData(form); - const selectedIp = formData.get('ip'); - - fetch('/private/generate_qr', { - method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, - body: JSON.stringify({ ip: selectedIp }), - }) - .then(response => response.json()) - .then(data => { - qrCodeContainer.innerHTML = ` -

QR Code for ${data.full_url}

- QR Code - `; - }) - .catch(error => { - console.error('Error:', error); - qrCodeContainer.innerHTML = '

Error generating QR code. Please try again.

'; - }); - }); - - function updateSubmissions() { - fetch('/private/get_last_submissions') - .then(response => response.json()) - .then(data => { - let tableHtml = ` - - - Student ID - Student Name - Submit Time - - - - `; - data.forEach(submission => { - tableHtml += ` - - ${submission['Student ID']} - ${submission['Student Name']} - ${submission['Submit Time']} - - `; - }); - tableHtml += ''; - submissionsTable.innerHTML = tableHtml; - }) - .catch(error => console.error('Error:', error)); - } - - // Update submissions every 5 seconds - setInterval(updateSubmissions, 5000); - // Initial update - updateSubmissions(); -}); diff --git a/templates/attendance_error.html b/templates/attendance_error.html deleted file mode 100644 index 08db5ad..0000000 --- a/templates/attendance_error.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - Attendance Submission Error - - - -
- - diff --git a/templates/attendance_form.html b/templates/attendance_form.html deleted file mode 100644 index ef1fe78..0000000 --- a/templates/attendance_form.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - Student Attendance Form - - - -
-

Student Attendance Form

-
-
- - -
- -
-
- - - diff --git a/templates/attendance_success.html b/templates/attendance_success.html deleted file mode 100644 index ae6be1c..0000000 --- a/templates/attendance_success.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - Attendance Submitted Successfully - - - -
-

Attendance Submitted Successfully

-

Thank you for submitting your attendance.

-
- - diff --git a/templates/index.html b/templates/index.html deleted file mode 100644 index e65926f..0000000 --- a/templates/index.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - QR Code Attendance - - - -
-

QR Code Attendance

-
- - -
-
- -

Last Submissions

- - - - - - - - - - {% for submission in last_submissions %} - - - - - - {% endfor %} - -
Student IDStudent NameSubmit Time
{{ submission['Student ID'] }}{{ submission['Student Name'] }}{{ submission['Submit Time'] }}
-
- - - -