国内流行的内容管理系统(CMS)多端全媒体解决方案 https://www.dedebiz.com
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

154 行
7.0KB

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
  6. <title>标签管理</title>
  7. <link rel="stylesheet" href="/static/web/css/font-awesome.min.css">
  8. <link rel="stylesheet" href="/static/web/css/bootstrap.min.css">
  9. <link rel="stylesheet" href="/static/web/css/admin.css">
  10. <script src="/static/web/js/jquery.min.js"></script>
  11. <script src="/static/web/js/bootstrap.min.js"></script>
  12. <script src="/static/web/js/admin.main.js"></script>
  13. </head>
  14. <body>
  15. <div class="container-fluid">
  16. <ol class="breadcrumb">
  17. <li class="breadcrumb-item"><a href="index_body.php">后台面板</a></li>
  18. <li class="breadcrumb-item active">标签管理</li>
  19. </ol>
  20. <div class="card shadow-sm mb-3">
  21. <div class="card-body d-flex justify-content-between">
  22. <form name="form2" action="tags_main.php">
  23. <input type="text" name="tag" value="<?php echo $tag;?>" placeholder="请输入标签" class="admin-input-lg">
  24. <button type="submit" class="btn btn-success btn-sm">搜索</button>
  25. </form>
  26. <form name="form1" action="tags_main.php?action=fetch" method="post">
  27. <input type="text" name="startaid" placeholder="请输入标签id开始" class="admin-input-sm mr-2">
  28. <input type="text" name="endaid" placeholder="请输入标签id结束" class="admin-input-sm">
  29. <button type="submit" class="btn btn-success btn-sm">获取标签</button>
  30. <a href="makehtml_taglist.php" class="btn btn-success btn-sm">更新标签</a>
  31. </form>
  32. </div>
  33. </div>
  34. <div class="card shadow-sm">
  35. <div class="card-header">标签管理</div>
  36. <div class="card-body">
  37. <form name="form3" action="tags_main.php?action=delete" method="post">
  38. <div class="table-responsive">
  39. <table class="table table-borderless table-hover">
  40. <thead>
  41. <tr>
  42. <td scope="col">选择</td>
  43. <td scope="col">id</td>
  44. <td scope="col">标签</td>
  45. <td scope="col"><a href="tags_main.php?tag=<?php echo $tag;?>&orderby=count&orderway=<?php echo $neworderway;?>">点击</a></td>
  46. <td scope="col"><a href="tags_main.php?tag=<?php echo $tag;?>&orderby=total&orderway=<?php echo $neworderway;?>">文档数</a></td>
  47. <td scope="col"><a href="tags_main.php?tag=<?php echo $tag;?>&orderby=addtime&orderway=<?php echo $neworderway;?>">添加时间</a></td>
  48. <td scope="col">更新时间</td>
  49. <td scope="col">操作</td>
  50. </tr>
  51. </thead>
  52. <tbody>
  53. {dede:datalist}
  54. <?php
  55. $fields['addtime'] = GetDateMk($fields['addtime']);
  56. $fields['uptime'] = GetDateMk($fields['uptime']);
  57. $fields['tag'] = dede_htmlspecialchars($fields['tag']);
  58. ?>
  59. <tr>
  60. <td><input type="checkbox" name="ids[]" value="<?php echo $fields['id'];?>"></td>
  61. <td>{dede:field.id/}</td>
  62. <td><a href="<?php echo $cfg_phpurl;?>/tags.php?/<?php echo $fields['id'];?>/" target="_blank">{dede:sfield.tag/}</a></td>
  63. <td><input type="text" value="<?php echo $fields['count'];?>" id="count<?php echo $fields['id'];?>" class="admin-input-sm"></td>
  64. <td><?php echo $fields['total'];?></td>
  65. <td><?php echo $fields['addtime'];?></td>
  66. <td><?php echo $fields['uptime'];?></td>
  67. <td>
  68. <a href='javascript:UpdateKwDes(<?php echo $fields['id'];?>,"<?php echo $fields['tag'];?>");' class="btn btn-light btn-sm"><i class="fa fa-cog" title="设置"></i></a>
  69. <a href="javascript:UpdateOne(<?php echo $fields['id'];?>);" class="btn btn-light btn-sm"><i class="fa fa-refresh" title="刷新"></i></a>
  70. <a href="makehtml_taglist.php?tagid=<?php echo $fields['id'];?>" class="btn btn-light btn-sm"><i class="fa fa-repeat" title="更新"></i></a>
  71. <a href="javascript:DeleteOne(<?php echo $fields['id'];?>);" class="btn btn-danger btn-sm"><i class="fa fa-trash" title="删除"></i></a>
  72. </td>
  73. </tr>
  74. {/dede:datalist}
  75. <tr>
  76. <td colspan="8">
  77. <a href="javascript:selAll();" class="btn btn-success btn-sm">全选</a>
  78. <a href="javascript:noSelAll();" class="btn btn-success btn-sm">取消</a>
  79. <button type="button" onclick="document.form3.submit();" class="btn btn-danger btn-sm">删除</button>
  80. </td>
  81. </tr>
  82. </tbody>
  83. </table>
  84. </div>
  85. </form>
  86. {dede:pagelist listsize='6'/}
  87. </div>
  88. </div>
  89. </div>
  90. <script>
  91. function selAll() {
  92. var a = document.getElementsByTagName("input");
  93. for (var i = 0; i < a.length; i++){
  94. if (a[i].type == "checkbox") a[i].checked = true;
  95. }
  96. }
  97. function noSelAll() {
  98. var a = document.getElementsByTagName("input");
  99. for (var i = 0; i < a.length; i++){
  100. if (a[i].type == "checkbox") a[i].checked = false;
  101. }
  102. }
  103. function UpdateOne(tid) {
  104. location = "tags_main.php?action=update&count=" + document.getElementById('count' + tid).value + "&tid=" + tid;
  105. }
  106. function DeleteOne(tid) {
  107. location = "tags_main.php?action=delete&ids=" + tid;
  108. }
  109. function UpdateKwDes(tid, tag) {
  110. $.get("tags_main.php?action=get_one&tid=" + tid, function(data) {
  111. let rs = JSON.parse(data);
  112. let title = rs.title ? rs.title : "";
  113. let keywords = rs.keywords ? rs.keywords : "";
  114. let description = rs.description ? rs.description : "";
  115. ShowMsg(`<div class="form-group row">
  116. <label for="iptTitle" class="col-sm-3 col-form-label">标签</label>
  117. <div class="col-sm-9"><input type="text" name="title" class="form-control" disabled value="${tag}"></div>
  118. </div>
  119. <div class="form-group row">
  120. <label for="iptKw" class="col-sm-3 col-form-label">标题</label>
  121. <div class="col-sm-9"><input type="text" name="title" id="iptTitle" class="form-control" placeholder="例如:DedeBIZ管理系统" value="${title}"></div>
  122. </div>
  123. <div class="form-group row">
  124. <label for="iptKw" class="col-sm-3 col-form-label">关键词</label>
  125. <div class="col-sm-9"><input type="text" name="kw" id="iptKw" class="form-control" placeholder="例如:dedebiz" value="${keywords}"></div>
  126. </div>
  127. <div class="form-group row">
  128. <label for="iptDes" class="col-sm-3 col-form-label">描述</label>
  129. <div class="col-sm-9"><textarea name="des" id="iptDes" class="form-control" placeholder="例如:DedeBIZ系统基于PHP7版本开发,具有很强的可扩展性,并且采用GPLv2协议完全开放源代码。">${description}</textarea></div>
  130. </div>`, {
  131. footer: `<button type="button" class="btn btn-success btn-sm" onclick="UpdateKwDesDo(${tid}, '~modalID~')">保存</button>`,
  132. });
  133. })
  134. }
  135. function UpdateKwDesDo(tid, mdlID) {
  136. let title = $("#iptTitle").val();
  137. let kw = $("#iptKw").val();
  138. let des = $("#iptDes").val();
  139. $.post("tags_main.php?action=set_one", {
  140. tid: tid,
  141. title: title,
  142. kw: kw,
  143. des: des,
  144. }, function(data) {
  145. let rs = JSON.parse(data);
  146. if (rs.code === 200) {
  147. location.reload();
  148. }
  149. });
  150. }
  151. </script>
  152. </body>
  153. </html>