Advertisement
Guest User

Untitled

a guest
Jun 28th, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.03 KB | None | 0 0
  1. <html>
  2. <head>
  3.     <meta charset=utf-8" />
  4.     <title>Be an artist</title>
  5. </head>
  6. <body>
  7.  
  8.        
  9.         <?php
  10.         $maRequete1 = "SELECT * FROM Dessin;";
  11.         $maRequete2 = "SELECT * FROM Evaluateurs;";
  12.         $connexion = mysql_connect("localhost",'gpi2','network');
  13.        
  14.         ?>
  15.         <form method="post" action="retourAjoutNote.php">
  16.         <?php
  17.  
  18.         if(! $connexion){
  19.             printf("Problème de connexion");
  20.         }
  21.         else {
  22.             $selectedDataBase = mysql_select_db("projet",$connexion);
  23.             if(! $selectedDataBase){
  24.                 printf("Problème d'accès à la base");
  25.             }
  26.             else{
  27.                 mysql_query("SET NAMES UTF8");
  28.                 $resultat = mysql_query($maRequete1);
  29.                 $tableau = mysql_fetch_array($resultat);
  30.  
  31.  
  32.                 do{
  33.                     ?>
  34.  
  35.                         <input type="radio" name="dessin" value="<?php echo $tableau['numero'] ?>"/>
  36.                     <?php
  37.                
  38.                 } while($tableau = mysql_fetch_array($resultat));
  39.                
  40.                 ?>
  41.                 <label for = 'note1'> Première note : </label>
  42.                 <input type="number" name="note" /><br/>
  43.  
  44.                 <label for = 'date'>Date de l'évaluation </label>
  45.                 <input type="date" name="date" /><br/>
  46.  
  47.                 $resultat2 = mysql_query($maRequete2);
  48.                 $tableau2 = mysql_fetch_array($resultat2);
  49.                 do{
  50.                     ?>
  51.                         <input type="radio" name="evaluateur" value="<?php echo $tableau2['numero'] ?>">
  52.                     <?php
  53.                
  54.                 } while($tableau = mysql_fetch_array($resultat2));
  55.                 ?>
  56.  
  57.                 <label for = 'commentaire1'>Commentaire : </label>
  58.                 <input type="text" name="commentaier1" /><br/>
  59.  
  60.  
  61.                 <label for = 'note2'> deuixème note : </label>
  62.                 <input type="number" name="note2" /><br/>
  63.  
  64.                 <label for = 'date2'>Date de l'évaluation </label>
  65.                 <input type="date" name="date2" /><br/>
  66.  
  67.                 <?php
  68.                 $tableau2 = mysql_fetch_array($resultat2);
  69.                 do{
  70.                     ?>
  71.                         <input type="radio" name="evaluateur" value="<?php echo $tableau2['numero'] ?>">
  72.                    
  73.                     <?php
  74.                
  75.                 } while($tableau = mysql_fetch_array($resultat2));
  76.            
  77.             mysql_close($connexion);
  78.         }
  79.         ?>
  80.  
  81.  
  82.         <input type="submit" value="Valider" />
  83.        
  84.  
  85.  
  86.     </form>
  87. </body>
  88. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement