$date = date('Y-m-d', $t); foreach ($snt["who"] as $id) { echo "<li><a href=\"reg_abstract?id={$id}&date={$date}\">" . get_member_name($id) . "</a></li>\n"; } echo "</ul>\n"; echo "</li>\n"; } echo "</ul>\n"; echo "</div>\n"; } function reg() { $id = get_valid_id($_REQUEST["id"]); $date = get_valid_date($_REQUEST["date"]); $t = strtotime($date); $talk_data = get_talk_data_or_gen($t, $id); if (file_exists(gen_memo_filename($t, $id))) { $memo_filename = date('ymd', $t) . "_{$id}.pdf"; $link = "http://ropas.snu.ac.kr/snt_memo2/" . $memo_filename; $memo = "<a href=\"" . $link . "\">" . $memo_filename . "</a>"; } else { $memo = "등록된 메모가 없습니다."; } $arr = array("ID" => $id, "NAME" => get_member_name($id), "WHEN" => $date, "TITLE" => htmlspecialchars($talk_data["title"]), "ABSTRACT" => htmlspecialchars($talk_data["abstract"]), "MEMO" => $memo); echo replace(__ROOT__ . "/template/reg_abstract.temp", $arr); } if (my_key_exists("id", $_REQUEST)) { reg(); } entry(); require __ROOT__ . '/template/footer.temp';
echo "<p>빈 코멘트입니다.</p>\n"; return false; } else { $talk_data = get_talk_data_or_gen($t, $id); $comments = $talk_data["comments"]; array_push($comments, $comment); $talk_data["comments"] = $comments; return put_talk_data($t, $id, $talk_data); } } function echo_reg_result($reg_result, $ret_url) { if ($reg_result) { echo "<p class=\"good\">짝짝짝! 등록 성공.</p>\n"; echo "<p>3초 후 <a href=\"" . htmlspecialchars($ret_url) . "\">이전 페이지</a>로 돌아갑니다...</p>\n"; echo "<script>setTimeout(function(){window.location.replace(\"" . $ret_url . "\");}, 3000);</script>\n"; } else { echo "<p class=\"alert\">등록 실패!</p>\n"; echo "<p><a href=\"javascript:history.go(-1)\">뒤로 가기</a></p>\n"; } } echo "<div class=\"section\">\n"; $ret_url = ""; if (my_key_exists("comment", $_REQUEST)) { $reg_result = reg_comment($ret_url); } else { $reg_result = reg_abstract($ret_url); } echo_reg_result($reg_result, $ret_url); echo "</div>\n"; require __ROOT__ . '/template/footer.temp';
function select_snt() { $snts = get_schedule(); foreach ($snts as $key => $snt) { echo "{$key}) " . date('Y-m-d H:i', time_of_when($snt["when"])) . "\n"; } echo "\n"; echo "Select a S&T (x to exit): "; $input_str = my_fgets(); echo "\n"; if ($input_str === "x") { echo "Exit\n"; exit(0); } else { if (my_key_exists($input_str, $snts)) { $snt = $snts[(int) $input_str]; echo "The S&T on " . date('Y-m-d H:i', time_of_when($snt["when"])) . " is selected.\n\n"; return $snt; } else { echo "Your input is invalid.\n"; exit(1); } } }