blob: aa6d102c79c8df74375c371e6b9e4f20f63b51cb [file] [log] [blame]
Andreu09b8b052019-09-21 21:47:20 +02001<?php
2 if (!isset($_COOKIE['user'])) {
3 header("Location: ./main.php");
4 die();
5 }
6?>
Andreu66ad5cf2019-09-18 17:15:44 +02007<html>
8 <head>
9 <meta charset="UTF-8">
10 <title>Pàgina de l'usuari</title>
Andreuefe66eb2019-09-21 18:41:49 +020011
Andreu66ad5cf2019-09-18 17:15:44 +020012 <link rel="stylesheet" href="./css/basic.css" />
13 <link rel="stylesheet" href="./css/main.css" />
Andreu10cb3042019-09-18 19:55:36 +020014
Andreu66ad5cf2019-09-18 17:15:44 +020015 <script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
Andreued8e1f92019-09-18 22:26:04 +020016 <script src="https://rawgit.com/notifyjs/notifyjs/master/dist/notify.js"></script>
Andreuefe66eb2019-09-21 18:41:49 +020017
Andreu10cb3042019-09-18 19:55:36 +020018 <script src="./js/utils.js"></script>
Andreuefe66eb2019-09-21 18:41:49 +020019 <script src="./js/animations.js"></script>
Andreu66ad5cf2019-09-18 17:15:44 +020020
Andreudca79f42019-09-18 23:53:19 +020021 <?php
Andreu09b8b052019-09-21 21:47:20 +020022 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');
Andreudca79f42019-09-18 23:53:19 +020026 ?>
Andreued8e1f92019-09-18 22:26:04 +020027
Andreu66ad5cf2019-09-18 17:15:44 +020028 <script>
Andreued491672019-09-20 13:09:18 +020029 let user = {
30 'id': <?=$user->id?>,
31 'quimata': <?=$user->quimata?>,
32 'requested': <?=$user->requested?>,
Andreuabbcb7e2019-09-21 18:22:14 +020033 'mort': <?=$user->mort?>,
34
35 'nom': "<?=$user->nomcomplet?>",
36 'curs': <?=$user->curs?>,
37 'grau': <?=$user->grau?>
Andreued491672019-09-20 13:09:18 +020038 };
Andreu66ad5cf2019-09-18 17:15:44 +020039 </script>
Andreudca79f42019-09-18 23:53:19 +020040
Andreu66ad5cf2019-09-18 17:15:44 +020041 </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>
Andreu885889c2019-09-19 00:28:20 +020047 <div id="state">0</div>
Andreu66ad5cf2019-09-18 17:15:44 +020048
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>
Andreuabbcb7e2019-09-21 18:22:14 +020056 <div id="butons" class="options">
57 <button id="win" onclick="js: send_request(user, 'REQ KILL');">L'he matat</button>
Andreu66ad5cf2019-09-18 17:15:44 +020058 </div>
59
60 <script>
Andreudca79f42019-09-18 23:53:19 +020061 $(document).ready(function() {
Andreuabbcb7e2019-09-21 18:22:14 +020062 // Set interval of checking
Andreuefe66eb2019-09-21 18:41:49 +020063 let checking = setInterval(function() { update_info(user); }, 1500);
Andreudca79f42019-09-18 23:53:19 +020064 });
Andreu66ad5cf2019-09-18 17:15:44 +020065 </script>
66 </body>
67</html>