diff --git a/ground/controllers/PageController.php b/ground/controllers/PageController.php new file mode 100644 index 0000000..45d980e --- /dev/null +++ b/ground/controllers/PageController.php @@ -0,0 +1,47 @@ +getAll($where, 'id DESC'); + + $categories = new Category(); + $categories = $categories->getAll('', 'ord'); + + $users = new User(); + $users = $users->getAll(); + + $result = array(); + + foreach ($points as $point) + { + $result[$point['id']]['id'] = $point['id']; + $result[$point['id']]['name'] = $point['name']; + $result[$point['id']]['img'] = $point['img']; + $result[$point['id']]['categoryIcon'] = $categories[$point['categoryId']]['icon']; + $result[$point['id']]['author'] = $users[$point['author']]['nick']; + } + + $res = App::$DB->query("SELECT COUNT(`id`) pointsCount FROM `points`")->fetch(PDO::FETCH_ASSOC); + App::setConfig('title', $res['pointsCount'] . ' или даже больше поводов не сидеть дома'); + + self::render('pointsTemplate.php', array( + 'categories' => $categories, + 'user' => App::$user, + 'points' => $result, + )); + } +} diff --git a/ground/views/layout.php b/ground/views/layout.php index 29a051d..a356702 100644 --- a/ground/views/layout.php +++ b/ground/views/layout.php @@ -33,6 +33,8 @@ Как пользоваться | Легенда + | + Список точек diff --git a/ground/views/layoutPage.php b/ground/views/layoutPage.php new file mode 100644 index 0000000..e06d5ae --- /dev/null +++ b/ground/views/layoutPage.php @@ -0,0 +1,106 @@ + + + + <?= App::getConfig('title') ?> + + + + + + + + + + + + + + + + + + + +
+

WikiPoints

+ + На карту + | + О проекте + | + Как пользоваться + | + Легенда + +
+ + + + + + + + + \ No newline at end of file diff --git a/ground/views/modals/categories.php b/ground/views/modals/categories.php index 803932b..a00871f 100644 --- a/ground/views/modals/categories.php +++ b/ground/views/modals/categories.php @@ -7,7 +7,7 @@