-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuser.php
73 lines (61 loc) · 2.12 KB
/
user.php
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
<?php
$u->taocaptcha();
?>
<div id="user-area" >
<a href="#" id="dangnhap">Đăng nhập</a> / <a href="#" id="dangky">Đăng ký</a>
</div>
<div class="modal text-left" id="myModal">
<div class="modal-content" id="content" ></div>
</div>
<?php require_once("user_dangnhap.php");?>
<?php require_once("user_dangky.php");?>
<script>
$(document).ready(function(){
$("#dangnhap").click(function(){
$("#myModal").show();
$("#content").html($("#formdn").html());
$("#content").css('height', '340px');
return false;
});
$("#dangky").click(function(){
$("#myModal").show();
$("#content").html($("#formdk").html());
$("#content").css('height', '620px');
return false;
});
$("#content").on('click', '#btn-dk', function(){
$.ajax({
url: "process.php",
type: "post",
data: $("#formdangky").serialize()+"&action=dangky",
success: function(data){
if(data == 'OK'){
$("#content").html("<h2>Đăng ký thành công!</h2> <p><a href='#' id='chuyendangnhap'>Đăng nhập<a></p>");
} else{
$("#error").html(data);
}
}
});
});
$("#content").on('click', '#chuyendangnhap', function(){
$("#dangnhap").click();
});
$("#content").on('click', '#btn-dn', function(){
$.ajax({
url: "process.php",
type: "post",
data: $("#formdangnhap").serialize()+"&action=dangnhap",
success: function(data){
if(data == 'OK'){
location.reload();
} else {
$("#error").html(data);
}
}
});
});
$("#content").on('click', '.close',function(){
$("#myModal").hide();
});
});
</script>