<?php
require_once APP_DIR . 'libs/View.php';
require_once APP_DIR . 'libs/Input.php';
require_once APP_DIR . 'libs/Database.php';
class ReviewsController
{
    private $_view;
    private $_db;

    public function __construct()
    {
        $this->_view  = new View();
        $this->_db = new Database();
    }

    public function index()
    {
        $sql = "SELECT * FROM " . PROPERTY_REVIEWS . " WHERE 1  AND status = 1 ";
        $this->_db->query($sql);
        $reviews = $this->_db->getAll();

        $sql = "SELECT * FROM " . PROPERTY_LIST . " WHERE 1  AND id = 1";
        $this->_db->query($sql);
        $property_data = $this->_db->single();

        $this->_view->setVal('reviews', $reviews);

        $this->_view->setVal('property_data', $property_data);
        $this->_view->setVal('favicon', '');
        $this->_view->setVal('site_logo', '');
        $this->_view->setVal('media_id', '');
        $this->_view->setVal('meta_title', '');
        $this->_view->setVal('meta_description', '');
        $this->_view->setVal('meta_keyword', '');
        $this->_view->renderFront(VIEW_DIR . 'review');
    }
}
