<?php

include_once "includes/config.php";
include_once "includes/database.php";
include_once 'includes/check_session.php';

if($user['cl_type'] =='customer_admin')
{
	header('Location: admin/index.php');
	exit;
	exit;
}
else if($user['cl_type'] =='manager')
{
	header('Location: orders/list.php');
	exit;
	exit;
}
else if($user['cl_type'] =='chef')
{
	header('Location: orders/chef.php');
	exit;
	exit;
}
else if($user['cl_type'] =='bar')
{
	header('Location: orders/bar.php');
	exit;
	exit;
}
else if($user['cl_type'] =='runner_head')
{
	header('Location: orders/runner_head.php');
	exit;
	exit;
}
else
{
	header('Location: ' . DOMAIN . '/auth/login.php');
	exit;
}


/*
 * 
 * 

session_start();

 if(!isset($_SESSION['id']) || $_SESSION['id']=='')
    {
            header('Location: /login.php');
            exit;
    }
    else
    {
        if($_SESSION['user_type'] == 'admin')
        {
            	header('Location: submissions.php');
        }
        elseif($_SESSION['user_type'] == 'chef')
        {
    	header('Location: new_orders.php');
        }
        elseif($_SESSION['user_type'] == 'staff')
        {
    	header('Location: menu_list.php');
        }
    }
   
 */