document.addEventListener('DOMContentLoaded', () => {
const head = document.getElementById('header');
let sessionUserId = null;
let userLevel = null;
const getSessionUserId = async () => {
        try {
            const response = await fetch('../php/get_session_user.php');
            const data = await response.json();
            sessionUserId = data.user_id;
            userLevel = data.user_level;
        } catch (error) {
            console.error('Error fetching session user ID:', error);
        }
    };
	getSessionUserId().then(() => {
        updateHeader(userLevel);
    });
	function updateHeader(lvl) {
		if(lvl == 2){
		head.innerHTML = 'Skolotājs';
		}else if(lvl == 3){
			head.innerHTML = 'Administrātors';
		}
	}
});