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

class Voted_List_Controller extends CI_Controller {

	public function vote_list()
	{
        $this->load->model('Fetch_Ballot_Model');

        if($this->Fetch_Ballot_Model->Fetch_Data())
            {   
                $all_data['bdata']=$this->Fetch_Ballot_Model->Fetch_Data();
            }
        else
            {
                $all_data['bdata']=null;
            }    

        $this->load->model('Voted_List_Model');

       if($this->Voted_List_Model->voted())
            {   
                $all_data['data']=$this->Voted_List_Model->voted();
                //echo " "."admin ".$data[0]->name." ".$data[0]->email." ".$data[0]->type;
               // echo " "."admin ".$data[1]->name." ".$data[1]->email." ".$data[1]->type;
    
                $this->load->view('Voted_List_View',$all_data);
            }    

        else
        {
            $all_data['data']=null;
            $this->load->view('Voted_List_View',$all_data);
        }
		
    }
    
}

