/* Load date formatter */
include_once $root_path . 'include/inc_date_format_functions.php';
if ($mode == 'save') {
    if ($dateput && $timeput && $berichtput && $author || $dateput2 && $berichtput2 && $author2) {
        // Load the editor functions
        include_once $root_path . 'include/inc_editor_fx.php';
        // Load the visual signalling functions
        include_once $root_path . 'include/inc_visual_signalling_fx.php';
        if ($dateput && $timeput && $berichtput && $author) {
            if ($dateput) {
                $_POST['dateput'] = formatDate2STD($dateput, $date_format);
            }
            $_POST['timeput'] = $_POST['timeput'] . ':00';
            // adjust time to 00:00:00 format
            $_POST['berichtput'] = deactivateHotHtml($berichtput);
            if ($report_obj->saveDirective($_POST)) {
                // Get the last insert id
                $_POST['ref_notes_nr'] = $db->Insert_ID();
                // Set the visual signal
                setEventSignalColor($pn, SIGNAL_COLOR_DOCTOR_INFO, SIGNAL_COLOR_LEVEL_FULL);
                $saved = true;
            } else {
                $saved = false;
                echo "<p>{$report_obj->sql}{$LDDbNoSave}";
            }
        }
        if ($dateput2 && $berichtput2 && $author2) {
            if (!$_POST['ref_notes_nr']) {
                $_POST['timeput'] = date('H:i:s');
            }
            if ($dateput2) {