<a href="https://github.com/stephenhu3" class="github-link" target="_blank"><img class="logo" src="../img/logo.png">GitHub | Stephen Hu</a> </li> </ul> </div> </div> </nav> <div class="container body-content"> <h2>Notes</h2> <div class="jumbotron" id="note-textarea"> <?php require_once "../db.php"; $notes = NoteDB::getInstance()->get_notes_by_user_name('Stephen'); if (0 === $notes->count()) { echo '<div class="error">'; echo 'The person '; echo 'Stephen'; echo 'is not found. Please check the spelling and try again.'; echo '</div>'; } else { while ($notes->valid()) { $row = $notes->current(); echo '<div id="note">'; echo 'Date Created: '; echo $row['DATE_CREATED']; echo '<br>'; // Saved notes appear here echo $row['CONTENT'];
<?php require_once "db.php"; if (isset($_POST['action'])) { switch ($_POST['action']) { case 'insert_note': $noteContent = $_POST["noteContent"]; $userDate = $_POST["userDate"]; echo $noteContent; NoteDB::getInstance()->insert_note(1, $noteContent, $userDate); break; } }