DB funciona perfectament
diff --git a/main.php b/main.php
index bd0cedb..960197b 100644
--- a/main.php
+++ b/main.php
@@ -4,22 +4,28 @@
<title>Pàgina de l'usuari</title>
<link rel="stylesheet" href="./css/basic.css" />
<link rel="stylesheet" href="./css/main.css" />
-
- <script src="./js/utils.js"></script>
+
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
+ <script src="./js/utils.js"></script>
<?php require 'login.php'; ?>
<script>
- if (<?=$user->mort?>) document.write("Venga niño, pitjor que el Condom, MORT.");
- else {
- let dead = false
- let killed = false
+ if (<?=$user->mort?>) {
+ // User is dead
+ document.write("Venga niño, pitjor que el Condom, MORT.");
+ } else {
+ let dead = false;
+ let killed = false;
+
+ // Check for requests
if(<?=$user->requested?> == 1) dead = confirm("El teu assassí ha dit que t'ha matat, és veritat?");
if(<?=$user->requested?> == 2) killed = confirm("En/na <?=$victim->nom()?> ha dit que l'has matat, és veritat?");
+
+ // Confirm/deny request
if (dead) send_request(<?=$user->id?>, 3); // confirm death
- else send_request(<?=$user->id?>, 5); // deny death
- if (killed) send_request(<?=$victim->id?>, 4); // confirm kill
- else send_request(<?=$user->id?>, 5); // deny kill
+ else send_request(<?=$user->id?>, 4); // deny death
+ if (killed) send_request(<?=$victim->id?>, 3); // confirm kill
+ else send_request(<?=$user->id?>, 4); // deny kill
}
</script>
</head>