<?php

defined('BASEPATH') OR exit('No direct script access allowed');
/*
MERMS Providers log out
*/
class Logout extends Web_Controller {

    public function index() {
        $data = array();
        $this->logUserOut();
    }

    private function logUserOut() {
        $data = array();
        $this->destroySession();
        $this->renderExternalPage('welcome_message', $data);
    }

    private function destroySession() {     
        $_SESSION['session_id'] =$_SESSION['username'] =$_SESSION['practice_name'] =$_SESSION['sessionpractice_code_id'] =$_SESSION['user_id'] =""; // "";
        $_SESSION['user_firstname'] =$_SESSION['user_lastname'] =$_SESSION['user_email'] =$_SESSION['practice_id'] =$_SESSION['user_provider'] =""; // "";
        $_SESSION['user_admin'] = "";
        unset($_SESSION);
        return;
    }

}
