Revize 76543147
Přidáno uživatelem Ondřej Drtina před více než 3 roky(ů)
application/view/modals/loginModal.html | ||
---|---|---|
27 | 27 |
</div> |
28 | 28 |
<div class="modal-footer"> |
29 | 29 |
<button type="button" class="btn btn-default" data-dismiss="modal" onclick="login()">Přihlásit se</button> |
30 |
<button type="button" class="btn btn-default" data-dismiss="modal">Zavřít</button> |
|
30 |
<button type="button" class="btn btn-default" data-dismiss="modal" onclick="register()">Zavřít</button>
|
|
31 | 31 |
</div> |
32 | 32 |
</div> |
33 | 33 |
</div> |
34 | 34 |
</div> |
35 | 35 |
|
36 | 36 |
<script> |
37 |
function register(){ |
|
38 |
var data = new FormData(); |
|
39 |
data.append("user", 'partyboypajda'); |
|
40 |
data.append("password", 'partypass'); |
|
41 |
data.append("role", 'partymanager'); |
|
42 |
let xhr = new XMLHttpRequest(); |
|
43 |
xhr.open("POST", "controller/RegistrationController.php"); |
|
44 |
xhr.send(data); |
|
45 |
} |
|
46 |
|
|
37 | 47 |
function login () { |
38 | 48 |
var data = new FormData(); |
39 | 49 |
data.append("username", document.getElementById('nick').value); |
... | ... | |
42 | 52 |
xhr.open("POST", "controller/LoginController.php"); |
43 | 53 |
xhr.onload = function(){ |
44 | 54 |
let search = JSON.parse(this.response); |
45 |
console.log(search);
|
|
55 |
console.log(this.response);
|
|
46 | 56 |
}; |
47 | 57 |
xhr.send(data); |
48 | 58 |
return false; |
Také k dispozici: Unified diff
přidána test reg. pro debug