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

class About extends CI_Controller {

	/**
	 * Index Page for this controller.
	 *
	 * Maps to the following URL
	 * 		http://example.com/index.php/welcome
	 *	- or -
	 * 		http://example.com/index.php/welcome/index
	 *	- or -
	 * Since this controller is set as the default controller in
	 * config/routes.php, it's displayed at http://example.com/
	 *
	 * So any other public methods not prefixed with an underscore will
	 * map to /index.php/welcome/<method_name>
	 * @see https://codeigniter.com/user_guide/general/urls.html
	 */
         var $menu;
         var $banner;
        public function __construct()
        {
            parent::__construct();
            $this->load->model('Section', 'section_model');
            $this->menu = $this->section_model->buildTopMenuItem();
            //added album model
            $this->load->model('BannerAlbum', 'banner_model');
            $this->banner = $this->banner_model->getBannerAll();
            //end added album model
            //get aboutus detail from general setting
            $this->load->model('GeneralDetails', 'generaldetails_model');
            $this->aboutus = $this->generaldetails_model->getAboutus();    
            //end get aboutus detail from general setting
            $this->breadcrumbs = [];

            $this->load->model('WhatsnewContent', 'whatsnew_model');
            $this->load->model('CourseContent', 'course_model');
            $this->load->model('RecommendContent', 'recommend_model');
            $this->load->model('GalleryContent', 'gallery_model');
            $this->load->model('PartnerContent', 'partner_model');
            $this->load->model('ContactDetails', 'contactdetails_model');
        }

        public function index()
	{
        //$this->load->view('welcome_message');
        $topTenWhatsnew=$this->whatsnew_model->getTopTenWhatsnew();
        $topCourse=$this->course_model->getTopCourseWithPic();
        $topRecommend=$this->recommend_model->getRecommendtoptencontentsAll();
        $topGallery=$this->gallery_model->getTopTenGallery();
        $topPartner=$this->partner_model->getTopTenPartner();

        
        $contactusdata = $this->contactdetails_model->getContactus();
            $this->twig->display('main', array(
                'path' => array(
                    'vendor' => $this->config->item('vendor_path'),
                    'script' => $this->config->item('script_path'),
                    'css' => $this->config->item('css_path'),
                    'image' => $this->config->item('image_path')
                ),
                'breadcrumbs' => $this->breadcrumbs,
                'menus' => $this->menu,
                'banner' => $this->banner,
                'aboutus' => $this->aboutus,
                'topTenWhatsnew' =>$topTenWhatsnew,
                'topCourse' =>$topCourse,
                'topRecommend' =>$topRecommend,
                'topGallery' => $topGallery,
                'topPartner' => $topPartner,
                'session' => 'about',
                'contactusdata' => $contactusdata,
                'page' => 'index'
            ));
        }
}
