Andreu | fd98b5d | 2019-09-22 13:15:10 +0200 | [diff] [blame^] | 1 | <?php |
| 2 | require '../credentials.php'; |
| 3 | require '../php/utils.php'; |
| 4 | |
| 5 | $inscrits = [ |
| 6 | ['Joan Hernanz Segarra', 3, 1], |
| 7 | ['Olga Almudena Martínez', 1, 1], |
| 8 | ['Jordi Ganso Rodríguez', 2, 0], |
| 9 | ['Júlia Montserrat Puig', 3, 0], |
| 10 | ['Berta Galofré Mestres', 4, 0], |
| 11 | ['Laia Pomar Raventós', 3, 1], |
| 12 | ['Irene Cusiné Baltà', 1, 0] |
| 13 | ]; |
| 14 | |
| 15 | $start = 6; |
| 16 | $i = $start; |
| 17 | foreach ($inscrits as $user) { |
| 18 | $i = ($i + 1) % ($start + count($inscrits)); |
| 19 | if ($i == 0) $i = $i + 1; |
| 20 | $template = "INSERT INTO `users` (`id`, `nom`, `curs`, `grau`, `quimata`, `requested`, `mort`, `password`)" . |
| 21 | " VALUES (NULL, '".$user[0]."', '".$user[1]."', '".$user[2]."', ".$i.", '0', '0', '')"; |
| 22 | if (query($template)) echo $template . "\n"; |
| 23 | } |
| 24 | ?> |