Compare commits

..

28 Commits

Author SHA1 Message Date
Stefano Assenzo
bdcfda8d07 Add files via upload 2023-01-31 18:48:59 +01:00
Stefano Assenzo
70425bb962 Delete orario3.png 2023-01-31 18:48:47 +01:00
Stefano Assenzo
0216dc7e6f Update index.html 2023-01-31 18:48:33 +01:00
Stefano Assenzo
82634564e0 Add files via upload 2023-01-23 15:57:00 +01:00
Stefano Assenzo
3839534e12 Update index.html 2023-01-23 15:56:44 +01:00
Stefano Assenzo
0c58343724 Delete orario1.png 2023-01-23 15:56:24 +01:00
Stefano Assenzo
ee8c0f5b59 Delete orario.png 2023-01-23 15:56:15 +01:00
Stefano Assenzo
2f03f7fe08 Add files via upload 2023-01-22 17:43:17 +01:00
Stefano Assenzo
0a2b2e07f3 Delete orario.png 2023-01-22 17:43:02 +01:00
Stefano Assenzo
7c35b46871 Update index.html 2023-01-22 17:42:51 +01:00
Stefano Assenzo
21b3d97b17 Add files via upload 2023-01-22 17:41:48 +01:00
Stefano Assenzo
e3e824eab6 Delete orario.png 2023-01-22 17:41:41 +01:00
Stefano Assenzo
73c6507936 Add files via upload 2023-01-22 17:40:33 +01:00
Stefano Assenzo
c7d8a69a60 Delete orario1.png 2023-01-22 17:40:16 +01:00
Stefano Assenzo
dc78b94dc9 Add files via upload 2023-01-22 17:39:54 +01:00
Stefano Assenzo
bdf8650c7c Delete orario.png 2023-01-22 17:39:39 +01:00
Stefano Assenzo
31dc0e5087 Add files via upload 2023-01-22 17:39:05 +01:00
Stefano Assenzo
5d863766b9 Delete orario.png 2023-01-22 17:38:03 +01:00
Stefano Assenzo
b8fc07a92e Add files via upload 2023-01-22 17:37:10 +01:00
Stefano Assenzo
8c0d918ccb Add files via upload 2023-01-20 19:01:39 +01:00
Stefano Assenzo
0f088b9545 Add files via upload 2023-01-20 18:54:45 +01:00
Stefano Assenzo
d9268e3403 Add files via upload 2023-01-13 16:33:03 +01:00
Stefano Assenzo
c3327a8c1c Delete orario.png 2023-01-13 16:31:12 +01:00
Stefano Assenzo
a1b0bfb3e1 Upload orario.png 2023-01-13 16:27:53 +01:00
Stefano Assenzo
61e450bf58 Delete orario.png 2023-01-13 16:27:23 +01:00
Stefano Assenzo
7062dffaeb Updated the repository 2022-12-26 18:19:13 +00:00
Stefano Assenzo
730591eda5 Merge pull request #1 from 1Merxx/main
Update index.html
2022-12-21 19:55:27 +01:00
1Merxx
3eb565c1fa Update index.html 2022-12-21 19:54:11 +01:00
33 changed files with 299 additions and 4443 deletions

View File

@@ -1,25 +0,0 @@
# 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
View File

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

141
app.py
View File

@@ -1,141 +0,0 @@
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)

BIN
assets/image/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
assets/image/orario4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

53
index.html Normal file
View File

@@ -0,0 +1,53 @@
<!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

@@ -0,0 +1,48 @@
<!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>

62
pages/orario/index.html Normal file
View File

@@ -0,0 +1,62 @@
<!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>

View File

@@ -1,9 +0,0 @@
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

@@ -1,14 +0,0 @@
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

@@ -1,11 +0,0 @@
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

@@ -1,11 +0,0 @@
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

@@ -1,144 +0,0 @@
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)

View File

@@ -1,96 +0,0 @@
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

@@ -1,12 +0,0 @@
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

@@ -1,62 +0,0 @@
# 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

@@ -1,304 +0,0 @@
# 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

@@ -1,308 +0,0 @@
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

@@ -1,58 +0,0 @@
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

@@ -1,308 +0,0 @@
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

@@ -1,308 +0,0 @@
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

@@ -1,74 +0,0 @@
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

@@ -1,830 +0,0 @@
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 Normal file
View File

@@ -0,0 +1,136 @@
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

@@ -1,22 +0,0 @@
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

@@ -1,24 +0,0 @@
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)

View File

@@ -1,35 +0,0 @@
<!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>

View File

@@ -1,783 +0,0 @@
<!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>

View File

@@ -1,40 +0,0 @@
{% 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

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

View File

@@ -1,24 +0,0 @@
{% 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

@@ -1,776 +0,0 @@
<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

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