33 lines
901 B
PHP
33 lines
901 B
PHP
<?php
|
|
|
|
require_once($_SERVER['DOCUMENT_ROOT'] . "/config.php");
|
|
|
|
if (isset($_GET['event_id'])) {
|
|
|
|
$get = clearInputData($_GET);
|
|
|
|
$docs_q = '';
|
|
$files = [];
|
|
|
|
if ($get['from'] == 'clients')
|
|
$docs_q = mysql_query("SELECT * FROM clients_files WHERE event_id = '".$get['event_id']."'");
|
|
|
|
if (!empty($docs_q)) {
|
|
while ($file = mysql_fetch_assoc($docs_q)) {
|
|
|
|
$path = 'https://uf.joywork.ru/upload/clients/'.$file['client_id'].'/'.$file['guid'].'.'.$file['type'];
|
|
if ($file['req_id'] > 0)
|
|
$path = 'https://uf.joywork.ru/upload/reqs/'.$file['req_id'].'/'.$file['guid'].'.'.$file['type'];
|
|
|
|
$files[] = [
|
|
'guid' => $file['guid'],
|
|
'name' => $file['name'],
|
|
'type' => $file['type'],
|
|
'path' => $path,
|
|
];
|
|
}
|
|
}
|
|
|
|
echo json_encode($files);
|
|
}
|