You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.4 KiB

7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
  1. @extends('admin.layouts.app')
  2. @section('title', '留言列表')
  3. @section('content')<form id="searcharc" class="navbar-form" action="/fladmin/guestbook" method="get">
  4. <div class="form-group"><input type="text" name="keyword" id="keyword" class="form-control required" placeholder="搜索关键词..."></div>
  5. <button type="submit" class="btn btn-info" value="Submit">搜索一下</button></form>
  6. <div class="table-responsive">
  7. <table class="table table-striped table-hover">
  8. <thead><tr class="info">
  9. <th>ID</th>
  10. <th width=25%>标题</th>
  11. <th>留言时间</th>
  12. <th width=45%>内容</th><th>操作</th>
  13. </tr></thead><tbody>
  14. <?php if($posts){foreach($posts as $row){ ?>
  15. <tr>
  16. <td><?php echo $row->id; ?></td>
  17. <td><?php echo $row->title; ?></td>
  18. <td><?php echo date('Y-m-d H:i:s',$row->addtime); ?></td>
  19. <td><?php echo $row->msg; ?></td><td>&nbsp;<a onclick="delconfirm('/fladmin/guestbook/del?id=<?php echo $row->id; ?>')" href="javascript:;">删除</a></td>
  20. </tr>
  21. <?php }} ?>
  22. </tbody></table></div><!-- 表格结束 -->
  23. <nav aria-label="Page navigation">{{ $posts->links() }}</nav>
  24. <script>
  25. $(function(){
  26. $('.required').on('focus', function() {
  27. $(this).removeClass('input-error');
  28. });
  29. $("#searcharc").submit(function(e){
  30. $(this).find('.required').each(function(){
  31. if( $(this).val() == "" )
  32. {
  33. e.preventDefault();
  34. $(this).addClass('input-error');
  35. }
  36. else
  37. {
  38. $(this).removeClass('input-error');
  39. }
  40. });
  41. });
  42. });
  43. </script>
  44. @endsection