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

class Voted_List_Model extends CI_Model
{
    function voted()
    {
       $this->db->order_by("ballot_name", "asc");
       $query = $this->db->select('*')->from('ballot_status')->get();  
       
       if($query->num_rows()>0)
       {   
          return $query->result();
       }

       else
       {
           return false;
       }
    }

    function conditional_show($name)
    {
        $name=trim($name);
        $name=urldecode($name);

       $this->db->where('ballot_name',$name);
       $query = $this->db->get('ballot_status');
       $res= $query->result();

       if($query->num_rows()>0)
       {
            return $res;
       }

       else
       {
           return false;
       }
    }

}

?>
