You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
946 B
25 lines
946 B
<?php
|
|
require_once('../ajax_asm.php');
|
|
if( $CUser->Data['id'] > 1 ){
|
|
$AID = intval($_POST['DID']);
|
|
$Data['files']=array();
|
|
$QS = "SELECT * FROM `lrf_uploads` WHERE `sensor_id`={$AID} ORDER BY `ts` DESC";
|
|
$result = $DATABASE->Query( $QS, false );
|
|
if( count($result) ){
|
|
|
|
foreach( $result as $R ){
|
|
$CN = array();
|
|
$CN['id'] = intval( $R['id'] );
|
|
$CN['file_name'] = $R['file'];
|
|
$CN['size'] = intval( filesize( 'data/uploads/'.$R['md5'] ) );
|
|
$CN['status'] = intval($R['status']) + (($R['issue_reset'])?512:0);
|
|
$CN['ts'] = date( "Y-m-d H:i:s", $R['ts'] );
|
|
$CN['memo'] = ($R['memo']?$R['memo']:'');
|
|
$Data['files'][] = array( intval( $R['id'] ), $R['file'], $CN['size'], (intval($R['status']) + (($R['issue_reset'])?512:0)), date( "Y-m-d H:i:s", $R['ts'] ), ($R['memo']?$R['memo']:'') );
|
|
};
|
|
};
|
|
echo json_encode( $Data );
|
|
exit();
|
|
};
|
|
header('location: /');
|
|
?>
|