Esempio n. 1
0
        $eventDescriptionErrorText = "Bad name value";
        $eventDescriptionErrorStyle = "background-color:#F99;";
        $error = true;
    }
    if (strlen($eventColour) != 3 && strlen($eventColour) != 6) {
        $eventColourErrorText = "Must be 3 or 6 letters";
        $eventColourErrorStyle = "background-color:#F99;";
        $error = true;
    }
    if (!GlobalActions::check_date($eventDate)) {
        $eventDateErrorText = "Bad date value(yyyy-mm-dd)";
        $eventDateErrorStyle = "background-color:#F99;";
        $error = true;
    }
    if (!$error) {
        $result = DBAccess::updateEvent($targetEventID, $eventTypeID, $eventName, $eventDescription, $eventDate, $eventTime, $eventColour, $eventActive);
        $value = $result[0]['Error'];
        if ($value > 0) {
            header("Location: ./viewEvent.php?eventID=" . $targetEventID);
        } else {
            $feedBack = "An error occured: '" . $value . "'";
        }
    } else {
        $feedBack = "Invalid input detected ";
    }
}
//Get list of types
$typeResult = DBAccess::getTypes();
$rows = count($typeResult, 0);
$optionType = "";
$optionType .= "<option value=\"0\">Select a Type</option>";