Files
WTS-Public/Admin.php
T
2026-10-27 20:22:37 -05:00

117 lines
3.0 KiB
PHP

<?php
ini_set('display_errors', 1); // Enable error display
ini_set('display_startup_errors', 1); // Show startup errors
error_reporting(E_ALL); // Report all types of errors
session_start();
require_once("./inc/HelperFunctions.php");
require_once("./inc/FileHelpers.php");
require_once("./inc/Editor_Event.php");
require_once("./inc/Editor_Place.php");
require_once("./inc/Editor_ProgChair.php");
require_once("./inc/Editor_Header.php");
require_once("./inc/Administrator.php");
SetTraceRoot(__DIR__, TRACEPATH);
TraceProgram(__FILE__, __FUNCTION__, __LINE__, "start " . date(DATE_RFC2822), TR_ENTRY);
// X Action=EventNew
// X ProgramDate=YYYY-MM-DD
// X EventDate=YYY-MM-DD
//
// X Action=PlaceEdit
// NewPlace=<text>
// Places=X
// X Action=HeaderSubmit
// Admin
// Create Event
// Edit Event
//
// Common
// Page Header Content
// New Member Information
// Membership Dues Information
// <h2>Edit Page Header</h2>
// <blockquote>
// something here to access the page header.
// </blockquote>
// <h2>Edit New Member Information</h2>
// <blockquote>
// something here to edit the new member information
// </blockquote>
// <h2>Edit Membership Dues Information</h2>
//
$formSubmission = false;
$FormData = array();
$CleanRequestData = array();
$CleanFiles = array();
foreach ($_REQUEST as $key => $value) {
TraceProgram(__FILE__, __FUNCTION__, __LINE__, "$key => $value");
$CleanRequestData[$key] = $value;
}
if (isset($_FILES)) {
TraceProgram(__FILE__, __FUNCTION__, __LINE__, "");
$CleanFiles = $_FILES;
}
if (isset($CleanRequestData['ErrorNotice'])) {
ShowTransientPage($CleanRequestData['ErrorNotice'], $CleanRequestData['ErrorCode']);
exit;
}
$Action = (isset($CleanRequestData['Action'])) ? $CleanRequestData['Action'] : "";
TraceProgram(__FILE__, __FUNCTION__, __LINE__, "\nClean RQST: " . print_r($CleanRequestData, true));
TraceProgram(__FILE__, __FUNCTION__, __LINE__, "\nClean FILE: " . print_r($CleanFiles, true));
switch ($Action) {
case 'DeleteEventItem':
case 'EventNew':
case 'EventEdit':
ShowEventForm();
break;
case 'PlaceEdit':
case 'PlaceSubmit':
ShowPlaceForm();
break;
case 'ProgChairEdit':
ShowProgChairForm();
break;
case 'HeaderEdit':
case 'HeaderSubmit':
ShowHeaderform();
break;
default:
ShowEventSelector();
break;
}
TraceProgram(__FILE__, __FUNCTION__, __LINE__, "end", TR_EXIT);
exit;
#################################################################
function ShowTransientPage($errNotice, $errCode) {
?>
<!doctype html>
<html>
<head>
<title>Error Notification</title>
<meta http-equiv='Refresh' content="10; url=<?php echo $_SERVER['PHP_SELF']; ?>" />
</head>
<body>
<h1>Error Notification</h1>
Apologies, but an error occurred.<br/><br/>
<?php printf("Please communicate this to the developer:<br/><br/><b>Error: %s, ErrorCode: %d</b>.", basename($errNotice, '.php'), $errCode); ?>
<br/><br/><br/>
You will be forwarded to the Admin page in a few seconds, or
<?php printf("<a href='%s'>Click here.</a>", $_SERVER['PHP_SELF']); ?>
</body>
</html>
<?
}
?>