// ###### checks for valid submit from form post function submit_valid() { global $HTTP_POST_VARS; if (!$HTTP_POST_VARS["Submit"]) { return 0; } if ($HTTP_POST_VARS['form_groupname']) { db_query("INSERT INTO groups (group_name,is_public) " . "values ('{$HTTP_POST_VARS['form_groupname']}',{$HTTP_POST_VARS['form_public']})"); return 1; } else { return 0; } } // ###### first check for valid login, if so, congratulate if (submit_valid()) { session_redirect("/admin/index.php"); } else { // not valid registration, or first time to page $HTML->header(array('title' => "Alexandria: Admin: New Group")); ?> <p><b>Alexandria New Group Creation</b> <?php if ($submit_error) { print "<p>{$submit_error}"; } ?> <form action="newgroup.php" method="post"> <p>Group Name: <br><input type="text" name="form_groupname"> <p>Publicly browseable?:
/** * Output Conditional Submission/Update JavaScript validation. * @since 2.2.0 * @version 2.2.0 * @return void */ function submit_valid_output($sub_type) { global $eID, $hc_cfg, $hc_lang_submit, $hc_lang_core, $hc_time; echo ' <script src="' . CalRoot . '/inc/javascript/validation.js"></script> <script src="' . CalRoot . '/inc/lang/' . $_SESSION['LangSet'] . '/popCal.js"></script> <script src="' . CalRoot . '/inc/javascript/DateSelect.js"></script> <script> //<!-- var calx = new CalendarPopup("dsCal"); calx.showNavigationDropdowns(); calx.setCssPrefix("hc_"); calx.offsetX = 30; calx.offsetY = -5; function toggleMe(who){who.style.display == "none" ? who.style.display = "block":who.style.display = "none";return false;} function chngClock(obj,inc,max){if(obj.disabled == false){var val = (!isNaN(obj.value)) ? parseInt(obj.value,10):0;val += inc;if(max == 59){if(val > max) val = 0;if(val < 0) val = max + 1 - Math.abs(val);} else {if(val > max) val = ' . $hc_time['minHr'] . ';if(val < ' . $hc_time['minHr'] . ') val = max;}obj.value = (val < 10) ? "0" + val : val;}} function togOverride(){ var inputs = (document.getElementById("overridetime").checked) ? true : false; document.getElementById("startTimeHour").disabled = inputs; document.getElementById("startTimeMins").disabled = inputs; document.getElementById("ignoreendtime").disabled = inputs; document.getElementById("specialtimeall").disabled = (inputs == true) ? false : true; if(' . $hc_time['input'] . ' == 12) document.getElementById("startTimeAMPM").disabled = inputs; if(document.getElementById("ignoreendtime").checked || inputs) togEndTime(true); else togEndTime(false); } function togEndTime(disable){ document.getElementById("endTimeHour").disabled = disable; document.getElementById("endTimeMins").disabled = disable; if(' . $hc_time['input'] . ' == 12) document.getElementById("endTimeAMPM").disabled = disable; } function chkDate(){ var err = ""; err += reqField(document.getElementById("eventDate"),"' . $hc_lang_submit['Valid23'] . '\\n"); err += validDate(document.getElementById("eventDate"),"' . $hc_cfg[51] . '","' . $hc_lang_submit['Valid24'] . ' ' . strtoupper($hc_cfg[51]) . '\\n"); err += validDateBefore("' . strftime($hc_cfg[24], strtotime(SYSDATE)) . '",document.getElementById("eventDate").value,"' . $hc_cfg[51] . '","' . $hc_lang_submit['Valid20'] . '\\n"); return err; } function togRegistration(){ var regChk = document.getElementById("rsvp_type").value; document.getElementById("rsvp_space").disabled = (regChk == 1) ? false : true; document.getElementById("openDate").disabled = (regChk == 1) ? false : true; document.getElementById("closeDate").disabled = (regChk == 1) ? false : true; document.getElementById("rsvpEmail").disabled = (regChk == 1) ? false : true; document.getElementById("rsvp").style.display = (regChk == 1) ? "block" : "none"; }'; if ($sub_type == 0) { submit_valid(); } else { submit_update_valid(); } testCaptcha(); include_once HCPATH . '/inc/javascript/locations.php'; echo ' //--> </script>'; }