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.

111 lines
3.5 KiB

8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
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')
  4. <h5 class="sub-header"><a href="/fladmin/category">栏目管理</a> > <a href="/fladmin/article">文章列表</a> [ <a href="/fladmin/article/add<?php if(!empty($_GET["id"])){echo '?catid='.$_GET["id"];}?>">发布文章</a> ]</h5>
  5. <div class="table-responsive">
  6. <table class="table table-striped table-hover">
  7. <thead>
  8. <tr>
  9. <th>ID</th>
  10. <th>选择</th>
  11. <th>文章标题</th>
  12. <th>更新时间</th>
  13. <th>类目</th><th>点击</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><input name="arcID" type="checkbox" value="<?php echo $row->id; ?>" class="np"></td>
  21. <td><a href="/fladmin/article/edit?id=<?php echo $row->id; ?>"><?php echo $row->title; ?></a> <?php if(!empty($row->litpic)){echo "<small style='color:red'>[图]</small>";}if($row->tuijian==1){echo "<small style='color:#22ac38'>[荐]</small>";} ?> </td>
  22. <td><?php echo date('Y-m-d',$row->pubdate); ?></td>
  23. <td><a href="/fladmin/article?id=<?php echo $row->typeid; ?>"><?php echo $row->name; ?></a></td><td><?php echo $row->click; ?></td><td><a target="_blank" href="<?php echo get_front_url(array("type"=>"content","catid"=>$row->typeid,"id"=>$row->id)); ?>">预览</a>&nbsp;<a href="/fladmin/article/edit?id=<?php echo $row->id; ?>">修改</a>&nbsp;<a onclick="delconfirm('/fladmin/article/del?id=<?php echo $row->id; ?>')" href="javascript:;">删除</a></td>
  24. </tr>
  25. <?php }} ?>
  26. <tr>
  27. <td colspan="8">
  28. <a href="javascript:selAll('arcID')" class="coolbg">反选</a>&nbsp;
  29. <a href="javascript:delArc()" class="coolbg">删除</a>&nbsp;
  30. <a href="javascript:tjArc()" class="coolbg">特荐</a>
  31. </td>
  32. </tr>
  33. </tbody>
  34. </table>
  35. </div><!-- 表格结束 -->
  36. <form id="searcharc" class="navbar-form" action="/fladmin/article" method="get">
  37. <select name="typeid" id="typeid" style="padding:6px 5px;vertical-align:middle;border:1px solid #DBDBDB;border-radius:4px;">
  38. <option value="0">选择栏目...</option>
  39. <?php $catlist = category_tree(get_category('arctype', 0)); foreach($catlist as $row) { ?><option value="<?php echo $row['id']; ?>"><?php for($i=0; $i<$row["deep"]; $i++) { echo "—"; } echo $row["name"]; ?></option><?php } ?>
  40. </select>
  41. <div class="form-group"><input type="text" name="keyword" id="keyword" class="form-control required" placeholder="搜索关键词..."></div>
  42. <button type="submit" class="btn btn-info" value="Submit">搜索一下</button></form>
  43. <nav aria-label="Page navigation">{{ $posts->links() }}</nav>
  44. <script>
  45. //推荐文章
  46. function tjArc(aid)
  47. {
  48. var checkvalue=getItems();
  49. if(checkvalue=='')
  50. {
  51. alert('必须选择一个或多个文档!');
  52. return;
  53. }
  54. if(confirm("确定要推荐吗"))
  55. {
  56. location="/fladmin/article/recommendarc?id="+checkvalue;
  57. }
  58. else
  59. {
  60. }
  61. }
  62. //批量删除文章
  63. function delArc(aid)
  64. {
  65. var checkvalue=getItems();
  66. if(checkvalue=='')
  67. {
  68. alert('必须选择一个或多个文档!');
  69. return;
  70. }
  71. if(confirm("确定删除吗"))
  72. {
  73. location="/fladmin/article/del?id="+checkvalue;
  74. }
  75. else
  76. {
  77. }
  78. }
  79. $(function(){
  80. $('.required').on('focus', function() {
  81. $(this).removeClass('input-error');
  82. });
  83. $("#searcharc").submit(function(e){
  84. $(this).find('.required').each(function(){
  85. if( $(this).val() == "" )
  86. {
  87. e.preventDefault();
  88. $(this).addClass('input-error');
  89. }
  90. else
  91. {
  92. $(this).removeClass('input-error');
  93. }
  94. });
  95. });
  96. });
  97. </script>
  98. @endsection