2020-05-22 10:40:50 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function api_pricehash($hash){
|
|
|
|
|
|
|
|
|
|
$pricesql = "
|
|
|
|
|
SELECT
|
2020-05-24 21:40:42 +03:00
|
|
|
`price_id`, `pricename`, `BeginDate`, `category_id`, `pages`, `pdf`, `html`, `author`
|
2020-05-22 10:40:50 +03:00
|
|
|
FROM
|
2020-05-24 21:40:42 +03:00
|
|
|
`price`
|
|
|
|
|
LEFT JOIN
|
|
|
|
|
price_authors ON price.priceauthor_id = price_authors.author_id
|
2020-05-22 10:40:50 +03:00
|
|
|
WHERE
|
|
|
|
|
`pricehash` = '$hash'
|
|
|
|
|
LIMIT 1
|
|
|
|
|
";
|
|
|
|
|
|
|
|
|
|
$price = db_get($pricesql);
|
|
|
|
|
|
|
|
|
|
if (!isset($price['price_id']))
|
2020-05-22 13:21:37 +03:00
|
|
|
return ['error' => 'not found hash'];
|
2020-05-22 10:40:50 +03:00
|
|
|
else
|
|
|
|
|
return $price;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2020-05-22 13:21:37 +03:00
|
|
|
function apipage_kuri($price_id, $page = 1){
|
2020-05-22 10:40:50 +03:00
|
|
|
|
|
|
|
|
|
2020-05-22 13:21:37 +03:00
|
|
|
$newsql = "
|
|
|
|
|
SELECT
|
2020-05-22 15:32:05 +03:00
|
|
|
news_id, title, text, img
|
2020-05-22 13:21:37 +03:00
|
|
|
FROM
|
|
|
|
|
`news`
|
|
|
|
|
WHERE
|
|
|
|
|
`price_id` = '$price_id'
|
|
|
|
|
AND
|
|
|
|
|
`page` = '$page'
|
2020-05-22 10:40:50 +03:00
|
|
|
|
2020-05-22 13:21:37 +03:00
|
|
|
";
|
2020-05-22 10:40:50 +03:00
|
|
|
|
2020-05-22 13:21:37 +03:00
|
|
|
$news = db_get($newsql);
|
|
|
|
|
|
|
|
|
|
return $news;
|
2020-05-22 10:40:50 +03:00
|
|
|
|
|
|
|
|
}
|