1
|
<div id="login-modal" class="modal fade" role="dialog">
|
2
|
<div class="modal-dialog modal-dialog-centered" role="document">
|
3
|
<div class="modal-content">
|
4
|
<div class="modal-header">
|
5
|
<h4 class="modal-title">Přihlásit se</h4>
|
6
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
7
|
</div>
|
8
|
<div class="modal-body">
|
9
|
<div class="container">
|
10
|
<div class="row">
|
11
|
<div class="col-xs-12 col-sm-5">
|
12
|
<label for="nick">Přihlašovací jméno</label>
|
13
|
</div>
|
14
|
<div class="col-xs-12 col-sm-7">
|
15
|
<input type="text" id="nick">
|
16
|
</div>
|
17
|
</div>
|
18
|
<div class="row">
|
19
|
<div class="col-xs-12 col-sm-5">
|
20
|
<label for="password">Heslo</label>
|
21
|
</div>
|
22
|
<div class="col-xs-12 col-sm-7">
|
23
|
<input type="password" id="password">
|
24
|
</div>
|
25
|
</div>
|
26
|
</div>
|
27
|
</div>
|
28
|
<div class="modal-footer">
|
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>
|
31
|
</div>
|
32
|
</div>
|
33
|
</div>
|
34
|
</div>
|
35
|
|
36
|
<script>
|
37
|
function login () {
|
38
|
var data = new FormData();
|
39
|
data.append("username", document.getElementById('nick').value);
|
40
|
data.append("password", document.getElementById('password').value);
|
41
|
var xhr = new XMLHttpRequest();
|
42
|
xhr.open("POST", "controller/LoginController.php");
|
43
|
xhr.onload = function(){
|
44
|
let search = JSON.parse(this.response);
|
45
|
console.log(search);
|
46
|
};
|
47
|
xhr.send(data);
|
48
|
return false;
|
49
|
}
|
50
|
|
51
|
</script>
|