forked from Nachomontoya/filesystem-explorer
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathHey.php
More file actions
181 lines (166 loc) · 7.6 KB
/
Hey.php
File metadata and controls
181 lines (166 loc) · 7.6 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
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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<?php
require_once('./assets/php/get_files.php');
require_once('./assets/php/upload_file_form.php');
require_once('./assets/php/delete_file_form.php');
?>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-gH2yIJqKdNHPEq0n4Mqa/HGKIhSkIHeL5AyhkYV8i59U5AR6csBvApHHNl/vI1Bx" crossorigin="anonymous">
<script src="https://kit.fontawesome.com/54141fca8b.js" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.1/dist/js/bootstrap.bundle.min.js"
integrity="sha384-u1OknCvxWvY5kfmNBILK2hRnQC3Pr17a+RTT6rIHI7NnikvbZlHgTPOOmMi466C8"
crossorigin="anonymous"></script>
<link href="./assets/css/index.css" rel="stylesheet">
<title>File System</title>
</head>
<body>
<header>
<div class="logo"><a href="./index.php">
<img src="./assets/img/logo.svg" alt="Logotipo" height="45px">
</a></div>
<nav>
<form class="d-flex" role="search" action="./assets/php/search_file.php" method="get">
<input class="form-control me-2 search-bar" name="key" type="search" placeholder="Search" aria-label="Search">
<input class="btn btn-outline-success" type="submit" value="Search">
</form>
<div class="btns-file-action">
<div class="upload-file" data-bs-toggle="modal" data-bs-target="#uploadModal">
<span>Upload</span>
<i class="fa-solid fa-arrow-up-from-bracket"></i>
</div>
<div class="new-folder" data-bs-toggle="modal" data-bs-target="#newFolderModal">
<span>New Folder</span>
<i class="fa-solid fa-folder-plus"></i>
</div>
<div class="move-file" data-bs-toggle="modal" data-bs-target="#moveModal">
<span>Move File</span>
<i class="fa-solid fa-file-export"></i>
</div>
<div class="delete-file" data-bs-toggle="modal" data-bs-target="#deleteModal">
<span>Delete</span>
<i class="fa-solid fa-trash"></i>
</div>
</div>
</nav>
</header>
<aside>
<section>
<h3 class="title-folders">Your folders</h3>
<ul id="folderManager">
<a href="./index.php"><li id="rootFolder">My Files <i class="fa-solid fa-caret-right"></i></li></a>
<?php getFolders("./root"); ?>
</ul>
</section>
</aside>
<main>
<h3 class="title-files">Hey <a href="/assembler_projects/php_module/filesystem-explorer/ale.php?name="><i class="fa-solid fa-rotate-left"></i></a></h3>
<?php getFiles("./root/Imágenes/ale/Hey"); ?>
</main>
<!-- MODAL FILE -->
<div class="modal fade" id="uploadModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Upload File</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body" id="uploadFileForm">
<form class ="upload-form" enctype="multipart/form-data" method="post" action="./assets/php/upload_file.php">
<label for="userfile">Select file:</label>
<input id ="userfile" name="userfile" type="file" required>
<label for="filename">Name file:</label>
<input id ="filename" name="filename" maxlength="15" pattern="^([a-zA-Z0-9\s\._-]+)$" type="text" required>
<label for="directory">Select target folder:</label>
<select name="directory" id="selectDirectory">
<option value="./root/" selected>Folder: My Files</option>
<?php uploadOptions('./root') ?>
</select>
<div class="modal-footer">
<input type="submit" class="btn btn-primary" value="Upload" name="submit">
</div>
</form>
</div>
</div>
</div>
</div>
<!-- MODAL FOLDER SECTION -->
<div class="modal fade" id="newFolderModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Create New Folder</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body" id="uploadFileForm">
<form class ="upload-form" enctype="multipart/form-data" method="post" action="./assets/php/new_folder.php">
<label for="foldername">Name folder:</label>
<input id ="foldername" name="foldername" type="text" maxlength="15" required>
<label for="directoryFolder">Select target folder:</label>
<select name="directoryFolder" id="selectDirectoryFolder">
<option value="./root/" selected>Folder: My Files</option>
<?php uploadOptions('./root') ?>
</select>
<div class="modal-footer">
<input type="submit" class="btn btn-primary" value="Create" name="submit">
</div>
</form>
</div>
</div>
</div>
</div>
<!-- MODAL MOVE -->
<div class="modal fade" id="moveModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Move File</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body" id="uploadFileForm">
<form class ="upload-form" enctype="multipart/form-data" method="post" action="./assets/php/move_file.php">
<label for="file">Select the file you want to move:</label>
<select name="file" id="selectDirectory">
<?php deleteOptions('./root') ?>
</select>
<label class="location-move" for="destination">Select the location where you want to move it:</label>
<select name="destination" id="selectDirectory">
<option value="./root/" selected>Folder: My Files</option>
<?php uploadOptions('./root') ?>
</select>
<div class="modal-footer">
<input type="submit" class="btn btn-primary" value="Move" name="submit">
</div>
</form>
</div>
</div>
</div>
</div>
<!-- MODAL DELETE -->
<div class="modal fade" id="deleteModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Delete File</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body" id="uploadFileForm">
<form class ="upload-form" enctype="multipart/form-data" method="post" action="./assets/php/delete_file.php">
<label for="file">Select the file you want to delete:</label>
<select name="file" id="selectDirectory">
<?php deleteOptions('./root') ?>
</select>
<div class="modal-footer">
<input type="submit" class="btn btn-primary" value="Delete" name="submit">
</div>
</form>
</div>
</div>
</div>
</div>
</body>
</html>