blob: bd0cedbeaec92738c0e30eacb2e2813bfed75783 [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" />
7
8 <script src="./js/utils.js"></script>
9 <script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
10
11 <?php require 'login.php'; ?>
12 <script>
Andreu57f3ca92019-09-18 19:40:42 +020013 if (<?=$user->mort?>) document.write("Venga niño, pitjor que el Condom, MORT.");
Andreu66ad5cf2019-09-18 17:15:44 +020014 else {
15 let dead = false
16 let killed = false
17 if(<?=$user->requested?> == 1) dead = confirm("El teu assassí ha dit que t'ha matat, és veritat?");
18 if(<?=$user->requested?> == 2) killed = confirm("En/na <?=$victim->nom()?> ha dit que l'has matat, és veritat?");
Andreu57f3ca92019-09-18 19:40:42 +020019 if (dead) send_request(<?=$user->id?>, 3); // confirm death
20 else send_request(<?=$user->id?>, 5); // deny death
21 if (killed) send_request(<?=$victim->id?>, 4); // confirm kill
22 else send_request(<?=$user->id?>, 5); // deny kill
Andreu66ad5cf2019-09-18 17:15:44 +020023 }
24 </script>
25 </head>
26 <body>
27 <div id="outter-container">
28 <div id="inner-container">
29 <h2>Hola <name id="user_name"><?=$user->nom()?></name>,</h2>
30 <h3>La teva víctima és:</h3>
31
32 <div class="victima">
33 <img width="300px" src="./imgs/<?=$victim->id?>.png" />
34 <h2 id="victim_name"><?=$victim->nomcomplet?></h2>
35 <h3><span id="victim_curs"><?=$victim->curs?></span>-<span id="victim_grau"><?=$victim->grau?></span></h3>
36 </div>
37 </div>
38 </div>
39 <div id="butons">
40 <button id="win" onclick="js: send_request(<?=$victim->id?>,1);">L'he matat</button>
41 <button id="lose" onclick="js: send_request(<?=$user->id?>,2);">M'han matat</button>
42 </div>
43
44 <script>
45
46 </script>
47 </body>
48</html>