blob: 1726e0d5b1a168c039bd6f57a2c56b52b7e7621b [file] [log] [blame]
Andreu09b8b052019-09-21 21:47:20 +02001<?php
2 if (!isset($_COOKIE['user'])) {
Andreu96f1bcd2019-09-22 00:33:09 +02003 header("Location: ./index.php");
Andreu09b8b052019-09-21 21:47:20 +02004 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
Andreu2457e402019-09-22 00:52:41 +020022 require './credentials.php';
Andreu09b8b052019-09-21 21:47:20 +020023 require './php/utils.php';
24 $user = get_users($_COOKIE['user']);
25 $victim = get_users($user->quimata);
Andreu4ed74962019-09-22 00:06:15 +020026 if ($user->mort) header("Location: ./dead.php");
Andreudca79f42019-09-18 23:53:19 +020027 ?>
Andreued8e1f92019-09-18 22:26:04 +020028
Andreu66ad5cf2019-09-18 17:15:44 +020029 <script>
Andreued491672019-09-20 13:09:18 +020030 let user = {
31 'id': <?=$user->id?>,
32 'quimata': <?=$user->quimata?>,
33 'requested': <?=$user->requested?>,
Andreuabbcb7e2019-09-21 18:22:14 +020034 'mort': <?=$user->mort?>,
35
36 'nom': "<?=$user->nomcomplet?>",
37 'curs': <?=$user->curs?>,
38 'grau': <?=$user->grau?>
Andreued491672019-09-20 13:09:18 +020039 };
Andreu66ad5cf2019-09-18 17:15:44 +020040 </script>
Andreudca79f42019-09-18 23:53:19 +020041
Andreu66ad5cf2019-09-18 17:15:44 +020042 </head>
43 <body>
44 <div id="outter-container">
45 <div id="inner-container">
46 <h2>Hola <name id="user_name"><?=$user->nom()?></name>,</h2>
Andreu96f1bcd2019-09-22 00:33:09 +020047
48 <div class="formulari_contrasenya" style="display: none;">
Andreu20cbd1d2019-09-22 00:00:57 +020049 <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
Andreu66ad5cf2019-09-18 17:15:44 +020058 <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>
Andreuabbcb7e2019-09-21 18:22:14 +020067 <div id="butons" class="options">
68 <button id="win" onclick="js: send_request(user, 'REQ KILL');">L'he matat</button>
Andreu66ad5cf2019-09-18 17:15:44 +020069 </div>
70
71 <script>
Andreudca79f42019-09-18 23:53:19 +020072 $(document).ready(function() {
Andreuabbcb7e2019-09-21 18:22:14 +020073 // Set interval of checking
Andreuefe66eb2019-09-21 18:41:49 +020074 let checking = setInterval(function() { update_info(user); }, 1500);
Andreu96f1bcd2019-09-22 00:33:09 +020075 // Set to hidden or not the password prompt
76 if (<?=$user->md5password=="" ? 1 : 0?>) $(".formulari_contrasenya").show();
Andreudca79f42019-09-18 23:53:19 +020077 });
Andreu66ad5cf2019-09-18 17:15:44 +020078 </script>
79 </body>
80</html>