Files
anpdf/app/api/apicontent.php
Zhuk Viatcheslav 6d2c5187d9 s
2020-11-20 12:27:26 +03:00

48 lines
778 B
PHP

<?php
function api_pricehash($hash){
$pricesql = "
SELECT
`price_id`, `pricename`, `BeginDate`, `category_id`, `pages`, `pdf`, `html`, `author`
FROM
`price`
LEFT JOIN
price_authors ON price.priceauthor_id = price_authors.author_id
WHERE
`pricehash` = '$hash'
LIMIT 1
";
$price = db_get($pricesql);
if (!isset($price['price_id']))
return ['error' => 'not found hash'];
else
return $price;
}
function apipage_kuri($price_id, $page = 1){
$newsql = "
SELECT
news_id, title, text, img, author_id
FROM
`news`
WHERE
`price_id` = '$price_id'
AND
`page` = '$page'
";
$news = db_get($newsql);
return $news;
}