blob: 31b4ae7aced79eda50bd286e595cef69e24ace3b [file] [log] [blame]
Andreu66ad5cf2019-09-18 17:15:44 +02001<html>
2 <head>
3 <meta charset="UTF-8">
4 <title>Pàgina de l'usuari</title>
5 <link rel="stylesheet" href="./css/basic.css" />
6 <link rel="stylesheet" href="./css/main.css" />
Andreu10cb3042019-09-18 19:55:36 +02007
Andreu66ad5cf2019-09-18 17:15:44 +02008 <script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
Andreu10cb3042019-09-18 19:55:36 +02009 <script src="./js/utils.js"></script>
Andreu66ad5cf2019-09-18 17:15:44 +020010
Andreu0b2f8432019-09-18 20:09:59 +020011 <?php require './php/login.php'; ?>
Andreu66ad5cf2019-09-18 17:15:44 +020012 <script>
Andreu10cb3042019-09-18 19:55:36 +020013 if (<?=$user->mort?>) {
14 // User is dead
15 document.write("Venga niño, pitjor que el Condom, MORT.");
16 } else {
17 let dead = false;
18 let killed = false;
19
20 // Check for requests
Andreu66ad5cf2019-09-18 17:15:44 +020021 if(<?=$user->requested?> == 1) dead = confirm("El teu assassí ha dit que t'ha matat, és veritat?");
22 if(<?=$user->requested?> == 2) killed = confirm("En/na <?=$victim->nom()?> ha dit que l'has matat, és veritat?");
Andreu10cb3042019-09-18 19:55:36 +020023
24 // Confirm/deny request
Andreu57f3ca92019-09-18 19:40:42 +020025 if (dead) send_request(<?=$user->id?>, 3); // confirm death
Andreu10cb3042019-09-18 19:55:36 +020026 else send_request(<?=$user->id?>, 4); // deny death
27 if (killed) send_request(<?=$victim->id?>, 3); // confirm kill
28 else send_request(<?=$user->id?>, 4); // deny kill
Andreu66ad5cf2019-09-18 17:15:44 +020029 }
30 </script>
31 </head>
32 <body>
33 <div id="outter-container">
34 <div id="inner-container">
35 <h2>Hola <name id="user_name"><?=$user->nom()?></name>,</h2>
36 <h3>La teva víctima és:</h3>
37
38 <div class="victima">
39 <img width="300px" src="./imgs/<?=$victim->id?>.png" />
40 <h2 id="victim_name"><?=$victim->nomcomplet?></h2>
41 <h3><span id="victim_curs"><?=$victim->curs?></span>-<span id="victim_grau"><?=$victim->grau?></span></h3>
42 </div>
43 </div>
44 </div>
45 <div id="butons">
46 <button id="win" onclick="js: send_request(<?=$victim->id?>,1);">L'he matat</button>
47 <button id="lose" onclick="js: send_request(<?=$user->id?>,2);">M'han matat</button>
48 </div>
49
50 <script>
51
52 </script>
53 </body>
54</html>