<?php
    session_start();
	if ( empty($_SESSION['login']) ) {
        header( 'Location: login.php' );
        die;
	}

    include 'include/database.php';

    $connection = connect($database);

    $canDelete = canDeleteValues($connection, $_SESSION['login']);
    
    if ($canDelete) {
        deleteProperty($connection, $_POST['propertyID'], $_POST['newName']);
    }

    $connection = null;
?>