<?php namespace App\Controllers\Admin;
class Dashboard extends AdminController
{
	public function __construct(){		
        $this->mObj = model('App\Models\Admin\DashboardModel');
		$this->menu_id = 1;
    }
	
	public function index()
	{
		$data['active']='main';
		// Set Meta content 
		$data['meta_data']['title'] = $data['meta_data']['title'] ?? $this->project->default_meta_title;
		$data['meta_data']['description'] = $data['meta_data']['description'] ?? $this->project->default_meta_description;
		$data['meta_data']['keywords'] = $data['meta_data']['keywords'] ?? $this->project->default_meta_keywords;
		// Get Total Count
		$data['total_tabs'] = '';//$this->get_total_tabs();
		// Get Pending followup list for calender
		//$data['fc_event_list'] = $this->get_calender_event_list();
		//$data['plugins'] = ['fullcalendar'];
		$data['footer_includes'] = ['dashboard_js'];	
		echo $this->view_inner_template('dashboard',$data);
	}
	
	private function get_calender_event_list(){
		$event_list = [];
		// get pending followup
		$user_id = "";
		if($this->session->get('user_type')=="User"){
			$user_id = $this->session->get($this->project->session_admin_user_id);
		}
		//$followup_list = $this->mObj->get_followup_list($user_id);
		//return $followup_list;
	}
	
	private function get_total_tabs(){
		$data['total_member'] = $this->mObj->get_total_member();
		$data['total_plot'] = $this->mObj->get_total_plot();
		$data['total_certified_export_registration'] = $this->mObj->get_total_export_registration(2);
		$data['total_organic_export_registration'] = $this->mObj->get_total_export_registration(1);
		return $data;
	}
}