PHP File Manager
Editing File: page-notes.php
<table class="table table-striped table-bordered" id="page-notes-table"> <thead> <tr> <th>By</th> <th>URL</th> <th>Note</th> <th width="180">Date</th> <th width="16"><abbr title="Solved?" class="tooltipped">S</abbr></th> <th>Actions</th> </tr> </thead> <tbody> <?php if(!empty($page_notes)): ?> <?php foreach($page_notes as $note_info): ?> <tr> <td><?php echo $note_info->first_name; ?></td> <td><a href="<?php echo $note_info->page; ?>" target="_blank"><?php echo $note_info->page; ?></a></td> <td><?php echo nl2br($note_info->note); ?></td> <td><?php echo date('D, jS M Y, H:i', $note_info->date); ?></td> <td><img src="/assets/images/icons/<?php echo ($note_info->solved) ? 'tick' : 'delete'; ?>.png" alt="" /></td> <td> <?php if(!$note_info->is_solved): ?> <a href="/page-notes/solve/<?php echo $note_info->note_id; ?>" class="action-tool" data-mode="solve"><img src="/assets/images/icons/tick.png" alt="" /></a> <?php endif; ?> <a href="/page-notes/delete/<?php echo $note_info->note_id; ?>" class="action-tool" data-mode="delete"><img src="/assets/images/icons/cancel.png" alt="" /></a> </td> </tr> <?php endforeach; ?> <?php else: ?> <tr> <td colspan="6">No notes</td> </tr> <?php endif; ?> </tbody> </table> <script type="text/javascript"> $(function() { $('.action-tool', '#page-notes-table').click(function(event) { event.preventDefault(); var self = $(this), mode = self.data('mode'), actionUrl = self.prop('href'), noteRow = self.closest('tr'); $.get(actionUrl, function(response) { if(response.success) { if(mode == 'delete') { noteRow.remove(); } else if(mode == 'solve') { self.remove(); $('img[src*="delete.png"]', noteRow).prop('src', '/assets/images/icons/tick.png'); $('tbody', '#page-notes-table').append(noteRow); } } }, 'json'); }) }); </script>
Cancel