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