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 | ed8e1f9 | 2019-09-18 22:26:04 +0200 | [diff] [blame] | 9 | <script src="https://rawgit.com/notifyjs/notifyjs/master/dist/notify.js"></script> |
Andreu | 10cb304 | 2019-09-18 19:55:36 +0200 | [diff] [blame] | 10 | <script src="./js/utils.js"></script> |
Andreu | 66ad5cf | 2019-09-18 17:15:44 +0200 | [diff] [blame] | 11 | |
Andreu | dca79f4 | 2019-09-18 23:53:19 +0200 | [diff] [blame^] | 12 | <?php |
| 13 | require './php/login.php'; |
| 14 | ?> |
Andreu | ed8e1f9 | 2019-09-18 22:26:04 +0200 | [diff] [blame] | 15 | |
Andreu | 66ad5cf | 2019-09-18 17:15:44 +0200 | [diff] [blame] | 16 | <script> |
Andreu | ed8e1f9 | 2019-09-18 22:26:04 +0200 | [diff] [blame] | 17 | let mort = <?=$user->mort?>; |
| 18 | let requested = <?=$user->requested?>; |
| 19 | let userid = <?=$user->id?>; |
| 20 | let victimid = <?=$victim->id?>; |
| 21 | let victimnom = "<?=$victim->nom()?>"; |
Andreu | 66ad5cf | 2019-09-18 17:15:44 +0200 | [diff] [blame] | 22 | </script> |
Andreu | dca79f4 | 2019-09-18 23:53:19 +0200 | [diff] [blame^] | 23 | |
Andreu | 66ad5cf | 2019-09-18 17:15:44 +0200 | [diff] [blame] | 24 | </head> |
| 25 | <body> |
| 26 | <div id="outter-container"> |
| 27 | <div id="inner-container"> |
| 28 | <h2>Hola <name id="user_name"><?=$user->nom()?></name>,</h2> |
| 29 | <h3>La teva víctima és:</h3> |
Andreu | dca79f4 | 2019-09-18 23:53:19 +0200 | [diff] [blame^] | 30 | <div style="display:none;" id="state">0</div> |
Andreu | 66ad5cf | 2019-09-18 17:15:44 +0200 | [diff] [blame] | 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> |
Andreu | dca79f4 | 2019-09-18 23:53:19 +0200 | [diff] [blame^] | 45 | $(document).ready(function() { |
| 46 | let checking = setInterval(function() { |
| 47 | $.ajax({ url: "./php/checkrequests.php", data: { id: userid }, type: 'GET', |
| 48 | success: function(data) { |
| 49 | $("#state").load("./php/checkrequests.php?id=" + userid, function() { |
| 50 | if (!mort) requested = check_requests($("#state").html(), victimnom, victimid, userid); |
| 51 | else clearInterval(checking); |
| 52 | }); |
| 53 | }}); |
| 54 | }, 1000); |
| 55 | }); |
Andreu | 66ad5cf | 2019-09-18 17:15:44 +0200 | [diff] [blame] | 56 | </script> |
| 57 | </body> |
| 58 | </html> |