</head> <body id="body-color"> <div id='loginDIV'> <fieldset id='fieldLOGIN' style='width:250px'><legend>LOGIN</legend> <form id='loginFORM' method='POST'> USERNAME  <input id='username' name='userNAME' type='text' size='25'><br><br> PASSWORD  <input id='password' name='userPASS' type='text' size='25'><br><br> <input id='inviaDATI' name='inviaDATI' type='submit' value='LOGIN'> </form> </fieldset> </div> </html> <?php if (isset($_POST['inviaDATI'])) { $user = mysql_real_escape_string($_POST['userNAME']); $pass = mysql_real_escape_string($_POST['userPASS']); $sql = "SELECT user FROM profili WHERE user='******' AND password='******'"; $query = mysql_query($sql) or die(mysql_error()); $si = mysql_num_rows($query); if ($si == 1) { session_start(); $_SESSION['username'] = $user; $_SESSION['logged'] = 1; header('Location:home.php'); } else { alert_pop("Login non riuscita"); } }
//resetto indice giorno settimana $indice = 1; } $numGiornoAttuale++; //aumento giorno attuale } unset($_SESSION['festivi']); //distruggo festivi scelti /*if($numGiornoAttuale==$giorni){ alert_pop("Tabella popolata"); }*/ } else { alert_pop(mysql_error()); } } else { alert_pop("Hai inserito un valore per anno non valido: VALORI AMMESSI 2015-2099!"); } } if (isset($_POST['seeMONTH'])) { $nomiMESI = ['ZERO', 'GENNAIO', 'FEBBRAIO', 'MARZO', 'APRILE', 'MAGGIO', 'GIUGNO', 'LUGLIO', 'AGOSTO', 'SETTEMBRE', 'OTTOBRE', 'NOVEMBRE', 'DICEMBRE']; $tabellaDESIDERATA = mysql_real_escape_string($_POST['meseVoluto']); $annoDESIDERATO = substr($tabellaDESIDERATA, 0, 4); $meseDESIDERATO = substr($tabellaDESIDERATA, 4); $sqlVEDI = "SELECT * FROM `{$tabellaDESIDERATA}` WHERE 1"; $eseguiVEDI = mysql_query($sqlVEDI) or die(mysql_error()); echo "<table id='orario' border='1px solid black'><tr><th>ANNO:{$annoDESIDERATO}</th><th>MESE:{$nomiMESI[$meseDESIDERATO]}</th></tr>"; //disegno tabella echo "<tr><td id='intestazione' align='center'>GIORNO</td><td></td>"; while (list($chiave, $valore) = each($lista)) { echo "<td id='nomeDIPENDENTE' align='center' width='80px'>{$valore}</td>"; }
if ($indice == 6 || $indice == 7) { //inserisci solo giorno mysql_query("INSERT INTO `{$tabella}` (numGiorno,nomeGiorno) VALUES ('{$numGiornoAttuale}','{$settimana[$indice]}')"); } else { mysql_query("INSERT INTO `{$tabella}` (numGiorno,nomeGiorno,Turno8,Turno6) VALUES ('{$numGiornoAttuale}','{$settimana[$indice]}','{$turnistiOTTO[$i]}','{$turnistiSEI[$l]}')"); $i++; $l++; } $numGiornoAttuale++; //aumento giorno attuale $indice++; if ($i == $indiceTURNISTIotto) { $i = 0; } if ($l == $indiceTURNISTIsei) { $l = 0; } if ($indice == 8) { $indice = 1; } } /*if($numGiornoAttuale==$giorni){ alert_pop("Tabella popolata"); }*/ } else { alert_pop(mysql_error()); } } else { alert_pop("Hai inserito un valore per anno non valido o inferiore a 2015!"); } }