<?php



if (isset($_POST['submitted'])) {
    require_once('mysqli_connect.php');
    require_once('login_functions.inc.php');
 
            
                           
                       
    
    list($check, $data) = check_loginb($dbc, $_POST['USER'], $_POST['PASS']);
    if ($check) {
        session_start();
        $_SESSION['USERID'] = $data['user'];
        $_SESSION['GROUPOFUSE'] = $data['groupa'];
	
		
     if ($data['groupa']==0){
	     $url = absolute_url('../pages/admin/loggedin0.php');
        header("Location: $url");
		exit();}
		elseif ($data['groupa']==1){
	     $url = absolute_url('../pages/1oGrafeio/1oGrafeio.php');
        header("Location: $url");   
		exit();
			}
     elseif ($data['groupa']==2){
	     $url = absolute_url('../pages/2oGrafeio/2oGrafeio.php');
        header("Location: $url");   
		exit();
			}
			elseif ($data['groupa']==3){
	     $url = absolute_url('../pages/3oGrafeio/3oGrafeio.php');
        header("Location: $url");   
		exit();
			}
			elseif ($data['groupa']==4){
	     $url = absolute_url('../pages/4oGrafeio/4oGrafeio.php');
        header("Location: $url");   
		exit();
			}
			elseif ($data['groupa']==5){
	     $url = absolute_url('../pages/ypdkths/ypdkths.php');
        header("Location: $url");   
		exit();
			}elseif ($data['groupa']==6){
	     $url = absolute_url('../pages/dkths/dkths.php');
        header("Location: $url");   
		exit();
			}
			elseif ($data['groupa']==7){
	     $url = absolute_url('../pages/1osLoxos/1osLoxos.php');
        header("Location: $url");   
		exit();
			}
     elseif ($data['groupa']==8){
	     $url = absolute_url('../pages/2osLoxos/2osLoxos.php');
        header("Location: $url");   
		exit();
			}
			elseif ($data['groupa']==9){
	     $url = absolute_url('../pages/3osLoxos/3osLoxos.php');
        header("Location: $url");   
		exit();
			}
			elseif ($data['groupa']==10){
	     $url = absolute_url('../pages/LD/LD.php');
        header("Location: $url");   
		exit();}
		elseif ($data['groupa']==11){
	     $url = absolute_url('../pages/LYT/LYT.php');
        header("Location: $url");   
		exit();}
    }else {
		
        $errors = $data;
	
    }
	
    mysqli_close($dbc);
}
//include('login_page.inc.php');
include('index.php');

?>
