File size: 793B
<?php
require_once($_SERVER['DOCUMENT_ROOT'].'/system/App.php');
if ($sys->isAjax())
{
$offset = !empty($_POST['offset']) ? (int) $_POST['offset'] : 0;
$count = !empty($_POST['count']) ? (int) $_POST['count'] : 10;
$query = Base::query(
'SELECT * FROM `audios` ORDER BY `id` ASC LIMIT 0,:limit', [
'limit/int' => 10,
],
'arr'
);
if (is_array($query))
{
foreach ($query as $key => $value)
{
$query[$key]['poster'] = $me['avatar'];
}
$json = [
'success' => 1,
'response' => $query,
];
}
else
{
$json = [
'error' => 1,
'comment' => 'Ваш плейлист пуст',
];
}
}
else
{
$json = [
'error' => 1,
'comment' => '404 Bad Request'
];
}
echo json_encode($json, JSON_UNESCAPED_UNICODE);