Files
anpdf/app/api/apicontent.php
Andrey Kuvshinov d91466c5d9 add readbook
2020-05-24 17:10:45 +03:00

46 lines
667 B
PHP

<?php
function api_pricehash($hash){
$pricesql = "
SELECT
`price_id`, `pricename`, `BeginDate`, `category_id`, `pages`, `pdf`, `html`
FROM
`price`
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
FROM
`news`
WHERE
`price_id` = '$price_id'
AND
`page` = '$page'
";
$news = db_get($newsql);
return $news;
}