session = session(); $this->MemberModel = new Member_model(); $this->UserModel = new User_model(); $this->dModel = new Dashboard_model(); $this->cModel = new Common_model(); helper(['form']); } public function index() { } function fetch_country() { echo $this->cModel->fetch_country(); } function fetch_state() { if($this->request->getVar('country_id')) { echo $this->cModel->fetch_state($this->request->getVar('country_id')); } } function fetch_city() { if($this->request->getVar('state_id')) { echo $this->cModel->fetch_city($this->request->getVar('state_id')); } } function check_if_mail_exists() { if($this->request->getVar('table')) { if($this->request->getVar('table') == 'member') { $data = $this->MemberModel->where('email', $this->request->getVar('email'))->find(); }else if($this->request->getVar('table') == 'users'){ $data = $this->UserModel->where('email', $this->request->getVar('email'))->find(); } if ($data) { echo true; } else { echo false; } } } // ----------------------------------------------- }