// ÀÛ¼ºÀÚ : ÃÖ»ó¹Î // ¼öÁ¤ÀÏ : 2002³â 3¿ù 11ÀÏ // ÆÄÀϸí : scheduleEdit.html // ÀÏÁ¤ ¼öÁ¤ include ("../inc/header.html"); include ("../common/common.php"); include ("../common/dbConnect.php"); memberCheck1(); function insertData() { global $conn, $startYear, $startMonth, $startDay, $endYear, $endMonth, $endDay, $subject, $content, $memberID, $memberName, $mode, $no; if($mode != "modify" && $mode != "delete") return; if($mode == "modify" && ($startYear == "" || $startMonth == "" || $startDay == "" || $endYear == "" || $endMonth == "" || $endDay == "" || $subject == "" || $content == "")) { alert("ºüÁø Ç׸ñÀÌ ÀÖ½À´Ï´Ù.", 1); return; } $startDate = "$startYear-$startMonth-$startDay"; $endDate = "$endYear-$endMonth-$endDay"; if($mode == "modify") { $query = "update schedule set writer='$memberName', id='$memberID', startDate='$startDate', endDate='$endDate', subject='$subject', content='$content', writeDate=now() "; $query .= "where no=$no"; $msg = "¼öÁ¤Çß½À´Ï´Ù."; } else if($mode == "delete") { $query = "delete from schedule where no=$no"; $msg = "»èÁ¦Çß½À´Ï´Ù."; } if($conn->runQuery($query)) { alert($msg, 1); $startMonth = (strlen($startMonth) == 1)?"0$startMonth":$startMonth; echo ""; exit(); } } function printTable() { global $conn, $no, $memberID; $query = "select writer, id, DATE_FORMAT(startDate, '%Y') startYear, DATE_FORMAT(startDate, '%m') startMonth, DATE_FORMAT(startDate, '%d') startDay, "; $query .= "DATE_FORMAT(endDate, '%Y') endYear, DATE_FORMAT(endDate, '%m') endMonth, DATE_FORMAT(endDate, '%d') endDay, subject, content from schedule where no=$no"; $result = $conn->runQuery($query); $rows = mysql_fetch_array($result); if($rows[id] != $memberID) alert("ÀÚ½ÅÀÌ ÀÛ¼ºÇÑ ÀÏÁ¤¸¸ ¼öÁ¤/»èÁ¦ÇÒ ¼ö ÀÖ½À´Ï´Ù.", 2); echo ""; echo "