Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include "connetti.php";
- /*$giorno=date(j);
- $mese=date(n);
- $anno=date(Y);
- */
- if($_REQUEST['username'] != null){
- $query = "select * from impiegato, turno, turno_has_impiegato where (impiegato.username = '".$_REQUEST['username']."') AND (impiegato.username = turno_has_impiegato.impiegato_username) AND (turno_has_impiegato.turno_idturno = turno.idturno)";
- $rows = mysql_query($query);
- echo "username: ".$_REQUEST['username'];
- echo "<table>";
- while($row = mysql_fetch_assoc($rows)){
- echo "<tr>";
- echo "<td>";
- echo "data turno: ".$row['data'];
- echo "</td>";
- echo "<td>";
- echo "ora ingresso: ".$row['oraingresso'];
- echo "</td>";
- echo "<td>";
- echo "ora uscita: ".$row['orauscita'];
- echo "</td>";
- echo "</tr>";
- }
- echo "</table>";
- }
- else{
- $Data=$anno.'-'.$mese.'-'.$giorno;
- /* 24 apr 1.54 so the story begins */
- $query = "select * from impiegato";
- $rows = mysql_query($query);
- if(mysql_num_rows($rows) == 0)
- echo "la tabella è vuota";
- else{
- echo "<table>";
- while($row = mysql_fetch_assoc($rows)){
- echo "<tr>";
- echo "<td>";
- echo "<span class='username'><a href='scriptcomm.php?username=".$row["username"]."'>".$row["username"]."</a></span>";
- echo "</td>";
- echo "<td>";
- echo "<span class='nome'>".$row["nome"]."</span>";
- echo "</td>";
- echo "<td>";
- echo "<span class='cognome'>".$row["cognome"]."</span>";
- echo "</td>";
- echo "</tr>";
- }
- echo "</table>";
- }
- }
- //function getAllStudents() {
- /*
- $Query = "SELECT * FROM commessa;";
- print("$QUery");
- $rows=mysql_query($Query);
- for($index=0;$record=mysql_fetch_assoc($rows);$index++)
- {
- foreach($record as $key=>$value)
- $data[$index][$key]=$value;
- }
- return $data;
- }
- //per estrare l'array..
- $elenco=getAllStudents();
- if(empty($elenco))
- echo "<BR><BR>Nessuno dato presente";
- else
- foreach($elenco as $value)
- {
- echo "<strong>".$value['dato1']."</strong>";
- echo " - ".$value['dato2']." ".$value['dato3'];
- }
- $Res = mysql_query($Query);
- if(!$Res)
- print("Inserimento non riuscito");
- else
- print("Inserimento riuscito correttamente");*/
- mysql_close($Connessione);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement