-
Notifications
You must be signed in to change notification settings - Fork 1
/
files.php
98 lines (91 loc) · 4.07 KB
/
files.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
<?php include 'process.php';?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Upload</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.3.1/dist/css/bootstrap.min.css">
<link href="css/custom.css" rel="stylesheet">
<link href="css/simple-sidebar.css" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.3.1/dist/js/bootstrap.min.js"></script>
</head>
<body>
<div class="d-flex" id="wrapper">
<!-- Sidebar -->
<div class="bg-light border-right" id="sidebar-wrapper">
<div class="sidebar-heading"> </div>
<div class="list-group list-group-flush">
<a href="upload.php" class="list-group-item list-group-item-action bg-light"><i class="fa fa-upload" aria-hidden="true"></i> Upload</a>
<a href="files.php" class="list-group-item list-group-item-action bg-light"><i class="fa fa-folder-open"></i> Files</a>
<a href="logout.php" class="list-group-item list-group-item-action bg-light"><i class="fa fa-sign-out" aria-hidden="true"></i> Logout</a>
</div>
</div>
<!-- /#sidebar-wrapper -->
<!-- Page Content -->
<div id="page-content-wrapper">
<nav class="navbar navbar-expand-lg navbar-light bg-light border-bottom">
<button class="btn btn-dark" id="menu-toggle">Toggle Menu</button>
</nav>
<div class="container">
<h1 class="mt-4"></h1>
<div class="table-responsive">
<table class="table table-striped table-bordered">
<thead class="thead-dark">
<th scope="col" width="20%">Filename</th>
<th scope="col">Size</th>
<th scope="col">Category</th>
<th scope="col">Description</th>
<th scope="col">Downloads</th>
<th scope="col">Action</th>
</thead>
<tbody>
<?php foreach ($files as $file): ?>
<tr>
<td data-label="Filename"><?php echo $file['name']; ?></td>
<td data-label="Size"><?php echo floor($file['size'] / 1000) . ' KB'; ?></td>
<td data-label="Category"><?php echo $file['category']; ?></td>
<td data-label="Description"><?php echo $file['description']; ?></td>
<td data-label="Downloads"><?php echo $file['downloads']; ?></td>
<td data-label="Action"><a href="files.php?file_id=<?php echo $file['id'] ?>" class="btn btn-dark"><i class="fa fa-download" aria-hidden="true"></i> </a> <a href="files.php?delete_id=<?php echo $file['id'] ?>" class="btn btn-danger" d><i class="fa fa-trash-o" aria-hidden="true"></i> </a></td>
</tr>
<?php endforeach;?>
</table>
</div>
</div>
</div>
<!-- /#page-content-wrapper -->
</div>
<!-- /#wrapper -->
<!-- Menu Toggle Script -->
<script>
$("#menu-toggle").click(function(e) {
e.preventDefault();
$("#wrapper").toggleClass("toggled");
});
</script>
<!-- Modal Confirm HTML -->
<div id="confirm" class="modal fade">
<div class="modal-dialog modal-confirm">
<div class="modal-content">
<div class="modal-header" style="background: #eea236;">
<div class="icon-box">
<i class="material-icons">priority_high</i>
</div>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="modal-body text-center">
<h4>Confirm?</h4>
<p>Are you sure you want to delete this?<br>This process can't be undone.</p>
<button class="btn btn-danger" data-dismiss="modal"><span>Cancel</span></button>
<a href="files.php?delete_id=<?php echo $file['id'] ?>"><button class="btn btn-dark"><span>Confirm</span></button></a>
</div>
</div>
</div>
</div>
</body>
</html>