blob: e7a14c397323b2b6c6dba281e50c559655269783 [file] [log] [blame]
Andreu66ad5cf2019-09-18 17:15:44 +02001<html>
2 <head>
3 <meta charset="UTF-8">
Andreu0d0f9fd2019-09-23 03:56:08 +02004 <title>PastanagAPP</title>
avm99963db383ed2019-09-22 02:14:42 +02005
6 <meta name="viewport" content="width=device-width, initial-scale=1">
Andreu0d0f9fd2019-09-23 03:56:08 +02007 <link rel="manifest" href="https://api.myjson.com/bins/u6r41">
8
9 <!-- Apple web app -->
10 <link rel="apple-touch-icon" href="./bin/images/icons/icon-72x72.png">
11 <meta name="apple-mobile-web-app-title" content="PastanagAPP">
12 <meta name="apple-mobile-web-app-capable" content="yes">
13 <meta name="apple-mobile-web-app-status-bar-style" content="green">
avm99963db383ed2019-09-22 02:14:42 +020014
Andreu4b2fbd92019-09-22 22:30:25 +020015 <link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Open+Sans" />
16
Andreu66ad5cf2019-09-18 17:15:44 +020017 <link rel="stylesheet" href="./css/basic.css" />
18 <link rel="stylesheet" href="./css/login.css" />
avm99963db383ed2019-09-22 02:14:42 +020019
Andreu0b2f8432019-09-18 20:09:59 +020020 <script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
Andreu543e70c2019-09-22 14:08:49 +020021 <script src="https://rawgit.com/notifyjs/notifyjs/master/dist/notify.js"></script>
22
23 <script src="./js/utils.js"></script>
24 <script src="./js/animations.js"></script>
Andreu66ad5cf2019-09-18 17:15:44 +020025 </head>
26 <body>
27 <div id="outter-container">
28 <div id="inner-container">
Andreua0fc8272019-09-23 00:35:25 +020029 <form action="./main.php" method="POST">
Andreudd6cfb42019-09-22 19:52:39 +020030 <input type="hidden" name="user" id="user">
31
32 <!-- MD Search Box -->
33 <div class="md-google-search__metacontainer">
34 <div class="md-google-search__container">
35 <div class="md-google-search">
36 <span class="md-google-search__search-btn">
37 <svg height="24px" viewBox="0 0 24 24" width="24px" xmlns="http://www.w3.org/2000/svg"><path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"></path><path d="M0 0h24v24H0z" fill="none"></path></svg>
38 </span>
39 <div class="md-google-search__field-container">
Andreu2211ab22019-09-23 18:13:26 +020040 <input id="search-input" class="md-google-search__field" required autocomplete="off" placeholder="Introdueix el teu nom..." value="" name="search" type="text" spellcheck="false" style="outline: none;">
Andreudd6cfb42019-09-22 19:52:39 +020041 </div>
42 <span class="md-google-search__empty-btn" style="display: none;">
43 <svg focusable="false" height="24px" viewBox="0 0 24 24" width="24px" xmlns="http://www.w3.org/2000/svg"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"></path><path d="M0 0h24v24H0z" fill="none"></path></svg>
44 </span>
45 </div>
46 </div>
47
48 <div class="autocomplete-container" style="display: none;">
49 <div id="autocomplete-list" class="autocomplete-items"></div>
50 </div>
51 </div>
avm99963db383ed2019-09-22 02:14:42 +020052
Andreu20cbd1d2019-09-22 00:00:57 +020053 <input disabled required placeholder="Clau d'accés..." id="password" type="password" name="password"/>
Andreu4b2fbd92019-09-22 22:30:25 +020054 <input type="submit" value="Entrar" id="submit" />
Andreu66ad5cf2019-09-18 17:15:44 +020055 </form>
Andreu0d0f9fd2019-09-23 03:56:08 +020056
57 <p>La primera persona que entri al teu compte tindrà l'oportunitat de canviar la contrasenya.</p>
Andreuae44f202019-09-23 23:15:56 +020058 <a href="./ranking.php">Anar al rànquing</a>
Andreu66ad5cf2019-09-18 17:15:44 +020059 </div>
60 </div>
avm99963db383ed2019-09-22 02:14:42 +020061
Andreudd6cfb42019-09-22 19:52:39 +020062 <script src="./js/autocomplete.js"></script>
Andreu0b2f8432019-09-18 20:09:59 +020063 <script>
Andreudd6cfb42019-09-22 19:52:39 +020064 fetch("./ajax/getusers.php").then(result => result.json()).then(users => {
Andreudd6cfb42019-09-22 19:52:39 +020065 autocomplete(document.getElementById("search-input"), users, "search");
Andreu1bf9ab72019-09-22 20:27:40 +020066 console.log(users);
67
Andreu99501052019-09-22 20:09:08 +020068 userid = <?=isset($_COOKIE['user']) ? (int)$_COOKIE['user'] : -1 ?>;
Andreu1bf9ab72019-09-22 20:27:40 +020069 username = get_user_name(users, userid);
Andreu4b2fbd92019-09-22 22:30:25 +020070 if (userid > 0) $("#search-input").prop("placeholder", username);
Andreu0b2f8432019-09-18 20:09:59 +020071 });
Andreu0d0f9fd2019-09-23 03:56:08 +020072
Andreu543e70c2019-09-22 14:08:49 +020073 $(document).ready(function() {
74 // Notify of messages
75 if (getUrlParameter("passwordchanged")) read_message("La teva clau d'accés ha canviat", "error");
76 if (getUrlParameter("wrongpassword")) read_message("La clau d'accés no és correcta", "error");
Andreu0d0f9fd2019-09-23 03:56:08 +020077 if (getUrlParameter("wrongconfirmation")) read_message("Les contrasenyes no coincideixen", "error");
78 if (getUrlParameter("errordb")) read_message("Hi ha hagut un problema a la base de dades, torna-ho a intentar", "error");
79 if (getUrlParameter("successpassword")) read_message("La teva clau d'accés s'ha guardat", "success");
Andreu543e70c2019-09-22 14:08:49 +020080 });
Andreu0b2f8432019-09-18 20:09:59 +020081 </script>
Andreu66ad5cf2019-09-18 17:15:44 +020082 </body>
83</html>