<a href="/thread/createrss" class="create-thread anchor-block anchor"><i class="fa fa-rss" style="color:orange;"></i><span style="color:orange;">RSS</span></a> <div class="offset-block"></div> <a href="https://skydrive.live.com/" class="onedrive-block anchor-block anchor"><img src="/images/Logo_OneDrive.png"></img></a> <div class="offset-block"></div> <a href="http://codegarage.edisonthk.com/" class="onedrive-block anchor-block anchor"><span style="font-weight:bold;"></> CodeGarage</span></a> <div class="offset-block"></div> <div class="notice-block"> <h5><i class="fa fa-bookmark-o"></i>お知らせ</h5> <br/> <?php foreach (NoticeBoard::AllChecked() as $notice) { ?> <p><span class="font-tiny"><?php echo $notice->getUpdateDate(); ?> </span><br/> <?php echo $notice->getContent(); ?> </p> <?php } ?> </div> <div class="offset-block"></div> </div> <?php
$content = preg_replace_callback("|\\[(.*?)\\]\\((.*?)\\)|", function ($matches) { return "<a href=\"{$matches[2]}\">{$matches['1']}</a>"; }, $content); if (!empty($content)) { NoticeBoard::create($author_id, $content); } die; } else { if ($_POST["action"] == "noticeboard_update") { // update note status $id = abs(intval($_POST["id"])); $checked = false; if ($_POST["checked"] == "checked") { $checked = true; } $notice = new NoticeBoard(); $notice->initWithId($id); $notice->setChecked($checked); die; } } } class ManagerController { private static $path = "manager/"; public static function noticeboard() { $noticeboard = true; $loginrecord = false; $permission = false; $googleanalytics = false;
?> " method="post"> <input name="action" style="display:none" value="noticeboard_create"> <textarea id="create_note_form_textarea" name="notice_content"></textarea> <input id="create_note_form_submit"type="submit" value="通知追加"> </form> </div> <p>次のリストはチェックされている内容は表示され。なので、表示しない内容があったらチェックを外してください。</p> <table> <tbody> <!-- --> <!-- --> <!-- noticeboard update html code --> <?php foreach (NoticeBoard::all() as $notice) { ?> <tr class="notice_row"> <td > <?php if ($notice->isChecked()) { $checked = "checked"; } else { $checked = ""; } ?> <input type="checkbox" name="<?php echo $notice->getId(); ?> " id="notice_checkbox_<?php echo $notice->getId();
public static function AllChecked() { $db = getDatabase(); $q = "SELECT * FROM nortification_board ORDER BY " . self::KEY_ID . " DESC"; try { $stmt = $db->prepare($q); $stmt->execute(); } catch (PDOException $ex) { Utils::HandlePDOException($ex); } $result = array(); foreach ($stmt->fetchAll() as $notice) { $temp = new NoticeBoard(); $temp->initWithVar($notice); if ($temp->isChecked()) { array_push($result, $temp); } } return $result; }