-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paththongtinsuperadmin.php
140 lines (130 loc) · 6.88 KB
/
thongtinsuperadmin.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
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<?php
session_start();
$conn=mysqli_connect('localhost','root','','quanlythuvien') or die('fail');
$manguoidung=$_SESSION["manguoidung"];
$sql_16="SELECT * FROM nguoidung WHERE MaNguoiDung='$manguoidung'";
$res_16=mysqli_query($conn,$sql_16);
$row_16=mysqli_fetch_assoc($res_16);
$hoten=$row_16["TenTaiKhoan"];
$tentk=$row_16["TenTaiKhoan"];
$tendn=$row_16["TenDangNhap"];
$mk=$row_16["MatKhau"];
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" integrity="sha512-iBBXm8fW90+nuLcSKlbmrPcLa0OT92xO1BIsZ+ywDWZCvqsWgccV3gFoRBv0z+8dLJgyAHIhR35VZc2oM/gI1w==" crossorigin="anonymous" />
<link rel="stylesheet" href="style-home.css">
<link rel="stylesheet" href="style-ltdg.css">
<link rel="stylesheet" href="style-table.css">
<link rel="stylesheet" href="style-option.css">
<link rel="stylesheet" href="style_thongbao.css">
<link rel="stylesheet" href="style-login.css">
<title>Thông tin tài khoản</title>
</head>
<body>
<div class="divContent main" id="divMain">
<div class="divMain">
<div class="container">
<?php
if(isset($_POST['luu'])){
$tentk=$_POST["tentkc"];
$tendn=$_POST["tendnc"];
$mk=$_POST["mkc"];
$sql_18="SELECT * FROM nguoidung WHERE MaNguoiDung='$manguoidung' AND TenDangNhap='$tendn' AND TenTaiKhoan='$tentk' AND MatKhau='$mk'";
$res_18=mysqli_query($conn,$sql_18);
if(mysqli_num_rows($res_18)>0){
?>
<div class="thongbaosachmoi TBTDTTDN divphieuthu">
<div class="TBthemmoi divktimthay">
<div class="TBcontent theDGcontent">
<h2>Mật khẩu trùng với mật khẩu cũ. Vui lòng kiểm tra lại!</h2>
<div class="btn closephieumuonsach">
<button id="tatTBTDTTDN">OK</button>
</div>
</div>
</div>
</div>
<script>
document.getElementById("tatTBTDTTDN").addEventListener("click", function(){
document.querySelector(".thongbaosachmoi").classList.add("action");
})
</script>
<?php
}
else{
$sql_19="UPDATE nguoidung SET MatKhau='$mk' WHERE MaNguoiDung='$manguoidung' AND TenTaiKhoan='$tentk' AND TenDangNhap='$tendn'";
if(mysqli_query($conn,$sql_19)){
?>
<div>
<div class="thongbaosachmoi TBTDTTDN divphieuthu">
<div class="TBthemmoi divktimthay">
<div class="TBcontent theDGcontent">
<h2>Thay đổi thông tin thành công</h2>
<div class="btn closephieumuonsach">
<button id="tatTBTDTTDN">OK</button>
</div>
</div>
</div>
</div>
<script>
document.getElementById("tatTBTDTTDN").addEventListener("click", function(){
document.querySelector(".thongbaosachmoi").classList.add("action");
})
</script>
</div>
<?php
}
}
}else{
$tentk=$row_16["TenTaiKhoan"];
$tendn=$row_16["TenDangNhap"];
$mk=$row_16["MatKhau"];
}
?>
<div class="thongtinsuperadmin">
<h2>Thông tin tài khoản</h2>
<div>
Tên tài khoản:
<input readonly type="text" name="tentk" value="<?php echo $tentk;?>"></input>
Tên đăng nhập:
<input readonly type="text" name="tendn" value="<?php echo $tendn;?>"></input>
Mật khẩu:
<input readonly type="text" name="mk" value="<?php echo $mk;?>"></input>
</div>
</div>
<div class="suathongtinsuperadmin action">
<h2>Sửa thông tin tài khoản</h2>
<form style="width:400px;" enctype="multipart/form-data" method="POST">
Tên tài khoản:
<input readonly class="kdcsua" type="text" name="tentkc" value="<?php echo $tentk;?>"></input>
Tên đăng nhập:
<input readonly class="kdcsua" type="text" name="tendnc" value="<?php echo $tendn;?>"></input>
Mật khẩu:
<input type="text" name="mkc" value="<?php echo $mk;?>"></input>
</div>
<div class="foodter" id="btnLuuTT">
<a href="index-superadmin.php" class="trangchu">Trang chủ</a>
<a href="#" class="register suaTT">Sửa thông tin</a>
<button style="width:150px" class="btntrangchu action"><a href="thongtinsuperadmin.php">Quay lại</a></button>
<button style="width:200px" type="submit" class="btnluu action" name="luu">Lưu thông tin</button>
</div>
</form>
</div>
</div>
</div>
<script>
document.querySelector(".suaTT").addEventListener("click", function(){
document.querySelector(".suathongtinsuperadmin").classList.remove("action");
document.querySelector(".thongtinsuperadmin").classList.add("action");
document.querySelector(".trangchu").classList.add("action");
document.querySelector(".btnluu").classList.remove("action");
document.querySelector(".suaTT").classList.add("action");
document.querySelector(".btntrangchu").classList.remove("action");
})
</script>
</body>
</html>