<?php
//DB Data
include '../../ASEngine/AS.php'; 
if(!$login->isLoggedIn())
    header("Location: ../../login.php");
$user = new ASUser(ASSession::get("user_id"));
$userInfo = $user->getInfo();

//basic include files
require_once("../../../db.php");

//variables
$inventory_id = $_GET['inventoryid'];
$element_id = $_GET['elementid'];
$top_destination = $_GET['topdestination'];
$toptypedestination = $_GET['toptypedestination'];
$control_message = $_GET['controlmes'];
$pageorigin = $_GET['pageorigin'];

mysqli_query($conn, "UPDATE approved_inventory SET top_destination = '$top_destination', topdestination_type = '$toptypedestination' WHERE inventory_id = '$element_id' ");

mysqli_close($conn);

header("Location: ../../$pageorigin?inventoryid=$inventory_id&message=$control_message");
?>