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

    include 'include/database.php';

    $connection = connect($database);

    $canEdit = canEditValues($connection, $_SESSION['login']);

    if ($canEdit) {
        updatePropertyColumn($connection, $_POST['id'], $_POST['column'], $_POST['value']);
    }

    $connection = null;
?>