// ÀÛ¼ºÀÚ : ÃÖ»ó¹Î // ¼öÁ¤ÀÏ : 2002³â 3¿ù 11ÀÏ // ÆÄÀϸí : diaryInput.html // Àϱâ ÀÎDz include ("../inc/header.html"); include ("../common/common.php"); include ("../common/dbConnect.php"); memberCheck1(); function insertData() { global $conn, $toYear, $toMonth, $toDay, $weather, $feel, $subject, $content, $attachFile, $attachFile_name, $attachFile_size, $attachFile_type, $memberID, $mode, $open; if($mode != "insert") return; if($toYear == "" || $toMonth == "" || $toDay == "" || $subject == "" || $content == "") { alert("ºüÁø Ç׸ñÀÌ ÀÖ½À´Ï´Ù.", 1); return; } if($attachFile != "none" && $attachFile_type != "image/pjpeg" && $attachFile_type != "image/gif") { alert("÷ºÎÆÄÀÏÀº À̹ÌÁö ÆÄÀϸ¸ °¡´ÉÇÕ´Ï´Ù.", 1); return; } if($attachFile != "none") { $fileDir = "./img_data"; makeDir($fileDir); $fileName = fileNameCheck($fileDir, $attachFile_name); copy($attachFile, $fileDir."/".$fileName); unlink($attachFile); } $toDate = "$toYear-$toMonth-$toDay"; $query = "insert into diary values ('', '$memberID', '$subject', '$weather', '$feel', '$content', '$toDate', now(), '$open', '$fileName')"; if($conn->runQuery($query)) { alert("ÀÔ·ÂÇß½À´Ï´Ù", 1); $toMonth = (strlen($toMonth) == 1)?"0$toMonth":$toMonth; echo ""; exit(); } } function printTable() { global $conn, $year, $month, $day, $weather, $feel, $subject, $content, $attachFile, $memberID, $memberName, $open; $weatherArray = array("¸¼°í ±ú²ýÇÔ", "ºñ¿ÂµÚ »óÄèÇÔ", "¿ì¿ïÇÑ ÇÏ´Ã", "ÇÏ¾á ´«", "ÃàÃàÇÑ ÀÏ»ó", "°ÇÑ ¹Ù¶÷", "¾îÁ¦ºÎÅÍ ºñ", "¿ì¹Ú-ÇÏ´ÃÀÇ ºÐ³ë","¾Ë¼ö¾ø´Â ÇÏ´Ã"); $feelArray = array("ȯÈñ", "±â»Ý", "Æò¹ü", "¿ì¿ï", "ºÐ³ë", "°¡½¿Àú¸²", "±×¸®¿ò", "½½ÇÄ", "¿Ü·Î¿ò", "¾ï¿ï", "¾ÈŸ±î¿ò", "¼ø¼ö", "ÂüÀ½", "¾Ë¼ö¾ø´Â ¸¶À½"); $query = "select count(no) from diary where id='$memberID' and DATE_FORMAT(toDay, '%Y-%m-%d')='$year-$month-$day'"; $result = $conn->runQuery($query); if(mysql_result($result, 0, 0) > 0) { alert("ÀÌ¹Ì Àϱ⸦ ÀÛ¼ºÇϼ̽À´Ï´Ù.", 2); } echo "