diff --git a/assemblee/assricgen.php b/assemblee/assricgen.php index a867bd5..dd210da 100644 --- a/assemblee/assricgen.php +++ b/assemblee/assricgen.php @@ -4,6 +4,7 @@ /* Copyright (C) 2015 Pietro Tamburrano + Copyright (C) 2023 Michele Sacco - Flowopia Network [Rielaborazione sezione assemblee per adeguamento nuova UI] Questo programma è un software libero; potete redistribuirlo e/o modificarlo secondo i termini della GNU Affero General Public License come pubblicata dalla Free Software Foundation; sia la versione 3, @@ -63,228 +64,173 @@ if (mysqli_num_rows($risass) == 0) { alert("Non hai richiesto/effettuato ancora nessuna assemblea"); -} else -{ +} else { + // Titolo della pagina $classe = "SELECT anno,sezione,specializzazione FROM tbl_classi WHERE idclasse=$idclasse"; $risclasse = eseguiQuery($con, $classe); $val = mysqli_fetch_array($risclasse); print "
RICHIESTA | -SVOLGIMENTO | -ESITO | -||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Data | -O.d.G. | -Rapp. di classe | -Docenti | -Autorizzazione | -Verbale | -Esame verbale | -
RICHIESTA | +SVOLGIMENTO | +|||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Data | +Info | +Esito | +Verbale | +|||||||||||||||
Rich.: " . data_italiana($dataass['datarichiesta']) . " "; -//DATA ASSEMBLEA - print "Svolg.: " . data_italiana($dataass['dataassemblea']) . " "; -//INIZIO - FINE - print "Ora: " . $dataass['orainizio'] . " - " . $dataass['orafine'] . " | ";
-
-//ORDINE DEL GIORNO
- print "" . nl2br($dataass['odg']) . " | "; - -//RAPPRESENTANTI - $alu = "SELECT cognome,nome FROM tbl_alunni + // sezione RICHIESTA + // Data + // Richiesta + print ("Richiesta il " . data_italiana($dataass['datarichiesta']) . " "); + // Svolgimento + print ("Svolta il " . data_italiana($dataass['dataassemblea']) . " (" . $dataass['orainizio'] . " - " . $dataass['orafine'] . ") | ");
+
+ // Info (O.d.G. - Docente Ora - Rapp. Richiedenti)
+ print(""); + // OdG + print(""); + // Rapp. di Classe + // Array nomi rappresentanti + $rapp = []; + // Query sql + $alu = "SELECT cognome,nome FROM tbl_alunni WHERE idalunno=" . $dataass['rappresentante1'] . " OR idalunno=" . $dataass['rappresentante2'] . " ORDER BY cognome"; - - $risalu = eseguiQuery($con, $alu); - print " | ";
- $numerorappresentantirichiedenti = 0;
- while ($dataalu = mysqli_fetch_array($risalu))
- {
- print ($dataalu['cognome'] . " " . $dataalu['nome'] . " "); - $numerorappresentantirichiedenti++; - } - - if ($numerorappresentantirichiedenti == 1 & $_SESSION['idstudente'] != $dataass['rappresentante1']) - { - if ($alurapp) - { - print "CONFERMA RICHIESTA"; - } - } - print " | ";
-
-
-//DOCENTI CONCEDENTI
- $doc = "SELECT cognome,nome FROM tbl_docenti WHERE iddocente=" . $dataass['docenteconcedente1'];
- if ($dataass['docenteconcedente2'] != 0)
- {
- $doc .= " OR iddocente=" . $dataass['docenteconcedente2'] . " ORDER BY cognome";
- }
- print "";
- $risdoc = eseguiQuery($con, $doc);
- $cont = 1;
- while ($datadoc = mysqli_fetch_array($risdoc))
- {
- if ($cont == 1)
- {
- if ($dataass['concesso1'] == 1)
- {
- $fontin = "";
- $fontfi = "";
- } else if ($dataass['concesso1'] == 2)
- {
- $fontin = "";
- $fontfi = "";
- } else
- {
- $fontin = "";
- $fontfi = "";
+ $risalu = eseguiQuery($con, $alu);
+ while($dataalu = mysqli_fetch_array($risalu)){
+ $ncrapp = $dataalu['cognome'] ." " .$dataalu['nome'];
+ array_push($rapp, $ncrapp);
+ };
+ // Check se assemblea confermata | TRUE = Info Rapp. Classe - FALSE = No Info Rapp. Classe
+ if($dataass['rappresentante2'] == 0 & $_SESSION['idstudente'] != $dataass['rappresentante1']){
+ if ($alurapp)
+ {
+ print (" ");
+ }else{
+ print(" ");
+ }
}
- } else
- {
- if ($dataass['concesso2'] == 1)
- {
- $fontin = "";
- $fontfi = "";
- } else if ($dataass['concesso2'] == 2)
- {
- $fontin = "";
- $fontfi = "";
- } else
- {
- $fontin = "";
- $fontfi = "";
+ else{
+ print(" ");
+ }
+ // Docenti Interessati
+ // Output nomi docenti concedenti
+ // Check se docente ha concesso l'assemblea
+ if($dataass['concesso1'] == 1){$fontc1 = '';} elseif($dataass['concesso1'] == 2){$fontc1 = '';};
+ if($dataass['concesso2'] == 1){$fontc2 = '';} elseif($dataass['concesso2'] == 2){$fontc2 = '';};
+ // Dati Docenti
+ // Primo
+ $docout1 = "" .estrai_dati_docente($dataass['docenteconcedente1'], $con) ." $fontc1";
+ // Secondo (se esiste)
+ if($dataass['docenteconcedente2'] != 0){
+ $docout2 = " " .estrai_dati_docente($dataass['docenteconcedente2'], $con) ." $fontc2"; + } + print(" "); + print(" | ");
+ // Esito Richiesta
+ print("");
+ if($dataass['autorizzato'] == 2){
+ print(" ". estrai_dati_docente($dataass['docenteautorizzante'], $con) ."");
+ if($dataass['note'] != NULL){
+ print(" "); + } + }elseif($dataass['autorizzato'] == 1){ + print(" ". estrai_dati_docente($dataass['docenteautorizzante'], $con) .""); + if($dataass['note'] != NULL){ + print(" "); } } - print ($fontin . $datadoc['cognome'] . " " . $datadoc['nome'] . " " . $fontfi); - $cont++; - } - print " | ";
-
-//DOCENTE AUTORIZZANTE (se esiste)
-//AUTORIZZAZIONE
-
- if ($dataass['autorizzato'] == 0)
- {
- print ""; - } else - { - if ($dataass['autorizzato'] == 2) - { - print " | " . nl2br($dataass['note']) . " " . estrai_dati_docente($dataass['docenteautorizzante'], $con) . " | ";
- } else
- {
- print "" . nl2br($dataass['note']) . " " . estrai_dati_docente($dataass['docenteautorizzante'], $con) . " | ";
- }
- }
-
-//VERBALE
- if ($alurapp)
- {
- if ($dataass['verbale'] == '' and $dataass['autorizzato'] == 1 and date('Y-m-d') > $dataass['dataassemblea'])
- {
- print "";
- print " Inserisci verbale!"; - } else - { - if ($dataass['verbale'] == '' and $dataass['autorizzato'] == 1 and date('Y-m-d') == $dataass['dataassemblea']) - { - print " | INSERISCI"; - } else - { - if (date('Y-m-d') < $dataass['dataassemblea']) - print " | "; - else if ($dataass['verbale'] != "") - print " | " . nl2br($dataass['verbale']); - else - print " | ";
-
- if ($dataass['verbale'] != "")
- {
- if ($dataass['oratermine'] != "00:00:00")
- {
- print " Ora termine: " . substr($dataass['oratermine'], 0, 5) . " "; - } else - { - print " "; - } -//SEGRETARIO - $alu = "SELECT cognome,nome FROM tbl_alunni - WHERE idalunno=" . $dataass['alunnosegretario']; - - $risalu = eseguiQuery($con, $alu); - $dataalu = mysqli_fetch_array($risalu); - print " " . $dataalu['cognome'] . " " . $dataalu['nome'] . " "; - -//PRESIDENTE - if ($dataass['alunnopresidente'] != 0) - { - $alu = "SELECT cognome,nome FROM tbl_alunni - WHERE idalunno=" . $dataass['alunnopresidente']; - - $risalu = eseguiQuery($con, $alu); - $dataalu = mysqli_fetch_array($risalu); - print " " . $dataalu['cognome'] . " " . $dataalu['nome'] . " Firma non presente! Verbale non ancora trasmesso!"; - } + print(" | ");
+ // Verbale
+ print(""); + // Modal visualizzazione verbale + $modalverb = " + Inserisci"); + }else{ + // Check se siamo in data dell'assemblea oppure no + if(date('Y-m-d') >= $dataass['dataassemblea']){ + // Check se verbale non è firmato dal presidente + if($dataass['alunnopresidente'] == 0 & $idalunno != $dataass['alunnosegretario'] & $dataass['autorizzato'] == 1){ + print(" Firma e Invia"); + // Stampa verbale + print($modalverb); + print(""); + // Fine stampa verbale + print(" Correggi"); + }elseif($dataass['autorizzato'] == 1 & $dataass['alunnopresidente'] == 0){ + print($modalverb); + print(""); + print(" Correggi"); + }elseif($dataass['autorizzato'] == 1){ + print($modalverb); + print(""); } } } + }else{ + // Check se verbale è inserito, firmato sia da segretario sia da presidente + if($dataass['verbale'] != NULL & $dataass['autorizzato'] == 1 & $dataass['alunnopresidente'] != 0 & $dataass['alunnosegretario'] != 0){ + print($modalverb); + print(""); + } } - } else // Alunno non rappresentante - { - if ($dataass['alunnopresidente'] != 0 & $dataass['alunnosegretario'] != 0) - print " | "; + // Check se alunno è rappresentante + if($alurapp){ + // Check se verbale non è stato inviato + if($dataass['verbale'] == NULL & $dataass['autorizzato'] == 1 & date('Y-m-d') >= $dataass['dataassemblea']){ + // Pulsante invio verbale + print("" . $dataass['verbale'] . ""; - else - print " | "; - } - print " | "; - - - print "" . nl2br($dataass['commenti_verbale']) . " " . estrai_dati_docente($dataass['docente_visione'], $con) . " | ";
-
-
-
-
-
- print "
"; - print ""; + print "
"; + print ""; +}else{ + print(" +Cognome e Nome | +Classe | +" . $alunno['cognome'] . " " . $alunno['nome'] . " | " . $alunno['anno'] . " " . $alunno['sezione'] . " " . $alunno['specializzazione'] . " | "); + } + } + ?> + +
Cognome e Nome | +" . $docente['cognome'] . " " . $docente['nome'] . " | "); + } + } + ?> + +
Cognome e Nome | +" . $amm['cognome'] . " " . $amm['nome'] . " | "); + } + } + ?> + +
N. | Cognome | Nome | Data nascita | Cod. Fisc. | Magg. | Cens. | Funz. | Aut. usc. ant. | ";
+ print "
N. | Cognome | Nome | Data nascita | Cod. Fisc. | Magg. | Cens. | Funz. | Lib. foto | Aut. usc. ant. | ";
if (verifica_classe_coordinata($_SESSION['idutente'], $idclasse, $con))
{
print "Telefoni genitori | "; @@ -71,12 +71,20 @@ print "C.F. | "; else print ""; + + if ($rec['liberatoria']) { + print " | S | "; + } else { + print "N | "; + } + if ($rec['autuscitaantclasse']) print "S | "; elseif (maggiorenne($rec['datanascita'])) print "MAGG. | "; else print "N | "; + $cont++; if (verifica_classe_coordinata($_SESSION['idutente'], $idclasse, $con)) {