Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $redir = True;
- if (isset($_COOKIE['prof']))
- {
- $redir = False;
- }
- ?>
- <html>
- <head>
- <?php if ($redir == True) { echo "<meta http-equiv=\"refresh\" content=\"0; URL=avant/index.php\">"; } ?>
- <title>Statistiques</title>
- <style>
- table
- {
- border-collapse: collapse; /* Les bordures du tableau seront collées (plus joli) */
- }
- td
- {
- border: 1px solid black;
- }
- </style>
- </head>
- <body>
- <h1>Combien d’élèves ont été tiré au hasard avec ce programme ?</h>
- <table>
- <tr>
- <td>Classe</td>
- <td>Nombre</td>
- </tr>
- <?php
- $prof = $_COOKIE["prof"];
- $tour = 0;
- $bon = False;
- while ($tour < 4)
- {
- $tour++;
- require "classes/".$tour.".php";
- $tour2 = 0;
- while ($tour2 < $nombredeleve)
- {
- $tour2++;
- $cp = fopen('data/'.$prof.'/'.$numero.'/e'.$tour2.'.txt', 'r+');
- $nombre = fgets($cp);
- fseek($cp, 0);
- fputs($cp, $nombre);
- fclose($cp);
- $total += $nombre;
- }
- echo "<tr><td><a href=\"stat/index.php?id=".$tour."\">".$nom." </td><td>".$total</td></tr>";
- }
- ?>
- </table>
- <p><a href="index.php">Appuyez ici pour revenir à la page d’accueil</a></p>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement