Compare commits

..

87 Commits

Author SHA1 Message Date
Stefano Assenzo
d8db86a33d ehi 2023-03-06 16:07:05 +00:00
Stefano Assenzo
f19d664646 So now? 2023-03-06 16:06:59 +00:00
Stefano Assenzo
2c78f7ed1e Everything should be right now 2023-03-06 16:02:21 +00:00
Stefano Assenzo
d6668d255d Update main.py 2023-03-06 16:34:00 +01:00
Stefano Assenzo
88097ac588 Update main.py 2023-03-06 16:18:56 +01:00
Stefano Assenzo
ae231d7952 Update main.py 2023-03-06 16:15:11 +01:00
Stefano Assenzo
a46fa83505 Create requirements.txt 2023-03-05 19:37:58 +01:00
Stefano Assenzo
2feba359e2 Rename bot.py to main.py 2023-03-05 19:34:00 +01:00
Stefano Assenzo
ef2d9a520b I'm finally done with this Telegram bot 2023-03-04 16:08:33 +00:00
Stefano Assenzo
5f2594ed4a Fix all 2023-03-03 16:02:42 +00:00
Stefano Assenzo
566d3e2811 I am doing too many things 2023-03-03 15:14:12 +00:00
Stefano Assenzo
4f4458c425 I forgot to remove the print 2023-02-17 17:04:36 +00:00
Stefano Assenzo
44ce965fb3 Fix bug 2023-02-17 17:02:56 +00:00
Stefano Assenzo
c83251c4d4 Remove inutil comments 2023-02-16 15:42:05 +00:00
Stefano Assenzo
a3e27ec3d5 Now there is no need to take a screenshot every time 2023-02-16 15:41:02 +00:00
Stefano Assenzo
4e892bc95a Now the api is no longer needed for the site, but can be used for future projects 2023-02-12 14:26:12 +00:00
Stefano Assenzo
0033914918 I forgot to put that it shows if le3 is busy or not 2023-02-12 14:21:42 +00:00
Stefano Assenzo
6175b33852 Simple homepage (WIP) 2023-02-12 13:22:33 +00:00
Stefano Assenzo
a711bff703 Remove inutil file 2023-02-12 12:40:53 +00:00
Stefano Assenzo
d7374d6f9d Reorder some file 2023-02-12 11:44:29 +00:00
Stefano Assenzo
ef80a64b12 Some test 2023-02-12 11:39:23 +00:00
Stefano Assenzo
f908f4c116 Mini bug not caused by me but by whoever writes the school timetable, because instead of writing motor activities he wrote motor activity so the script did not find the class with which we will do motor activity.
Now I fixed
2023-02-12 11:24:54 +00:00
Stefano Assenzo
3fe56893b6 Simple login and registration in Flask with MongoDB 2023-02-12 11:08:57 +00:00
Stefano Assenzo
e856c71eff Now let us know if the two electrical and electronics lab rooms are occupied or not 2023-02-10 15:40:16 +00:00
Stefano Assenzo
b135312aa0 Fix little bug 2023-02-04 11:21:05 +00:00
Stefano Assenzo
e987685dce I finally finished the table, I just have to make it small enough for Whatsapp 2023-01-31 17:46:33 +00:00
Stefano Assenzo
0788b337b7 New table for school time - Little test for Whatsapp Bot 2023-01-31 16:08:05 +00:00
Stefano Assenzo
931cf9975e So now the script send me a photo 2023-01-29 16:01:53 +00:00
Stefano Assenzo
74da1235b4 Remove comments 2023-01-29 14:36:59 +00:00
Stefano Assenzo
c6b54bda37 I try to make the Discord bot with little success, at the moment I focus on something else 2023-01-29 14:27:47 +00:00
Stefano Assenzo
177374a894 Ok 2023-01-28 17:42:28 +00:00
Stefano Assenzo
3f75138d16 Reorder libraries on app.py 2023-01-28 17:41:45 +00:00
Stefano Assenzo
23ac13f5d1 Now it's all about .env - I started making Whatsapp bot 2023-01-28 17:39:21 +00:00
Stefano Assenzo
76af099702 Now send a screenshot of the timetable when you find Italian language in the school time table and I have fixed the school time table so no one has trouble reading it 2023-01-28 15:28:50 +00:00
Stefano Assenzo
14b7a724ae Remove inutil lines of code 2023-01-27 20:30:47 +00:00
Stefano Assenzo
b4eb0a0b29 Now find the classes we do PE with even though we have multiple times a week 2023-01-27 20:30:11 +00:00
Stefano Assenzo
aaae780530 Small code tidying up 2023-01-27 16:33:15 +00:00
Stefano Assenzo
01f83d6171 Add style on school time table - Remove inutile lines of code 2023-01-27 16:12:10 +00:00
Stefano Assenzo
6ad24a92a7 Fix little bug and simplified use 2023-01-27 15:27:13 +00:00
Stefano Assenzo
464152de50 Try new style for table 2023-01-26 17:19:45 +00:00
Stefano Assenzo
5ef9c4f0f9 Fix JSON database MongoDB 2023-01-26 17:12:51 +00:00
Stefano Assenzo
debaf06011 Create simple table inteface with school time api 2023-01-26 17:06:43 +00:00
Stefano Assenzo
5c4b983e0e Now api school time works! 2023-01-25 17:17:17 +00:00
Stefano Assenzo
54175f01cd Now it's possible change school time table (testing) 2023-01-25 16:41:05 +00:00
Stefano Assenzo
f58b8a06c6 Add comments on the code and add a simple slash commands 2023-01-25 16:00:49 +00:00
Stefano Assenzo
d07dbac7f5 Add day on message Discord bot 2023-01-25 15:54:00 +00:00
Stefano Assenzo
6dfa4e3bb3 Fix little bug on Discord bot 2023-01-25 15:51:23 +00:00
Stefano Assenzo
061d0bee7e Merge branch 'dev' of https://github.com/assenzostefano/class-website into dev 2023-01-25 15:47:58 +00:00
Stefano Assenzo
f3a75fadc0 So now the Discord bot send a message when it find a subject call Lingua Italiana - I try to fix the api for school time table 2023-01-25 15:44:38 +00:00
Stefano Assenzo
88a5bcdb33 Little test 2023-01-24 15:10:19 +00:00
Stefano Assenzo
56b021398d Now reads classrooms correctly and uploads them to MongoDB 2023-01-24 14:57:16 +00:00
Stefano Assenzo
bf041c0bbb So now the bot found School Subject Italiano and send a message 2023-01-22 16:34:33 +00:00
Stefano Assenzo
bb8a5d2dbc Fix email check 2023-01-22 13:59:47 +00:00
Stefano Assenzo
a945d9e72b Upload all document on archive collection 2023-01-22 13:44:00 +00:00
Stefano Assenzo
bf1f7bbf9b Now loads teachers and school subjects correctly - I rearranged the JSON in preparation for the Discord bot. 2023-01-22 13:35:13 +00:00
Stefano Assenzo
8b65584ac3 Now it checks if the file has already been downloaded and if it is an .xlsx, and automatically starts the automatic generation of the school schedule 2023-01-14 16:36:29 +00:00
Stefano Assenzo
0f8a83c9c5 Now before uploading tasks to MongoDB check if they have already been uploaded 2023-01-14 15:23:00 +00:00
Stefano Assenzo
fef82d882d Remove inutil files 2023-01-14 12:51:55 +00:00
Stefano Assenzo
e4a7000399 Reoder the check homework, so now in more tidy 2023-01-14 12:48:04 +00:00
Stefano Assenzo
4fcfa71b49 Add library on requirements.txt 2023-01-13 20:45:26 +00:00
Stefano Assenzo
85c669be38 Delete my test file (ops i accidently upload the file with the other commit) 2023-01-13 20:39:37 +00:00
Stefano Assenzo
092e3c4f84 New structure JSON for DB and split date (no current test) 2023-01-13 20:37:18 +00:00
Stefano Assenzo
cfb9c229f9 Create requirements.txt (empty) 2023-01-13 16:16:57 +00:00
Stefano Assenzo
c1ba2cf5b5 Create API for homework 2023-01-13 15:50:30 +00:00
Stefano Assenzo
0306dc700f Now it works correctly and loads everything to the database- TO-DO: Create the api for the homework school and add the various controls before adding the homework. 2023-01-10 16:05:59 +00:00
Stefano Assenzo
8b3ce90566 So now i send all homework data to database (MongoDB) 2023-01-08 18:28:41 +00:00
Stefano Assenzo
073ccd5dfe Add publication date homework 2023-01-08 17:47:35 +00:00
Stefano Assenzo
dc06dbc3c2 Now the script can even take the school subject from Nuvola 2023-01-08 17:00:51 +00:00
Stefano Assenzo
f4341ea442 It finally takes homework automatically, I just have to enter the dates and upload them to the database - I started a very basic but still very broken login system. 2023-01-08 15:33:16 +00:00
Stefano Assenzo
f7ce81ef5d Add logging (work in progress...) 2023-01-07 11:44:09 +00:00
Stefano Assenzo
7c30cf9b8f Fixed the .env and started Nuvola web-scraping to take homework 2023-01-07 11:38:10 +00:00
Stefano Assenzo
607d371534 Reordering comments and functions 2023-01-06 18:33:24 +00:00
Stefano Assenzo
02afe8bace I fixed the email auto check and added the comments 2023-01-06 18:29:07 +00:00
Stefano Assenzo
af806c4f16 Now it works correctly, I just have to rename the file it downloads and I'm done 2023-01-05 11:40:54 +00:00
Stefano Assenzo
bced0ee355 Now I can download and convert the file automatically, but the automatic generation of the school timetable doesn't work correctly at the moment 2023-01-04 16:33:28 +00:00
Stefano Assenzo
03ce9b49e8 Now it is perfect 2022-12-28 15:14:49 +00:00
Stefano Assenzo
55a24bb0a2 Test for Cloudflare Pages 2022-12-28 15:10:55 +00:00
Stefano Assenzo
6f05b82a77 I just reordered the files 2022-12-28 15:06:45 +00:00
Stefano Assenzo
6b7f0f86b6 Now it reads my emails and writes down the sender and content, I just need to implement that it only reads emails sent from my school and downloads the attachment to pass to 'update_time_school.py' which will do the rest of the work. 2022-12-28 15:04:42 +00:00
Stefano Assenzo
74d1ef52c6 Finaly fix auto update school time table and fix API for school time table! 2022-12-27 17:19:04 +00:00
Stefano Assenzo
f9b9de9a3d I moved some stuff around and fixed the api (I'm stupid) 2022-12-27 16:25:33 +00:00
Stefano Assenzo
acbce1bd1a Delete inutil file 2022-12-24 17:19:49 +00:00
Stefano Assenzo
0cd208930b Now the API is ready and everything works correctly 2022-12-24 16:38:40 +00:00
Stefano Assenzo
a0c2b9382e Change name variable 2022-12-23 16:00:07 +00:00
Stefano Assenzo
40ec324e02 So now i generate automaticaly the time school 2022-12-23 15:57:48 +00:00
Stefano Assenzo
d1908c3fa7 Upload all new files 2022-12-05 15:13:40 +00:00
Stefano Assenzo
9ff56a5acb Delete inutil files 2022-12-05 15:11:04 +00:00
33 changed files with 4443 additions and 299 deletions

25
.env.example Normal file
View File

@@ -0,0 +1,25 @@
# Databse (MongoDB)
PASSWORD_MONGODB = ""
URL_MONGODB = ""
# Email
IMAP_SERVER = ""
SMTP_PORT = ""
EMAIL = ""
PWD_EMAIL = ""
EMAIL_SCHOOL = ""
DOWNLOAD_FOLDER = ""
# Nuvola
USERNAME_NUVOLA = ""
PASSWORD_NUVOLA = ""
# Discord
DISCORD_TOKEN = ""
GENERAL_ID = ""
# Whatsapp
SID = ""
AUTHTOKEN = ""
PHONE_NUMBER_BOT = ""
PHONE_NUMBER_PERSONAL = ""

10
.gitignore vendored Normal file
View File

@@ -0,0 +1,10 @@
test.xlsx
.env
geckodriver.log
all.log
__pycache__
test.py
school_time.xlsx
venv
screenshot.png
Dockerfile

141
app.py Normal file
View File

@@ -0,0 +1,141 @@
from flask import Flask, render_template, url_for, request, redirect, session
from pymongo import MongoClient
from dotenv import load_dotenv
import logging
import urllib
import bcrypt
import sys
import os
load_dotenv()
logging.basicConfig(
level=logging.INFO,
format="%(asctime)s [%(levelname)s] %(message)s",
handlers=[
logging.FileHandler("src/log/all.log"),
logging.StreamHandler(sys.stdout)
]
)
app = Flask(__name__)
app.secret_key = "testing"
PASSWORD_MONGODB = os.getenv('PASSWORD_MONGODB') #Password for MongoDB
URL_MONGODB = os.getenv('URL_MONGODB') #URL for MongoDB
client = MongoClient("mongodb+srv://elci:" + urllib.parse.quote_plus(PASSWORD_MONGODB) + URL_MONGODB) #Connect to MongoDB
database = client["website-class"] #Database name
collection = database["school-time-table"] #Collection school time table current
@app.route('/')
def homepage():
logging.info("A user went up: Homepage")
dict = list(collection.find({}, {"_id": 0, "School Subject": 1}))
return render_template('homepage.html', data=dict)
#imageList = os.listdir('static/images')
#imageList = ['images/' + image for image in imageList]
#return render_template('go.html', imageList=imageList)
@app.route('/orario')
def orario():
logging.info("A user went up: Orario")
# Take all data from mongodb
dict = list(collection.find({}, {"_id": 0, "School Subject": 1}))
number = str(range(0,7))
day = str(["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"])
return render_template('orario/orario.html', data=dict, number=number, day=day)
# #connect to your Mongo DB database
def MongoDB():
client = MongoClient("mongodb+srv://elci:" + urllib.parse.quote_plus(PASSWORD_MONGODB) + URL_MONGODB)
db = client.get_database('website-class')
records = db.users
return records
records = MongoDB()
#assign URLs to have a particular route
@app.route("/register", methods=['post', 'get'])
def register():
message = ''
#if method post in index
if "email" in session:
return redirect(url_for("logged_in"))
if request.method == "POST":
user = request.form.get("fullname")
email = request.form.get("email")
password1 = request.form.get("password1")
password2 = request.form.get("password2")
#if found in database showcase that it's found
user_found = records.find_one({"name": user})
email_found = records.find_one({"email": email})
if user_found:
message = 'There already is a user by that name'
return render_template('index.html', message=message)
if email_found:
message = 'This email already exists in database'
return render_template('index.html', message=message)
if password1 != password2:
message = 'Passwords should match!'
return render_template('index.html', message=message)
else:
#hash the password and encode it
hashed = bcrypt.hashpw(password2.encode('utf-8'), bcrypt.gensalt())
#assing them in a dictionary in key value pairs
user_input = {'name': user, 'email': email, 'password': hashed}
#insert it in the record collection
records.insert_one(user_input)
#find the new created account and its email
user_data = records.find_one({"email": email})
new_email = user_data['email']
#if registered redirect to logged in as the registered user
return render_template('logged_in/logged_in.html', email=new_email)
return render_template('index.html')
@app.route("/login", methods=["POST", "GET"])
def login():
message = 'Please login to your account'
if "email" in session:
return redirect(url_for("logged_in"))
if request.method == "POST":
email = request.form.get("email")
password = request.form.get("password")
#check if email exists in database
email_found = records.find_one({"email": email})
if email_found:
email_val = email_found['email']
passwordcheck = email_found['password']
#encode the password and check if it matches
if bcrypt.checkpw(password.encode('utf-8'), passwordcheck):
session["email"] = email_val
return redirect(url_for('logged_in'))
else:
if "email" in session:
return redirect(url_for("logged_in"))
message = 'Wrong password'
return render_template('login/login.html', message=message)
else:
message = 'Email not found'
return render_template('login/login.html', message=message)
return render_template('login/login.html', message=message)
@app.route('/logged_in')
def logged_in():
if "email" in session:
email = session["email"]
return render_template('logged_in/logged_in.html', email=email)
else:
return redirect(url_for("login"))
@app.route("/logout", methods=["POST", "GET"])
def logout():
if "email" in session:
session.pop("email", None)
return render_template("signout/signout.html")
else:
return render_template('index.html')
if __name__ == '__main__':
logging.info("Web server started!")
app.run(port=4999, debug=True)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 KiB

View File

@@ -1,53 +0,0 @@
<!DOCTYPE html>
<head>
<!-- Animazione pulsanti -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.5.2/animate.min.css">
<!-- File css -->
<link rel="stylesheet" href="style.css" type="text/css" media="all" />
<!-- Per rendere la pagina responsive -->
<meta name="viewport" content="width=device-width" >
<!-- Icona nella barra del browser / Favicon -->
<link rel="apple-touch-icon" sizes="57x57" href="logo.png">
</head>
<body>
<header>
<!-- Titolo nella barra del browser -->
<title>2 Elci - Homepage</title>
<!-- Titolo centrale del sito -->
<center>
<div align=center><h1>2 Elettrici | Engim Veneto SFP Turazza</h1></div>
<div align='center' style='padding:4px;'></div>
</center>
<!-- Immagine orario classe -->
<span style="border:2px; padding:4px; width:150px"><a href='/pages/orario'>ORARIO</a></span>
<span style="padding:4px; width:150px"><a href='/pages/calendario'>CALENDARIO</a></span>
</div>
<!-- Numerosi spazi -->
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</body>

View File

@@ -1,48 +0,0 @@
<!DOCTYPE html>
<head>
<!-- Per rendere la pagina responsive -->
<meta name="viewport" content="width=device-width">
<!-- Animazione pulsanti -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.5.2/animate.min.css">
<!-- File css -->
<link rel="stylesheet" href="/style.css" type="text/css" media="all" />
<!-- Icona nella barra del browser / Favicon -->
<link rel="apple-touch-icon" sizes="57x57" href="/Favicon/apple-icon-57x57.png">
<body>
<!-- Titolo nella barra del browser -->
<title>2 Elci - Calendario</title>
<!-- Pulsante per tornare alla home -->
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<center><a href="/index.html">Home</a></center>
<!-- Vari spazi-->
<!-- Calendario Google -->
<center><iframe src="https://calendar.google.com/calendar/embed?height=600&amp;wkst=2&amp;bgcolor=%23ffffff&amp;ctz=Europe%2FRome&amp;showTitle=0&amp;showNav=1&amp;showDate=1&amp;showPrint=0&amp;showTabs=0&amp;showCalendars=1&amp;showTz=0&amp;src=NnZ2ZWljN2ZuaGRkdjNyY2JnNTIycTJzc3NAZ3JvdXAuY2FsZW5kYXIuZ29vZ2xlLmNvbQ&amp;color=%23F09300" style="border-width:0" width="1000" height="600" frameborder="0" scrolling="no"></iframe></center>
</body>
</head>

View File

@@ -1,62 +0,0 @@
<!DOCTYPE html>
<head>
<!-- Per rendere la pagina responsive -->
<meta name="viewport" content="width=device-width">
<!-- Animazione pulsanti -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.5.2/animate.min.css">
<!-- File css -->
<link rel="stylesheet" href="/style.css" type="text/css" media="all" />
<!-- Icona nella barra del browser / Favicon -->
<link rel="apple-touch-icon" sizes="57x57" href="/assets/image/logo.png">
</head>
<body>
<!-- Titolo nella barra del browser -->
<title>2 Elci - Orario</title>
<!-- Pulsante per tornare alla home + Vari spazi-->
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<center><a href="/index.html">Home</a></center>
<br>
<br>
<!-- Immagine orario -->
<center><img class="orarioscuola" src="/assets/image/orario4.png"></center>
<center>
<a href="/assets/image/orario4.png" download="Orario scuola">Scarica l'orario</a>
</center>
</div>
</body>
</html>
</body>

9
requirements.txt Normal file
View File

@@ -0,0 +1,9 @@
pymongo==4.3.3
python-dotenv==0.21.0
selenium==4.7.2
imbox==0.9.8
openpyxl==3.0.10
python-dotenv==0.21.0
Flask==2.2.2
requests==2.28.1
python_bcrypt==0.3.2

View File

@@ -0,0 +1,14 @@
from discord import Option
import discord
bot = discord.Bot()
@bot.slash_command()
@discord.default_permissions(ban_members = True, administrator = True)
async def ban_user(bot, ctx, member: Option(discord.Member, description="Select a member", required=True), reason: Option(str, description="Reason", required=True)):
try:
await member.ban(reason=reason)
await ctx.respond(f'{member.mention} has been banned!')
except:
await ctx.respond(f'{member.mention} has not been banned!')

View File

@@ -0,0 +1,11 @@
import discord
from discord.ext import commands
bot = discord.Bot()
@bot.slash_command()
@commands.has_permissions(manage_messages=True)
@commands.cooldown(1, 5, commands.BucketType.user)
async def clear_messages(ctx, amount : int):
await ctx.channel.purge(limit=amount+1)
await ctx.respond('Messages have been cleared!')

View File

@@ -0,0 +1,11 @@
import discord
bot = discord.Bot()
@bot.slash_command()
@discord.default_permissions(kick_members = True, administrator = True)
async def kick_user(bot, ctx, member : discord.Member, *, reason=None):
try:
await member.kick(reason=reason)
await ctx.respond(f'{member.mention} has been kicked!')
except:
await ctx.respond(f'{member.mention} has not been kicked!')

View File

@@ -0,0 +1,144 @@
from commands.moderation import ban, kick, clear_msg
from discord.commands.context import ApplicationContext # Discord
from selenium.webdriver.firefox.options import Options # Selenium
from discord.commands import Option # Discord
from discord.ext import commands
from bson.objectid import ObjectId # MongoDB
from selenium import webdriver # Selenium
from dotenv import load_dotenv
from selenium import webdriver # Selenium
from discord.ext import tasks # Discord
import urllib.parse # MongoDB
import datetime # Date
import discord # Discord
import pymongo # MongoDB
import time # Time
import os # OS
# .env
load_dotenv() # Load .env file
DISCORD_TOKEN = os.getenv('DISCORD_TOKEN') # Discord token
GENERAL_ID = os.getenv('GENERAL_ID') # Channel ID
PASSWORD_MONGODB = os.getenv('PASSWORD_MONGODB') # Password for MongoDB
URL_MONGODB = os.getenv('URL_MONGODB') # URL for MongoDB
# MongoDB
mongo_url = "mongodb+srv://elci:" + urllib.parse.quote_plus(PASSWORD_MONGODB) + URL_MONGODB # URL for MongoDB (with password)
client = pymongo.MongoClient(mongo_url) # Connect to MongoDB
database = client["website-class"] # Database name
collection = database["school-time-table"] # Collection school time table current
collection_email = database["email"] # Collection email
#Date
current_time = datetime.datetime.now() # Current time
day = str(current_time.day) # Day
month = str(current_time.month) # Month
year = str(current_time.year) # Year
hour = str(current_time.hour) # Hour
minute = str(current_time.minute) # Minute
long_date = day + "-" + month + "-" + year + " " + hour + ":" + minute # Long date with day, month, year, hour and minute
bot = discord.Bot()
@bot.event
async def on_ready():
print('We have logged in as {0.user}'.format(bot))
bot.loop.create_task(orario())
# Search on MongoDB the subject and send a message on Discord if the subject is found
@tasks.loop(seconds=1)
async def orario():
documents = collection.find()
send_screenshot = 0
# Iterate through the documents
for document in documents:
for day in document['School Subject']:
for i, subject in enumerate(document['School Subject'][day]):
if subject['Subject'] == "CALF1 LINGUA ITALIANA":
# Send a message on channel #general with the subject found and the index of the subject
options = Options() # Set options
options.add_argument("--headless") # Headless mode (so you don't see the browser)
options.add_argument('--disable-gpu') # Disable GPU
if send_screenshot == 0:
driver = webdriver.Firefox(options=options)
driver.get('http://127.0.0.1:4999/orario')
time.sleep(5)
driver.get_screenshot_as_file("screenshot.png")
driver.quit()
channel = bot.get_channel(GENERAL_ID)
await channel.send(file=discord.File("screenshot.png"))
os.remove("screenshot.png")
send_screenshot += 1
else:
pass
channel = bot.get_channel(GENERAL_ID)
await channel.send(f"Day: {day}, Hour school: {i}, Subject found: {subject['Subject']} at index: {i}")
send_screenshot = 0
@bot.slash_command(name='change_school_time', description='Change school time')
async def change_school_time(
ctx : ApplicationContext,
day: Option(str,
"Select a day",
choices=["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
required=True,
),
hour_school: Option(str,
"Select hour school",
choices=["First hour", "Second hour", "Third hour", "Fourth hour", "Fifth hour", "Sixth hour", "Seventh hour", "Eighth hour", "Ninth hour"],
required=True,
), text: str
):
await ctx.respond(f"Day selected: {day}, Hour school selected: {hour_school}, Text: {text}")
# Update the subject on MongoDB
if hour_school == "First hour":
hour_school = "0"
elif hour_school == "Second hour":
hour_school = "1"
elif hour_school == "Third hour":
hour_school = "2"
elif hour_school == "Fourth hour":
hour_school = "3"
elif hour_school == "Fifth hour":
hour_school = "4"
elif hour_school == "Sixth hour":
hour_school = "5"
elif hour_school == "Seventh hour":
hour_school = "6"
elif hour_school == "Eighth hour":
hour_school = "7"
elif hour_school == "Ninth hour":
hour_school = "8"
find_document = list(collection.find({}, {"Date": long_date}))
array_document = find_document[0]["_id"]
collection.update_one(
{"_id": ObjectId(array_document)},
{"$set": {f"School Subject.{day}.{int(hour_school)}.Subject": text}}
)
@bot.slash_command(name='confirm', description='Confirm change school time')
async def confirm(ctx : ApplicationContext):
await ctx.respond(f"Confirm")
collection_email.update_one({}, {"$set": {"Send on Whatsapp": "yes"}})
#@bot.slash_command()
#@discord.default_permissions(ban_members = True, administrator = True)
#async def ban(ctx, member: Option(discord.Member, description="Select a member", required=True), reason: Option(str, description="Reason", required=True)):
# ban.ban_user(bot, ctx, member, reason)
#
#@bot.slash_command()
#@discord.default_permissions(kick_members = True, administrator = True)
#async def kick(ctx, member: Option(discord.Member, description="Select a member", required=True), reason: Option(str, description="Reason", required=True)):
# kick.kick_user(bot, ctx, member, reason)
#
#@bot.slash_command(name= 'clear', description= 'Clears messages from a channel')
#@commands.has_permissions(manage_messages=True, administrator=True)
#@commands.cooldown(1, 5, commands.BucketType.user)
#async def clear(ctx, messages: Option(int, description="Amount of messages to delete", required=True)):
# clear_msg.clear_messages(ctx, amount = messages)
bot.run(DISCORD_TOKEN)

96
src/bot/telegram/main.py Normal file
View File

@@ -0,0 +1,96 @@
from bson.objectid import ObjectId
from dotenv import load_dotenv
from telebot import telebot
import threading
import datetime
import schedule
import pymongo
import urllib
import os
load_dotenv()
PASSWORD_MONGODB = os.getenv('PASSWORD_MONGODB') #Password for MongoDB
URL_MONGODB = os.getenv('URL_MONGODB') #URL for MongoDB
mongo_url = "mongodb+srv://elci:" + urllib.parse.quote_plus(PASSWORD_MONGODB) + URL_MONGODB #URL for MongoDB (with password)
client = pymongo.MongoClient(mongo_url) #Connect to MongoDB
database = client["website-class"] #Database name
collection = database["subscribe"] #Collection school time table current
collection_schooltime = database["school-time-table"] #Collection school time table current
API_TOKEN = os.getenv('TELEGRAM_TOKEN')
bot = telebot.TeleBot(API_TOKEN)
@bot.message_handler(commands=['start'])
def send_welcome(message):
bot.send_message(message.chat.id, "Hello, I'm a bot")
@bot.message_handler(commands=['subscribe'])
def subscribe(message):
take_id = message.from_user.id #Get user id
#Insert the id of the user who writes /subscribe in the database
find_document_username = list(collection.find({}, {"_id": 1}))
array_username = find_document_username[0]["_id"]
collection.update_one(
{ "_id": ObjectId(array_username)},
{
"$push": { "username": take_id }
}
)
bot.send_message(message.chat.id, "You are subscribed")
def send_notification():
today = datetime.datetime.today().strftime('%A')
tomorrow = (datetime.datetime.today() + datetime.timedelta(days=1)).strftime('%A')
now = datetime.datetime.now()
if today == "Saturday" or today == "Sunday":
print("Today is weekend")
else:
# Alla prima ora (7.50) manda una notifica a tutti gli utenti che hanno scritto /subscribe della materia della prima ora e così via
find_document = list(collection_schooltime.find({}, {"_id": 0, "School Subject": 1}))
collection_find_username = list(collection.find({}, {"username": 1,})) #Find all username in collection
array_username = collection_find_username[0]["username"] #Array with all username
#gaga = find_document['School Subject'][today][0]['Subject']
print(now.strftime("%H:%M"))
if now.strftime("%H:%M") == "07:50":
for i in find_document:
for b in array_username:
bot.send_message(b, str(i['School Subject'][today][0]['Room']) + ", " + i['School Subject'][today][0]['Teacher'] + ", " + i['School Subject'][today][0]['Subject'] + "\n" + "Successiva: " + str(i['School Subject'][today][1]['Room']) + ", " + i['School Subject'][today][1]['Teacher'] + ", " + i['School Subject'][today][1]['Subject'])
elif now.strftime("%H:%M") == "08:50":
for i in find_document:
for b in array_username:
bot.send_message(b, str(i['School Subject'][today][1]['Room']) + ", " + i['School Subject'][today][1]['Teacher'] + ", " + str(i['School Subject'][today][1]['Subject']) + "\n" + "Successiva: " + str(i['School Subject'][today][2]['Room']) + ", " + i['School Subject'][today][2]['Teacher'] + ", " + i['School Subject'][today][2]['Subject'])
elif now.strftime("%H:%M") == "09:50":
for i in find_document:
for b in array_username:
bot.send_message(b, str(i['School Subject'][today][2]['Room']) + ", " + i['School Subject'][today][2]['Teacher'] + ", " + str(i['School Subject'][today][2]['Subject']) + "\n" + "Successiva: " + str(i['School Subject'][today][3]['Room']) + ", " + i['School Subject'][today][3]['Teacher'] + ", " + i['School Subject'][today][3]['Subject'])
elif now.strftime("%H:%M") == "11:05":
for i in find_document:
for b in array_username:
bot.send_message(b, str(i['School Subject'][today][3]['Room']) + ", " + i['School Subject'][today][3]['Teacher'] + ", " + str(i['School Subject'][today][3]['Subject']) + "\n" + "Successiva: " + str(i['School Subject'][today][4]['Room']) + ", " + i['School Subject'][today][4]['Teacher'] + ", " + i['School Subject'][today][4]['Subject'])
elif now.strftime("%H:%M") == "12:05":
for i in find_document:
for b in array_username:
bot.send_message(b, str(i['School Subject'][today][4]['Room']) + ", " + i['School Subject'][today][4]['Teacher'] + ", " + str(i['School Subject'][today][4]['Subject']) + "\n" + "Successiva: " + str(i['School Subject'][today][5]['Room']) + ", " + i['School Subject'][today][5]['Teacher'] + ", " + i['School Subject'][today][5]['Subject'])
elif now.strftime("%H:%M") == "13:05":
for i in find_document:
for b in array_username:
bot.send_message(b, str(i['School Subject'][today][5]['Room']) + ", " + i['School Subject'][today][5]['Teacher'] + ", " + str(i['School Subject'][today][5]['Subject']))
elif now.strftime("%H:%M") == "21:00":
if tomorrow == "Sunday" or tomorrow == "Saturday":
print("Nope")
else:
for i in find_document:
for b in array_username:
bot.send_message(b, i['School Subject'][tomorrow][0]['Subject'] + ", " + i['School Subject'][tomorrow][0]['Teacher'] + "\n" + i['School Subject'][tomorrow][1]['Subject'] + ", " + i['School Subject'][tomorrow][1]['Teacher'] + "\n" + i['School Subject'][tomorrow][2]['Subject'] + ", " + i['School Subject'][tomorrow][2]['Teacher'] + "\n" + i['School Subject'][tomorrow][3]['Subject'] + ", " + i['School Subject'][tomorrow][3]['Teacher'] + "\n" + i['School Subject'][tomorrow][4]['Subject'] + ", " + i['School Subject'][tomorrow][4]['Teacher'] + "\n" + i['School Subject'][tomorrow][5]['Subject'] + ", " + i['School Subject'][tomorrow][5]['Teacher'])
schedule.every().day.at("07:50").do(send_notification)
schedule.every().day.at("08:50").do(send_notification)
schedule.every().day.at("09:50").do(send_notification)
schedule.every().day.at("11:05").do(send_notification)
schedule.every().day.at("12:05").do(send_notification)
schedule.every().day.at("13:05").do(send_notification)
schedule.every().day.at("21:00").do(send_notification)
now = datetime.datetime.now()
t1 = threading.Thread(target=bot.polling).start()
while True:
schedule.run_pending()

View File

@@ -0,0 +1,12 @@
pymongo==4.3.3
urllib3==1.26.13
python-dotenv==0.21.0
schedule==1.1.0
telebot==0.0.5
pybson==0.5.9
pybson==0.5.9
python-dotenv==0.21.0
telebot==0.0.5
schedule==1.1.0
pymongo==4.3.3
urllib3==1.26.13

View File

@@ -0,0 +1,62 @@
# Import file for check homework
from day_one import day_one
# Libraries for open and use Firefox
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.firefox.options import Options
from selenium.webdriver.common.by import By
from selenium import webdriver
# Libraries for MongoDB and .env file
from dotenv import load_dotenv
import urllib.parse
import datetime
import pymongo
import time
import os
#Load .env file
load_dotenv() #Load .env file
USERNAME = os.getenv('USERNAME_NUVOLA') #Username for Nuvola
PASSWORD = os.getenv('PASSWORD_NUVOLA') #Password for Nuvola
PASSWORD_MONGODB = os.getenv('PASSWORD_MONGODB') #Password for MongoDB
URL_MONGODB = os.getenv('URL_MONGODB') #URL for MongoDB
mongo_url = "mongodb+srv://elci:" + urllib.parse.quote_plus(PASSWORD_MONGODB) + URL_MONGODB #URL for MongoDB (with password)
client = pymongo.MongoClient(mongo_url) #Connect to MongoDB
database = client["website-class"] #Database name
collection = database["homework"] #Collection school time table current
# Options for Firefox
options = Options() # Set options
options.add_argument("--headless") # Headless mode (so you don't see the browser)
options.add_argument('--disable-gpu') # Disable GPU
def start_search():
#time.sleep(7200)
global driver
driver = webdriver.Firefox(options=options) # Open Firefox and set options
driver.get("https://nuvola.madisoft.it/login") # Open Nuvola website
username = WebDriverWait(driver, 100).until(EC.element_to_be_clickable((By.ID, "username"))) # Wait for the username input
password = WebDriverWait(driver, 100).until(EC.element_to_be_clickable((By.ID, "password"))) # Wait for the password input
username.click()
username.clear()
username.send_keys(USERNAME) # Insert username
password.click()
password.clear()
password.send_keys(PASSWORD) # Insert password
WebDriverWait(driver, 50).until(EC.element_to_be_clickable((By.XPATH, "/html/body/div[1]/div[2]/div/div[2]/form/button"))).click() # Click on login button
# Section Homework
WebDriverWait(driver, 250).until(EC.element_to_be_clickable((By.XPATH, "/html/body/div/div/div[1]/nav/div/div/a[6]"))).click() # Click on homework button
homework_check()
def homework_check():
day_one.giorno_uno(driver, collection)
driver.close()
print("Finish")
start_search()
start_search()

View File

@@ -0,0 +1,304 @@
# Libraries for open and use Firefox
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.common.by import By
def giorno_cinque(driver, collection):
#Giorno cinque
try:
date = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div/div[1]/div[1]/div[1]/button[1]"))).text) # Date
split_date = date.split() # Split date
description = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/p"))).text) # Homework 1 or no homework
mydict = {
"subjects": [
{
"name": "No school subject",
"homework": [
{
"date": {
"long date": date,
"day": split_date[0],
"month": split_date[1],
"year": split_date[2],
},
"description": description,
}
]
}
]
},
if collection.find({},{ "_id": 0, "long_date": date ,"name": "No school subject", "description": description }):
print("Homework already in database")
else:
x = collection.insert_many(mydict) # Insert data in MongoDB
school_subject = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li/h2"))).text) # School subject 1
new_school_subject = {"$set": {"name": school_subject}} # Update school subject
collection.update_one(mydict, new_school_subject) # Update school subject
try:
school_subject_1 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[1]/div/ul/li/p"))).text) # School subject 1
description_1 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[1]/div/ul/li/p"))).text) # Homework 1
mydict1 = {
"subjects": [
{
"name": school_subject_1,
"homework": [
{
"date": {
"long date": date,
"day": split_date[0],
"month": split_date[1],
"year": split_date[2],
},
"description": description_1,
}
]
}
]
},
if collection.find({},{ "_id": 0, "long_date": date ,"name": school_subject_1, "description": description_1 }):
print("Homework already in database")
else:
x = collection.insert_many(mydict1) # Insert data in MongoDB
school_subject_2 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[2]/h2"))).text) # School subject 2
description_2 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[2]/div/ul/li/p"))).text) # Homework 2
mydict2 = {
"subjects": [
{
"name": school_subject_2,
"homework": [
{
"date": {
"long date": date,
"day": split_date[0],
"month": split_date[1],
"year": split_date[2],
},
"description": description_2,
}
]
}
]
},
if collection.find({},{ "_id": 0, "long_date": date ,"name": school_subject_2, "description": description_2 }):
print("Homework already in database")
else:
x = collection.insert_many(mydict2) # Insert data in MongoDB
school_subject_3 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[3]/h2"))).text) # School subject 3
description_3 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[3]/div/ul/li/p"))).text) # Homework 3
mydict3 = {
"subjects": [
{
"name": school_subject_3,
"homework": [
{
"date": {
"long date": date,
"day": split_date[0],
"month": split_date[1],
"year": split_date[2],
},
"description": description_3,
}
]
}
]
},
if collection.find({},{ "_id": 0, "long_date": date ,"name": school_subject_3, "description": description_3 }):
print("Homework already in database")
else:
x = collection.insert_many(mydict3) # Insert data in MongoDB
school_subject_4 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[4]/h2"))).text) # School subject 4
description_4 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[4]/div/ul/li/p"))).text) # Homework 4
mydict4 = {
"subjects": [
{
"name": school_subject_4,
"homework": [
{
"date": {
"long date": date,
"day": split_date[0],
"month": split_date[1],
"year": split_date[2],
},
"description": description_4,
}
]
}
]
},
if collection.find({},{ "_id": 0, "long_date": date ,"name": school_subject_4, "description": description_4 }):
print("Homework already in database")
else:
x = collection.insert_many(mydict4) # Insert data in MongoDB
school_subject_5 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[5]/h2"))).text) # School subject 5
description_5 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[5]/div/ul/li/p"))).text) # Homework 5
mydict5 = {
"subjects": [
{
"name": school_subject_5,
"homework": [
{
"date": {
"long date": date,
"day": split_date[0],
"month": split_date[1],
"year": split_date[2],
},
"description": description_5,
}
]
}
]
},
if collection.find({},{ "_id": 0, "long_date": date ,"name": school_subject_5, "description": description_5 }):
print("Homework already in database")
else:
x = collection.insert_many(mydict5) # Insert data in MongoDB
except TimeoutException:
WebDriverWait(driver, 250).until(EC.element_to_be_clickable((By.XPATH, "/html/body/div/div/main/div/div/div[1]/div[1]/div[1]/button[3]"))).click() # Click on next day button
except TimeoutException:
try:
school_subject_1 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[1]/h2"))).text) # School subject 1
description_1 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[1]/div/ul/li/p"))).text) # Homework 1
mydict6 = {
"subjects": [
{
"name": school_subject_1,
"homework": [
{
"date": {
"long date": date,
"day": split_date[0],
"month": split_date[1],
"year": split_date[2],
},
"description": description_1,
}
]
}
]
},
if collection.find({},{ "_id": 0, "long_date": date ,"name": school_subject_1, "description": description_1 }):
print("Homework already in database")
else:
x = collection.insert_many(mydict6) # Insert data in MongoDB
school_subject_2 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[2]/h2"))).text) # School subject 2
description_2 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[2]/div/ul/li/p"))).text) # Homework 2
mydict7 = {
"subjects": [
{
"name": school_subject_2,
"homework": [
{
"date": {
"long date": date,
"day": split_date[0],
"month": split_date[1],
"year": split_date[2],
},
"description": description_2,
}
]
}
]
},
if collection.find({},{ "_id": 0, "long_date": date ,"name": school_subject_2, "description": description_2 }):
print("Homework already in database")
else:
x = collection.insert_many(mydict7) # Insert data in MongoDB
school_subject_3 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[3]/h2"))).text) # School subject 3
description_3 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[3]/div/ul/li/p"))).text) # Homework 3
mydict8 = {
"subjects": [
{
"name": school_subject_3,
"homework": [
{
"date": {
"long date": date,
"day": split_date[0],
"month": split_date[1],
"year": split_date[2],
},
"description": description_3,
}
]
}
]
},
if collection.find({},{ "_id": 0, "long_date": date ,"name": school_subject_3, "description": description_3 }):
print("Homework already in database")
else:
x = collection.insert_many(mydict8) # Insert data in MongoDB
school_subject_4 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[4]/h2"))).text) # School subject 4
description_4 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[4]/div/ul/li/p"))).text) # Homework 4
mydict9 = {
"subjects": [
{
"name": school_subject_4,
"homework": [
{
"date": {
"long date": date,
"day": split_date[0],
"month": split_date[1],
"year": split_date[2],
},
"description": description_4,
}
]
}
]
},
if collection.find({},{ "_id": 0, "long_date": date ,"name": school_subject_4, "description": description_4 }):
print("Homework already in database")
else:
x = collection.insert_many(mydict9) # Insert data in MongoDB
school_subject_5 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[5]/h2"))).text) # School subject 5
description_5 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[5]/div/ul/li/p"))).text) # Homework 5
mydict10 = {
"subjects": [
{
"name": school_subject_5,
"homework": [
{
"date": {
"long date": date,
"day": split_date[0],
"month": split_date[1],
"year": split_date[2],
},
"description": description_5,
}
]
}
]
},
if collection.find({},{ "_id": 0, "long_date": date ,"name": school_subject_5, "description": description_5 }):
print("Homework already in database")
else:
x = collection.insert_many(mydict10) # Insert data in MongoDB
except TimeoutException:
WebDriverWait(driver, 250).until(EC.element_to_be_clickable((By.XPATH, "/html/body/div/div/main/div/div/div[1]/div[1]/div[1]/button[3]"))).click() # Click on next day button

View File

@@ -0,0 +1,308 @@
from day_five import day_five
# Libraries for open and use Firefox
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.common.by import By
def giorno_quattro(driver, collection):
#Giorno quattro
try:
date = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div/div[1]/div[1]/div[1]/button[1]"))).text) # Date
split_date = date.split() # Split date
description = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/p"))).text) # Homework 1 or no homework
mydict = {
"subjects": [
{
"name": "No school subject",
"homework": [
{
"date": {
"long date": date,
"day": split_date[0],
"month": split_date[1],
"year": split_date[2],
},
"description": description,
}
]
}
]
},
if collection.find({},{ "_id": 0, "long_date": date ,"name": "No school subject", "description": description }):
print("Homework already in database")
else:
x = collection.insert_many(mydict) # Insert data in MongoDB
school_subject = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li/h2"))).text) # School subject 1
new_school_subject = {"$set": {"name": school_subject}} # Update school subject
collection.update_one(mydict, new_school_subject) # Update school subject
try:
school_subject_1 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[1]/div/ul/li/p"))).text) # School subject 1
description_1 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[1]/div/ul/li/p"))).text) # Homework 1
mydict1 = {
"subjects": [
{
"name": school_subject_1,
"homework": [
{
"date": {
"long date": date,
"day": split_date[0],
"month": split_date[1],
"year": split_date[2],
},
"description": description_1,
}
]
}
]
},
if collection.find({},{ "_id": 0, "long_date": date ,"name": school_subject_1, "description": description_1 }):
print("Homework already in database")
else:
x = collection.insert_many(mydict1) # Insert data in MongoDB
school_subject_2 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[2]/h2"))).text) # School subject 2
description_2 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[2]/div/ul/li/p"))).text) # Homework 2
mydict2 = {
"subjects": [
{
"name": school_subject_2,
"homework": [
{
"date": {
"long date": date,
"day": split_date[0],
"month": split_date[1],
"year": split_date[2],
},
"description": description_2,
}
]
}
]
},
if collection.find({},{ "_id": 0, "long_date": date ,"name": school_subject_2, "description": description_2 }):
print("Homework already in database")
else:
x = collection.insert_many(mydict2) # Insert data in MongoDB
school_subject_3 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[3]/h2"))).text) # School subject 3
description_3 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[3]/div/ul/li/p"))).text) # Homework 3
mydict3 = {
"subjects": [
{
"name": school_subject_3,
"homework": [
{
"date": {
"long date": date,
"day": split_date[0],
"month": split_date[1],
"year": split_date[2],
},
"description": description_3,
}
]
}
]
},
if collection.find({},{ "_id": 0, "long_date": date ,"name": school_subject_3, "description": description_3 }):
print("Homework already in database")
else:
x = collection.insert_many(mydict3) # Insert data in MongoDB
school_subject_4 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[4]/h2"))).text) # School subject 4
description_4 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[4]/div/ul/li/p"))).text) # Homework 4
mydict4 = {
"subjects": [
{
"name": school_subject_4,
"homework": [
{
"date": {
"long date": date,
"day": split_date[0],
"month": split_date[1],
"year": split_date[2],
},
"description": description_4,
}
]
}
]
},
if collection.find({},{ "_id": 0, "long_date": date ,"name": school_subject_4, "description": description_4 }):
print("Homework already in database")
else:
x = collection.insert_many(mydict4) # Insert data in MongoDB
school_subject_5 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[5]/h2"))).text) # School subject 5
description_5 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[5]/div/ul/li/p"))).text) # Homework 5
mydict5 = {
"subjects": [
{
"name": school_subject_5,
"homework": [
{
"date": {
"long date": date,
"day": split_date[0],
"month": split_date[1],
"year": split_date[2],
},
"description": description_5,
}
]
}
]
},
if collection.find({},{ "_id": 0, "long_date": date ,"name": school_subject_5, "description": description_5 }):
print("Homework already in database")
else:
x = collection.insert_many(mydict5) # Insert data in MongoDB
except TimeoutException:
WebDriverWait(driver, 250).until(EC.element_to_be_clickable((By.XPATH, "/html/body/div/div/main/div/div/div[1]/div[1]/div[1]/button[3]"))).click() # Click on next day button
day_five.giorno_cinque(driver, collection)
except TimeoutException:
try:
school_subject_1 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[1]/h2"))).text) # School subject 1
description_1 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[1]/div/ul/li/p"))).text) # Homework 1
mydict6 = {
"subjects": [
{
"name": school_subject_1,
"homework": [
{
"date": {
"long date": date,
"day": split_date[0],
"month": split_date[1],
"year": split_date[2],
},
"description": description_1,
}
]
}
]
},
if collection.find({},{ "_id": 0, "long_date": date ,"name": school_subject_1, "description": description_1 }):
print("Homework already in database")
else:
x = collection.insert_many(mydict6) # Insert data in MongoDB
school_subject_2 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[2]/h2"))).text) # School subject 2
description_2 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[2]/div/ul/li/p"))).text) # Homework 2
mydict7 = {
"subjects": [
{
"name": school_subject_2,
"homework": [
{
"date": {
"long date": date,
"day": split_date[0],
"month": split_date[1],
"year": split_date[2],
},
"description": description_2,
}
]
}
]
},
if collection.find({},{ "_id": 0, "long_date": date ,"name": school_subject_2, "description": description_2 }):
print("Homework already in database")
else:
x = collection.insert_many(mydict7) # Insert data in MongoDB
school_subject_3 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[3]/h2"))).text) # School subject 3
description_3 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[3]/div/ul/li/p"))).text) # Homework 3
mydict8 = {
"subjects": [
{
"name": school_subject_3,
"homework": [
{
"date": {
"long date": date,
"day": split_date[0],
"month": split_date[1],
"year": split_date[2],
},
"description": description_3,
}
]
}
]
},
if collection.find({},{ "_id": 0, "long_date": date ,"name": school_subject_3, "description": description_3 }):
print("Homework already in database")
else:
x = collection.insert_many(mydict8) # Insert data in MongoDB
school_subject_4 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[4]/h2"))).text) # School subject 4
description_4 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[4]/div/ul/li/p"))).text) # Homework 4
mydict9 = {
"subjects": [
{
"name": school_subject_4,
"homework": [
{
"date": {
"long date": date,
"day": split_date[0],
"month": split_date[1],
"year": split_date[2],
},
"description": description_4,
}
]
}
]
},
if collection.find({},{ "_id": 0, "long_date": date ,"name": school_subject_4, "description": description_4 }):
print("Homework already in database")
else:
x = collection.insert_many(mydict9) # Insert data in MongoDB
school_subject_5 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[5]/h2"))).text) # School subject 5
description_5 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[5]/div/ul/li/p"))).text) # Homework 5
mydict10 = {
"subjects": [
{
"name": school_subject_5,
"homework": [
{
"date": {
"long date": date,
"day": split_date[0],
"month": split_date[1],
"year": split_date[2],
},
"description": description_5,
}
]
}
]
},
if collection.find({},{ "_id": 0, "long_date": date ,"name": school_subject_5, "description": description_5 }):
print("Homework already in database")
else:
x = collection.insert_many(mydict10) # Insert data in MongoDB
except TimeoutException:
WebDriverWait(driver, 250).until(EC.element_to_be_clickable((By.XPATH, "/html/body/div/div/main/div/div/div[1]/div[1]/div[1]/button[3]"))).click() # Click on next day button
day_five.giorno_cinque(driver, collection)

View File

@@ -0,0 +1,58 @@
from day_two import day_two
# Libraries for open and use Firefox
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.common.by import By
def insert_homework_to_mongo(collection, school_subject, date, description):
# Check if homework already exists in the collection
if collection.find_one({"long_date": date, "name": school_subject, "description": description}):
print("Homework already in database")
else:
# Create dictionary for MongoDB document
mydict = {
"name": school_subject,
"date": {
"long_date": date,
"day": date.split()[0],
"month": date.split()[1],
"year": date.split()[2]
},
"description": description
}
# Insert document into MongoDB
x = collection.insert_one(mydict)
print("Homework inserted into database")
def giorno_uno(driver, collection):
#Giorno uno
try:
date = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div/div[1]/div[1]/div[1]/button[1]"))).text) # Date
split_date = date.split() # Split date
description = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/p"))).text) # Homework 1 or no homework
# Insert homework for "No school subject"
insert_homework_to_mongo(collection, "No school subject", date, description)
# Loop through all school subjects and insert homework for each
school_subjects = driver.find_elements_by_xpath("/html/body/div/div/main/div/div[2]/div/ul/li")
for subject in school_subjects:
school_subject = str(subject.find_element_by_xpath("./h2").text)
homework = subject.find_element_by_xpath("./div/ul/li/p").text
# Insert homework for current school subject
insert_homework_to_mongo(collection, school_subject, date, homework)
try:
# Click on next day button
WebDriverWait(driver, 250).until(EC.element_to_be_clickable((By.XPATH, "/html/body/div/div/main/div/div/div[1]/div[1]/div[1]/button[3]"))).click()
# Call giorno_due() function from day_two.py for next day
day_two.giorno_due(driver, collection)
except TimeoutException:
# No more days to scrape, end function
pass
except:
print("Error")

View File

@@ -0,0 +1,308 @@
from day_four import day_four
# Libraries for open and use Firefox
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.common.by import By
def giorno_tre(driver, collection):
#Giorno tre
try:
date = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div/div[1]/div[1]/div[1]/button[1]"))).text) # Date
split_date = date.split() # Split date
description = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/p"))).text) # Homework 1 or no homework
mydict = {
"subjects": [
{
"name": "No school subject",
"homework": [
{
"date": {
"long date": date,
"day": split_date[0],
"month": split_date[1],
"year": split_date[2],
},
"description": description,
}
]
}
]
},
if collection.find({},{ "_id": 0, "long_date": date ,"name": "No school subject", "description": description }):
print("Homework already in database")
else:
x = collection.insert_many(mydict) # Insert data in MongoDB
school_subject = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li/h2"))).text) # School subject 1
new_school_subject = {"$set": {"name": school_subject}} # Update school subject
collection.update_one(mydict, new_school_subject) # Update school subject
try:
school_subject_1 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[1]/div/ul/li/p"))).text) # School subject 1
description_1 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[1]/div/ul/li/p"))).text) # Homework 1
mydict1 = {
"subjects": [
{
"name": school_subject_1,
"homework": [
{
"date": {
"long date": date,
"day": split_date[0],
"month": split_date[1],
"year": split_date[2],
},
"description": description_1,
}
]
}
]
},
if collection.find({},{ "_id": 0, "long_date": date ,"name": school_subject_1, "description": description_1 }):
print("Homework already in database")
else:
x = collection.insert_many(mydict1) # Insert data in MongoDB
school_subject_2 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[2]/h2"))).text) # School subject 2
description_2 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[2]/div/ul/li/p"))).text) # Homework 2
mydict2 = {
"subjects": [
{
"name": school_subject_2,
"homework": [
{
"date": {
"long date": date,
"day": split_date[0],
"month": split_date[1],
"year": split_date[2],
},
"description": description_2,
}
]
}
]
},
if collection.find({},{ "_id": 0, "long_date": date ,"name": school_subject_2, "description": description_2 }):
print("Homework already in database")
else:
x = collection.insert_many(mydict2) # Insert data in MongoDB
school_subject_3 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[3]/h2"))).text) # School subject 3
description_3 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[3]/div/ul/li/p"))).text) # Homework 3
mydict3 = {
"subjects": [
{
"name": school_subject_3,
"homework": [
{
"date": {
"long date": date,
"day": split_date[0],
"month": split_date[1],
"year": split_date[2],
},
"description": description_3,
}
]
}
]
},
if collection.find({},{ "_id": 0, "long_date": date ,"name": school_subject_3, "description": description_3 }):
print("Homework already in database")
else:
x = collection.insert_many(mydict3) # Insert data in MongoDB
school_subject_4 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[4]/h2"))).text) # School subject 4
description_4 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[4]/div/ul/li/p"))).text) # Homework 4
mydict4 = {
"subjects": [
{
"name": school_subject_4,
"homework": [
{
"date": {
"long date": date,
"day": split_date[0],
"month": split_date[1],
"year": split_date[2],
},
"description": description_4,
}
]
}
]
},
if collection.find({},{ "_id": 0, "long_date": date ,"name": school_subject_4, "description": description_4 }):
print("Homework already in database")
else:
x = collection.insert_many(mydict4) # Insert data in MongoDB
school_subject_5 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[5]/h2"))).text) # School subject 5
description_5 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[5]/div/ul/li/p"))).text) # Homework 5
mydict5 = {
"subjects": [
{
"name": school_subject_5,
"homework": [
{
"date": {
"long date": date,
"day": split_date[0],
"month": split_date[1],
"year": split_date[2],
},
"description": description_5,
}
]
}
]
},
if collection.find({},{ "_id": 0, "long_date": date ,"name": school_subject_5, "description": description_5 }):
print("Homework already in database")
else:
x = collection.insert_many(mydict5) # Insert data in MongoDB
except TimeoutException:
WebDriverWait(driver, 250).until(EC.element_to_be_clickable((By.XPATH, "/html/body/div/div/main/div/div/div[1]/div[1]/div[1]/button[3]"))).click() # Click on next day button
day_four.giorno_quattro(driver, collection)
except TimeoutException:
try:
school_subject_1 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[1]/h2"))).text) # School subject 1
description_1 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[1]/div/ul/li/p"))).text) # Homework 1
mydict6 = {
"subjects": [
{
"name": school_subject_1,
"homework": [
{
"date": {
"long date": date,
"day": split_date[0],
"month": split_date[1],
"year": split_date[2],
},
"description": description_1,
}
]
}
]
},
if collection.find({},{ "_id": 0, "long_date": date ,"name": school_subject_1, "description": description_1 }):
print("Homework already in database")
else:
x = collection.insert_many(mydict6) # Insert data in MongoDB
school_subject_2 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[2]/h2"))).text) # School subject 2
description_2 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[2]/div/ul/li/p"))).text) # Homework 2
mydict7 = {
"subjects": [
{
"name": school_subject_2,
"homework": [
{
"date": {
"long date": date,
"day": split_date[0],
"month": split_date[1],
"year": split_date[2],
},
"description": description_2,
}
]
}
]
},
if collection.find({},{ "_id": 0, "long_date": date ,"name": school_subject_2, "description": description_2 }):
print("Homework already in database")
else:
x = collection.insert_many(mydict7) # Insert data in MongoDB
school_subject_3 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[3]/h2"))).text) # School subject 3
description_3 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[3]/div/ul/li/p"))).text) # Homework 3
mydict8 = {
"subjects": [
{
"name": school_subject_3,
"homework": [
{
"date": {
"long date": date,
"day": split_date[0],
"month": split_date[1],
"year": split_date[2],
},
"description": description_3,
}
]
}
]
},
if collection.find({},{ "_id": 0, "long_date": date ,"name": school_subject_3, "description": description_3 }):
print("Homework already in database")
else:
x = collection.insert_many(mydict8) # Insert data in MongoDB
school_subject_4 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[4]/h2"))).text) # School subject 4
description_4 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[4]/div/ul/li/p"))).text) # Homework 4
mydict9 = {
"subjects": [
{
"name": school_subject_4,
"homework": [
{
"date": {
"long date": date,
"day": split_date[0],
"month": split_date[1],
"year": split_date[2],
},
"description": description_4,
}
]
}
]
},
if collection.find({},{ "_id": 0, "long_date": date ,"name": school_subject_4, "description": description_4 }):
print("Homework already in database")
else:
x = collection.insert_many(mydict9) # Insert data in MongoDB
school_subject_5 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[5]/h2"))).text) # School subject 5
description_5 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[5]/div/ul/li/p"))).text) # Homework 5
mydict10 = {
"subjects": [
{
"name": school_subject_5,
"homework": [
{
"date": {
"long date": date,
"day": split_date[0],
"month": split_date[1],
"year": split_date[2],
},
"description": description_5,
}
]
}
]
},
if collection.find({},{ "_id": 0, "long_date": date ,"name": school_subject_5, "description": description_5 }):
print("Homework already in database")
else:
x = collection.insert_many(mydict10) # Insert data in MongoDB
except TimeoutException:
WebDriverWait(driver, 250).until(EC.element_to_be_clickable((By.XPATH, "/html/body/div/div/main/div/div/div[1]/div[1]/div[1]/button[3]"))).click() # Click on next day button
day_four.giorno_quattro(driver, collection)

View File

@@ -0,0 +1,308 @@
from day_three import day_three
# Libraries for open and use Firefox
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.common.by import By
def giorno_due(driver, collection):
#Giorno due
try:
date = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div/div[1]/div[1]/div[1]/button[1]"))).text) # Date
split_date = date.split() # Split date
description = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/p"))).text) # Homework 1 or no homework
mydict = {
"subjects": [
{
"name": "No school subject",
"homework": [
{
"date": {
"long date": date,
"day": split_date[0],
"month": split_date[1],
"year": split_date[2],
},
"description": description,
}
]
}
]
},
if collection.find({},{ "_id": 0, "long_date": date ,"name": "No school subject", "description": description }):
print("Homework already in database")
else:
x = collection.insert_many(mydict) # Insert data in MongoDB
school_subject = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li/h2"))).text) # School subject 1
new_school_subject = {"$set": {"name": school_subject}} # Update school subject
collection.update_one(mydict, new_school_subject) # Update school subject
try:
school_subject_1 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[1]/div/ul/li/p"))).text) # School subject 1
description_1 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[1]/div/ul/li/p"))).text) # Homework 1
mydict1 = {
"subjects": [
{
"name": school_subject_1,
"homework": [
{
"date": {
"long date": date,
"day": split_date[0],
"month": split_date[1],
"year": split_date[2],
},
"description": description_1,
}
]
}
]
},
if collection.find({},{ "_id": 0, "long_date": date ,"name": school_subject_1, "description": description_1 }):
print("Homework already in database")
else:
x = collection.insert_many(mydict1) # Insert data in MongoDB
school_subject_2 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[2]/h2"))).text) # School subject 2
description_2 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[2]/div/ul/li/p"))).text) # Homework 2
mydict2 = {
"subjects": [
{
"name": school_subject_2,
"homework": [
{
"date": {
"long date": date,
"day": split_date[0],
"month": split_date[1],
"year": split_date[2],
},
"description": description_2,
}
]
}
]
},
if collection.find({},{ "_id": 0, "long_date": date ,"name": school_subject_2, "description": description_2 }):
print("Homework already in database")
else:
x = collection.insert_many(mydict2) # Insert data in MongoDB
school_subject_3 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[3]/h2"))).text) # School subject 3
description_3 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[3]/div/ul/li/p"))).text) # Homework 3
mydict3 = {
"subjects": [
{
"name": school_subject_3,
"homework": [
{
"date": {
"long date": date,
"day": split_date[0],
"month": split_date[1],
"year": split_date[2],
},
"description": description_3,
}
]
}
]
},
if collection.find({},{ "_id": 0, "long_date": date ,"name": school_subject_3, "description": description_3 }):
print("Homework already in database")
else:
x = collection.insert_many(mydict3) # Insert data in MongoDB
school_subject_4 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[4]/h2"))).text) # School subject 4
description_4 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[4]/div/ul/li/p"))).text) # Homework 4
mydict4 = {
"subjects": [
{
"name": school_subject_4,
"homework": [
{
"date": {
"long date": date,
"day": split_date[0],
"month": split_date[1],
"year": split_date[2],
},
"description": description_4,
}
]
}
]
},
if collection.find({},{ "_id": 0, "long_date": date ,"name": school_subject_4, "description": description_4 }):
print("Homework already in database")
else:
x = collection.insert_many(mydict4) # Insert data in MongoDB
school_subject_5 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[5]/h2"))).text) # School subject 5
description_5 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[5]/div/ul/li/p"))).text) # Homework 5
mydict5 = {
"subjects": [
{
"name": school_subject_5,
"homework": [
{
"date": {
"long date": date,
"day": split_date[0],
"month": split_date[1],
"year": split_date[2],
},
"description": description_5,
}
]
}
]
},
if collection.find({},{ "_id": 0, "long_date": date ,"name": school_subject_5, "description": description_5 }):
print("Homework already in database")
else:
x = collection.insert_many(mydict5) # Insert data in MongoDB
except TimeoutException:
WebDriverWait(driver, 250).until(EC.element_to_be_clickable((By.XPATH, "/html/body/div/div/main/div/div/div[1]/div[1]/div[1]/button[3]"))).click() # Click on next day button
day_three.giorno_tre(driver, collection)
except TimeoutException:
try:
school_subject_1 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[1]/h2"))).text) # School subject 1
description_1 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[1]/div/ul/li/p"))).text) # Homework 1
mydict6 = {
"subjects": [
{
"name": school_subject_1,
"homework": [
{
"date": {
"long date": date,
"day": split_date[0],
"month": split_date[1],
"year": split_date[2],
},
"description": description_1,
}
]
}
]
},
if collection.find({},{ "_id": 0, "long_date": date ,"name": school_subject_1, "description": description_1 }):
print("Homework already in database")
else:
x = collection.insert_many(mydict6) # Insert data in MongoDB
school_subject_2 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[2]/h2"))).text) # School subject 2
description_2 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[2]/div/ul/li/p"))).text) # Homework 2
mydict7 = {
"subjects": [
{
"name": school_subject_2,
"homework": [
{
"date": {
"long date": date,
"day": split_date[0],
"month": split_date[1],
"year": split_date[2],
},
"description": description_2,
}
]
}
]
},
if collection.find({},{ "_id": 0, "long_date": date ,"name": school_subject_2, "description": description_2 }):
print("Homework already in database")
else:
x = collection.insert_many(mydict7) # Insert data in MongoDB
school_subject_3 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[3]/h2"))).text) # School subject 3
description_3 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[3]/div/ul/li/p"))).text) # Homework 3
mydict8 = {
"subjects": [
{
"name": school_subject_3,
"homework": [
{
"date": {
"long date": date,
"day": split_date[0],
"month": split_date[1],
"year": split_date[2],
},
"description": description_3,
}
]
}
]
},
if collection.find({},{ "_id": 0, "long_date": date ,"name": school_subject_3, "description": description_3 }):
print("Homework already in database")
else:
x = collection.insert_many(mydict8) # Insert data in MongoDB
school_subject_4 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[4]/h2"))).text) # School subject 4
description_4 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[4]/div/ul/li/p"))).text) # Homework 4
mydict9 = {
"subjects": [
{
"name": school_subject_4,
"homework": [
{
"date": {
"long date": date,
"day": split_date[0],
"month": split_date[1],
"year": split_date[2],
},
"description": description_4,
}
]
}
]
},
if collection.find({},{ "_id": 0, "long_date": date ,"name": school_subject_4, "description": description_4 }):
print("Homework already in database")
else:
x = collection.insert_many(mydict9) # Insert data in MongoDB
school_subject_5 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[5]/h2"))).text) # School subject 5
description_5 = str(WebDriverWait(driver, 250).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div/div/main/div/div[2]/div/ul/li[5]/div/ul/li/p"))).text) # Homework 5
mydict10 = {
"subjects": [
{
"name": school_subject_5,
"homework": [
{
"date": {
"long date": date,
"day": split_date[0],
"month": split_date[1],
"year": split_date[2],
},
"description": description_5,
}
]
}
]
},
if collection.find({},{ "_id": 0, "long_date": date ,"name": school_subject_5, "description": description_5 }):
print("Homework already in database")
else:
x = collection.insert_many(mydict10) # Insert data in MongoDB
except TimeoutException:
WebDriverWait(driver, 250).until(EC.element_to_be_clickable((By.XPATH, "/html/body/div/div/main/div/div/div[1]/div[1]/div[1]/button[3]"))).click() # Click on next day button
day_three.giorno_tre(driver, collection)

View File

@@ -0,0 +1,74 @@
from dotenv import load_dotenv
from imbox import Imbox
import urllib.parse
import traceback
import pathlib
import pymongo
import time
import os
# Load .env file
load_dotenv()
HOST = os.getenv('IMAP_SERVER') #IMAP server
USERNAME = os.getenv('EMAIL') #Username (ex . test@example.com)
PASSWORD = os.getenv('PWD_EMAIL') #IMAP Password
DOWNLOAD_FOLDER = os.getenv('DOWNLOAD_FOLDER') #Download folder for xlsx file
EMAIL_SCHOOL = os.getenv('EMAIL_SCHOOL') #Email school
PASSWORD_MONGODB = os.getenv('PASSWORD_MONGODB') #Password for MongoDB
URL_MONGODB = os.getenv('URL_MONGODB') #URL for MongoDB
mongo_url = "mongodb+srv://elci:" + urllib.parse.quote_plus(PASSWORD_MONGODB) + URL_MONGODB #URL for MongoDB (with password)
client = pymongo.MongoClient(mongo_url) #Connect to MongoDB
database = client["website-class"] #Database name
collection = database["email"] #Collection school time table current
def recheck_email(): # Every 10 seconds check if there is a new email
time.sleep(600)
check_email()
def check_email():
try:
if not os.path.isdir(DOWNLOAD_FOLDER):
os.makedirs(DOWNLOAD_FOLDER, exist_ok=True)
mail = Imbox(HOST, username=USERNAME, password=PASSWORD, ssl=True, ssl_context=None, starttls=False) # Connect to IMAP Server
messages = mail.messages(sent_from=EMAIL_SCHOOL, unread=True) # Get unread emails from school
for (uid, message) in messages:
mail.mark_seen(uid)
# Download attachments
for idx, attachment in enumerate(message.attachments):
try:
att_fn = attachment.get('filename') # Get attachment filename
print(att_fn)
download_path = f"{DOWNLOAD_FOLDER}/{att_fn}"
extension_file = pathlib.Path(att_fn).suffix # Get extension file
print(extension_file)
if extension_file != ".xlsx": # Check if file is xlsx
print("Check file")
else:
if collection.find_one({"Filename": att_fn, "Send on Whatsapp": "no"}):
print("File already exists")
recheck_email()
else:
with open(download_path, "wb") as fp:
fp.write(attachment.get('content').read())
os.rename(download_path, f"{DOWNLOAD_FOLDER}/school_time.xlsx") # Rename file
collection.delete_many({}) # Delete old file
collection.insert_one({"Filename": att_fn, "Send on Whatsapp": "no"}) # Insert filename to MongoDB
send_xlsx()
except:
print(traceback.print_exc())
mail.logout() # Logout from email
recheck_email()
except:
print(traceback.print_exc())
recheck_email()
def send_xlsx():
from update_time_school import update_time_school
update_time_school()
#os.remove(f"{DOWNLOAD_FOLDER}/school_time.xlsx") # Delete file
recheck_email()
check_email()

View File

@@ -0,0 +1,830 @@
from openpyxl.styles import NamedStyle
from bson.objectid import ObjectId
from dotenv import load_dotenv
import openpyxl as xl
import datetime
import pymongo
import urllib
import os
load_dotenv() #Load .env file
PASSWORD_MONGODB = os.getenv('PASSWORD_MONGODB') #Password for MongoDB
URL_MONGODB = os.getenv('URL_MONGODB') #URL for MongoDB
mongo_url = "mongodb+srv://elci:" + urllib.parse.quote_plus(PASSWORD_MONGODB) + URL_MONGODB #URL for MongoDB (with password)
client = pymongo.MongoClient(mongo_url) #Connect to MongoDB
database = client["website-class"] #Database name
collection = database["school-time-table"] #Collection school time table current
collection_archive = database["archive-school-time-table"] #Collection school time table archive
def update_time_school():
# Load excel file
namefile_xlsx = "attachments/school_time.xlsx"
workbook = xl.load_workbook(filename=namefile_xlsx)
date_style = NamedStyle(name='date_style',number_format='dd/mm/yy')
workbook.add_named_style(date_style)
ws = workbook.active
#Date
current_time = datetime.datetime.now()
day = str(current_time.day)
month = str(current_time.month)
year = str(current_time.year)
hour = str(current_time.hour)
minute = str(current_time.minute)
long_date = day + "-" + month + "-" + year + " " + hour + ":" + minute
#Create collection
mydict = {
"Date": long_date,
"School Subject": {
"Monday": [
{
"Subject": "",
"Teacher": "",
"Room": "",
"PE with": "",
"le is busy": "",
"le3 is busy": "",
},
{
"Subject": "",
"Teacher": "",
"Room": "",
"PE with": "",
"le is busy": "",
"le3 is busy": "",
},
{
"Subject": "",
"Teacher": "",
"Room": "",
"PE with": "",
"le is busy": "",
"le3 is busy": "",
},
{
"Subject": "",
"Teacher": "",
"Room": "",
"PE with": "",
"le is busy": "",
"le3 is busy": "",
},
{
"Subject": "",
"Teacher": "",
"Room": "",
"PE with": "",
"le is busy": "",
"le3 is busy": "",
},
{
"Subject": "",
"Teacher": "",
"Room": "",
"PE with": "",
"le is busy": "",
"le3 is busy": "",
},
{
"Subject": "",
"Teacher": "",
"Room": "",
"PE with": "",
"le is busy": "",
"le3 is busy": "",
},
{
"Subject": "",
"Teacher": "",
"Room": "",
"PE with": "",
"le is busy": "",
"le3 is busy": "",
},
],
"Tuesday": [
{
"Subject": "",
"Teacher": "",
"Room": "",
"PE with": "",
"le is busy": "",
"le3 is busy": "",
},
{
"Subject": "",
"Teacher": "",
"Room": "",
"PE with": "",
"le is busy": "",
"le3 is busy": "",
},
{
"Subject": "",
"Teacher": "",
"Room": "",
"PE with": "",
"le is busy": "",
"le3 is busy": "",
},
{
"Subject": "",
"Teacher": "",
"Room": "",
"PE with": "",
"le is busy": "",
"le3 is busy": "",
},
{
"Subject": "",
"Teacher": "",
"Room": "",
"PE with": "",
"le is busy": "",
"le3 is busy": "",
},
{
"Subject": "",
"Teacher": "",
"Room": "",
"PE with": "",
"le is busy": "",
"le3 is busy": "",
},
{
"Subject": "",
"Teacher": "",
"Room": "",
"PE with": "",
"le is busy": "",
"le3 is busy": "",
},
{
"Subject": "",
"Teacher": "",
"Room": "",
"PE with": "",
"le is busy": "",
"le3 is busy": "",
},
],
"Wednesday": [
{
"Subject": "",
"Teacher": "",
"Room": "",
"PE with": "",
"le is busy": "",
"le3 is busy": "",
},
{
"Subject": "",
"Teacher": "",
"Room": "",
"PE with": "",
"le is busy": "",
"le3 is busy": "",
},
{
"Subject": "",
"Teacher": "",
"Room": "",
"PE with": "",
"le is busy": "",
"le3 is busy": "",
},
{
"Subject": "",
"Teacher": "",
"Room": "",
"PE with": "",
"le is busy": "",
"le3 is busy": "",
},
{
"Subject": "",
"Teacher": "",
"Room": "",
"PE with": "",
"le is busy": "",
"le3 is busy": "",
},
{
"Subject": "",
"Teacher": "",
"Room": "",
"PE with": "",
"le is busy": "",
"le3 is busy": "",
},
{
"Subject": "",
"Teacher": "",
"Room": "",
"PE with": "",
"le is busy": "",
"le3 is busy": "",
},
{
"Subject": "",
"Teacher": "",
"Room": "",
"PE with": "",
"le is busy": "",
"le3 is busy": "",
},
],
"Thursday": [
{
"Subject": "",
"Teacher": "",
"Room": "",
"PE with": "",
"le is busy": "",
"le3 is busy": "",
},
{
"Subject": "",
"Teacher": "",
"Room": "",
"PE with": "",
"le is busy": "",
"le3 is busy": "",
},
{
"Subject": "",
"Teacher": "",
"Room": "",
"PE with": "",
"le is busy": "",
"le3 is busy": "",
},
{
"Subject": "",
"Teacher": "",
"Room": "",
"PE with": "",
"le is busy": "",
"le3 is busy": "",
},
{
"Subject": "",
"Teacher": "",
"Room": "",
"PE with": "",
"le is busy": "",
"le3 is busy": "",
},
{
"Subject": "",
"Teacher": "",
"Room": "",
"PE with": "",
"le is busy": "",
"le3 is busy": "",
},
{
"Subject": "",
"Teacher": "",
"Room": "",
"PE with": "",
"le is busy": "",
"le3 is busy": "",
},
{
"Subject": "",
"Teacher": "",
"Room": "",
"PE with": "",
"le is busy": "",
"le3 is busy": "",
},
],
"Friday": [
{
"Subject": "",
"Teacher": "",
"Room": "",
"PE with": "",
"le is busy": "",
"le3 is busy": "",
},
{
"Subject": "",
"Teacher": "",
"Room": "",
"PE with": "",
"le is busy": "",
"le3 is busy": "",
},
{
"Subject": "",
"Teacher": "",
"Room": "",
"PE with": "",
"le is busy": "",
"le3 is busy": "",
},
{
"Subject": "",
"Teacher": "",
"Room": "",
"PE with": "",
"le is busy": "",
"le3 is busy": "",
},
{
"Subject": "",
"Teacher": "",
"Room": "",
"PE with": "",
"le is busy": "",
"le3 is busy": "",
},
{
"Subject": "",
"Teacher": "",
"Room": "",
"PE with": "",
"le is busy": "",
"le3 is busy": "",
},
{
"Subject": "",
"Teacher": "",
"Room": "",
"PE with": "",
"le is busy": "",
"le3 is busy": "",
},
{
"Subject": "",
"Teacher": "",
"Room": "",
"PE with": "",
"le is busy": "",
"le3 is busy": "",
},
],
"Saturday": [
{
"Subject": "",
"Teacher": "",
"Room": "",
"PE with": "",
"le is busy": "",
"le3 is busy": "",
},
{
"Subject": "",
"Teacher": "",
"Room": "",
"PE with": "",
"le is busy": "",
"le3 is busy": "",
},
{
"Subject": "",
"Teacher": "",
"Room": "",
"PE with": "",
"le is busy": "",
"le3 is busy": "",
},
{
"Subject": "",
"Teacher": "",
"Room": "",
"PE with": "",
"le is busy": "",
"le3 is busy": "",
},
{
"Subject": "",
"Teacher": "",
"Room": "",
"PE with": "",
"le is busy": "",
"le3 is busy": "",
},
{
"Subject": "",
"Teacher": "",
"Room": "",
"PE with": "",
"le is busy": "",
"le3 is busy": "",
},
{
"Subject": "",
"Teacher": "",
"Room": "",
"PE with": "",
"le is busy": "",
"le3 is busy": "",
},
{
"Subject": "",
"Teacher": "",
"Room": "",
"PE with": "",
"le is busy": "",
"le3 is busy": "",
},
],
}
}
x = collection.delete_many({}) #Delete all documents in collection (school-time-table)
x = collection.insert_one(mydict) # Add collection on collection (school-time-table)
x = collection_archive.insert_one(mydict) # Add collection on collection (archive-school-time-table)
check_repeat = 0
check_repeat_teacher = 0
check_repeat_room = 0
dont_repeat = 0
dont_repeat_teacher = 0
dont_repeat_room = 0
gagaga_teacher = 0
gagaga_room = 0
number_teacher = 1
number_room = 1
number = 1
number_day = 0
gagaga = 0
#Search my class in excel file and add in MongoDB
for row in range (1, 100):
# column B ~ column F
for column in range (1, 100):
cell = ws.cell(row, column)
if cell.value == "2elci":
#Search school time table
for i in range(4,80):
day = str(ws.cell(row=i, column=3).value) # Get day from excel file
school_subject = ws.cell(row=i, column=column).value # Get school subject from excel file
teacher = ws.cell(row=i, column=column+1).value # Get teacher from excel file
room = ws.cell(row=i, column=column+2).value # Get room from excel file
# Simple counter for don't repeat
if dont_repeat == 9:
check_repeat += 1
if check_repeat == 5:
check_repeat = 0
dont_repeat = 0
else:
if day == "None": #If day is None, don't add a school subject in MongoDB
if school_subject == 0 or school_subject == "0": #If school subject is 0, add "" in MongoDB
number += 1
gagaga += 1
dont_repeat += 1
if number == 9:
number = 1
if gagaga == 9:
gagaga = 0
else: #If school subject is not 0, add school subject in MongoDB
remove_things_in_front = school_subject.split(' ', 1)[1]
find_document_school_time_table = list(collection.find({}, {"Date": long_date}))
find_document_archive_school_time_table = list(collection_archive.find({}, {"Date": long_date}))
array_document_school_time_table = find_document_school_time_table[0]["_id"]
array_document_archive_school_time_table = find_document_archive_school_time_table[0]["_id"]
# Shorten school subject name
if remove_things_in_front == "MISURE ELETTRICHE":
remove_things_in_front = "MISURE"
elif remove_things_in_front == " EDUCAZIONE ATTIVITA' MOTORIE":
remove_things_in_front = "MOTORIA"
elif remove_things_in_front == "EDUCAZIONE ATTIVITA' MOTORIE":
remove_things_in_front = "Motoria"
elif remove_things_in_front == "DIRITTO ED ECONOMIA":
remove_things_in_front = "DIRITTO"
elif remove_things_in_front == "INGLESE PROFESSIONALE":
remove_things_in_front = "INGLESE PRO."
elif remove_things_in_front == "LABORATORIO ELETTRICO":
remove_things_in_front = "LAB. ELETTRICO"
elif remove_things_in_front == "LINGUA INGLESE":
remove_things_in_front = "INGLESE"
elif remove_things_in_front == "SCIENZE INTEGRATE - FISICA":
remove_things_in_front = "FISICA"
elif remove_things_in_front == "21PM2 LABORATORIO ELETTRICO":
remove_things_in_front == "LAB. ELETTRICO"
collection.update_one( # Add school subject in MongoDB beacause school subject is not 0
{ "_id": ObjectId(array_document_school_time_table)},
{ "$set": {
"School Subject." + array_test[0] + "." + str(gagaga) + ".Subject": remove_things_in_front,
}
}
)
collection_archive.update_one( # Add school subject in MongoDB (archive) beacause school subject is not 0
{ "_id": ObjectId(array_document_archive_school_time_table)},
{ "$set": {
"School Subject." + array_test[0] + "." + str(gagaga) + ".Subject": remove_things_in_front,
}
}
)
number += 1
gagaga += 1
dont_repeat += 1
# Simple counter for don't repeat
if number == 9:
number = 1
if gagaga == 8:
gagaga = 0
else:
datetime_obj = datetime.datetime.strptime(day, "%Y-%m-%d %H:%M:%S").strftime("%d %m %Y") # Convert date to day
convert_date_to_day = datetime.datetime.strptime(datetime_obj, '%d %m %Y').strftime('%A') # Convert date to day
array_test = [] # Create array
array_test.append(convert_date_to_day) # Add day in array
number_day += 1
if school_subject == 0 or school_subject == "0": #If school subject is 0, add "" in MongoDB
find_document_school_time_table = list(collection.find({}, {"Date": long_date}))
find_document_archive_school_time_table = list(collection_archive.find({}, {"Date": long_date}))
array_document_school_time_table = find_document_school_time_table[0]["_id"]
array_document_archive_school_time_table = find_document_archive_school_time_table[0]["_id"]
collection.update_one( # Add "" in MongoDB beacause school subject is 0
{ "_id": ObjectId(array_document_school_time_table)},
{ "$set": {
"School Subject." + array_test[0] + "." + str(gagaga) + ".Subject": school_subject,
}
}
)
collection_archive.update_one( # Add "" in MongoDB (archive) beacause school subject is 0
{ "_id": ObjectId(array_document_archive_school_time_table)},
{ "$set": {
"School Subject." + array_test[0] + "." + str(gagaga) + ".Subject": school_subject,
}
}
)
number += 1
gagaga += 1
dont_repeat += 1
number = 0
if number == 9:
number = 1
if gagaga == 8:
gagaga = 0
else: #If school subject is not 0, add school subject in MongoDB
if school_subject == "MISURE ELETTRICHE":
school_subject = "MISURE"
elif school_subject == " EDUCAZIONE ATTIVITA' MOTORIE":
school_subject = "MOTORIA"
elif school_subject == "EDUCAZIONE ATTIVITA' MOTORIE":
school_subject = "Motoria"
elif school_subject == "DIRITTO ED ECONOMIA":
school_subject = "DIRITTO"
elif school_subject == "INGLESE PROFESSIONALE":
school_subject = "INGLESE PRO."
elif school_subject == "LABORATORIO ELETTRICO":
school_subject = "LAB. ELETTRICO"
elif school_subject == "LINGUA INGLESE":
school_subject = "INGLESE"
elif school_subject == "SCIENZE INTEGRATE - FISICA":
school_subject = "FISICA"
elif school_subject == "21PM2 LABORATORIO ELETTRICO":
school_subject == "LAB. ELETTRICO"
# Search document on MongoDB
find_document_school_time_table = list(collection.find({}, {"Date": long_date}))
find_document_archive_school_time_table = list(collection_archive.find({}, {"Date": long_date}))
array_document_school_time_table = find_document_school_time_table[0]["_id"]
array_document_archive_school_time_table = find_document_archive_school_time_table[0]["_id"]
collection.update_one( # Add school subject in MongoDB beacause school subject is not 0
{ "_id": ObjectId(array_document_school_time_table)},
{ "$set": {
"School Subject." + array_test[0] + "." + str(gagaga)+ ".Subject": school_subject,
}
}
)
collection_archive.update_one( # Add school subject in MongoDB (archive) beacause school subject is not 0
{ "_id": ObjectId(array_document_archive_school_time_table)},
{ "$set": {
"School Subject." + array_test[0] + "." + str(gagaga)+ ".Subject": school_subject,
}
}
)
number += 1
gagaga += 1
dont_repeat += 1
# Simple counter for don't repeat
if number == 9:
number = 1
if gagaga == 8:
gagaga = 0
#Search teacher
if dont_repeat_teacher == 9:
check_repeat_teacher += 1 # 13
if check_repeat_teacher == 5:
check_repeat_teacher = 0
dont_repeat_teacher = 0
else:
if day == "None": # Check if day is None
if teacher == 0: # Check if teacher is 0
# If teacher is 0, add anything in MongoDB
number_teacher += 1
gagaga_teacher += 1
dont_repeat_teacher += 1
if number_teacher == 9:
number_teacher = 1
if gagaga_teacher == 9:
gagaga_teacher = 0
else:
# Search document on MongoDB
find_document_school_time_table = list(collection.find({}, {"Date": long_date}))
find_document_archive_school_time_table = list(collection_archive.find({}, {"Date": long_date}))
array_document_school_time_table = find_document_school_time_table[0]["_id"]
array_document_archive_school_time_table = find_document_archive_school_time_table[0]["_id"]
collection.update_one( # Add teacher in MongoDB beacause teacher is not 0
{ "_id": ObjectId(array_document_school_time_table)},
{ "$set": {
"School Subject." + array_test[0] + "." + str(gagaga_teacher) + ".Teacher": teacher,
}
}
)
collection_archive.update_one( # Add teacher in MongoDB (archive) beacause teacher is not 0
{ "_id": ObjectId(array_document_archive_school_time_table)},
{ "$set": {
"School Subject." + array_test[0] + "." + str(gagaga_teacher)+ ".Teacher": teacher,
}
}
)
number_teacher += 1
gagaga_teacher += 1
dont_repeat_teacher += 1
if number_teacher == 9:
number_teacher = 1
if gagaga_teacher == 8:
gagaga_teacher = 0
else:
datetime_obj = datetime.datetime.strptime(day, "%Y-%m-%d %H:%M:%S").strftime("%d %m %Y") # Convert date to day
convert_date_to_day = datetime.datetime.strptime(datetime_obj, '%d %m %Y').strftime('%A') # Convert date to day
array_test = [] # Create array
array_test.append(convert_date_to_day) # Add day in array
# Search document on MongoDB
find_document_school_time_table = list(collection.find({}, {"Date": long_date}))
find_document_archive_school_time_table = list(collection_archive.find({}, {"Date": long_date}))
array_document_school_time_table = find_document_school_time_table[0]["_id"]
array_document_archive_school_time_table = find_document_archive_school_time_table[0]["_id"]
collection.update_one( # Add teacher in MongoDB beacause teacher is not 0
{ "_id": ObjectId(array_document_school_time_table)},
{ "$set": {
"School Subject." + array_test[0] + "." + str(gagaga_teacher)+ ".Teacher": teacher,
}
}
)
collection_archive.update_one( # Add teacher in MongoDB (archive) beacause teacher is not 0
{ "_id": ObjectId(array_document_archive_school_time_table)},
{ "$set": {
"School Subject." + array_test[0] + "." + str(gagaga_teacher)+ ".Teacher": teacher,
}
}
)
number_teacher += 1
gagaga_teacher += 1
dont_repeat_teacher += 1
# Simple counter for don't repeat
if number_teacher == 9:
number_teacher = 1
if gagaga_teacher == 8:
gagaga_teacher = 0
#Search room school
if dont_repeat_room == 9:
check_repeat_room += 1
if check_repeat_room == 5:
check_repeat_room = 0
dont_repeat_room = 0
else:
if day == "None": # Check if day is None
if room == 0:
number_room += 1
gagaga_room += 1
dont_repeat_room += 1
if number_room == 9:
number_room = 1
if gagaga_room == 9:
gagaga_room = 0
else:
# Search document on MongoDB
find_document_school_time_table = list(collection.find({}, {"Date": long_date}))
find_document_archive_school_time_table = list(collection_archive.find({}, {"Date": long_date}))
array_document_school_time_table = find_document_school_time_table[0]["_id"]
array_document_archive_school_time_table = find_document_archive_school_time_table[0]["_id"]
collection.update_one( # Add room in MongoDB beacause room is not 0
{ "_id": ObjectId(array_document_school_time_table)},
{ "$set": {
"School Subject." + array_test[0] + "." + str(gagaga_room) + ".Room": room,
}
}
)
collection_archive.update_one( # Add room in MongoDB (archive) beacause room is not 0
{ "_id": ObjectId(array_document_archive_school_time_table)},
{ "$set": {
"School Subject." + array_test[0] + "." + str(gagaga_room)+ ".Room": room,
}
}
)
number_room += 1
gagaga_room += 1
dont_repeat_room += 1
# Simple counter for don't repeat
if number_room == 9:
number_room = 1
if gagaga_room == 8:
gagaga_room = 0
else:
datetime_obj = datetime.datetime.strptime(day, "%Y-%m-%d %H:%M:%S").strftime("%d %m %Y") # Convert date to day
convert_date_to_day = datetime.datetime.strptime(datetime_obj, '%d %m %Y').strftime('%A')
array_test = [] # Create array
array_test.append(convert_date_to_day) # Add day in array
# Search document on MongoDB
find_document_school_time_table = list(collection.find({}, {"Date": long_date}))
find_document_archive_school_time_table = list(collection_archive.find({}, {"Date": long_date}))
array_document_school_time_table = find_document_school_time_table[0]["_id"]
array_document_archive_school_time_table = find_document_archive_school_time_table[0]["_id"]
collection.update_one( # Add room in MongoDB beacause room is not 0
{ "_id": ObjectId(array_document_school_time_table)},
{ "$set": {
"School Subject." + array_test[0] + "." + str(gagaga_room)+ ".Room": room,
}
}
)
collection_archive.update_one( # Add room in MongoDB (archive) beacause room is not 0
{ "_id": ObjectId(array_document_archive_school_time_table)},
{ "$set": {
"School Subject." + array_test[0] + "." + str(gagaga_room)+ ".Room": room,
}
}
)
number_room += 1
gagaga_room += 1
dont_repeat_room += 1
# Simple counter for don't repeat
if number_room == 9:
number_room = 1
if gagaga_room == 8:
gagaga_room = 0
# Look for other classes doing PE at the same time as us
if school_subject == "CEAM EDUCAZIONE ATTIVITA' MOTORIE" or school_subject == "CEAM EDUCAZIONE ATTIVITA' MOTORIE" or school_subject == "CEAM EDUCAZIONE ATTIVITA' MOTORIA":
for c in range(1,100):
search_motoria = ws.cell(row=i, column=c).value
if search_motoria == "CEAM EDUCAZIONE ATTIVITA' MOTORIE" or search_motoria == "CEAM EDUCAZIONE ATTIVITA' MOTORIE" or search_motoria == "CEAM EDUCAZIONE ATTIVITA' MOTORIA":
if c == column:
pass
else:
search_class = ws.cell(row=3, column=c).value # Search class
collection.update_one( # Add class in MongoDB
{ "_id": ObjectId(array_document_school_time_table)},
{ "$set": {
"School Subject." + array_test[0] + "." + str(gagaga_room-1)+ ".PE with": search_class,
}
}
)
else:
pass
# Search if class le3 is busy
for c in range(1,100):
search_other_subject = ws.cell(row=i, column=c).value
if c == column:
pass
else:
if teacher == "Martin":
if search_other_subject == "le3" or search_other_subject == "le":
search_class = ws.cell(row=3, column=c-2).value
if search_class == "2elci":
pass
else:
if c == column:
pass
else:
if search_other_subject == "le3":
collection.update_one(
{ "_id": ObjectId(array_document_school_time_table)},
{ "$set": {
"School Subject." + array_test[0] + "." + str(gagaga_room-1)+ ".le3 is busy": search_class,
}
}
)
if search_other_subject == "le":
collection.update_one(
{ "_id": ObjectId(array_document_school_time_table)},
{ "$set": {
"School Subject." + array_test[0] + "." + str(gagaga_room-1)+ ".le is busy": search_class,
}
}
)
else:
pass
update_time_school()

136
style.css
View File

@@ -1,136 +0,0 @@
a {
text-decoration: none;
outline: none;
display: inline-block;
width: 250px;
height: 50px;
line-height: 45px;
border-radius: 45px;
margin: 10px 20px;
font-family: 'Montserrat', sans-serif;
font-size: 11px;
text-transform: uppercase;
text-align: center;
letter-spacing: 3px;
font-weight: 600;
color: #524f4e;
background: white;
box-shadow: 0 8px 15px rgba(0,0,0,.1);
transition: .3s;
}
a:hover {
background: #2EE59D;
box-shadow: 0 15px 20px rgba(46,229,157,.4);
color: white;
transform: translateY(-7px);
}
a:logo {
margin-top: 43px;
float: left;
width: 358px;
}
@import url("https://fonts.googleapis.com/css?family=Fredoka+One&display=swap");
html {
background: var(--backg);
--btn: #2ab1ce;
--backg: #fff;
--colorx: #232323;
width: 100%;
height: 100vh;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
html[data-theme='dartheme'] {
background: var(--backg);
--btn: #ea4b3c;
--backg: #232323;
--colorx: #fff;
}
h1 {
font-family: 'Fredoka One', cursive;
font-weight: 300;
color: var(--colorx);
}
h2 {
font-family: 'Fredoka One', cursive;
font-weight: 100;
color: var(--colorx);
}
input[type=checkbox] {
visibility: hidden;
height: 0;
width: 0;
}
label {
margin: 0 auto;
display: flex;
justify-content: center;
align-items: center;
border-radius: 100px;
position: relative;
cursor: pointer;
text-indent: -9999px;
width: 60px;
height: 30px;
background: var(--btn);
position : absolute;
line-height: 12px;
width: 60px;
font-size: 50pt;
font-family: tahoma;
margin-top: 5px;
margin-right: 6px;
position:absolute;
top: 15px;
right: 15px;
}
label:after {
border-radius: 50%;
position: absolute;
content: '';
background: #fff;
width: 20px;
height: 20px;
top: 5px;
left: 4px;
transition: ease-in-out 200ms;
}
input:checked + label {
background: #ea4b3c;
}
input:checked + label:after {
left: calc(100% - 5px);
transform: translateX(-100%);
}
html.transition,
html.transition *,
html.transition *:before,
html.transition *:after {
transition: ease-in-out 200ms !important;
transition-delay: 0 !important;
}
#nomeid{
position : absolute;
left : 20px;
right : 20px;
}
.orarioscuola {max-width: 100%}
.theme-dark {
--color-background: #30110d;
-color: #f2bc94;
}

View File

@@ -0,0 +1,22 @@
from flask import Flask, jsonify
from dotenv import load_dotenv
import urllib.parse
import pymongo
import os
load_dotenv() #Load .env file
PASSWORD_MONGODB = os.getenv('PASSWORD_MONGODB') #Password for MongoDB
URL_MONGODB = os.getenv('URL_MONGODB') #URL for MongoDB
mongo_url = "mongodb+srv://elci:" + urllib.parse.quote_plus(PASSWORD_MONGODB) + URL_MONGODB #URL for MongoDB (with password)
client = pymongo.MongoClient(mongo_url) #Connect to MongoDB
database = client["website-class"] #Database name
collection = database["homework"] #Collection school time table current
app = Flask(__name__)
@app.route('/homework')
def get_homework():
homework = collection.find({}, {"_id": 0})
return jsonify(list(homework))
if __name__ == '__main__':
app.run()

View File

@@ -0,0 +1,24 @@
from flask import Flask, jsonify
from pymongo import MongoClient
from dotenv import load_dotenv
import urllib
import os
app = Flask(__name__)
load_dotenv() #Load .env file
PASSWORD_MONGODB = os.getenv('PASSWORD_MONGODB') #Password for MongoDB
URL_MONGODB = os.getenv('URL_MONGODB') #URL for MongoDB
mongo_url = "mongodb+srv://elci:" + urllib.parse.quote_plus(PASSWORD_MONGODB) + URL_MONGODB #URL for MongoDB (with password)
client = MongoClient(mongo_url) #Connect to MongoDB
database = client["website-class"] #Database name
collection = database["school-time-table"]
@app.route("/", methods=["GET"])
def get_subjects():
subjects = collection.find({}, {"_id": 0})
#Return all subjects
return jsonify(list(subjects))
if __name__ == '__main__':
app.run(debug=True)

35
templates/base.html Normal file
View File

@@ -0,0 +1,35 @@
<!doctype html>
<html lang="en">
<head><meta charset="utf-8">
<title>{% block title %}{%endblock %}</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous">
</head>
<body>
<nav class="navbar navbar-light" style="background-color: #e3f2fd;">
<a class="navbar-brand" href="#">Registration Form</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavAltMarkup" aria-controls="navbarNavAltMarkup" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNavAltMarkup">
<div class="navbar-nav">
<a class="nav-item nav-link active" href="/">Register <span class="sr-only">(current)</span></a>
<a class="nav-item nav-link" href="/login">Login</a>
<a class="nav-item nav-link" href="/logout">Logout</a>
</div>
</div>
</nav>
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js" integrity="sha384-OgVRvuATP1z7JjHLkuOU7Xw704+h835Lr+6QL9UvYjZE3Ipu6Tp75j7Bh/kR0JKI" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js" integrity="sha384-OgVRvuATP1z7JjHLkuOU7Xw704+h835Lr+6QL9UvYjZE3Ipu6Tp75j7Bh/kR0JKI" crossorigin="anonymous"></script>
{% block content %}{% endblock %}
</body>
</html>

783
templates/homepage.html Normal file
View File

@@ -0,0 +1,783 @@
<!DOCTYPE html>
<html>
<head>
<title>2 Elci - Homepage</title>
</head>
<body>
<br>
<center><h1>2 Elci</h1></center>
<style type="text/css">
.ritz .waffle a {
color: inherit;
}
.ritz .waffle .s5 {
border-right: 1px SOLID #000000;
background-color: #ffffff;
text-align: center;
color: #000000;
font-family: 'docs-Calibri', Arial;
font-size: 11pt;
vertical-align: bottom;
white-space: nowrap;
direction: ltr;
padding: 0px 3px 0px 3px;
}
.ritz .waffle .s4 {
border-right: 1px SOLID #000000;
background-color: #ffffff;
text-align: left;
font-weight: bold;
color: #000000;
font-family: 'docs-Calibri', Arial;
font-size: 11pt;
vertical-align: bottom;
white-space: nowrap;
direction: ltr;
padding: 0px 3px 0px 3px;
}
.ritz .waffle .s6 {
border-bottom: 1px SOLID #000000;
border-right: 1px SOLID #000000;
background-color: #ffffff;
text-align: left;
font-weight: bold;
color: #000000;
font-family: 'docs-Calibri', Arial;
font-size: 11pt;
vertical-align: bottom;
white-space: nowrap;
direction: ltr;
padding: 0px 3px 0px 3px;
}
.ritz .waffle .s1 {
border-bottom: 1px SOLID #000000;
background-color: #ffffff;
text-align: left;
font-weight: bold;
color: #000000;
font-family: 'docs-Calibri', Arial;
font-size: 11pt;
vertical-align: bottom;
white-space: nowrap;
direction: ltr;
padding: 0px 3px 0px 3px;
}
.ritz .waffle .s2 {
border-right: 1px SOLID #000000;
background-color: #ffffff;
text-align: center;
color: #000000;
font-family: 'docs-Calibri', Arial;
font-size: 11pt;
vertical-align: middle;
white-space: nowrap;
direction: ltr;
padding: 0px 3px 0px 3px;
}
.ritz .waffle .s8 {
border-left: none;
background-color: #ffffff;
text-align: left;
font-weight: bold;
color: #000000;
font-family: 'docs-Calibri', Arial;
font-size: 11pt;
vertical-align: bottom;
white-space: nowrap;
direction: ltr;
padding: 0px 3px 0px 3px;
}
.ritz .waffle .s9 {
border-bottom: 1px SOLID #000000;
border-right: 1px SOLID #000000;
background-color: #ffffff;
text-align: left;
font-weight: bold;
color: #000000;
font-family: 'docs-Calibri', Arial;
font-size: 11pt;
vertical-align: middle;
white-space: nowrap;
direction: ltr;
padding: 0px 3px 0px 3px;
}
.ritz .waffle .s3 {
border-right: 1px SOLID #000000;
background-color: #ffffff;
text-align: left;
font-weight: bold;
color: #000000;
font-family: 'docs-Calibri', Arial;
font-size: 11pt;
vertical-align: middle;
white-space: nowrap;
direction: ltr;
padding: 0px 3px 0px 3px;
}
.ritz .waffle .s0 {
border-bottom: 1px SOLID #000000;
background-color: #ffffff;
text-align: left;
color: #000000;
font-family: 'docs-Calibri', Arial;
font-size: 11pt;
vertical-align: bottom;
white-space: nowrap;
direction: ltr;
padding: 0px 3px 0px 3px;
}
.ritz .waffle .s7 {
border-right: none;
background-color: #ffffff;
text-align: left;
font-weight: bold;
color: #000000;
font-family: 'docs-docs-Calibri', Arial;
font-size: 11pt;
vertical-align: bottom;
white-space: nowrap;
direction: ltr;
padding: 0px 3px 0px 3px;
}
</style>
<div class="ritz grid-container" dir="ltr" style="overflow-x:auto;">
<table class="waffle" cellspacing="0" cellpadding="0">
<tbody>
{% for i in data %}
<tr style="height: 19px">
<td class="s0"></td>
<td class="s1" colspan="2">Lunedì</td>
<td class="s1" colspan="2">Martedì</td>
<td class="s1" colspan="2">Mercoledì</td>
<td class="s1" colspan="2">Giovedì</td>
<td class="s1" colspan="2">Venerdì</td>
</tr>
<tr style="height: 21px">
<td class="s2">7:55</td>
<td class="s3" colspan="2">{{ i['School Subject']['Monday'][0]['Subject']}}</td>
<td class="s3" dir="ltr" colspan="2">{{ i['School Subject']['Tuesday'][0]['Subject']}}</td>
<td class="s3" colspan="2">{{ i['School Subject']['Wednesday'][0]['Subject']}}</td>
<td class="s3" dir="ltr" colspan="2">{{ i['School Subject']['Thursday'][0]['Subject']}}</td>
<td class="s4" dir="ltr" colspan="2">{{ i['School Subject']['Friday'][0]['Subject']}}</td>
</tr>
<tr style="height: 19px">
<td class="s5"></td>
<td class="s4" colspan="2">{{ i['School Subject']['Monday'][0]['Teacher']}}</td>
<td class="s4" dir="ltr" colspan="2">{{ i['School Subject']['Tuesday'][0]['Teacher']}}</td>
<td class="s4" colspan="2">{{ i['School Subject']['Wednesday'][0]['Teacher']}}</td>
<td class="s4" dir="ltr" colspan="2">{{ i['School Subject']['Thursday'][0]['Teacher']}}</td>
<td class="s4" dir="ltr" colspan="2">{{ i['School Subject']['Friday'][0]['Teacher']}}</td>
</tr>
<tr style="height: 19px">
<td class="s5">08.55</td>
<td class="s6" dir="ltr" colspan="2">{{ i['School Subject']['Monday'][0]['Room']}}</td>
<td class="s6" dir="ltr" colspan="2">{{ i['School Subject']['Tuesday'][0]['Room']}}</td>
<td class="s6" colspan="2">{{ i['School Subject']['Wednesday'][0]['Room']}}</td>
<td class="s6" dir="ltr" colspan="2">{{ i['School Subject']['Thursday'][0]['Room']}}</td>
<td class="s6" dir="ltr" colspan="2">{{ i['School Subject']['Friday'][0]['Room']}}</td>
</tr>
<tr style="height: 19px">
<td class="s5">08.55</td>
<td class="s4" colspan="2">{{ i['School Subject']['Monday'][1]['Subject']}}</td>
<td class="s4" dir="ltr" colspan="2">{{ i['School Subject']['Tuesday'][1]['Subject']}}</td>
<td class="s4" colspan="2">{{ i['School Subject']['Wednesday'][1]['Subject']}}</td>
<td class="s4" colspan="2">{{ i['School Subject']['Thursday'][1]['Subject']}}</td>
<td class="s4" dir="ltr" colspan="2">{{ i['School Subject']['Friday'][1]['Subject']}}</td>
</tr>
<tr style="height: 19px">
<td class="s5"></td>
<td class="s4" colspan="2">{{ i['School Subject']['Monday'][1]['Teacher']}}</td>
<td class="s4" dir="ltr" colspan="2">{{ i['School Subject']['Tuesday'][1]['Teacher']}}</td>
<td class="s4" colspan="2">{{ i['School Subject']['Wednesday'][1]['Teacher']}}</td>
<td class="s4" colspan="2">{{ i['School Subject']['Thursday'][1]['Teacher']}}</td>
<td class="s4" dir="ltr" colspan="2">{{ i['School Subject']['Friday'][1]['Teacher']}}</td>
</tr>
<tr style="height: 19px">
<td class="s5">09.55</td>
<td class="s6" colspan="2">{{ i['School Subject']['Monday'][1]['Room']}}</td>
<td class="s6" dir="ltr" colspan="2">{{ i['School Subject']['Tuesday'][1]['Room']}}</td>
<td class="s6" colspan="2">{{ i['School Subject']['Wednesday'][1]['Room']}}</td>
<td class="s6" dir="ltr" colspan="2">{{ i['School Subject']['Thursday'][1]['Room']}}</td>
<td class="s6" dir="ltr" colspan="2">{{ i['School Subject']['Friday'][1]['Room']}}</td>
</tr>
<tr style="height: 19px">
<td class="s5">09.55</td>
<td class="s4" colspan="2">{{ i['School Subject']['Monday'][2]['Subject']}}</td>
<td class="s4" dir="ltr" colspan="2">{{ i['School Subject']['Tuesday'][2]['Subject']}}</td>
<td class="s4" colspan="2">{{ i['School Subject']['Wednesday'][2]['Subject']}}</td>
<td class="s4" dir="ltr" colspan="2">{{ i['School Subject']['Thursday'][2]['Subject']}}</td>
<td class="s4" dir="ltr" colspan="2">{{ i['School Subject']['Friday'][2]['Subject']}}</td>
</tr>
<tr style="height: 19px">
<td class="s5"></td>
<td class="s4" colspan="2">{{ i['School Subject']['Monday'][2]['Teacher']}}</td>
<td class="s4" dir="ltr" colspan="2">{{ i['School Subject']['Tuesday'][2]['Teacher']}}</td>
<td class="s4" colspan="2">{{ i['School Subject']['Wednesday'][2]['Teacher']}}</td>
<td class="s4" dir="ltr" colspan="2">{{ i['School Subject']['Thursday'][2]['Teacher']}}</td>
<td class="s4" dir="ltr" colspan="2">{{ i['School Subject']['Friday'][2]['Teacher']}}</td>
</tr>
<tr style="height: 19px">
<td class="s5">10.55</td>
<td class="s6" colspan="2">{{ i['School Subject']['Monday'][2]['Room']}}</td>
<td class="s6" dir="ltr" colspan="2">{{ i['School Subject']['Tuesday'][2]['Room']}}</td>
<td class="s6" colspan="2">{{ i['School Subject']['Wednesday'][2]['Room']}}</td>
<td class="s6" dir="ltr" colspan="2">{{ i['School Subject']['Thursday'][2]['Room']}}</td>
<td class="s6" dir="ltr" colspan="2">{{ i['School Subject']['Friday'][2]['Room']}}</td>
</tr>
<tr style="height: 19px">
<td class="s5">11.10</td>
<td class="s4" dir="ltr" colspan="2">{{ i['School Subject']['Monday'][3]['Subject']}}</td>
<td class="s4" dir="ltr" colspan="2">{{ i['School Subject']['Tuesday'][3]['Subject']}}</td>
<td class="s4" dir="ltr" colspan="2">{{ i['School Subject']['Wednesday'][3]['Subject']}}</td>
<td class="s4" colspan="2">{{ i['School Subject']['Thursday'][3]['Subject']}}</td>
<td class="s7 softmerge" dir="ltr">
<div class="softmerge-inner" colspan="2">{{ i['School Subject']['Friday'][3]['Subject']}}</div>
</td>
</tr>
<tr style="height: 19px">
<td class="s5"></td>
<td class="s4" dir="ltr" colspan="2">{{ i['School Subject']['Monday'][3]['Teacher']}}</td>
<td class="s4" dir="ltr" colspan="2">{{ i['School Subject']['Tuesday'][3]['Teacher']}}</td>
<td class="s4" dir="ltr" colspan="2">{{ i['School Subject']['Wednesday'][3]['Teacher']}}</td>
<td class="s4" colspan="2">{{ i['School Subject']['Thursday'][3]['Teacher']}}</td>
<td class="s4" dir="ltr" colspan="2">{{ i['School Subject']['Friday'][3]['Teacher']}}</td>
</tr>
<tr style="height: 19px">
<td class="s5">12.10</td>
<td class="s9" dir="ltr" colspan="2">{{ i['School Subject']['Monday'][3]['Room']}}</td>
<td class="s6" dir="ltr" colspan="2">{{ i['School Subject']['Tuesday'][3]['Room']}}</td>
<td class="s9" dir="ltr" colspan="2">{{ i['School Subject']['Wednesday'][3]['Room']}}</td>
<td class="s6" colspan="2">{{ i['School Subject']['Thursday'][3]['Room']}}</td>
<td class="s6" dir="ltr" colspan="2">{{ i['School Subject']['Friday'][3]['Room']}}</td>
</tr>
<tr style="height: 19px">
<td class="s5">12.10</td>
<td class="s4" dir="ltr" colspan="2">{{ i['School Subject']['Monday'][4]['Subject']}}</td>
<td class="s4" colspan="2">{{ i['School Subject']['Tuesday'][4]['Subject']}}</td>
<td class="s4" dir="ltr" colspan="2">{{ i['School Subject']['Wednesday'][4]['Subject']}}</td>
<td class="s4" colspan="2">{{ i['School Subject']['Thursday'][4]['Subject']}}</td>
<td class="s4" dir="ltr" colspan="2">{{ i['School Subject']['Friday'][4]['Subject']}}</td>
</tr>
<tr style="height: 19px">
<td class="s5"></td>
<td class="s4" dir="ltr" colspan="2">{{ i['School Subject']['Monday'][4]['Teacher']}}</td>
<td class="s4" colspan="2">{{ i['School Subject']['Tuesday'][4]['Teacher']}}</td>
<td class="s4" dir="ltr" colspan="2">{{ i['School Subject']['Wednesday'][4]['Teacher']}}</td>
<td class="s4" colspan="2">{{ i['School Subject']['Thursday'][4]['Teacher']}}</td>
<td class="s4" dir="ltr" colspan="2">{{ i['School Subject']['Friday'][4]['Teacher']}}</td>
</tr>
<tr style="height: 19px">
<td class="s5">13.10</td>
<td class="s6" dir="ltr" colspan="2">{{ i['School Subject']['Monday'][4]['Room']}}</td>
<td class="s6" colspan="2">{{ i['School Subject']['Tuesday'][4]['Room']}}</td>
<td class="s6" dir="ltr" colspan="2">{{ i['School Subject']['Wednesday'][4]['Room']}}</td>
<td class="s6" colspan="2">{{ i['School Subject']['Thursday'][4]['Room']}}</td>
<td class="s6" dir="ltr" colspan="2">{{ i['School Subject']['Friday'][4]['Room']}}</td>
</tr>
<tr style="height: 19px">
<td class="s5">13.10</td>
<td class="s4" colspan="2">{{ i['School Subject']['Monday'][5]['Subject']}}</td>
<td class="s4" colspan="2">{{ i['School Subject']['Tuesday'][5]['Subject']}}</td>
<td class="s4" dir="ltr" colspan="2">{{ i['School Subject']['Wednesday'][5]['Subject']}}</td>
<td class="s4" colspan="2">{{ i['School Subject']['Thursday'][5]['Subject']}}</td>
<td class="s4" dir="ltr" colspan="2">{{ i['School Subject']['Friday'][5]['Subject']}}</td>
</tr>
<tr style="height: 19px">
<td class="s5"></td>
<td class="s4" colspan="2">{{ i['School Subject']['Monday'][5]['Teacher']}}</td>
<td class="s4" colspan="2">{{ i['School Subject']['Tuesday'][5]['Teacher']}}</td>
<td class="s4" colspan="2">{{ i['School Subject']['Wednesday'][5]['Teacher']}}</td>
<td class="s4" colspan="2">{{ i['School Subject']['Thursday'][5]['Teacher']}}</td>
<td class="s4" dir="ltr" colspan="2">{{ i['School Subject']['Friday'][5]['Teacher']}}</td>
</tr>
<tr style="height: 19px">
<td class="s5">14.10</td>
<td class="s6" colspan="2">{{ i['School Subject']['Monday'][5]['Room']}}</td>
<td class="s6" colspan="2">{{ i['School Subject']['Tuesday'][5]['Room']}}</td>
<td class="s6" dir="ltr" colspan="2">{{ i['School Subject']['Wednesday'][5]['Room']}}</td>
<td class="s6" colspan="2">{{ i['School Subject']['Thursday'][5]['Room']}}</td>
<td class="s6" dir="ltr" colspan="2">{{ i['School Subject']['Friday'][5]['Room']}}</td>
</tr>
{% endfor %}
</tbody>
</table>
<br>
{% for i in data %}
{% if i['School Subject']['Monday'][0]['PE with'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Motoria) Lunedì alla prima ora siamo con: {{ i['School Subject']['Monday'][0]['PE with']}}</div>
{% endif %}
{% if i['School Subject']['Monday'][1]['PE with'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Motoria) Lunedì alla seconda ora siamo con: {{ i['School Subject']['Monday'][1]['PE with']}}</div>
{% endif %}
{% if i['School Subject']['Monday'][2]['PE with'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Motoria) Lunedì alla terza ora siamo con: {{ i['School Subject']['Monday'][2]['PE with']}}</div>
{% endif %}
{% if i['School Subject']['Monday'][3]['PE with'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Motoria) Lunedì alla quarta ora siamo con: {{ i['School Subject']['Monday'][3]['PE with']}}</div>
{% endif %}
{% if i['School Subject']['Monday'][4]['PE with'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Motoria) Lunedì alla quinta ora siamo con: {{ i['School Subject']['Monday'][4]['PE with']}}</div>
{% endif %}
{% if i['School Subject']['Monday'][5]['PE with'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Motoria) Lunedì alla sesta ora siamo con: {{ i['School Subject']['Monday'][5]['PE with']}}</div>
{% endif %}
{% if i['School Subject']['Tuesday'][0]['PE with'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Motoria) Martedì alla prima ora siamo con: {{ i['School Subject']['Tuesday'][0]['PE with']}}</div>
{% endif %}
{% if i['School Subject']['Tuesday'][1]['PE with'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Motoria) Martedì alla seconda ora siamo con: {{ i['School Subject']['Tuesday'][1]['PE with']}}</div>
{% endif %}
{% if i['School Subject']['Tuesday'][2]['PE with'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Motoria) Martedì alla terza ora siamo con: {{ i['School Subject']['Tuesday'][2]['PE with']}}</div>
{% endif %}
{% if i['School Subject']['Tuesday'][3]['PE with'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Motoria) Martedì alla quarta ora siamo con: {{ i['School Subject']['Tuesday'][3]['PE with']}}</div>
{% endif %}
{% if i['School Subject']['Tuesday'][4]['PE with'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Motoria) Martedì alla quinta ora siamo con: {{ i['School Subject']['Tuesday'][4]['PE with']}}</div>
{% endif %}
{% if i['School Subject']['Tuesday'][5]['PE with'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Motoria) Martedì alla sesta ora siamo con: {{ i['School Subject']['Tuesday'][5]['PE with']}}</div>
{% endif %}
{% if i['School Subject']['Wednesday'][0]['PE with'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Motoria) Mercoledì alla prima ora siamo con: {{ i['School Subject']['Wednesday'][0]['PE with']}}</div>
{% endif %}
{% if i['School Subject']['Wednesday'][1]['PE with'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Motoria) Mercoledì alla seconda ora siamo con: {{ i['School Subject']['Wednesday'][1]['PE with']}}</div>
{% endif %}
{% if i['School Subject']['Wednesday'][2]['PE with'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Motoria) Mercoledì alla terza ora siamo con: {{ i['School Subject']['Wednesday'][2]['PE with']}}</div>
{% endif %}
{% if i['School Subject']['Wednesday'][3]['PE with'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Motoria) Mercoledì alla quarta ora siamo con: {{ i['School Subject']['Wednesday'][3]['PE with']}}</div>
{% endif %}
{% if i['School Subject']['Wednesday'][4]['PE with'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Motoria) Mercoledì alla quinta ora siamo con: {{ i['School Subject']['Wednesday'][4]['PE with']}}</div>
{% endif %}
{% if i['School Subject']['Wednesday'][5]['PE with'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Motoria) Mercoledì alla sesta ora siamo con: {{ i['School Subject']['Wednesday'][5]['PE with']}}</div>
{% endif %}
{% if i['School Subject']['Thursday'][0]['PE with'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Motoria) Giovedì alla prima ora siamo con: {{ i['School Subject']['Thursday'][0]['PE with']}}</div>
{% endif %}
{% if i['School Subject']['Thursday'][1]['PE with'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Motoria) Giovedì alla seconda ora siamo con: {{ i['School Subject']['Thursday'][1]['PE with']}}</div>
{% endif %}
{% if i['School Subject']['Thursday'][2]['PE with'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Motoria) Giovedì alla terza ora siamo con: {{ i['School Subject']['Thursday'][2]['PE with']}}</div>
{% endif %}
{% if i['School Subject']['Thursday'][3]['PE with'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Motoria) Giovedì alla quarta ora siamo con: {{ i['School Subject']['Thursday'][3]['PE with']}}</div>
{% endif %}
{% if i['School Subject']['Thursday'][4]['PE with'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Motoria) Giovedì alla quinta ora siamo con: {{ i['School Subject']['Thursday'][4]['PE with']}}</div>
{% endif %}
{% if i['School Subject']['Thursday'][5]['PE with'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Motoria) (Motoria) Giovedì alla sesta ora siamo con: {{ i['School Subject']['Thursday'][5]['PE with']}}</div>
{% endif %}
{% if i['School Subject']['Friday'][0]['PE with'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Motoria) (Motoria) Venerdì alla prima ora siamo con: {{ i['School Subject']['Friday'][0]['PE with']}}</div>
{% endif %}
{% if i['School Subject']['Friday'][1]['PE with'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Motoria) (Motoria) Venerdì alla seconda ora siamo con: {{ i['School Subject']['Friday'][1]['PE with']}}</div>
{% endif %}
{% if i['School Subject']['Friday'][2]['PE with'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Motoria) (Motoria) Venerdì alla terza ora siamo con: {{ i['School Subject']['Friday'][2]['PE with']}}</div>
{% endif %}
{% if i['School Subject']['Friday'][3]['PE with'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Motoria) (Motoria) Venerdì alla quarta ora siamo con: {{ i['School Subject']['Friday'][3]['PE with']}}</div>
{% endif %}
{% if i['School Subject']['Friday'][4]['PE with'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Motoria) (Motoria) Venerdì alla quinta ora siamo con: {{ i['School Subject']['Friday'][4]['PE with']}}</div>
{% endif %}
{% if i['School Subject']['Friday'][5]['PE with'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Motoria) (Motoria) Venerdì alla sesta ora siamo con: {{ i['School Subject']['Friday'][5]['PE with']}}</div>
{% endif %}
{% endfor %}
{% for i in data %}
{% if i['School Subject']['Monday'][0]['le is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Lunedì (1 ora) le è occupato da: {{ i['School Subject']['Monday'][1]['le is busy']}}</div>
{% endif %}
{% if i['School Subject']['Monday'][1]['le is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Lunedì (2 ora) le è occupato da: {{ i['School Subject']['Monday'][1]['le is busy']}}</div>
{% endif %}
{% if i['School Subject']['Monday'][2]['le is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Lunedì (3 ora) le è occupato da: {{ i['School Subject']['Monday'][2]['le is busy']}}</div>
{% endif %}
{% if i['School Subject']['Monday'][3]['le is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Lunedì (4 ora) le è occupato da: {{ i['School Subject']['Monday'][3]['le is busy']}}</div>
{% endif %}
{% if i['School Subject']['Monday'][4]['le is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Lunedì (5 ora) le è occupato da: {{ i['School Subject']['Monday'][4]['le is busy']}}</div>
{% endif %}
{% if i['School Subject']['Monday'][5]['le is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Lunedì (6 ora) le è occupato da: {{ i['School Subject']['Monday'][5]['le is busy']}}</div>
{% endif %}
{% if i['School Subject']['Tuesday'][0]['le is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Martedì (1 ora) le è occupato da: {{ i['School Subject']['Tuesday'][0]['le is busy']}}</div>
{% endif %}
{% if i['School Subject']['Tuesday'][1]['le is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Martedì (2 ora) le è occupato da: {{ i['School Subject']['Tuesday'][1]['le is busy']}}</div>
{% endif %}
{% if i['School Subject']['Tuesday'][2]['le is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Martedì (3 ora) le è occupato da: {{ i['School Subject']['Tuesday'][2]['le is busy']}}</div>
{% endif %}
{% if i['School Subject']['Tuesday'][3]['le is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Martedì (4 ora) le è occupato da: {{ i['School Subject']['Tuesday'][3]['le is busy']}}</div>
{% endif %}
{% if i['School Subject']['Tuesday'][4]['le is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Martedì (5 ora) le è occupato da: {{ i['School Subject']['Tuesday'][4]['le is busy']}}</div>
{% endif %}
{% if i['School Subject']['Tuesday'][5]['le is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Martedì (6 ora) le è occupato da: {{ i['School Subject']['Tuesday'][5]['le is busy']}}</div>
{% endif %}
{% if i['School Subject']['Wednesday'][0]['le is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Mercoledì (1 ora) le è occupato da: {{ i['School Subject']['Wednesday'][0]['le is busy']}}</div>
{% endif %}
{% if i['School Subject']['Wednesday'][1]['le is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Mercoledì (2 ora) le è occupato da: {{ i['School Subject']['Wednesday'][1]['le is busy']}}</div>
{% endif %}
{% if i['School Subject']['Wednesday'][2]['le is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Mercoledì (3 ora) le è occupato da: {{ i['School Subject']['Wednesday'][2]['le is busy']}}</div>
{% endif %}
{% if i['School Subject']['Wednesday'][3]['le is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Mercoledì (4 ora) le è occupato da: {{ i['School Subject']['Wednesday'][3]['le is busy']}}</div>
{% endif %}
{% if i['School Subject']['Wednesday'][4]['le is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Mercoledì (5 ora) le è occupato da: {{ i['School Subject']['Wednesday'][4]['le is busy']}}</div>
{% endif %}
{% if i['School Subject']['Wednesday'][5]['le is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Mercoledì (6 ora) le è occupato da: {{ i['School Subject']['Wednesday'][5]['le is busy']}}</div>
{% endif %}
{% if i['School Subject']['Thursday'][0]['le is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Giovedì (1 ora) le è occupato da: {{ i['School Subject']['Thursday'][0]['le is busy']}}</div>
{% endif %}
{% if i['School Subject']['Thursday'][1]['le is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Giovedì (2 ora) le è occupato da: {{ i['School Subject']['Thursday'][1]['le is busy']}}</div>
{% endif %}
{% if i['School Subject']['Thursday'][2]['le is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Giovedì (3 ora) le è occupato da: {{ i['School Subject']['Thursday'][2]['le is busy']}}</div>
{% endif %}
{% if i['School Subject']['Thursday'][3]['le is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Giovedì (4 ora) le è occupato da: {{ i['School Subject']['Thursday'][2]['le is busy']}}</div>
{% endif %}
{% if i['School Subject']['Thursday'][4]['le is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Giovedì (5 ora) le è occupato da: {{ i['School Subject']['Thursday'][4]['le is busy']}}</div>
{% endif %}
{% if i['School Subject']['Thursday'][5]['le is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Giovedì (6 ora) le è occupato da: {{ i['School Subject']['Thursday'][5]['le is busy']}}</div>
{% endif %}
{% if i['School Subject']['Friday'][0]['le is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Venerdì (1 ora) le è occupato da: {{ i['School Subject']['Friday'][0]['le is busy']}}</div>
{% endif %}
{% if i['School Subject']['Friday'][1]['le is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Venerdì (2 ora) le è occupato da: {{ i['School Subject']['Friday'][1]['le is busy']}}</div>
{% endif %}
{% if i['School Subject']['Friday'][2]['le is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Venerdì (3 ora) le è occupato da: {{ i['School Subject']['Friday'][2]['le is busy']}}</div>
{% endif %}
{% if i['School Subject']['Friday'][3]['le is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Venerdì (4 ora) le è occupato da: {{ i['School Subject']['Friday'][3]['le is busy']}}</div>
{% endif %}
{% if i['School Subject']['Friday'][4]['le is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Venerdì (5 ora) le è occupato da: {{ i['School Subject']['Friday'][3]['le is busy']}}</div>
{% endif %}
{% if i['School Subject']['Friday'][5]['le is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Venerdì (6 ora) le è occupato da: {{ i['School Subject']['Friday'][5]['le is busy']}}</div>
{% endif %}
{% endfor %}
{% for i in data %}
{% if i['School Subject']['Monday'][0]['le3 is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Lunedì (1 ora) le3 è occupato da: {{ i['School Subject']['Monday'][0]['le3 is busy']}}</div>
{% endif %}
{% if i['School Subject']['Monday'][1]['le3 is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Lunedì (2 ora) le3 è occupato da: {{ i['School Subject']['Monday'][1]['le3 is busy']}}</div>
{% endif %}
{% if i['School Subject']['Monday'][2]['le3 is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Lunedì (3 ora) le3 è occupato da: {{ i['School Subject']['Monday'][2]['le3 is busy']}}</div>
{% endif %}
{% if i['School Subject']['Monday'][3]['le3 is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Lunedì (4 ora) le3 è occupato da: {{ i['School Subject']['Monday'][3]['le3 is busy']}}</div>
{% endif %}
{% if i['School Subject']['Monday'][4]['le3 is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Lunedì (5 ora) le3 è occupato da: {{ i['School Subject']['Monday'][4]['le3 is busy']}}</div>
{% endif %}
{% if i['School Subject']['Monday'][5]['le3 is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Lunedì (6 ora) le3 è occupato da: {{ i['School Subject']['Monday'][5]['le3 is busy']}}</div>
{% endif %}
{% if i['School Subject']['Tuesday'][0]['le3 is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Martedì (1 ora) le3 è occupato da: {{ i['School Subject']['Tuesday'][0]['le3 is busy']}}</div>
{% endif %}
{% if i['School Subject']['Tuesday'][1]['le3 is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Martedì (2 ora) le3 è occupato da: {{ i['School Subject']['Tuesday'][1]['le3 is busy']}}</div>
{% endif %}
{% if i['School Subject']['Tuesday'][2]['le3 is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Martedì (3 ora) le3 è occupato da: {{ i['School Subject']['Tuesday'][2]['le3 is busy']}}</div>
{% endif %}
{% if i['School Subject']['Tuesday'][3]['le3 is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Martedì (4 ora) le3 è occupato da: {{ i['School Subject']['Tuesday'][3]['le3 is busy']}}</div>
{% endif %}
{% if i['School Subject']['Tuesday'][4]['le3 is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Martedì (5 ora) le3 è occupato da: {{ i['School Subject']['Tuesday'][4]['le3 is busy']}}</div>
{% endif %}
{% if i['School Subject']['Tuesday'][5]['le3 is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Martedì (6 ora) le3 è occupato da: {{ i['School Subject']['Tuesday'][5]['le3 is busy']}}</div>
{% endif %}
{% if i['School Subject']['Wednesday'][0]['le3 is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Mercoledì (1 ora) le3 è occupato da: {{ i['School Subject']['Wednesday'][0]['le3 is busy']}}</div>
{% endif %}
{% if i['School Subject']['Wednesday'][1]['le3 is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Mercoledì (2 ora) le3 è occupato da: {{ i['School Subject']['Wednesday'][1]['le3 is busy']}}</div>
{% endif %}
{% if i['School Subject']['Wednesday'][2]['le3 is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Mercoledì (3 ora) le3 è occupato da: {{ i['School Subject']['Wednesday'][2]['le3 is busy']}}</div>
{% endif %}
{% if i['School Subject']['Wednesday'][3]['le3 is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Mercoledì (4 ora) le3 è occupato da: {{ i['School Subject']['Wednesday'][3]['le3 is busy']}}</div>
{% endif %}
{% if i['School Subject']['Wednesday'][4]['le3 is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Mercoledì (5 ora) le3 è occupato da: {{ i['School Subject']['Wednesday'][4]['le3 is busy']}}</div>
{% endif %}
{% if i['School Subject']['Wednesday'][5]['le3 is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Mercoledì (6 ora) le3 è occupato da: {{ i['School Subject']['Wednesday'][5]['le3 is busy']}}</div>
{% endif %}
{% if i['School Subject']['Thursday'][0]['le3 is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Giovedì (1 ora) le3 è occupato da: {{ i['School Subject']['Thursday'][0]['le3 is busy']}}</div>
{% endif %}
{% if i['School Subject']['Thursday'][1]['le3 is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Giovedì (2 ora) le3 è occupato da: {{ i['School Subject']['Thursday'][1]['le3 is busy']}}</div>
{% endif %}
{% if i['School Subject']['Thursday'][2]['le3 is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Giovedì (3 ora) le3 è occupato da: {{ i['School Subject']['Thursday'][2]['le3 is busy']}}</div>
{% endif %}
{% if i['School Subject']['Thursday'][3]['le3 is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Giovedì (4 ora) le3 è occupato da: {{ i['School Subject']['Thursday'][3]['le3 is busy']}}</div>
{% endif %}
{% if i['School Subject']['Thursday'][4]['le3 is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Giovedì (5 ora) le3 è occupato da: {{ i['School Subject']['Thursday'][4]['le3 is busy']}}</div>
{% endif %}
{% if i['School Subject']['Thursday'][5]['le3 is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Giovedì (6 ora) le3 è occupato da: {{ i['School Subject']['Thursday'][5]['le3 is busy']}}</div>
{% endif %}
{% if i['School Subject']['Friday'][0]['le3 is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Venerdì (1 ora) le3 è occupato da: {{ i['School Subject']['Friday'][0]['le3 is busy']}}</div>
{% endif %}
{% if i['School Subject']['Friday'][1]['le3 is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Venerdì (2 ora) le3 è occupato da: {{ i['School Subject']['Friday'][1]['le3 is busy']}}</div>
{% endif %}
{% if i['School Subject']['Friday'][2]['le3 is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Venerdì (3 ora) le3 è occupato da: {{ i['School Subject']['Friday'][2]['le3 is busy']}}</div>
{% endif %}
{% if i['School Subject']['Friday'][3]['le3 is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Venerdì (4 ora) le3 è occupato da: {{ i['School Subject']['Friday'][3]['le3 is busy']}}</div>
{% endif %}
{% if i['School Subject']['Friday'][4]['le3 is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Venerdì (5 ora) le3 è occupato da: {{ i['School Subject']['Friday'][4]['le3 is busy']}}</div>
{% endif %}
{% if i['School Subject']['Friday'][5]['le3 is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Venerdì (6 ora) le3 è occupato da: {{ i['School Subject']['Friday'][5]['le3 is busy']}}</div>
{% endif %}
{% endfor %}
</div>
</body>

40
templates/index.html Normal file
View File

@@ -0,0 +1,40 @@
{% extends "base.html" %}
{% block title %}Register System{% endblock %}
{% block content %}
{% if message %}
<div class="alert alert-secondary" role="alert">
<p>{{ message }}</p>
</div>
{% endif %}
<form action="" method="post">
<div class="form-group">
<label for="Fullname">Full name</label>
<input name="fullname" class="form-control" id="inputFullName" aria-describedby="emailHelp" placeholder="Enter full name">
<small id="fullName" class="form-text text-muted">Please enter your full name(First name and Last name)</small>
</div>
<div class="form-group">
<label for="InputEmail">Email address</label>
<input name="email" class="form-control" id="InputEmail" placeholder="Enter email">
<small id="emailHelp" class="form-text text-muted">We'll never share your email with anyone else.</small>
</div>
<div class="form-group">
<label for="InputPassword">Password</label>
<input type="password" name="password1" class="form-control" id="InputPassword" placeholder="Password">
</div>
<div class="form-group">
<label for="InputPassword2">Repeat Password</label>
<input type="password" name="password2" class="form-control" id="InputPassword2" placeholder="Repeat Password">
</div>
<button type="submit" class="btn btn-primary">Submit</button>
</form>
{% endblock %}

View File

@@ -0,0 +1,7 @@
{% extends "base.html" %}
{% block title %}Youv'e logged in {% endblock %}
{% block content %}
<p>Hello You have Logged in as {{ email }}</p>
{% endblock %}

View File

@@ -0,0 +1,24 @@
{% extends "base.html" %}
{% block title %}Login System{% endblock %}
{% block content %}
{% if message %}
<div class="alert alert-secondary" role="alert">
<p>{{ message }}</p>
</div>
{% endif %}
<form action="" method="post">
<div class="form-group">
<label for="InputEmail">Email address</label>
<input name="email" class="form-control" id="InputEmail" placeholder="Enter email">
<small id="emailHelp" class="form-text text-muted">We'll never share your email with anyone else.</small>
</div>
<div class="form-group">
<label for="InputPassword">Password</label>
<input type="password" name="password" class="form-control" id="InputPassword" placeholder="Password">
</div>
<button type="submit" class="btn btn-primary">Submit</button>
</form>
{% endblock %}

View File

@@ -0,0 +1,776 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style type="text/css">
.ritz .waffle a {
color: inherit;
}
.ritz .waffle .s5 {
border-right: 1px SOLID #000000;
background-color: #ffffff;
text-align: center;
color: #000000;
font-family: 'docs-Calibri', Arial;
font-size: 11pt;
vertical-align: bottom;
white-space: nowrap;
direction: ltr;
padding: 0px 3px 0px 3px;
}
.ritz .waffle .s4 {
border-right: 1px SOLID #000000;
background-color: #ffffff;
text-align: left;
font-weight: bold;
color: #000000;
font-family: 'docs-Calibri', Arial;
font-size: 11pt;
vertical-align: bottom;
white-space: nowrap;
direction: ltr;
padding: 0px 3px 0px 3px;
}
.ritz .waffle .s6 {
border-bottom: 1px SOLID #000000;
border-right: 1px SOLID #000000;
background-color: #ffffff;
text-align: left;
font-weight: bold;
color: #000000;
font-family: 'docs-Calibri', Arial;
font-size: 11pt;
vertical-align: bottom;
white-space: nowrap;
direction: ltr;
padding: 0px 3px 0px 3px;
}
.ritz .waffle .s1 {
border-bottom: 1px SOLID #000000;
background-color: #ffffff;
text-align: left;
font-weight: bold;
color: #000000;
font-family: 'docs-Calibri', Arial;
font-size: 11pt;
vertical-align: bottom;
white-space: nowrap;
direction: ltr;
padding: 0px 3px 0px 3px;
}
.ritz .waffle .s2 {
border-right: 1px SOLID #000000;
background-color: #ffffff;
text-align: center;
color: #000000;
font-family: 'docs-Calibri', Arial;
font-size: 11pt;
vertical-align: middle;
white-space: nowrap;
direction: ltr;
padding: 0px 3px 0px 3px;
}
.ritz .waffle .s8 {
border-left: none;
background-color: #ffffff;
text-align: left;
font-weight: bold;
color: #000000;
font-family: 'docs-Calibri', Arial;
font-size: 11pt;
vertical-align: bottom;
white-space: nowrap;
direction: ltr;
padding: 0px 3px 0px 3px;
}
.ritz .waffle .s9 {
border-bottom: 1px SOLID #000000;
border-right: 1px SOLID #000000;
background-color: #ffffff;
text-align: left;
font-weight: bold;
color: #000000;
font-family: 'docs-Calibri', Arial;
font-size: 11pt;
vertical-align: middle;
white-space: nowrap;
direction: ltr;
padding: 0px 3px 0px 3px;
}
.ritz .waffle .s3 {
border-right: 1px SOLID #000000;
background-color: #ffffff;
text-align: left;
font-weight: bold;
color: #000000;
font-family: 'docs-Calibri', Arial;
font-size: 11pt;
vertical-align: middle;
white-space: nowrap;
direction: ltr;
padding: 0px 3px 0px 3px;
}
.ritz .waffle .s0 {
border-bottom: 1px SOLID #000000;
background-color: #ffffff;
text-align: left;
color: #000000;
font-family: 'docs-Calibri', Arial;
font-size: 11pt;
vertical-align: bottom;
white-space: nowrap;
direction: ltr;
padding: 0px 3px 0px 3px;
}
.ritz .waffle .s7 {
border-right: none;
background-color: #ffffff;
text-align: left;
font-weight: bold;
color: #000000;
font-family: 'docs-docs-Calibri', Arial;
font-size: 11pt;
vertical-align: bottom;
white-space: nowrap;
direction: ltr;
padding: 0px 3px 0px 3px;
}
</style>
<div class="ritz grid-container" dir="ltr" style="overflow-x:auto;">
<table class="waffle" cellspacing="0" cellpadding="0">
<tbody>
{% for i in data %}
<tr style="height: 19px">
<td class="s0"></td>
<td class="s1" colspan="2">Lunedì</td>
<td class="s1" colspan="2">Martedì</td>
<td class="s1" colspan="2">Mercoledì</td>
<td class="s1" colspan="2">Giovedì</td>
<td class="s1" colspan="2">Venerdì</td>
</tr>
<tr style="height: 21px">
<td class="s2">7:55</td>
<td class="s3" colspan="2">{{ i['School Subject']['Monday'][0]['Subject']}}</td>
<td class="s3" dir="ltr" colspan="2">{{ i['School Subject']['Tuesday'][0]['Subject']}}</td>
<td class="s3" colspan="2">{{ i['School Subject']['Wednesday'][0]['Subject']}}</td>
<td class="s3" dir="ltr" colspan="2">{{ i['School Subject']['Thursday'][0]['Subject']}}</td>
<td class="s4" dir="ltr" colspan="2">{{ i['School Subject']['Friday'][0]['Subject']}}</td>
</tr>
<tr style="height: 19px">
<td class="s5"></td>
<td class="s4" colspan="2">{{ i['School Subject']['Monday'][0]['Teacher']}}</td>
<td class="s4" dir="ltr" colspan="2">{{ i['School Subject']['Tuesday'][0]['Teacher']}}</td>
<td class="s4" colspan="2">{{ i['School Subject']['Wednesday'][0]['Teacher']}}</td>
<td class="s4" dir="ltr" colspan="2">{{ i['School Subject']['Thursday'][0]['Teacher']}}</td>
<td class="s4" dir="ltr" colspan="2">{{ i['School Subject']['Friday'][0]['Teacher']}}</td>
</tr>
<tr style="height: 19px">
<td class="s5">08.55</td>
<td class="s6" dir="ltr" colspan="2">{{ i['School Subject']['Monday'][0]['Room']}}</td>
<td class="s6" dir="ltr" colspan="2">{{ i['School Subject']['Tuesday'][0]['Room']}}</td>
<td class="s6" colspan="2">{{ i['School Subject']['Wednesday'][0]['Room']}}</td>
<td class="s6" dir="ltr" colspan="2">{{ i['School Subject']['Thursday'][0]['Room']}}</td>
<td class="s6" dir="ltr" colspan="2">{{ i['School Subject']['Friday'][0]['Room']}}</td>
</tr>
<tr style="height: 19px">
<td class="s5">08.55</td>
<td class="s4" colspan="2">{{ i['School Subject']['Monday'][1]['Subject']}}</td>
<td class="s4" dir="ltr" colspan="2">{{ i['School Subject']['Tuesday'][1]['Subject']}}</td>
<td class="s4" colspan="2">{{ i['School Subject']['Wednesday'][1]['Subject']}}</td>
<td class="s4" colspan="2">{{ i['School Subject']['Thursday'][1]['Subject']}}</td>
<td class="s4" dir="ltr" colspan="2">{{ i['School Subject']['Friday'][1]['Subject']}}</td>
</tr>
<tr style="height: 19px">
<td class="s5"></td>
<td class="s4" colspan="2">{{ i['School Subject']['Monday'][1]['Teacher']}}</td>
<td class="s4" dir="ltr" colspan="2">{{ i['School Subject']['Tuesday'][1]['Teacher']}}</td>
<td class="s4" colspan="2">{{ i['School Subject']['Wednesday'][1]['Teacher']}}</td>
<td class="s4" colspan="2">{{ i['School Subject']['Thursday'][1]['Teacher']}}</td>
<td class="s4" dir="ltr" colspan="2">{{ i['School Subject']['Friday'][1]['Teacher']}}</td>
</tr>
<tr style="height: 19px">
<td class="s5">09.55</td>
<td class="s6" colspan="2">{{ i['School Subject']['Monday'][1]['Room']}}</td>
<td class="s6" dir="ltr" colspan="2">{{ i['School Subject']['Tuesday'][1]['Room']}}</td>
<td class="s6" colspan="2">{{ i['School Subject']['Wednesday'][1]['Room']}}</td>
<td class="s6" dir="ltr" colspan="2">{{ i['School Subject']['Thursday'][1]['Room']}}</td>
<td class="s6" dir="ltr" colspan="2">{{ i['School Subject']['Friday'][1]['Room']}}</td>
</tr>
<tr style="height: 19px">
<td class="s5">09.55</td>
<td class="s4" colspan="2">{{ i['School Subject']['Monday'][2]['Subject']}}</td>
<td class="s4" dir="ltr" colspan="2">{{ i['School Subject']['Tuesday'][2]['Subject']}}</td>
<td class="s4" colspan="2">{{ i['School Subject']['Wednesday'][2]['Subject']}}</td>
<td class="s4" dir="ltr" colspan="2">{{ i['School Subject']['Thursday'][2]['Subject']}}</td>
<td class="s4" dir="ltr" colspan="2">{{ i['School Subject']['Friday'][2]['Subject']}}</td>
</tr>
<tr style="height: 19px">
<td class="s5"></td>
<td class="s4" colspan="2">{{ i['School Subject']['Monday'][2]['Teacher']}}</td>
<td class="s4" dir="ltr" colspan="2">{{ i['School Subject']['Tuesday'][2]['Teacher']}}</td>
<td class="s4" colspan="2">{{ i['School Subject']['Wednesday'][2]['Teacher']}}</td>
<td class="s4" dir="ltr" colspan="2">{{ i['School Subject']['Thursday'][2]['Teacher']}}</td>
<td class="s4" dir="ltr" colspan="2">{{ i['School Subject']['Friday'][2]['Teacher']}}</td>
</tr>
<tr style="height: 19px">
<td class="s5">10.55</td>
<td class="s6" colspan="2">{{ i['School Subject']['Monday'][2]['Room']}}</td>
<td class="s6" dir="ltr" colspan="2">{{ i['School Subject']['Tuesday'][2]['Room']}}</td>
<td class="s6" colspan="2">{{ i['School Subject']['Wednesday'][2]['Room']}}</td>
<td class="s6" dir="ltr" colspan="2">{{ i['School Subject']['Thursday'][2]['Room']}}</td>
<td class="s6" dir="ltr" colspan="2">{{ i['School Subject']['Friday'][2]['Room']}}</td>
</tr>
<tr style="height: 19px">
<td class="s5">11.10</td>
<td class="s4" dir="ltr" colspan="2">{{ i['School Subject']['Monday'][3]['Subject']}}</td>
<td class="s4" dir="ltr" colspan="2">{{ i['School Subject']['Tuesday'][3]['Subject']}}</td>
<td class="s4" dir="ltr" colspan="2">{{ i['School Subject']['Wednesday'][3]['Subject']}}</td>
<td class="s4" colspan="2">{{ i['School Subject']['Thursday'][3]['Subject']}}</td>
<td class="s7 softmerge" dir="ltr">
<div class="softmerge-inner" colspan="2">{{ i['School Subject']['Friday'][3]['Subject']}}</div>
</td>
</tr>
<tr style="height: 19px">
<td class="s5"></td>
<td class="s4" dir="ltr" colspan="2">{{ i['School Subject']['Monday'][3]['Teacher']}}</td>
<td class="s4" dir="ltr" colspan="2">{{ i['School Subject']['Tuesday'][3]['Teacher']}}</td>
<td class="s4" dir="ltr" colspan="2">{{ i['School Subject']['Wednesday'][3]['Teacher']}}</td>
<td class="s4" colspan="2">{{ i['School Subject']['Thursday'][3]['Teacher']}}</td>
<td class="s4" dir="ltr" colspan="2">{{ i['School Subject']['Friday'][3]['Teacher']}}</td>
</tr>
<tr style="height: 19px">
<td class="s5">12.10</td>
<td class="s9" dir="ltr" colspan="2">{{ i['School Subject']['Monday'][3]['Room']}}</td>
<td class="s6" dir="ltr" colspan="2">{{ i['School Subject']['Tuesday'][3]['Room']}}</td>
<td class="s9" dir="ltr" colspan="2">{{ i['School Subject']['Wednesday'][3]['Room']}}</td>
<td class="s6" colspan="2">{{ i['School Subject']['Thursday'][3]['Room']}}</td>
<td class="s6" dir="ltr" colspan="2">{{ i['School Subject']['Friday'][3]['Room']}}</td>
</tr>
<tr style="height: 19px">
<td class="s5">12.10</td>
<td class="s4" dir="ltr" colspan="2">{{ i['School Subject']['Monday'][4]['Subject']}}</td>
<td class="s4" colspan="2">{{ i['School Subject']['Tuesday'][4]['Subject']}}</td>
<td class="s4" dir="ltr" colspan="2">{{ i['School Subject']['Wednesday'][4]['Subject']}}</td>
<td class="s4" colspan="2">{{ i['School Subject']['Thursday'][4]['Subject']}}</td>
<td class="s4" dir="ltr" colspan="2">{{ i['School Subject']['Friday'][4]['Subject']}}</td>
</tr>
<tr style="height: 19px">
<td class="s5"></td>
<td class="s4" dir="ltr" colspan="2">{{ i['School Subject']['Monday'][4]['Teacher']}}</td>
<td class="s4" colspan="2">{{ i['School Subject']['Tuesday'][4]['Teacher']}}</td>
<td class="s4" dir="ltr" colspan="2">{{ i['School Subject']['Wednesday'][4]['Teacher']}}</td>
<td class="s4" colspan="2">{{ i['School Subject']['Thursday'][4]['Teacher']}}</td>
<td class="s4" dir="ltr" colspan="2">{{ i['School Subject']['Friday'][4]['Teacher']}}</td>
</tr>
<tr style="height: 19px">
<td class="s5">13.10</td>
<td class="s6" dir="ltr" colspan="2">{{ i['School Subject']['Monday'][4]['Room']}}</td>
<td class="s6" colspan="2">{{ i['School Subject']['Tuesday'][4]['Room']}}</td>
<td class="s6" dir="ltr" colspan="2">{{ i['School Subject']['Wednesday'][4]['Room']}}</td>
<td class="s6" colspan="2">{{ i['School Subject']['Thursday'][4]['Room']}}</td>
<td class="s6" dir="ltr" colspan="2">{{ i['School Subject']['Friday'][4]['Room']}}</td>
</tr>
<tr style="height: 19px">
<td class="s5">13.10</td>
<td class="s4" colspan="2">{{ i['School Subject']['Monday'][5]['Subject']}}</td>
<td class="s4" colspan="2">{{ i['School Subject']['Tuesday'][5]['Subject']}}</td>
<td class="s4" dir="ltr" colspan="2">{{ i['School Subject']['Wednesday'][5]['Subject']}}</td>
<td class="s4" colspan="2">{{ i['School Subject']['Thursday'][5]['Subject']}}</td>
<td class="s4" dir="ltr" colspan="2">{{ i['School Subject']['Friday'][5]['Subject']}}</td>
</tr>
<tr style="height: 19px">
<td class="s5"></td>
<td class="s4" colspan="2">{{ i['School Subject']['Monday'][5]['Teacher']}}</td>
<td class="s4" colspan="2">{{ i['School Subject']['Tuesday'][5]['Teacher']}}</td>
<td class="s4" colspan="2">{{ i['School Subject']['Wednesday'][5]['Teacher']}}</td>
<td class="s4" colspan="2">{{ i['School Subject']['Thursday'][5]['Teacher']}}</td>
<td class="s4" dir="ltr" colspan="2">{{ i['School Subject']['Friday'][5]['Teacher']}}</td>
</tr>
<tr style="height: 19px">
<td class="s5">14.10</td>
<td class="s6" colspan="2">{{ i['School Subject']['Monday'][5]['Room']}}</td>
<td class="s6" colspan="2">{{ i['School Subject']['Tuesday'][5]['Room']}}</td>
<td class="s6" dir="ltr" colspan="2">{{ i['School Subject']['Wednesday'][5]['Room']}}</td>
<td class="s6" colspan="2">{{ i['School Subject']['Thursday'][5]['Room']}}</td>
<td class="s6" dir="ltr" colspan="2">{{ i['School Subject']['Friday'][5]['Room']}}</td>
</tr>
{% endfor %}
</tbody>
</table>
<br>
{% for i in data %}
{% if i['School Subject']['Monday'][0]['PE with'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Motoria) Lunedì alla prima ora siamo con: {{ i['School Subject']['Monday'][0]['PE with']}}</div>
{% endif %}
{% if i['School Subject']['Monday'][1]['PE with'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Motoria) Lunedì alla seconda ora siamo con: {{ i['School Subject']['Monday'][1]['PE with']}}</div>
{% endif %}
{% if i['School Subject']['Monday'][2]['PE with'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Motoria) Lunedì alla terza ora siamo con: {{ i['School Subject']['Monday'][2]['PE with']}}</div>
{% endif %}
{% if i['School Subject']['Monday'][3]['PE with'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Motoria) Lunedì alla quarta ora siamo con: {{ i['School Subject']['Monday'][3]['PE with']}}</div>
{% endif %}
{% if i['School Subject']['Monday'][4]['PE with'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Motoria) Lunedì alla quinta ora siamo con: {{ i['School Subject']['Monday'][4]['PE with']}}</div>
{% endif %}
{% if i['School Subject']['Monday'][5]['PE with'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Motoria) Lunedì alla sesta ora siamo con: {{ i['School Subject']['Monday'][5]['PE with']}}</div>
{% endif %}
{% if i['School Subject']['Tuesday'][0]['PE with'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Motoria) Martedì alla prima ora siamo con: {{ i['School Subject']['Tuesday'][0]['PE with']}}</div>
{% endif %}
{% if i['School Subject']['Tuesday'][1]['PE with'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Motoria) Martedì alla seconda ora siamo con: {{ i['School Subject']['Tuesday'][1]['PE with']}}</div>
{% endif %}
{% if i['School Subject']['Tuesday'][2]['PE with'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Motoria) Martedì alla terza ora siamo con: {{ i['School Subject']['Tuesday'][2]['PE with']}}</div>
{% endif %}
{% if i['School Subject']['Tuesday'][3]['PE with'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Motoria) Martedì alla quarta ora siamo con: {{ i['School Subject']['Tuesday'][3]['PE with']}}</div>
{% endif %}
{% if i['School Subject']['Tuesday'][4]['PE with'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Motoria) Martedì alla quinta ora siamo con: {{ i['School Subject']['Tuesday'][4]['PE with']}}</div>
{% endif %}
{% if i['School Subject']['Tuesday'][5]['PE with'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Motoria) Martedì alla sesta ora siamo con: {{ i['School Subject']['Tuesday'][5]['PE with']}}</div>
{% endif %}
{% if i['School Subject']['Wednesday'][0]['PE with'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Motoria) Mercoledì alla prima ora siamo con: {{ i['School Subject']['Wednesday'][0]['PE with']}}</div>
{% endif %}
{% if i['School Subject']['Wednesday'][1]['PE with'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Motoria) Mercoledì alla seconda ora siamo con: {{ i['School Subject']['Wednesday'][1]['PE with']}}</div>
{% endif %}
{% if i['School Subject']['Wednesday'][2]['PE with'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Motoria) Mercoledì alla terza ora siamo con: {{ i['School Subject']['Wednesday'][2]['PE with']}}</div>
{% endif %}
{% if i['School Subject']['Wednesday'][3]['PE with'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Motoria) Mercoledì alla quarta ora siamo con: {{ i['School Subject']['Wednesday'][3]['PE with']}}</div>
{% endif %}
{% if i['School Subject']['Wednesday'][4]['PE with'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Motoria) Mercoledì alla quinta ora siamo con: {{ i['School Subject']['Wednesday'][4]['PE with']}}</div>
{% endif %}
{% if i['School Subject']['Wednesday'][5]['PE with'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Motoria) Mercoledì alla sesta ora siamo con: {{ i['School Subject']['Wednesday'][5]['PE with']}}</div>
{% endif %}
{% if i['School Subject']['Thursday'][0]['PE with'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Motoria) Giovedì alla prima ora siamo con: {{ i['School Subject']['Thursday'][0]['PE with']}}</div>
{% endif %}
{% if i['School Subject']['Thursday'][1]['PE with'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Motoria) Giovedì alla seconda ora siamo con: {{ i['School Subject']['Thursday'][1]['PE with']}}</div>
{% endif %}
{% if i['School Subject']['Thursday'][2]['PE with'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Motoria) Giovedì alla terza ora siamo con: {{ i['School Subject']['Thursday'][2]['PE with']}}</div>
{% endif %}
{% if i['School Subject']['Thursday'][3]['PE with'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Motoria) Giovedì alla quarta ora siamo con: {{ i['School Subject']['Thursday'][3]['PE with']}}</div>
{% endif %}
{% if i['School Subject']['Thursday'][4]['PE with'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Motoria) Giovedì alla quinta ora siamo con: {{ i['School Subject']['Thursday'][4]['PE with']}}</div>
{% endif %}
{% if i['School Subject']['Thursday'][5]['PE with'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Motoria) (Motoria) Giovedì alla sesta ora siamo con: {{ i['School Subject']['Thursday'][5]['PE with']}}</div>
{% endif %}
{% if i['School Subject']['Friday'][0]['PE with'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Motoria) (Motoria) Venerdì alla prima ora siamo con: {{ i['School Subject']['Friday'][0]['PE with']}}</div>
{% endif %}
{% if i['School Subject']['Friday'][1]['PE with'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Motoria) (Motoria) Venerdì alla seconda ora siamo con: {{ i['School Subject']['Friday'][1]['PE with']}}</div>
{% endif %}
{% if i['School Subject']['Friday'][2]['PE with'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Motoria) (Motoria) Venerdì alla terza ora siamo con: {{ i['School Subject']['Friday'][2]['PE with']}}</div>
{% endif %}
{% if i['School Subject']['Friday'][3]['PE with'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Motoria) (Motoria) Venerdì alla quarta ora siamo con: {{ i['School Subject']['Friday'][3]['PE with']}}</div>
{% endif %}
{% if i['School Subject']['Friday'][4]['PE with'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Motoria) (Motoria) Venerdì alla quinta ora siamo con: {{ i['School Subject']['Friday'][4]['PE with']}}</div>
{% endif %}
{% if i['School Subject']['Friday'][5]['PE with'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Motoria) (Motoria) Venerdì alla sesta ora siamo con: {{ i['School Subject']['Friday'][5]['PE with']}}</div>
{% endif %}
{% endfor %}
{% for i in data %}
{% if i['School Subject']['Monday'][0]['le is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Lunedì (1 ora) le è occupato da: {{ i['School Subject']['Monday'][1]['le is busy']}}</div>
{% endif %}
{% if i['School Subject']['Monday'][1]['le is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Lunedì (2 ora) le è occupato da: {{ i['School Subject']['Monday'][1]['le is busy']}}</div>
{% endif %}
{% if i['School Subject']['Monday'][2]['le is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Lunedì (3 ora) le è occupato da: {{ i['School Subject']['Monday'][2]['le is busy']}}</div>
{% endif %}
{% if i['School Subject']['Monday'][3]['le is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Lunedì (4 ora) le è occupato da: {{ i['School Subject']['Monday'][3]['le is busy']}}</div>
{% endif %}
{% if i['School Subject']['Monday'][4]['le is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Lunedì (5 ora) le è occupato da: {{ i['School Subject']['Monday'][4]['le is busy']}}</div>
{% endif %}
{% if i['School Subject']['Monday'][5]['le is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Lunedì (6 ora) le è occupato da: {{ i['School Subject']['Monday'][5]['le is busy']}}</div>
{% endif %}
{% if i['School Subject']['Tuesday'][0]['le is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Martedì (1 ora) le è occupato da: {{ i['School Subject']['Tuesday'][0]['le is busy']}}</div>
{% endif %}
{% if i['School Subject']['Tuesday'][1]['le is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Martedì (2 ora) le è occupato da: {{ i['School Subject']['Tuesday'][1]['le is busy']}}</div>
{% endif %}
{% if i['School Subject']['Tuesday'][2]['le is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Martedì (3 ora) le è occupato da: {{ i['School Subject']['Tuesday'][2]['le is busy']}}</div>
{% endif %}
{% if i['School Subject']['Tuesday'][3]['le is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Martedì (4 ora) le è occupato da: {{ i['School Subject']['Tuesday'][3]['le is busy']}}</div>
{% endif %}
{% if i['School Subject']['Tuesday'][4]['le is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Martedì (5 ora) le è occupato da: {{ i['School Subject']['Tuesday'][4]['le is busy']}}</div>
{% endif %}
{% if i['School Subject']['Tuesday'][5]['le is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Martedì (6 ora) le è occupato da: {{ i['School Subject']['Tuesday'][5]['le is busy']}}</div>
{% endif %}
{% if i['School Subject']['Wednesday'][0]['le is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Mercoledì (1 ora) le è occupato da: {{ i['School Subject']['Wednesday'][0]['le is busy']}}</div>
{% endif %}
{% if i['School Subject']['Wednesday'][1]['le is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Mercoledì (2 ora) le è occupato da: {{ i['School Subject']['Wednesday'][1]['le is busy']}}</div>
{% endif %}
{% if i['School Subject']['Wednesday'][2]['le is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Mercoledì (3 ora) le è occupato da: {{ i['School Subject']['Wednesday'][2]['le is busy']}}</div>
{% endif %}
{% if i['School Subject']['Wednesday'][3]['le is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Mercoledì (4 ora) le è occupato da: {{ i['School Subject']['Wednesday'][3]['le is busy']}}</div>
{% endif %}
{% if i['School Subject']['Wednesday'][4]['le is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Mercoledì (5 ora) le è occupato da: {{ i['School Subject']['Wednesday'][4]['le is busy']}}</div>
{% endif %}
{% if i['School Subject']['Wednesday'][5]['le is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Mercoledì (6 ora) le è occupato da: {{ i['School Subject']['Wednesday'][5]['le is busy']}}</div>
{% endif %}
{% if i['School Subject']['Thursday'][0]['le is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Giovedì (1 ora) le è occupato da: {{ i['School Subject']['Thursday'][0]['le is busy']}}</div>
{% endif %}
{% if i['School Subject']['Thursday'][1]['le is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Giovedì (2 ora) le è occupato da: {{ i['School Subject']['Thursday'][1]['le is busy']}}</div>
{% endif %}
{% if i['School Subject']['Thursday'][2]['le is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Giovedì (3 ora) le è occupato da: {{ i['School Subject']['Thursday'][2]['le is busy']}}</div>
{% endif %}
{% if i['School Subject']['Thursday'][3]['le is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Giovedì (4 ora) le è occupato da: {{ i['School Subject']['Thursday'][2]['le is busy']}}</div>
{% endif %}
{% if i['School Subject']['Thursday'][4]['le is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Giovedì (5 ora) le è occupato da: {{ i['School Subject']['Thursday'][4]['le is busy']}}</div>
{% endif %}
{% if i['School Subject']['Thursday'][5]['le is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Giovedì (6 ora) le è occupato da: {{ i['School Subject']['Thursday'][5]['le is busy']}}</div>
{% endif %}
{% if i['School Subject']['Friday'][0]['le is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Venerdì (1 ora) le è occupato da: {{ i['School Subject']['Friday'][0]['le is busy']}}</div>
{% endif %}
{% if i['School Subject']['Friday'][1]['le is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Venerdì (2 ora) le è occupato da: {{ i['School Subject']['Friday'][1]['le is busy']}}</div>
{% endif %}
{% if i['School Subject']['Friday'][2]['le is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Venerdì (3 ora) le è occupato da: {{ i['School Subject']['Friday'][2]['le is busy']}}</div>
{% endif %}
{% if i['School Subject']['Friday'][3]['le is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Venerdì (4 ora) le è occupato da: {{ i['School Subject']['Friday'][3]['le is busy']}}</div>
{% endif %}
{% if i['School Subject']['Friday'][4]['le is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Venerdì (5 ora) le è occupato da: {{ i['School Subject']['Friday'][3]['le is busy']}}</div>
{% endif %}
{% if i['School Subject']['Friday'][5]['le is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Venerdì (6 ora) le è occupato da: {{ i['School Subject']['Friday'][5]['le is busy']}}</div>
{% endif %}
{% endfor %}
{% for i in data %}
{% if i['School Subject']['Monday'][0]['le3 is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Lunedì (1 ora) le3 è occupato da: {{ i['School Subject']['Monday'][0]['le3 is busy']}}</div>
{% endif %}
{% if i['School Subject']['Monday'][1]['le3 is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Lunedì (2 ora) le3 è occupato da: {{ i['School Subject']['Monday'][1]['le3 is busy']}}</div>
{% endif %}
{% if i['School Subject']['Monday'][2]['le3 is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Lunedì (3 ora) le3 è occupato da: {{ i['School Subject']['Monday'][2]['le3 is busy']}}</div>
{% endif %}
{% if i['School Subject']['Monday'][3]['le3 is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Lunedì (4 ora) le3 è occupato da: {{ i['School Subject']['Monday'][3]['le3 is busy']}}</div>
{% endif %}
{% if i['School Subject']['Monday'][4]['le3 is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Lunedì (5 ora) le3 è occupato da: {{ i['School Subject']['Monday'][4]['le3 is busy']}}</div>
{% endif %}
{% if i['School Subject']['Monday'][5]['le3 is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Lunedì (6 ora) le3 è occupato da: {{ i['School Subject']['Monday'][5]['le3 is busy']}}</div>
{% endif %}
{% if i['School Subject']['Tuesday'][0]['le3 is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Martedì (1 ora) le3 è occupato da: {{ i['School Subject']['Tuesday'][0]['le3 is busy']}}</div>
{% endif %}
{% if i['School Subject']['Tuesday'][1]['le3 is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Martedì (2 ora) le3 è occupato da: {{ i['School Subject']['Tuesday'][1]['le3 is busy']}}</div>
{% endif %}
{% if i['School Subject']['Tuesday'][2]['le3 is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Martedì (3 ora) le3 è occupato da: {{ i['School Subject']['Tuesday'][2]['le3 is busy']}}</div>
{% endif %}
{% if i['School Subject']['Tuesday'][3]['le3 is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Martedì (4 ora) le3 è occupato da: {{ i['School Subject']['Tuesday'][3]['le3 is busy']}}</div>
{% endif %}
{% if i['School Subject']['Tuesday'][4]['le3 is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Martedì (5 ora) le3 è occupato da: {{ i['School Subject']['Tuesday'][4]['le3 is busy']}}</div>
{% endif %}
{% if i['School Subject']['Tuesday'][5]['le3 is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Martedì (6 ora) le3 è occupato da: {{ i['School Subject']['Tuesday'][5]['le3 is busy']}}</div>
{% endif %}
{% if i['School Subject']['Wednesday'][0]['le3 is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Mercoledì (1 ora) le3 è occupato da: {{ i['School Subject']['Wednesday'][0]['le3 is busy']}}</div>
{% endif %}
{% if i['School Subject']['Wednesday'][1]['le3 is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Mercoledì (2 ora) le3 è occupato da: {{ i['School Subject']['Wednesday'][1]['le3 is busy']}}</div>
{% endif %}
{% if i['School Subject']['Wednesday'][2]['le3 is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Mercoledì (3 ora) le3 è occupato da: {{ i['School Subject']['Wednesday'][2]['le3 is busy']}}</div>
{% endif %}
{% if i['School Subject']['Wednesday'][3]['le3 is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Mercoledì (4 ora) le3 è occupato da: {{ i['School Subject']['Wednesday'][3]['le3 is busy']}}</div>
{% endif %}
{% if i['School Subject']['Wednesday'][4]['le3 is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Mercoledì (5 ora) le3 è occupato da: {{ i['School Subject']['Wednesday'][4]['le3 is busy']}}</div>
{% endif %}
{% if i['School Subject']['Wednesday'][5]['le3 is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Mercoledì (6 ora) le3 è occupato da: {{ i['School Subject']['Wednesday'][5]['le3 is busy']}}</div>
{% endif %}
{% if i['School Subject']['Thursday'][0]['le3 is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Giovedì (1 ora) le3 è occupato da: {{ i['School Subject']['Thursday'][0]['le3 is busy']}}</div>
{% endif %}
{% if i['School Subject']['Thursday'][1]['le3 is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Giovedì (2 ora) le3 è occupato da: {{ i['School Subject']['Thursday'][1]['le3 is busy']}}</div>
{% endif %}
{% if i['School Subject']['Thursday'][2]['le3 is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Giovedì (3 ora) le3 è occupato da: {{ i['School Subject']['Thursday'][2]['le3 is busy']}}</div>
{% endif %}
{% if i['School Subject']['Thursday'][3]['le3 is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Giovedì (4 ora) le3 è occupato da: {{ i['School Subject']['Thursday'][3]['le3 is busy']}}</div>
{% endif %}
{% if i['School Subject']['Thursday'][4]['le3 is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Giovedì (5 ora) le3 è occupato da: {{ i['School Subject']['Thursday'][4]['le3 is busy']}}</div>
{% endif %}
{% if i['School Subject']['Thursday'][5]['le3 is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Giovedì (6 ora) le3 è occupato da: {{ i['School Subject']['Thursday'][5]['le3 is busy']}}</div>
{% endif %}
{% if i['School Subject']['Friday'][0]['le3 is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Venerdì (1 ora) le3 è occupato da: {{ i['School Subject']['Friday'][0]['le3 is busy']}}</div>
{% endif %}
{% if i['School Subject']['Friday'][1]['le3 is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Venerdì (2 ora) le3 è occupato da: {{ i['School Subject']['Friday'][1]['le3 is busy']}}</div>
{% endif %}
{% if i['School Subject']['Friday'][2]['le3 is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Venerdì (3 ora) le3 è occupato da: {{ i['School Subject']['Friday'][2]['le3 is busy']}}</div>
{% endif %}
{% if i['School Subject']['Friday'][3]['le3 is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Venerdì (4 ora) le3 è occupato da: {{ i['School Subject']['Friday'][3]['le3 is busy']}}</div>
{% endif %}
{% if i['School Subject']['Friday'][4]['le3 is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Venerdì (5 ora) le3 è occupato da: {{ i['School Subject']['Friday'][4]['le3 is busy']}}</div>
{% endif %}
{% if i['School Subject']['Friday'][5]['le3 is busy'] == "" %}
<div class="s7"></div>
{% else %}
<div class="s7">(Martin) Venerdì (6 ora) le3 è occupato da: {{ i['School Subject']['Friday'][5]['le3 is busy']}}</div>
{% endif %}
{% endfor %}
</div>

View File

@@ -0,0 +1,7 @@
{% extends "base.html" %}
{% block title %}Register System{% endblock %}
{% block content %}
<h1>You are signed out!</h1>
{% endblock %}