-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuserA.php
162 lines (156 loc) · 5.06 KB
/
userA.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
<?php
session_start();
require 'function/function.php';
if (!isset($_SESSION["login"])){
header("Location:login/index.php");
exit;
}
$username = $_SESSION['username'];
$admina = query("SELECT * FROM library WHERE Author = '$username' ORDER BY id DESC ");
// $admina = query("SELECT * FROM library ORDER BY id");
if(isset($_POST['cari'])){
$admina =cari($_POST["keyword"]);
}
if(isset($_POST["submit"])){
// cek apakah data tambah berhasil
if (tambah($_POST) > 0){
echo "
<script>
alert('Data Berhasil Ditambah');
document.location.href = 'userA.php';
</script>
";
}else{
echo "
<script>
alert('Data Gagal Ditambah');
document.location.href = 'userA.php';
</script>
";
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ADMIN USER LIB DIAR</title>
<link href="css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" media="screen" href="css/style.css">
</head>
<style>
/* sytle ke-2 */
.sidenav
{
background-color: white;
border-right:2px solid black;
}
.sidenav a{
font-size:14pt;
}
.sidenav a:hover {
color: rgb(255, 174, 0);
}
ul.topnav {
background-color: rgb(26, 128, 1);;
}
ul.topnav li a:hover {background-color: rgb(255, 174, 0);}
table tr th
{
background-color: rgb(8, 219, 8);
}
/* tutup style ke-2 */
#footer
{
border-top: 2px solid white;
height:50px;
background:rgb(26, 128, 1);;
color:#fff;
position: relative;
bottom:0px;
width:100%;
}
#footer p
{
padding-right: 0.5cm;
text-align: right;
float: right;
}
#footer a
{
margin-left:160px;
text-decoration: none;
color: white;
text-align: left;
}
</style>
<body>
<ul class="topnav">
<li><a href="http://localhost/Lib-Diar/usera.php">Home</a></li>
<li><a href="#news">News</a></li>
<li><a href="#contact">Contact</a></li>
<li><a href="#contact">Contact</a></li>
<li><a href="#contact">Contact</a></li>
<div style="float:right;">
<li><a href="" ><img src="img/<?= $admina['0']["Gambar"];?>" style="border-radius:30px;height:23px;width:30px;"></a></li>
<li class="icon">
<a href="javascript:void(0);" onclick="myFunction()">☰</a>
</li>
</div>
</ul>
<div class="sidenav">
<a href="http://localhost/Lib-Diar/usera.php"><img src="img/logo.png" alt=""style="height:40px;width:125px;border-bottom:2px solid rgb(85, 84, 84); "></a>
<a href="#tab1" style="font-size:13pt;margin-top:14px;" >✉ ADMIN_INFO</a>
<a href="form.php" action="form.php" name="tambah" method="POST">✙ Tambah...</a>
<a href="#services">✪ Services</a>
<a href="#clients">☎ Clients</a>
<a href="#footer">✆ Contact Us</a>
<a href="logout.php">☚ Log out</a>
</div>
<div id="tab1">
<form action="" method="post" style="text-align:right;">
<input type="text" name="keyword" placeholder ="Masukan Keyword..." size="30" style="margin-bottom:10px;border-radius: 10px 0px 0px 10px;" autofocus>
<button type="submit" name="cari" style="opacity:50%;border-radius: 0px 10px 10px 0px;"><img src="img/pembesar.png" style="height:16px;width:16px;"></button>
</form>
<table border="1" class="table table-striped">
<tr>
<th>No</th>
<th>Profil</th>
<th>Name</th>
<th>Jumlah Post</th>
<th>View</th>
</tr>
<?php $i=1;?>
<?php foreach($admina as $row): ?>
<tr >
<td><?= $i?></td>
<td><img src="img/<?= $row["Gambar"];?>" Style="width:80px; height:60px;"></td>
<td><a href=""><?= $row["NamaDiary"];?></a></td>
<td><?= count($row["NamaDiary"]);?></td>
<td>
<button style="background-color:green;"><a style="color:#333"href="tambah.php?id=<?= $row["ID"];?>">Ubah</a></button> |
<button style="background-color:red;"><a style="color:#333" href="function/hapus.php?id=<?= $row["ID"];?>" onclick="return confirm('Yakin ?');">Hapus</a></button>
</td>
</tr>
<?php $i++;?>
<?php endforeach;?>
</table>
<br>
<br>
</div>
<div id="footer">
<p>Copyright © 2019 Design By Jordan Istiqlal </p>
<a href="">📞 : Contact Us</a>
<br>
<a href="https://www.google.co.id/maps/place/Universitas+Darussalam+Gontor/@-7.9022981,111.4900853,17z/data=!3m1!4b1!4m5!3m4!1s0x2e790aa79efd972b:0xf09ed064954d29b2!8m2!3d-7.9022981!4d111.492274?hl=id">🏰 : Find Us Here</a>
</div>
<script src="js/javas.js"></script>
<script>
/* Toggle between adding and removing the "responsive" class to topnav when the user clicks on the icon */
function myFunction() {
document.getElementsByClassName("topnav")[0].classList.toggle("responsive");
}
</script>
</body>
</html>