<?php
    session_start();
    include '../prijava/connect.php';
    setlocale(LC_TIME,"hr_HR");
    date_default_timezone_set("Europe/Zagreb");
    
    if ($dbc) {
        $date = $_GET['date'];
        $query = "UPDATE orders SET completed = '1' WHERE date = '$date'";
        $result = mysqli_query($dbc,$query) or die('Error querying database.');
        $query = "INSERT INTO complete (date, finish) VALUES ('$date', '1')";
        $result = mysqli_query($dbc,$query) or die('Error querying database.');
    }
?>