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

class Show_All_Data_Model extends CI_Model
{

    function Fetch_Data()
    {
        $query = $this->db->select('*')->from('users')->get();
    
       if($query->num_rows()>0)
       {
             return $query->result();
       }

       else
       {
           return false;
       }
    }

    function Fetch_Client_Data_Zone($zone)
    {
        if($zone!='All')
        {
            $this->db->group_start()
            ->where('zone',$zone)
            ->or_where('zone','All')
            ->group_end();
            
            $query = $this->db->get('users');
        }
       
       else
       {
            $query = $this->db->get('users');
       } 
      
       
       if($query->num_rows()>0)
       {
             return $query->result();
       }

       else
       {
           return false;
       }
    }

    function Fetch_Ballots($zone)
    {
        $query = $this->db->select('*')->from('users')->get();
    
       if($query->num_rows()>0)
       {
             return $query->result();
       }

       else
       {
           return false;
       }
    }


}

?>
