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

    include 'include/database.php';

    $connection = connect($database);

    $canReset = canResetAlerts($connection, $_SESSION['login']);

    if ($canReset) {
        resetAlert($connection, $_POST['id']);
    }

    $connection = null;
?>