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

class Show_Data_Model extends CI_Model
{
    
    /**
     * This function used to check the login credentials of the user
     * @param string $email : This is email of the user
     * @param string $password : This is encrypted password of the user
     */
    function User_data($cid)
    {
       $this->db->where('cid',$cid);
       $query = $this->db->get('users');
       $res= $query->result();

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

       else
       {
           return false;
       }
    }

    function Admins_data($cid)
    {
       $this->db->where('username',$cid);
       $query = $this->db->get('administrator');
       $res= $query->result();
      
       if($query->num_rows()>0)
       {
            return true;
       }

       else
       {
           return false;
       }
    }

    function LoginData($email)
    {
       $this->db->where('cid',$email);
       $query = $this->db->get('users');
       $res= $query->result();
       

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

       else
       {
           return false;
       }
    }

    function Candidate_data($cid)
    {
       $this->db->where('pid',$cid);
       $query = $this->db->get('participants');
       $res= $query->result();

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

       else
       {
           return false;
       }
    }

}

?>
