<?php

	class Pages extends CI_Controller{



		 public function __construct() { 

		      parent::__construct(); 

		      $this->load->library("flash");

		   }



		public function index(){

			$page = 'dashboard';

			if(!file_exists(APPPATH.'views/pages/'.$page.'.php')){

				show_404();

			}



			$data['title'] = 'Dashboard';

			$this->load->view('flash');

			$this->load->view('templates/header', $data);

			$this->load->view('pages/'.$page, $data);

			$this->load->view('templates/footer');

			

		}



		public function create_event(){

			$page = 'create_event';

			if(!file_exists(APPPATH.'views/pages/'.$page.'.php')){

				show_404();

			}



			$data['title'] = ucfirst($page);



			$this->load->view('templates/header', $data);

			$this->load->view('pages/'.$page, $data);

			$this->load->view('templates/footer');

		}



		public function how($page = 'how'){

			if(!file_exists(APPPATH.'views/pages/'.$page.'.php')){

				show_404();

			}



			$data['title'] = 'HOW IT WORKS';



			$this->load->view('templates/header', $data);

			$this->load->view('pages/'.$page, $data);

			$this->load->view('templates/footer');

		}



		public function blog($page = 'blog'){

			if(!file_exists(APPPATH.'views/pages/'.$page.'.php')){

				show_404();

			}



			$data['title'] = ucfirst($page);



			$this->load->view('templates/header', $data);

			$this->load->view('pages/'.$page, $data);

			$this->load->view('templates/footer');

		}

	}