Advertisement
Guest User

Untitled

a guest
Oct 21st, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.97 KB | None | 0 0
  1. <?php
  2. $prof = $_COOKIE["prof"];
  3. ?>
  4. <html>
  5. <head>
  6. <title>Statistiques</title>
  7. <style>
  8.             table
  9. {
  10.     border-collapse: collapse; /* Les bordures du tableau seront collées (plus joli) */
  11. }
  12. td
  13. {
  14.     border: 1px solid black;
  15. }
  16.         </style>
  17. </head>
  18. <body>
  19. <h1>Combien d’élèves ont été tiré au hasard avec ce programme ?</h>
  20. <table>
  21.    <tr>
  22.        <td>Classe</td>
  23.        <td>Nombre</td>
  24.    </tr>
  25. <?php
  26. $tour = 0;
  27. $bon = False;
  28.  
  29. while ($tour < 4)
  30. {
  31. $tour++;
  32. require "classes/".$tour.".php";
  33. $tour2 = 0;
  34. for (compteur = 0 ; compteur < $nombredeleve ; compteur++)
  35. {
  36.    $cp = fopen('data/'.$prof.'/'.$numero.'/e'.$tour2.'.txt', 'r+');
  37.  
  38. $nombre = fgets($cp);
  39. fseek($cp, 0);
  40. fputs($cp, $nombre);
  41. fclose($cp);
  42. $total += $nombre;
  43. }
  44. echo "<tr><td><a href=\"stat/index.php?id=".$tour."\">".$nom." </td><td>".$total</td></tr>";
  45. }
  46.  
  47. ?>
  48.  
  49.  
  50.  
  51. </table>
  52. <p><a href="index.php">Appuyez ici pour revenir à la page d’accueil</a></p>
  53. </body>
  54. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement