<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

class Home extends SiteController {
  function __construct () {
    parent::__construct();
    $this->data['page'] = 'home';
    $this->data['metatags'] = $this->getMetatags($this->data['page']);
  }

  public function index () {
    $this->load->model('bannerModel');
    $this->data['banners'] = $this->bannerModel->getAll();

    $this->load->model('serviceModel');
    $this->data['services'] = $this->serviceModel->getAll();

    $this->load->model('pageContentModel');
    $this->data['whyChooseUs'] = $this->pageContentModel->getRowWhere(['slug' => 'why-choose-us']);

    $this->load->model('testimonialModel');
    $this->data['testimonials'] = $this->testimonialModel->getAll();

    $this->load->model('WhyChooseUsItemModel');
    $this->data['whyChooseUsItems'] = $this->WhyChooseUsItemModel->getAll();

    $this->load->view('index', $this->data);
  }

  public function error () {
    $this->data['page'] = 'error';

    $this->load->view('404', $this->data);
  }
}