<?php

session_start();

if (!isset($_SESSION['uid'])) {
    echo "<script>window.location='../index.php';</script>";
} else {
    include_once '../config/properties.php';
    include_once '../config/database.php';
    require("../resources/offering.php");
    $offering = new Offering();
    switch ($_POST['mode']) {
        case "change": {
                $user_id = $_SESSION['uid'];
                $language_id = $_POST['language'];
                $offering->language_update($user_id, $language_id);
                break;
            }
        default:
            break;
    }
}
?>

