Exemplo n.º 1
0
                $Image->setContent($_POST["content"]);
                $Image->setTags($_POST["content"]);
                $Image->setLocation($_POST["location"]);
                $Image->setMonth($_POST["month"]);
                $Image->setDay($_POST["day"]);
                $Image->setYear($_POST["year"]);
                $Image->query($user["id"]);
                header("Location: " . htmlspecialchars($_SERVER["HTTP_REFERER"]));
            } catch (Exception $e) {
                echo $e->getMessage();
            }
        }
    } else {
        $Update = new Update($user["id"], $Database);
        try {
            echo $_POST["month"] . '-' . $_POST["day"];
            $Update->setContent($_POST["content"]);
            $Update->setTags($_POST["content"]);
            $Update->setCategory("text");
            $Update->setMonth($_POST["month"]);
            $Update->setDay($_POST["day"]);
            $Update->setYear($_POST["year"]);
            $Update->setLocation($_POST["location"]);
            $Update->setCalendarId($_POST["calendar_id"]);
            $Update->create();
            header("Location: " . htmlspecialchars($_SERVER["HTTP_REFERER"]));
        } catch (Exception $e) {
            echo $e->getMessage();
        }
    }
}