Andreu | 09b8b05 | 2019-09-21 21:47:20 +0200 | [diff] [blame^] | 1 | <?php |
| 2 | if (!isset($_COOKIE['user'])) { |
| 3 | header("Location: ./main.php"); |
| 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 | 09b8b05 | 2019-09-21 21:47:20 +0200 | [diff] [blame^] | 22 | require './php/utils.php'; |
| 23 | $user = get_users($_COOKIE['user']); |
| 24 | $victim = get_users($user->quimata); |
| 25 | if ($user->mort) die('Puto mort de merda'); |
Andreu | dca79f4 | 2019-09-18 23:53:19 +0200 | [diff] [blame] | 26 | ?> |
Andreu | ed8e1f9 | 2019-09-18 22:26:04 +0200 | [diff] [blame] | 27 | |
Andreu | 66ad5cf | 2019-09-18 17:15:44 +0200 | [diff] [blame] | 28 | <script> |
Andreu | ed49167 | 2019-09-20 13:09:18 +0200 | [diff] [blame] | 29 | let user = { |
| 30 | 'id': <?=$user->id?>, |
| 31 | 'quimata': <?=$user->quimata?>, |
| 32 | 'requested': <?=$user->requested?>, |
Andreu | abbcb7e | 2019-09-21 18:22:14 +0200 | [diff] [blame] | 33 | 'mort': <?=$user->mort?>, |
| 34 | |
| 35 | 'nom': "<?=$user->nomcomplet?>", |
| 36 | 'curs': <?=$user->curs?>, |
| 37 | 'grau': <?=$user->grau?> |
Andreu | ed49167 | 2019-09-20 13:09:18 +0200 | [diff] [blame] | 38 | }; |
Andreu | 66ad5cf | 2019-09-18 17:15:44 +0200 | [diff] [blame] | 39 | </script> |
Andreu | dca79f4 | 2019-09-18 23:53:19 +0200 | [diff] [blame] | 40 | |
Andreu | 66ad5cf | 2019-09-18 17:15:44 +0200 | [diff] [blame] | 41 | </head> |
| 42 | <body> |
| 43 | <div id="outter-container"> |
| 44 | <div id="inner-container"> |
| 45 | <h2>Hola <name id="user_name"><?=$user->nom()?></name>,</h2> |
| 46 | <h3>La teva víctima és:</h3> |
Andreu | 885889c | 2019-09-19 00:28:20 +0200 | [diff] [blame] | 47 | <div id="state">0</div> |
Andreu | 66ad5cf | 2019-09-18 17:15:44 +0200 | [diff] [blame] | 48 | |
| 49 | <div class="victima"> |
| 50 | <img width="300px" src="./imgs/<?=$victim->id?>.png" /> |
| 51 | <h2 id="victim_name"><?=$victim->nomcomplet?></h2> |
| 52 | <h3><span id="victim_curs"><?=$victim->curs?></span>-<span id="victim_grau"><?=$victim->grau?></span></h3> |
| 53 | </div> |
| 54 | </div> |
| 55 | </div> |
Andreu | abbcb7e | 2019-09-21 18:22:14 +0200 | [diff] [blame] | 56 | <div id="butons" class="options"> |
| 57 | <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] | 58 | </div> |
| 59 | |
| 60 | <script> |
Andreu | dca79f4 | 2019-09-18 23:53:19 +0200 | [diff] [blame] | 61 | $(document).ready(function() { |
Andreu | abbcb7e | 2019-09-21 18:22:14 +0200 | [diff] [blame] | 62 | // Set interval of checking |
Andreu | efe66eb | 2019-09-21 18:41:49 +0200 | [diff] [blame] | 63 | let checking = setInterval(function() { update_info(user); }, 1500); |
Andreu | dca79f4 | 2019-09-18 23:53:19 +0200 | [diff] [blame] | 64 | }); |
Andreu | 66ad5cf | 2019-09-18 17:15:44 +0200 | [diff] [blame] | 65 | </script> |
| 66 | </body> |
| 67 | </html> |