Andreu | 09b8b05 | 2019-09-21 21:47:20 +0200 | [diff] [blame] | 1 | <?php |
| 2 | if (!isset($_COOKIE['user'])) { |
Andreu | 96f1bcd | 2019-09-22 00:33:09 +0200 | [diff] [blame] | 3 | header("Location: ./index.php"); |
Andreu | 09b8b05 | 2019-09-21 21:47:20 +0200 | [diff] [blame] | 4 | die(); |
| 5 | } |
| 6 | ?> |
Andreu | 66ad5cf | 2019-09-18 17:15:44 +0200 | [diff] [blame] | 7 | <html> |
| 8 | <head> |
| 9 | <meta charset="UTF-8"> |
| 10 | <title>Pàgina de l'usuari</title> |
Andreu | efe66eb | 2019-09-21 18:41:49 +0200 | [diff] [blame] | 11 | |
Andreu | 66ad5cf | 2019-09-18 17:15:44 +0200 | [diff] [blame] | 12 | <link rel="stylesheet" href="./css/basic.css" /> |
| 13 | <link rel="stylesheet" href="./css/main.css" /> |
Andreu | 10cb304 | 2019-09-18 19:55:36 +0200 | [diff] [blame] | 14 | |
Andreu | 66ad5cf | 2019-09-18 17:15:44 +0200 | [diff] [blame] | 15 | <script src="https://code.jquery.com/jquery-3.4.1.min.js"></script> |
Andreu | ed8e1f9 | 2019-09-18 22:26:04 +0200 | [diff] [blame] | 16 | <script src="https://rawgit.com/notifyjs/notifyjs/master/dist/notify.js"></script> |
Andreu | efe66eb | 2019-09-21 18:41:49 +0200 | [diff] [blame] | 17 | |
Andreu | 10cb304 | 2019-09-18 19:55:36 +0200 | [diff] [blame] | 18 | <script src="./js/utils.js"></script> |
Andreu | efe66eb | 2019-09-21 18:41:49 +0200 | [diff] [blame] | 19 | <script src="./js/animations.js"></script> |
Andreu | 66ad5cf | 2019-09-18 17:15:44 +0200 | [diff] [blame] | 20 | |
Andreu | dca79f4 | 2019-09-18 23:53:19 +0200 | [diff] [blame] | 21 | <?php |
Andreu | 2457e40 | 2019-09-22 00:52:41 +0200 | [diff] [blame^] | 22 | require './credentials.php'; |
Andreu | 09b8b05 | 2019-09-21 21:47:20 +0200 | [diff] [blame] | 23 | require './php/utils.php'; |
| 24 | $user = get_users($_COOKIE['user']); |
| 25 | $victim = get_users($user->quimata); |
Andreu | 4ed7496 | 2019-09-22 00:06:15 +0200 | [diff] [blame] | 26 | if ($user->mort) header("Location: ./dead.php"); |
Andreu | dca79f4 | 2019-09-18 23:53:19 +0200 | [diff] [blame] | 27 | ?> |
Andreu | ed8e1f9 | 2019-09-18 22:26:04 +0200 | [diff] [blame] | 28 | |
Andreu | 66ad5cf | 2019-09-18 17:15:44 +0200 | [diff] [blame] | 29 | <script> |
Andreu | ed49167 | 2019-09-20 13:09:18 +0200 | [diff] [blame] | 30 | let user = { |
| 31 | 'id': <?=$user->id?>, |
| 32 | 'quimata': <?=$user->quimata?>, |
| 33 | 'requested': <?=$user->requested?>, |
Andreu | abbcb7e | 2019-09-21 18:22:14 +0200 | [diff] [blame] | 34 | 'mort': <?=$user->mort?>, |
| 35 | |
| 36 | 'nom': "<?=$user->nomcomplet?>", |
| 37 | 'curs': <?=$user->curs?>, |
| 38 | 'grau': <?=$user->grau?> |
Andreu | ed49167 | 2019-09-20 13:09:18 +0200 | [diff] [blame] | 39 | }; |
Andreu | 66ad5cf | 2019-09-18 17:15:44 +0200 | [diff] [blame] | 40 | </script> |
Andreu | dca79f4 | 2019-09-18 23:53:19 +0200 | [diff] [blame] | 41 | |
Andreu | 66ad5cf | 2019-09-18 17:15:44 +0200 | [diff] [blame] | 42 | </head> |
| 43 | <body> |
| 44 | <div id="outter-container"> |
| 45 | <div id="inner-container"> |
| 46 | <h2>Hola <name id="user_name"><?=$user->nom()?></name>,</h2> |
Andreu | 96f1bcd | 2019-09-22 00:33:09 +0200 | [diff] [blame] | 47 | |
| 48 | <div class="formulari_contrasenya" style="display: none;"> |
Andreu | 20cbd1d | 2019-09-22 00:00:57 +0200 | [diff] [blame] | 49 | <p>Sembla que no tens contrasenya, la gent podrà entrar a la teva compta...</p> |
| 50 | <form action="./php/change_password.php" method="POST"> |
| 51 | <input type="hidden" value="<?=$_COOKIE['user']?>" name="userid"> |
| 52 | <input type="password" placeholder="Nova contrasenya..." name="password" /><br /> |
| 53 | <input type="password" placeholder="Repeteix la contrasenya" name="confirmation"/><br /> |
| 54 | <input type="submit"> |
| 55 | </form> |
| 56 | </div> |
| 57 | |
Andreu | 66ad5cf | 2019-09-18 17:15:44 +0200 | [diff] [blame] | 58 | <h3>La teva víctima és:</h3> |
| 59 | |
| 60 | <div class="victima"> |
| 61 | <img width="300px" src="./imgs/<?=$victim->id?>.png" /> |
| 62 | <h2 id="victim_name"><?=$victim->nomcomplet?></h2> |
| 63 | <h3><span id="victim_curs"><?=$victim->curs?></span>-<span id="victim_grau"><?=$victim->grau?></span></h3> |
| 64 | </div> |
| 65 | </div> |
| 66 | </div> |
Andreu | abbcb7e | 2019-09-21 18:22:14 +0200 | [diff] [blame] | 67 | <div id="butons" class="options"> |
| 68 | <button id="win" onclick="js: send_request(user, 'REQ KILL');">L'he matat</button> |
Andreu | 66ad5cf | 2019-09-18 17:15:44 +0200 | [diff] [blame] | 69 | </div> |
| 70 | |
| 71 | <script> |
Andreu | dca79f4 | 2019-09-18 23:53:19 +0200 | [diff] [blame] | 72 | $(document).ready(function() { |
Andreu | abbcb7e | 2019-09-21 18:22:14 +0200 | [diff] [blame] | 73 | // Set interval of checking |
Andreu | efe66eb | 2019-09-21 18:41:49 +0200 | [diff] [blame] | 74 | let checking = setInterval(function() { update_info(user); }, 1500); |
Andreu | 96f1bcd | 2019-09-22 00:33:09 +0200 | [diff] [blame] | 75 | // Set to hidden or not the password prompt |
| 76 | if (<?=$user->md5password=="" ? 1 : 0?>) $(".formulari_contrasenya").show(); |
Andreu | dca79f4 | 2019-09-18 23:53:19 +0200 | [diff] [blame] | 77 | }); |
Andreu | 66ad5cf | 2019-09-18 17:15:44 +0200 | [diff] [blame] | 78 | </script> |
| 79 | </body> |
| 80 | </html> |