<?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('TermsModel');
		$this->load->model('NotificationModel');

		$this->load->model('SiteDataModel');
		// $this->SiteDataModel->insert_row();
	}

	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://d38x82mkkml5o1.cloudfront.net/'.$site_row['logo'];
		$data['is_single_gallery'] = $site_row['is_single_gallery'];
		

		$data['header_title'] = 'FAQs';

		$this->load->view('template/header', $data);
		$this->load->view('template/sidebar', $data);
		$this->load->view('faqs', $data);
		$this->load->view('template/footer', $data);
	}

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




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

        $data['terms_list'] = $this->TermsModel->get_rows(" and site_id = '".$site_row['id']."'");

		$data['title'] = 'Terms Conditions | MAKEABL';
		$data['header_title'] = 'T&C’s';
		
		$data['site_logo'] = 'http://d38x82mkkml5o1.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('termsConditions', $data);
		$this->load->view('template/footer', $data);
	}


	
}
