Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <meta charset="UTF-8">
- <title>LISTA</title>
- <link type="text/css" rel="stylesheet" href="stilepopup.css"> <!-- link al foglio di stile -->
- </head>
- <body>
- <?php
- $host = "localhost";
- $user = "quintaainfo1516";
- $password = "diploma2016";
- $conn = mysql_connect($host, $user, $password);
- if(!$conn){
- die("errore in connessione - " . mysql_error());
- }
- mysql_select_db("merende",$conn) or die("Accesso al database non riuscito - " . mysql_error());
- session_start();
- $id = $_SESSION["id"];
- $pwd = $_SESSION["pwd"];
- $querym = "select distinct(Nome), Sezione FROM g3utenti, g3ordini WHERE g3utenti.ID_U=g3ordini.ID_U AND g3utenti.Nome = 3 OR g3utenti.Nome = 4 OR g3utenti.Nome = 5";
- $queryr = "select distinct(Nome), Sezione FROM g3utenti, g3ordini WHERE g3utenti.ID_U=g3ordini.ID_U AND g3utenti.Nome = 1 OR g3utenti.Nome = 2";
- if(($id=="Massi") && ($pwd=="cottoemaio")){
- //codice massi
- $ris_query = mysql_query($querym,$conn);
- print "<div>";
- while($riga=mysql_fetch_array($ris_query)){
- $nome=$riga['Nome'];
- $sez=$riga['Sezione'];
- print " <a id='myBtn' href='area_massi.php?v1=$nome&v2=$sez'>".$nome.$sez."</a>";
- }
- }
- if((isset($_GET["v1"]))&&(isset($_GET["v2"]))){
- $nome2=$_GET['v1'];
- $sez2=$_GET['v2'];
- $tot=0;
- $queryo = "SELECT g3prodotti.descrizione, g3ordini.Quantita, g3ordini.Note, g3prodotti.prezzo*g3ordini.Quantita AS PrezzoTot
- FROM g3prodotti, g3ordini, g3utenti
- WHERE g3ordini.ID_P=g3prodotti.ID_P
- AND g3ordini.ID_U=g3utenti.ID_U
- AND g3utenti.Nome= '$nome2'
- AND g3utenti.Sezione = '$sez2'
- GROUP BY g3prodotti.descrizione";
- $ris_query2 = mysql_query($queryo,$conn);//oggetto che salva il risultato della query
- print "<div id='myModal' class='modal'>";
- print "<div class='modal-content'>";
- print "<div class='modal-header'>";
- print "<span class='close'>×</span>";
- print "<h2>".$nome2." ".$sez2."</h2>";
- print "</div>";
- print "<div class='modal-body'>";
- print "<table>";
- while($riga2=mysql_fetch_array($ris_query2)){
- $s="<tr>";
- $s.="<td>".$riga2['descrizione']."</td>";
- $s.="<td>".$riga2['Quantita']."</td>";
- $s.="<td>".$riga2['Note']."</td>";
- $s.="<td>".$riga2['PrezzoTot']."</td>";
- $s.="</tr>";
- $tot = $tot + $riga2['PrezzoTot'];
- print $s;
- }
- print "</table>";
- echo "prezzo totale: €".$tot;
- print "</div>";
- print "</div>";
- print "</div>";
- }
- //if(($id=="Rossella") && ($pwd=="rossaetonda")){
- //codice rossella
- // $ris_query = mysql_query($queryr,$conn);
- // while($riga=mysql_fetch_array($ris_query)){
- // $html=$riga['Nome'].$riga['Sezione'];
- // $button="<p><button id='1' onclick='myFunction()' style='visibility:visible'>".$html."</button></p>";
- //echo $button;
- //}
- //}
- ?>
- <script language="JavaScript" type="text/javascript">
- // Get the modal
- var modal = document.getElementById('myModal');
- // Get the button that opens the modal
- var btn = document.getElementById("myBtn");
- // Get the <span> element that closes the modal
- var span = document.getElementsByClassName("close")[0];
- // When the user clicks on the button, open the modal
- btn.onclick = function() {
- modal.style.display = "block";
- }
- // When the user clicks on <span> (x), close the modal
- span.onclick = function() {
- modal.style.display = "none";
- }
- // When the user clicks anywhere outside of the modal, close it
- window.onclick = function(event) {
- if (event.target == modal) {
- modal.style.display = "none";
- }
- }
- </script>
- <a href="logfuori.php"> logout </a>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement