-
Notifications
You must be signed in to change notification settings - Fork 0
/
Download.php
112 lines (106 loc) · 2.31 KB
/
Download.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
<?php
session_start();
if(isset($_GET["dw"]))
{
$file = 'D.php';
if (file_exists($file)) {
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.basename($file));
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
header('Content-Length: ' . filesize($file));
readfile($file);
exit;
}
}
?>
<!doctype html>
<html>
<head>
<title>Certificate Signing Request Page</title>
</head>
<style>
body {
font-family: 'sans serif';
padding: 0;
margin: 0;
}
.mid {
text-align: center;
}
.navbar a {
color: black;
}
.navbar {
height: 50px;
background: black;
}
.navbar ul {
margin: 0;
padding: 0;
height: 100%;
}
.navbar li {
color: white;
font-weight: bold;
line-height: 50px;
list-style: none;
display: inline-block;
padding-left: 10px;
padding-right: 20px;
box-sizing: border-box;
border-right: solid black 1px;
background: #888888;
}
</style>
<body>
<div class="navbar">
<ul class="navbar-item">
<a href="#"><li>Home</li></a><a href="#"><li>Something</li></a>
</ul>
</div>
<h1 class="center"> Download
</h1>
<form action ="RA.php" method="POST">
<table border="1">
<th>No</th>
<th>ID Request</th>
<th>Status</th>
<th></th>
<?php
$user_name = "root";
$password = "";
$database = "CA";
$server = "localhost";
$db_handle = mysql_connect($server, $user_name, $password);
$db_found = mysql_select_db($database);
if (!$db_found) echo "Database NOT Found";
else {
$SQL = "SELECT * FROM request where id=1";
$result = mysql_query($SQL);
$i=1;
while ( $db_field = mysql_fetch_assoc($result) ) {
echo "<tr>";
echo "<td>" .$i."</td>";
echo "<td>" . $db_field['id_request'] . "</td>";
if($db_field['Persetujuan']==1)
{
echo "<td>" . "Disetujui" . "</td>";
echo "<td><a href='Download.php?dw=1' />Download</td>";
}
else
{
echo "<td>" . "Belum disetujui" . "</td>";
echo "<td>" . "Tidak Bisa Download" . "</td>";
}
echo "</tr>";
$i=$i+1;
}
}
mysql_close($db_handle);
?>
</table>
</body>
</html>