Andreu | 66ad5cf | 2019-09-18 17:15:44 +0200 | [diff] [blame] | 1 | <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" /> |
Andreu | 10cb304 | 2019-09-18 19:55:36 +0200 | [diff] [blame] | 7 | |
Andreu | 66ad5cf | 2019-09-18 17:15:44 +0200 | [diff] [blame] | 8 | <script src="https://code.jquery.com/jquery-3.4.1.min.js"></script> |
Andreu | 10cb304 | 2019-09-18 19:55:36 +0200 | [diff] [blame] | 9 | <script src="./js/utils.js"></script> |
Andreu | 66ad5cf | 2019-09-18 17:15:44 +0200 | [diff] [blame] | 10 | |
Andreu | 0b2f843 | 2019-09-18 20:09:59 +0200 | [diff] [blame^] | 11 | <?php require './php/login.php'; ?> |
Andreu | 66ad5cf | 2019-09-18 17:15:44 +0200 | [diff] [blame] | 12 | <script> |
Andreu | 10cb304 | 2019-09-18 19:55:36 +0200 | [diff] [blame] | 13 | 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 |
Andreu | 66ad5cf | 2019-09-18 17:15:44 +0200 | [diff] [blame] | 21 | 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?"); |
Andreu | 10cb304 | 2019-09-18 19:55:36 +0200 | [diff] [blame] | 23 | |
| 24 | // Confirm/deny request |
Andreu | 57f3ca9 | 2019-09-18 19:40:42 +0200 | [diff] [blame] | 25 | if (dead) send_request(<?=$user->id?>, 3); // confirm death |
Andreu | 10cb304 | 2019-09-18 19:55:36 +0200 | [diff] [blame] | 26 | 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 |
Andreu | 66ad5cf | 2019-09-18 17:15:44 +0200 | [diff] [blame] | 29 | } |
| 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> |