-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paththongtinadmin.php
171 lines (160 loc) · 8.57 KB
/
thongtinadmin.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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<?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="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300&display=swap" rel="stylesheet">
<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">
<script src="jsbaocao.js" defer></script>
<title>Thông tin Admin</title>
</head>
<body>
<div class="option">
<div class="header">
<ul class="container-main">
<li class="select">
<a href="index-home.php">
<i class="fas fa-home"></i>
Trang chủ
</a>
</li>
<li class="select"><a href="lapthedocgia.php" class="register">Lập thẻ độc giả</a></li>
<li class="select"><a href="tiepnhansachmoi.php" class="newbooks">Tiếp nhận sách mới</a></li>
<li class="select"><a href="tracuusach.php" class="tracuusach">Tra cứu sách</a></li>
<li class="select"><a href="sachmuon.php">Cho mượn sách</a></li>
<li class="select"><a href="trasach.php">Nhận trả sách</a></li>
<li class="select"><a href="phieuthutienphat.php">Lập phiếu thu tiền phạt</a></li>
<li class="select">
<a class="jsdownBC">Lập báo cáo <i class="fas fa-caret-down"></i></a>
<ul class="downBC action">
<li><a href="BCMStheloai.php">Mượn sách theo thể loại</a></li>
<li><a href="BCsachtratre.php">Sách trả trễ</a></li>
</ul>
</li>
<li class="select">
<a href="option.php">
Khác
</a>
</li>
</ul>
</div>
</div>
<div class="divContent main" id="divMain">
<div class="divMain">
<div class="container">
<h2>Thông tin tài khoản</h2>
<?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">
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 class="suathongtinsuperadmin action">
<form class="formsuatk" enctype="multipart/form-data" method="POST">
Tên tài khoản: <br>
<input class="kdcsua" readonly type="text" name="tentkc" value="<?php echo $tentk;?>"></input>
Tên đăng nhập:
<input class="kdcsua" readonly 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-home.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="index-home.php">Trang chủ</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>