-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlist-view.php
More file actions
64 lines (56 loc) · 2.22 KB
/
Copy pathlist-view.php
File metadata and controls
64 lines (56 loc) · 2.22 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
<?php
include 'list-view-all.php';
// Función para mostrar los datos en el ListView
function show_data_all($ext, $desde, $hasta) {
// Consigo los datos del JSON a través de una función declarada en 'list-view-all.php'
$data = get_data($ext);
$info = array();
settype($data, "array");
if (empty($data)) {
echo False;
}
else {
foreach ($data as $obj) { // Itera cada dato
$name = $obj->Nombre; // Retorna el nombre del dato
$url = $obj->URL; // Retorna la URL del dato
$id = $obj->id; // Consigue el ID del archivo
if ($id >= intval($desde) && $id <= intval($hasta)) {
$array = array($url, $name);
array_push($info, $array);
}
}
echo json_encode($info); // Manda los datos al FrontEnd(JS)
}
}
if (!empty($_POST['desde']) && isset($_POST['desde'])) {
if (!empty($_POST['hasta']) && isset($_POST['hasta'])) {
if (!empty($_POST['radio']) && isset($_POST['radio'])) {
$desde = $_POST['desde'];
$hasta = $_POST['hasta'];
$format = $_POST['radio'];
switch ($format) {
case 'jpg': show_data_all("jpg", $desde, $hasta); break;
case 'png': show_data_all("png", $desde, $hasta); break;
case 'mp3': show_data_all("mp3", $desde, $hasta); break;
case 'mp4': show_data_all("mp4", $desde, $hasta); break;
case 'gif': show_data_all("gif", $desde, $hasta); break;
case 'bmp': show_data_all("bmp", $desde, $hasta); break;
case 'pdf': show_data_all("pdf", $desde, $hasta); break;
case 'txt': show_data_all("txt", $desde, $hasta); break;
case 'css': show_data_all("css", $desde, $hasta); break;
case 'js': show_data_all("js", $desde, $hasta); break;
case 'html': show_data_all("html", $desde, $hasta); break;
case 'php': show_data_all("php", $desde, $hasta); break;
case 'ogg': show_data_all("ogg", $desde, $hasta); break;
case 'aac': show_data_all("aac", $desde, $hasta); break;
case 'm4a': show_data_all("m4a", $desde, $hasta); break;
case 'rar': show_data_all("rar", $desde, $hasta); break;
case 'zip': show_data_all("zip", $desde, $hasta); break;
case 'flv': show_data_all("flv", $desde, $hasta); break;
case 'swf': show_data_all("swf", $desde, $hasta); break;
}
}
else { echo "SelectFormat NULL. statusCode: 404"; }
}
}
?>