diff --git a/app/api/book.php b/app/api/book.php index 57a865f..e3a0076 100644 --- a/app/api/book.php +++ b/app/api/book.php @@ -3,10 +3,9 @@ * */ - function bookid_kuri($hash) { - $query = "SELECT `price_id`, `pricename`, `BeginDate`, `priceanons`, `priceimg`, `pricehash` FROM `price` WHERE `pricehash` = '$hash' LIMIT 1"; + $query = "SELECT `price_id`, `pricename`, `BeginDate`, `priceanons`, `priceimg`, `pricehash`, `price` FROM `price` WHERE `pricehash` = '$hash' LIMIT 1"; $book = dbl_get($query); @@ -21,6 +20,47 @@ function bookid_kuri($hash) { } +} + + + + + + +/** + * вернуть товары магазина (все или по фильтру) + */ +function api_books_kuri($category = 'all', $page = 1){ + + $limit = 25; + + if ($page > 1){ + $offset = $limit * ($page - 1); + $offset_str = ", $offset"; + } + else { + $offset_str = ''; + } + + if ($category == 'all'){ + $where = ''; + } + else { + + $category_sql = "SELECT `category_id` FROM `pricecategory` WHERE `categoryslug` = '$category' LIMIT 1"; + + $category = db_get($category_sql); + + if (isset($category['category_id'])) { + $category_id = $category['category_id']; + $where = "WHERE `category_id` = $category_id"; + } + + } + + $sql_books = "SELECT * FROM `price` $where ORDER BY `price_id` DESC LIMIT $limit $offset_str"; + + return db_get($sql_books); } \ No newline at end of file diff --git a/app/helpers/picbook.php b/app/helpers/picbook.php new file mode 100644 index 0000000..4a3f230 --- /dev/null +++ b/app/helpers/picbook.php @@ -0,0 +1,10 @@ + - - - -

Вам доступен весь архив

- -

Всего покупок:

- - - -
-

- - -

-
- -
- Мои покупки -
-
- Консультации -
- - - - -
+
diff --git a/app/views/blocks/auth.phtml b/app/views/blocks/auth.phtml index 9b6daee..3312539 100644 --- a/app/views/blocks/auth.phtml +++ b/app/views/blocks/auth.phtml @@ -5,6 +5,7 @@ Войти + Моя библиотека  Выйти
\ No newline at end of file diff --git a/app/views/book.phtml b/app/views/book.phtml index 7bf55f7..5531b84 100644 --- a/app/views/book.phtml +++ b/app/views/book.phtml @@ -2,10 +2,15 @@ -
\ No newline at end of file diff --git a/app/views/books.phtml b/app/views/books.phtml new file mode 100644 index 0000000..6cec2bc --- /dev/null +++ b/app/views/books.phtml @@ -0,0 +1,17 @@ + +
+ + + + +
+ + \ No newline at end of file diff --git a/app/views/layout.phtml b/app/views/layout.phtml index a69e8cd..43c11d2 100644 --- a/app/views/layout.phtml +++ b/app/views/layout.phtml @@ -115,6 +115,12 @@ _tmr.push({id: "1069168", type: "pageView", start: (new Date()).getTime()});
+ +
+ + +
+ diff --git a/app/views/login.phtml b/app/views/login.phtml index 7ea2d6d..858392f 100644 --- a/app/views/login.phtml +++ b/app/views/login.phtml @@ -11,6 +11,7 @@

Забыли пароль?

Создать пароль

+

Оформить годовой членский взнос

@@ -18,7 +19,7 @@
-

Чтобы войти в КЛАН оформите пожалуйста Годовой членский взнос пройдя по этой ссылке. Вас ждут:

+

Участникам КЛАНА доступны: