-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinput-uu.php
More file actions
89 lines (82 loc) · 1.82 KB
/
input-uu.php
File metadata and controls
89 lines (82 loc) · 1.82 KB
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
<?php
session_start();
if (!isset($_SESSION['username']) && !isset($_SESSION['category']) ) {
header("location: login.html");
}else {
if ($_SESSION['category'] != 6) {
session_destroy();
header("location: login.html");
}
}
?>
<!DOCTYPE html>
<html>
<head>
<link rel='shortcut icon' type='image/x-icon' href='img/favicon.jpg' />
<title>Input Glosarium</title>
<style>
body{
background-color: #f5f5f0;
}
table,th,td{
border:1px solid black;
border-collapse: collapse;
text-align: center;
}
th,td{
max-width: 1000px;
}
th{
color:white;
background-color: black;
}
.wrapper1{
padding-top: 10px;
}
</style>
</head>
<body>
<div class="wrapper">
<div class="wrapper1">
<div style="padding-left: 20px;">
<h2>Welcome, <?php echo $_SESSION['username'];?></h2><a href="logout.php"><button>Logout</button></a>
<form method="post" action="input-uu1.php" enctype="multipart/form-data">
<label>Nama Undang-Undang:</label><br>
<input type="text" name="name"><br>
<label>File Undang-Undang :</label>
<input type="file" name="uu"><br>
<input type="submit" value="Submit">
</form>
<?php
require_once "db.php";
$conn = konek_db();
$query = $conn->prepare("select * from `website`.`uu`");
$result= $query->execute();
if(!$result)
echo "Gagal Koneksi";
$rows = $query->get_result();
?>
<br>
<table>
<th>ID</th>
<th>Nama</th>
<?php
while($row = $rows->fetch_array()){
$url_delete = "delete-uu.php?id=".$row['id'];
if($row['uu'] == null || $row['uu'] == "")
echo "UU tidak boleh tidak ada";
else
$url_uu = "UU/".$row['uu'];
echo "<tr>";
echo '<td>'. $row['id'] . '</td>';
echo '<td>'. $row['nama'] . '</td>';
echo "<td><a href='".$url_delete."'><button>Hapus</button></a></td>";
echo "</tr>";
}
?>
</table>
</div>
</div>
</div>
</body>
</html>