Purpose of this program is simple setup and simple usage with only one QR Code to clock in and clock out. Also added local QR code maker to avoiding link leakage in online platforms of the Google Apps Script link.
It works in the Google Apps Script platform and Google Sheets. It is triggered when the QR Code is scanned.
- If it is the first time of the scan from an employee, it wants to employee to enter his/her name.
- Script takes this input and saves it to the browsers local storage with localStorage() function.
- After script appends the employee clock in/clock out information name, action, date and time to the google sheets.
- For each reloding or revisiting the QR Code changes the action IN -> OUT or OUT -> IN loop.
- Google App Script
- Google Sheets File
- Columns will be || Employee Name | Action | Data | Time || format
- Open the google sheets and go Extentions > Apps Script File
- Then you have to open a new script in Google Apps Script.
- Import main.gs file to the Google Apps Script.
- Deploy the script
- Copy the link given in the deploy page.
- Paste it to the
makeqr.pyfile. - Enter
pip install qrcode pillow - Run the
makeqr.pywithpython3 makeqr.py
Thats it ! You have working shift tracker and QR Code for it.
Please protect your QR code and link. Bad behaviour hacker might be access the google sheets and change or enter invalid and unauthorized logs to the sheet. Consider this possibilities please.
For XSS code injection tried to prevent it but not sure how effective it is.