$galleryImage = GalleryImage::fetchFromParameters($_POST); if (!$galleryImage->save()) { $logger->LogError("Error saving news category."); foreach ($galleryImage->errors as $error) { $logger->LogError($error); $errors[] = $error; } } else { $message = "Values were updated successfully!"; } } else { if (isset($_REQUEST['id']) && is_numeric($_REQUEST['id'])) { $logger->LogInfo("Page was called for edit of id: " . $_REQUEST['id']); $id = intval($_REQUEST['id']); $logger->LogDebug("Numeric id is: {$id}"); $galleryImage = GalleryImage::fetchFromDb($id); if ($galleryImage == null) { $logger->LogError("Invalid request. No gallery image with id: {$id} exists."); $errors[] = "Invalid request. No gallery image with id: {$id} exists."; } } } include "header.php"; ?> </td> <tr> <td valign="top"> <?php if (sizeof($errors) > 0) { echo ' <table width="100%">' . "\n"; foreach ($errors as $error) {