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

class FaqController extends CI_Controller {

	public function __construct()
	{
		parent::__construct();
		$this->load->model('FaqModel');
		$this->load->model('GuestModel');
		$this->load->model('AuthModel');
		$this->load->model('SiteModel');
		$this->load->model('NotificationModel');
	}

	public function index()
	{
		$userdata = $this->session->userdata('makeabl2020');
		if (empty($userdata) || !isset($userdata["id"]))
			redirect('login', 'refresh');

        $site_row = $this->SiteModel->get_row($userdata['site_id']);

		$data['title'] = 'FAQ | MAKEABL';
		$data['userdata'] = $userdata;
		$data['guest_detail'] = $this->GuestModel->get_row($userdata['id']);
		$data['faq_list'] = $this->FaqModel->get_rows(" and site_id = '".$userdata['site_id']."'");
		$data['notification_list'] = $this->NotificationModel->get_rows(" where id > 0 and isDeleted = 0 and guest_id = '".$userdata["id"]."' order by id desc");
		$data['new_notification_count'] = $this->NotificationModel->get_count(" where id > 0 and isDeleted = 0 and guest_id = '".$userdata["id"]."' and isShow = 0");
		$data['site_logo'] = 'http://d1z6a3vjnfowyr.cloudfront.net/'.$site_row['logo'];
		$data['is_single_gallery'] = $site_row['is_single_gallery'];
		
		$this->load->view('template/header', $data);
		$this->load->view('template/sidebar', $data);
		$this->load->view('faqs', $data);
		$this->load->view('template/footer', $data);
	}
}
