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.

53 lines
1.5 KiB

8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 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>
  9. <tr>
  10. <th>ID</th>
  11. <th width=25%>标题</th>
  12. <th>留言时间</th>
  13. <th width=45%>内容</th><th>操作</th>
  14. </tr>
  15. </thead>
  16. <tbody>
  17. <?php if($posts){foreach($posts as $row){ ?>
  18. <tr>
  19. <td><?php echo $row->id; ?></td>
  20. <td><?php echo $row->title; ?></td>
  21. <td><?php echo date('Y-m-d H:i:s',$row->addtime); ?></td>
  22. <td><?php echo $row->msg; ?></td><td>&nbsp;<a onclick="delconfirm('/fladmin/guestbook/del?id=<?php echo $row->id; ?>')" href="javascript:;">删除</a></td>
  23. </tr>
  24. <?php }} ?>
  25. </tbody>
  26. </table>
  27. </div><!-- 表格结束 -->
  28. <nav aria-label="Page navigation">{{ $posts->links() }}</nav>
  29. <script>
  30. $(function(){
  31. $('.required').on('focus', function() {
  32. $(this).removeClass('input-error');
  33. });
  34. $("#searcharc").submit(function(e){
  35. $(this).find('.required').each(function(){
  36. if( $(this).val() == "" )
  37. {
  38. e.preventDefault();
  39. $(this).addClass('input-error');
  40. }
  41. else
  42. {
  43. $(this).removeClass('input-error');
  44. }
  45. });
  46. });
  47. });
  48. </script>
  49. @endsection