コード例 #1
0
        print "<script type='text/javascript'>\n\t\t\t\twindow.opener.location.reload();\n\t\t\t\tsetTimeout(function(){self.close();},2500);\n\t\t\t\t</script>";
        //Query failed
    } else {
        print "<p><b>{$lang['global_01']}{$lang['colon']}</b> {$lang['calendar_popup_28']}</p>";
        if (SUPER_USER) {
            print db_error() . "<br>QUERY:<br>{$sql}";
        }
    }
    /**
     * DISPLAY CONFIRMATION THAT CALENDAR EVENT WAS DELETED
     */
} elseif (isset($_GET['cal_id']) && is_numeric($_GET['cal_id']) && !empty($_POST) && isset($_POST['deleteCalEv'])) {
    //Query to delete calendar event
    $sql = "delete from redcap_events_calendar where cal_id = " . $_GET['cal_id'];
    //Logging
    log_event($sql, "redcap_events_calendar", "MANAGE", $_GET['cal_id'], calLogChange($_GET['cal_id']), "Delete calendar event");
    //Run query after logging because values will be deleted
    db_query($sql);
    //Show confirmation
    print "<div style='color:red;padding:30px 0 0 15px;margin-bottom:10px;font-weight:bold;font-size:16px;'>\n\t\t\t\t{$lang['calendar_popup_29']}<br><br><br>\n\t\t\t</div>";
    //Render javascript to refresh calendar underneath and close pop-up
    print "<script type='text/javascript'>\n\t\t\twindow.opener.location.reload();\n\t\t\tsetTimeout(function(){self.close();},2500);\n\t\t\t</script>";
}
/**
 * PAGE FOOTER
 */
callJSfile('Calendar.js');
$_GET['width'] = isset($_GET['width']) && is_numeric($_GET['width']) && $_GET['width'] < 1200 ? $_GET['width'] : 800;
print "</div>\n\t\t<script type='text/javascript'>\n\t\t\$(function(){\n\t\t\t// Resize window to fit contents\n\t\t\tvar maxh = window.screen.height - 100;\n\t\t\tvar divh = document.getElementById('bodydiv').offsetHeight + 130;\n\t\t\tvar newh = (divh > maxh) ? maxh : divh;\n\t\t\twindow.resizeTo({$_GET['width']},newh);\n\t\t\t// Load calendar pop-up\n\t\t\t\$('#newdate').datepicker({buttonText: 'Click to select a date',yearRange: '-100:+10',changeMonth: true, changeYear: true, dateFormat: user_date_format_jquery});\t\t\t\t\t\t\n\t\t\t// Pop-up time-select initialization\n\t\t\t\$('.time').timepicker({hour: currentTime('h'), minute: currentTime('m'), timeFormat: 'hh:mm'});\n\t\t});\n\t\t</script>";
?>
</body>
コード例 #2
0
            $q = db_query($sql);
            if (!$q) {
                exit("<b>{$lang['global_01']}!</b>");
            } else {
                $msg = $msg_saved_status;
                //LOGGING
                log_event($sql, "redcap_events_calendar", "MANAGE", $_GET['cal_id'], calLogChange($_GET['cal_id']), "Edit calendar event");
            }
            break;
            //Edit notes
        //Edit notes
        case "edit_notes":
            $sql = "update redcap_events_calendar set notes = '" . prep($_POST['notes']) . "' where cal_id = {$_POST['cal_id']}";
            if (db_query($sql)) {
                //LOGGING
                log_event($sql, "redcap_events_calendar", "MANAGE", $_POST['cal_id'], calLogChange($_POST['cal_id']), "Edit calendar event");
            }
            exit;
            break;
    }
}
//DATE Field
if ($_GET['view'] == "date") {
    print "<div id='change_date' style='display:block;'>\n\t\t\t\t<b>" . DateTimeRC::format_ts_from_ymd($event_date) . " (" . DateTimeRC::getDay($event_date) . ")</b>&nbsp; ";
    // Dont' allow user to change date here if tied to an Event (need to change on Scheduling page where it might affect other scheduled dates)
    if ($row['event_id'] == "") {
        print "<a href='javascript:;' style='text-decoration:underline;font-size:11px;' onclick=\"\$('#change_date').css({'display':'none'});\$('#save_date').css({'display':'block'});\">{$lang['calendar_popup_ajax_03']}</a>";
    }
    print "{$msg}\n\t\t\t</div>\n\t\t\t<div id='save_date' style='display:none;position:relative;'>\n\t\t\t\t<input type='text' id='newdate' name='newdate' onblur=\"redcap_validate(this,'','','hard','date_'+user_date_format_validation,1,1,user_date_format_delimiter);\" value='" . DateTimeRC::format_ts_from_ymd($event_date) . "' class='x-form-text x-form-field' style='width:70px;' maxlength='10'><span class='df'>(" . DateTimeRC::get_user_format_label() . ")</span>\n\t\t\t\t&nbsp;&nbsp;\n\t\t\t\t<input type='button' id='savebtndatecalpopup' style='font-size:11px;' value='" . cleanHtml($lang['calendar_popup_ajax_04']) . "' onclick='saveDateCalPopup({$_GET['cal_id']})'> &nbsp;\n\t\t\t\t<input type='button' style='font-size:11px;' value='" . cleanHtml($lang['global_53']) . "' onclick=\"\$('#change_date').css({'display':'block'});\$('#save_date').css({'display':'none'});\">\n\t\t\t</div>";
    //TIME Field
} elseif ($_GET['view'] == "time") {