-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjson_files.php
37 lines (28 loc) · 919 Bytes
/
json_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
<?php
//$flagNoAuth = true;
$itemGUID = $_GET['guid'];
$order = ($_GET['order']=="asc"?"ASC":"DESC");
require ('common/auth.php');
$sql = "SELECT filName as alias
, filType as type
, filGUID as file
, filInsertDate as date
, filSize as size
, USR.usrName$strLocal as author, usrFlagDeleted
FROM stbl_file FIL
JOIN stbl_user USR ON usrID=filInsertBy
WHERE filEntityID=".$oSQL->e($itemGUID)." AND filSize>0 ORDER BY filID $order;";
$rs = $oSQL->do_query($sql);
ob_start();
$res = Array();
while ($rw = $oSQL->fetch_array($rs)){
$rw['size'] = convert_size_human($rw['size']);
$rw['class']=str_replace('.','_',basename($rw['filType']));
$res[] = $rw;
}
echo json_encode($res);
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
header('Content-type:application/json; charset=UTF-8');
ob_flush();
?>