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

class DashboardController extends CI_Controller {
	
	public function index()
	{

		$this->db->from('applications');
		$this->db->where('payment_status', 0);
		$drafted = $this->db->count_all_results();

		$this->db->from('applications');
		$this->db->where('payment_status', 1);
		$pending = $this->db->count_all_results();

		$this->db->from('applications');
		$this->db->where('payment_status', 2);
		$completed = $this->db->count_all_results();
		
		 $view_data['drafted'] = $drafted;
		 $view_data['pending'] = $pending;
		 $view_data['completed'] = $completed;
		 
        $data = array(
			'title' => "Home",
			'content' => $this->load->view('dashboard/home', $view_data, true),
		);
		$this->load->view('base/base_template', $data);		
		
	}


}
