blob: c3c3a971e9f99dde29bf5f8cb3eeae958ab759cb [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>
avm99963db383ed2019-09-22 02:14:42 +020011
12 <meta name="viewport" content="width=device-width, initial-scale=1">
13
Andreu66ad5cf2019-09-18 17:15:44 +020014 <link rel="stylesheet" href="./css/basic.css" />
15 <link rel="stylesheet" href="./css/main.css" />
avm99963db383ed2019-09-22 02:14:42 +020016
Andreu66ad5cf2019-09-18 17:15:44 +020017 <script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
Andreued8e1f92019-09-18 22:26:04 +020018 <script src="https://rawgit.com/notifyjs/notifyjs/master/dist/notify.js"></script>
avm99963db383ed2019-09-22 02:14:42 +020019
Andreu10cb3042019-09-18 19:55:36 +020020 <script src="./js/utils.js"></script>
Andreuefe66eb2019-09-21 18:41:49 +020021 <script src="./js/animations.js"></script>
avm99963db383ed2019-09-22 02:14:42 +020022
23 <?php
Andreu2457e402019-09-22 00:52:41 +020024 require './credentials.php';
Andreu09b8b052019-09-21 21:47:20 +020025 require './php/utils.php';
26 $user = get_users($_COOKIE['user']);
27 $victim = get_users($user->quimata);
Andreu4ed74962019-09-22 00:06:15 +020028 if ($user->mort) header("Location: ./dead.php");
Andreudca79f42019-09-18 23:53:19 +020029 ?>
avm99963db383ed2019-09-22 02:14:42 +020030
Andreu66ad5cf2019-09-18 17:15:44 +020031 <script>
Andreued491672019-09-20 13:09:18 +020032 let user = {
33 'id': <?=$user->id?>,
34 'quimata': <?=$user->quimata?>,
35 'requested': <?=$user->requested?>,
Andreuabbcb7e2019-09-21 18:22:14 +020036 'mort': <?=$user->mort?>,
avm99963db383ed2019-09-22 02:14:42 +020037
Andreuabbcb7e2019-09-21 18:22:14 +020038 'nom': "<?=$user->nomcomplet?>",
39 'curs': <?=$user->curs?>,
40 'grau': <?=$user->grau?>
Andreued491672019-09-20 13:09:18 +020041 };
Andreu66ad5cf2019-09-18 17:15:44 +020042 </script>
avm99963db383ed2019-09-22 02:14:42 +020043
Andreu66ad5cf2019-09-18 17:15:44 +020044 </head>
45 <body>
46 <div id="outter-container">
47 <div id="inner-container">
48 <h2>Hola <name id="user_name"><?=$user->nom()?></name>,</h2>
avm99963db383ed2019-09-22 02:14:42 +020049
Andreu96f1bcd2019-09-22 00:33:09 +020050 <div class="formulari_contrasenya" style="display: none;">
Andreu20cbd1d2019-09-22 00:00:57 +020051 <p>Sembla que no tens contrasenya, la gent podrà entrar a la teva compta...</p>
52 <form action="./php/change_password.php" method="POST">
53 <input type="hidden" value="<?=$_COOKIE['user']?>" name="userid">
54 <input type="password" placeholder="Nova contrasenya..." name="password" /><br />
55 <input type="password" placeholder="Repeteix la contrasenya" name="confirmation"/><br />
56 <input type="submit">
57 </form>
58 </div>
avm99963db383ed2019-09-22 02:14:42 +020059
60 <p>La teva víctima és:</p>
61
62 <table class="victima">
63 <tr>
64 <td><img id="victim_img" src="./imgs/<?=$victim->id?>.png" /></td>
65 <td>
66 <div id="victim_name"><?=$victim->nomcomplet?></div>
67 <div id="victim_curs_i_grau"><span id="victim_curs"><?=$victim->curs?></span>-<span id="victim_grau"><?=$victim->grau?></span></div>
68 <div id="butons" class="options">
69 <button id="win" onclick="js: send_request(user, 'REQ KILL');">L'he matat</button>
70 </div>
71 </td>
72 </tr>
73 </table>
74
75 <div style="clear: both;"></div>
Andreu66ad5cf2019-09-18 17:15:44 +020076 </div>
77 </div>
avm99963db383ed2019-09-22 02:14:42 +020078
Andreu66ad5cf2019-09-18 17:15:44 +020079 <script>
Andreudca79f42019-09-18 23:53:19 +020080 $(document).ready(function() {
Andreuabbcb7e2019-09-21 18:22:14 +020081 // Set interval of checking
Andreuefe66eb2019-09-21 18:41:49 +020082 let checking = setInterval(function() { update_info(user); }, 1500);
Andreu96f1bcd2019-09-22 00:33:09 +020083 // Set to hidden or not the password prompt
84 if (<?=$user->md5password=="" ? 1 : 0?>) $(".formulari_contrasenya").show();
Andreudca79f42019-09-18 23:53:19 +020085 });
Andreu66ad5cf2019-09-18 17:15:44 +020086 </script>
87 </body>
88</html>