-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
executable file
·113 lines (91 loc) · 4.38 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Log in</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/bootstrap-theme.min.css">
<link rel="stylesheet" href="css/login.css">
<!--[if lt IE 9]>
<script src="js/vendor/html5-3.6-respond-1.4.2.min.js"></script>
<![endif]-->
</head>
<body>
<!--[if lt IE 8]>
<p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
<![endif]-->
<div class="col-md-4 col-md-offset-4" id="login">
<H2>Sign in</H2>
<form action="login.php" method="post">
<label for="user">Username</label>
<input type="text" class="form-control" name="user" id="user">
<label for="user">Password</label>
<input type="password" class="form-control" name="pass">
<input type="submit" class="btn btn-primary pull-right" value="Log in!">
</form>
<span>Or <a href="" class="sign-up-btn">sign up?</a></span>
<div class="sign-up ">
<form class="register-form">
<label for="username">Username</label>
<input type="text" name="username" id="username" class="form-control">
<label for="pass">Password</label>
<input type="password" name="pass" id="pass" class="form-control">
<input type="submit" class="btn btn-warning" value="Register" id="register">
</form>
</div>
</div>
<div class="container">
<div class="alert-wrapper col-md-6 col-md-offset-3">
<div class="alert " role="alert"> SSS </div>
</div>
</div>
<footer class="col-md-12">
<p>© Roman Rajchert 2015</p>
</footer>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/vendor/jquery-1.11.2.min.js"><\/script>')</script>
<script src="js/vendor/bootstrap.min.js"></script>
<script>
$(function(){
$(".sign-up-btn").on("click",function(e){
e.preventDefault();
$(".sign-up").css("visibility","visible !important");
$(".sign-up").slideToggle(1000);
});
$('.register-form').submit(function(e) {
console.log("odeslano");
e.preventDefault();
var formData = $('.register-form').serialize();
$.ajax({
type : 'POST',
url : 'register.php',
data : formData,
dataType : 'json'
})
.done(function(data) {
$alert = $(".alert");
$alert.removeClass("alert-danger");
$alert.removeClass("alert-success");
if(data.error){
$alert.addClass("alert-danger");
$alert.html(data.error);
}
if(data.succes){
$alert.addClass("alert-success");
$alert.html(data.succes);
$('.register-form')[0].reset();
$(".sign-up").slideUp(500);
}
$(".alert-wrapper").slideDown(500);
setTimeout(function(){
$(".alert-wrapper").slideUp(500);
}, 3000);
});
});
});
</script>
</body>
</html>