Advertisement
Guest User

Untitled

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