$originalDate = $_POST['date'];
                $myDateTime = DateTime::createFromFormat('d/m/Y', $originalDate);
                $date = $myDateTime->format('Y-m-d');
                if ($_POST['title'] == "") {
                    header("location: admin_corsi.php?msg=emptytitle");
                    die;
                }
                $title = htmlentities($_POST['title']);
                $desc = $_POST['description'];
                if ($_POST['price'] == "") {
                    header("location: admin_corsi.php?msg=emptyprice");
                    die;
                }
                $price = htmlentities($_POST['price']);
                //se e' tutto ok chiamo il metodo passando id + tutti i nuovi valori
                if (dbcontroller::updateCorsoMonotematico($id, $date, $title, $desc, $price)) {
                    header("location: admin_corsi.php?msg=success-update");
                } else {
                    header("location: admin_corsi.php?msg=errordb");
                }
            } else {
                header("location: admin_corsi.php?msg=error-update");
            }
        } else {
            header("location: admin_corsi.php?msg=error-update");
        }
    } else {
        header("location: admin_corsi.php?msg=error-update");
    }
} else {
    header("location: admin_corsi.php?msg=error-update");