Skip to content
This repository has been archived by the owner on Jun 15, 2023. It is now read-only.

Commit

Permalink
Ripreso CSS validato e apportate le altre modifiche
Browse files Browse the repository at this point in the history
  • Loading branch information
WatEagle001 authored Sep 2, 2022
1 parent 9615b10 commit 215f9df
Show file tree
Hide file tree
Showing 53 changed files with 2,877 additions and 2,909 deletions.
718 changes: 359 additions & 359 deletions DB/AutoAsta.sql

Large diffs are not rendered by default.

144 changes: 72 additions & 72 deletions JS/script.js
Original file line number Diff line number Diff line change
@@ -1,72 +1,72 @@

function checkText(input, text, regexp){
var element = document.getElementById(input);
var test = element.value;
var parent = element.parentNode;
var alert = parent.querySelector(".invalid-feedback");

return showAlert(alert, regexp.test(test) || test === "" , text, parent);
}

function checkEmail(){
var regex = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+$/;
var element = document.getElementById('email');
var test = element.value;
var parent = element.parentNode;
var alert = parent.querySelector(".invalid-feedback");

return showAlert(alert,regex.test(test) || test === "", 'Email non valida', parent);
}

function checkPassword(){
var inputPassword = document.getElementById('psw');
var inputRepeatPassword =document.getElementById('password-repeat');
var parent = inputRepeatPassword.parentNode;
var alert = parent.querySelector(".invalid-feedback");
return showAlert(alert, inputPassword.value === inputRepeatPassword.value, 'Password e Conferma Password non coincidono, riprova', parent);
}

function checkDateProfile(){
var element = document.getElementById("data_nascita");
var parent = element.parentNode;
var alert = parent.querySelector(".invalid-feedback");
var condition = false;
var userAge= getAge(element.value);
if(userAge < 18){
text = 'Devi avere almeno 18 anni per registrarti al nostro portale';
}
else
condition = true;

return showAlert(alert, condition, text, parent);
}

function getAge(DOB) {
var today = new Date();
var birthDate = new Date(DOB);
var age = today.getFullYear() - birthDate.getFullYear();
var m = today.getMonth() - birthDate.getMonth();
if (m < 0 || (m === 0 && today.getDate() < birthDate.getDate())) {
age--;
}
return age;
}

function showAlert(alert, condition, text, parent){
if(alert) parent.removeChild(alert);

if(!condition && text !== ""){
var div = document.createElement("div");
div.classList.add("feedback");
div.classList.add("invalid-feedback");
var p = document.createElement("p");
p.appendChild(document.createTextNode(text));
div.appendChild(p);
parent.appendChild(div);

return false;
}

return true;
}

function checkText(input, text, regexp){
var element = document.getElementById(input);
var test = element.value;
var parent = element.parentNode;
var alert = parent.querySelector(".invalid-feedback");

return showAlert(alert, regexp.test(test) || test === "" , text, parent);
}

function checkEmail(){
var regex = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+$/;
var element = document.getElementById('email');
var test = element.value;
var parent = element.parentNode;
var alert = parent.querySelector(".invalid-feedback");

return showAlert(alert,regex.test(test) || test === "", 'Email non valida', parent);
}

function checkPassword(){
var inputPassword = document.getElementById('psw');
var inputRepeatPassword =document.getElementById('password-repeat');
var parent = inputRepeatPassword.parentNode;
var alert = parent.querySelector(".invalid-feedback");
return showAlert(alert, inputPassword.value === inputRepeatPassword.value, 'Password e Conferma Password non coincidono, riprova', parent);
}

function checkDateProfile(){
var element = document.getElementById("data_nascita");
var parent = element.parentNode;
var alert = parent.querySelector(".invalid-feedback");
var condition = false;
var userAge= getAge(element.value);
if(userAge < 18){
text = 'Devi avere almeno 18 anni per registrarti al nostro portale';
}
else
condition = true;

return showAlert(alert, condition, text, parent);
}

function getAge(DOB) {
var today = new Date();
var birthDate = new Date(DOB);
var age = today.getFullYear() - birthDate.getFullYear();
var m = today.getMonth() - birthDate.getMonth();
if (m < 0 || (m === 0 && today.getDate() < birthDate.getDate())) {
age--;
}
return age;
}

function showAlert(alert, condition, text, parent){
if(alert) parent.removeChild(alert);

if(!condition && text !== ""){
var div = document.createElement("div");
div.classList.add("feedback");
div.classList.add("invalid-feedback");
var p = document.createElement("p");
p.appendChild(document.createTextNode(text));
div.appendChild(p);
parent.appendChild(div);

return false;
}

return true;
}

2 changes: 1 addition & 1 deletion css/mobile.css
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ input:focus::placeholder{

#accesso{
text-align: center;
font-size: 1 em;
font-size: 1em;
border-radius: 3px;
border: 1px solid #000;
padding: 0.2em;
Expand Down
1 change: 1 addition & 0 deletions css/print.css
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ transform: scale(1.05);
font-size: 1.3em;
}


/*
------------------------------------------------------
====================== VEICOLI =======================
Expand Down
4 changes: 0 additions & 4 deletions css/styleAlternative.css
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,6 @@ div .userProfileCard{
background-color: #f1f1f1;
border-bottom: 1px solid #000;
margin-bottom: 0.5em;
border-width: 80%;
}

.login_form hr{
Expand Down Expand Up @@ -522,7 +521,6 @@ div .userProfileCard{
background-color: #f1f1f1;
border-bottom: 1px solid #000;
margin-bottom: 0.5em;
border-width: 80%;
}

.registration_form textarea{
Expand All @@ -533,7 +531,6 @@ div .userProfileCard{
background-color: #f1f1f1;
border-bottom: 1px solid #000;
margin-bottom: 0.5em;
border-width: 80%;
}

.registration_form select{
Expand All @@ -544,7 +541,6 @@ div .userProfileCard{
background-color: #f1f1f1;
border-bottom: 1px solid #000;
margin-bottom: 0.5em;
border-width: 80%;
}

.register_btn{
Expand Down
18 changes: 9 additions & 9 deletions html/404.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<h2>PAGINA ERRORE 404</h2>
<div class = "errorPage">
<h3>AMANTE DEL FUORISTRADA&#63;</h3>
<img id="img_404" src="../img/errore2.jpg">
<p>Oh no, sembra che tu sia finito fuori strada &#46;&#46;&#46;
Purtroppo non vendiamo carri attrezzi, ma fortunatamente potrai vedere e acquistare molte altre tipologie di veicoli presso i nostri eventi. Rimiettiti nelle nostre mani e tornerai nella stada giusta. Fidati, non te ne pentirai </p>
<a id ="homeButton" href="../php/index.php">TORNA ALLA PAGINA INIZIALE</a>
</div>

<h2>PAGINA ERRORE 404</h2>
<div class = "errorPage">
<h3>AMANTE DEL FUORISTRADA&#63;</h3>
<img id="img_404" src="../img/errore2.jpg">
<p>Oh no, sembra che tu sia finito fuori strada &#46;&#46;&#46;
Purtroppo non vendiamo carri attrezzi, ma fortunatamente potrai vedere e acquistare molte altre tipologie di veicoli presso i nostri eventi. </p>
<a id ="homeButton" href="../php/index.php">TORNA ALLA PAGINA INIZIALE</a>
</div>

70 changes: 35 additions & 35 deletions html/editSingleEvento.html
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
<form action="../php/editorEventi.php?id_Evento={value-id_Evento}" " method="post" id="formEditEventi">
<div class="registration_form">
<h2>Modifica Evento</h2>
<p>Compila i campi seguenti per modificare un evento</p>
<hr>

<fieldset name="capienza" form="formEditEventi">
<label for="capienza"><b>Capienza</b></label>
<input type="text" value = {value-capienza} placeholder="Inserisci la capienza" name="capienza" id="capienza">
</fieldset>

<fieldset name="data" form="formEditEventi">
<label for="data"><b>Data</b></label>
<input type="date" value = {value-data} placeholder="Inserisci la data" name="data" id="data">
</fieldset>

<fieldset name="nome" form="formEditEventi">
<label for="nome"><b>Nome</b></label>
<input type="text" value = {value-nome} placeholder="Inserisci il nome" name="nome" id="nome">
</fieldset>

<fieldset name="descrizione" form="formEditEventi">
<label for="descrizione"><b>Descrizione</b></label>
<textarea id="descrizione" name="descrizione">{value-descrizione}</textarea>
</fieldset>

<fieldset name="prezzo" form="formEditEventi">
<label for="prezzo"><b>Prezzo</b></label>
<input type="number" value = {value-prezzo} placeholder="Inserisci il prezzo" name="prezzo" id="prezzo">
</select>
</fieldset>

<button type="submit" class="register_btn" name="submit">Modifica Dati Evento</button>
<input type="reset" class="reset_btn">
</div>
<form action="../php/editorEventi.php?id_Evento={value-id_Evento}" " method="post" id="formEditEventi">
<div class="registration_form">
<h2>Modifica Evento</h2>
<p>Compila i campi seguenti per modificare un evento</p>
<hr>

<fieldset name="capienza" form="formEditEventi">
<label for="capienza"><b>Capienza</b></label>
<input type="text" value = {value-capienza} placeholder="Inserisci la capienza" name="capienza" id="capienza">
</fieldset>

<fieldset name="data" form="formEditEventi">
<label for="data"><b>Data</b></label>
<input type="date" value = {value-data} placeholder="Inserisci la data" name="data" id="data">
</fieldset>

<fieldset name="nome" form="formEditEventi">
<label for="nome"><b>Nome</b></label>
<input type="text" value = {value-nome} placeholder="Inserisci il nome" name="nome" id="nome">
</fieldset>

<fieldset name="descrizione" form="formEditEventi">
<label for="descrizione"><b>Descrizione</b></label>
<textarea id="descrizione" name="descrizione">{value-descrizione}</textarea>
</fieldset>

<fieldset name="prezzo" form="formEditEventi">
<label for="prezzo"><b>Prezzo</b></label>
<input type="number" value = {value-prezzo} placeholder="Inserisci il prezzo" name="prezzo" id="prezzo">
</select>
</fieldset>

<button type="submit" class="register_btn" name="submit">Modifica Dati Evento</button>
<input type="reset" class="reset_btn">
</div>
</form>
12 changes: 6 additions & 6 deletions html/eventi_home.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@


<h2> PROSSIMO EVENTO IN PROGRAMMA </h2>
<dl class="eventList">
{event-list}
</dl>


<h2> PROSSIMO EVENTO IN PROGRAMMA </h2>
<dl class="eventList">
{event-list}
</dl>
10 changes: 5 additions & 5 deletions html/footer.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<footer>
<address>
<p>AUTO ASTA</p>
<p>Carlesso Niccol&ograve;, Pillon Matteo, Sold&agrave; Matteo, Veronese Andrea</p>
<p>Universit&agrave; degli Studi di Padova - Dipartimento di Matematica</p>
<footer>
<address>
<p>AUTO ASTA</p>
<p>Carlesso Niccol&ograve;, Pillon Matteo, Sold&agrave; Matteo, Veronese Andrea</p>
<p>Universit&agrave; degli Studi di Padova - Dipartimento di Matematica</p>
</footer>
Loading

0 comments on commit 215f9df

Please sign in to comment.