function activity_delete($delete_ID) { $db = new MyDB(); if (!$db) { echo $db->lastErrorMsg(); } else { } $sql = <<<EOF DELETE from Activity where id = {$delete_ID}; EOF; $ret = $db->exec($sql); if (!$ret) { echo $db->lastErrorMsg(); } else { $sql = <<<EOF DELETE from ActivityMember where activityId = {$delete_ID}; EOF; $ret = $db->exec($sql); if (!$ret) { echo $db->lastErrorMsg(); } else { $db->close(); header("Location: http://www.kmoving.com/user/groups/activity.php"); } } } if (is_Author($delete_ID)) { activity_delete($delete_ID); } else { header("Location: http://www.kmoving.com/user/groups/activity.php?msg=noAuthority"); }
} else { $db->close(); return false; } } function activity_refresh($id, $title, $target, $content) { $db = new MyDB(); if (!$db) { echo $db->lastErrorMsg(); } else { } $sql = <<<EOF UPDATE Activity SET title='{$title}',target='{$target}',content='{$content}' where id={$id}; EOF; $ret = $db->exec($sql); if (!$ret) { echo $db->lastErrorMsg(); } $db->close(); } $id = $_POST["id-refresh"]; $title = $_POST["title-refresh"]; $target = $_POST["target-refresh"]; $content = $_POST["content-refresh"]; if (is_Author($id)) { activity_refresh($id, $title, $target, $content); header("Location: http://www.kmoving.com/user/groups/activity.php?msg=refreshSuccess"); } else { header("Location: http://www.kmoving.com/user/groups/activity.php?msg=noAuthority"); }