-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDownloadFile.php
89 lines (76 loc) · 2.39 KB
/
DownloadFile.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
<?php include('config/setup.php'); ?>
<?php
$message = "";
if($_POST['submitted'] == 1)
{
$query = "SELECT * FROM file WHERE fetchcode='$_POST[retrievingcode]'";
$result = mysqli_query($dbc,$query);
$message.=$query."<br>";
$message.=mysqli_error($dbc)."<br>";
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Login</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0"/>
<?php include('config/css.php'); ?>
<?php include('config/js.php'); ?>
</head>
<body class='indigo lighten-5'>
<?php include(D_TEMPLATE.'/navigation.php'); ?>
<dir style='padding: 1% 1% 1% 1%;'>
<div>
<div class="row">
<form class="col s12" action="DownloadFile.php" method="post" role="form">
<div class="row">
<div class="input-field col s12">
<input type="text" id="retrievingcode" name="retrievingcode" class="validate">
<label for="retrievingcode">Retrieving Code: </label>
</div>
</div>
<button type="submit" class="waves-effect waves-light btn">Submit</button>
<input type="hidden" name="submitted" value="1">
</form>
</div>
</div>
<div>
<div class="row">
<table class="responsive-table hightlight col s12">
<thead>
<tr>
<th data-field="filename">File Name</th>
<th data-field="uploadtime">Upload Time</th>
<th data-field="lastdownload">Last Download Time</th>
</tr>
</thead>
<tbody>
<?php
while($table_user = mysqli_fetch_assoc($result)) {
?>
<tr>
<!--
<td><?php echo '<a href="handledownload.php?id='.$table_user['savename'].'">'.$table_user['filename'].'</a>'; ?></td> -->
<td><?php echo '<a href="storage/'.$table_user['savename'].'">'.$table_user['filename'].'</a>'; ?></td>
<td><?php echo $table_user['uploadtime']; ?></td>
<td><?php echo $table_user['lastdownloadtime']; ?></td>
<!--
<td><?php echo '<a href="delete_user.php?id='.$table_user['user_id'].'">Delete</a>' ?></td>
-->
</tr>
<?php
}
?>
</tbody>
</table>
</div>
</div>
<h3>Message:</h3>
<?php
//echo "<p>".$message."</p>"
?>
</dir>
<?php include(D_TEMPLATE.'/footer.php'); ?>
</body>
</html>