国内流行的内容管理系统(CMS)多端全媒体解决方案 https://www.dedebiz.com
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
4.3KB

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
  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. </head>
  11. <body>
  12. <form name="forms" method="post" action="media_main.php">
  13. <table class="table border my-3">
  14. <tr>
  15. <td bgcolor="#f8fafb">
  16. <input type="text" name="keyword" id="keyword" placeholder="请输入关键词" value="<?php echo $keyword?>" class="admin-input-lg mr-3">
  17. <select name="mediatype" class="admin-input-sm mr-3">
  18. <option value="0">文件类型</option>
  19. <option value="1" <?php if ($mediatype==1) echo "selected"?>>图片</option>
  20. <option value="2" <?php if ($mediatype==2) echo "selected"?>>FLASH</option>
  21. <option value="3" <?php if ($mediatype==3) echo "selected"?>>视频音频</option>
  22. <option value="4" <?php if ($mediatype==4) echo "selected"?>>其它附件</option>
  23. </select>
  24. <select name="membertype" class="admin-input-sm">
  25. <option value="0">会员组</option>
  26. <option value="1" <?php if ($membertype==1) echo "selected"?>>管理员</option>
  27. <option value="2" <?php if ($membertype==2) echo "selected"?>>外部会员</option>
  28. </select>
  29. <button type="submit" name="submit" class="btn btn-success btn-sm">搜索</button>
  30. <a href="media_add.php" class="btn btn-success btn-sm">添加附件</a>
  31. </td>
  32. </tr>
  33. </table>
  34. </form>
  35. <form name="form1">
  36. <table class="table border mb-3">
  37. <tr>
  38. <td bgcolor="#f8fafb" colspan="7">附件管理</td>
  39. </tr>
  40. <tr bgcolor="#f8f9fa" align="center">
  41. <td width="6%">选择</td>
  42. <td width="26%">文件标题</td>
  43. <td width="10%">文件大小</td>
  44. <td width="16%">上传会员</td>
  45. <td width="16%">上传时间</td>
  46. <td width="10%">文件类型</td>
  47. <td>操作</td>
  48. </tr>
  49. {dede:datalist empty='<tr><td colspan="7" align="center">暂无记录</td></tr>'}
  50. <tr align="center">
  51. <td><input type="checkbox" name="aids" id="aids{dede:field.aid/}" value="{dede:field.aid/}"></td>
  52. <td><a href="{dede:field.url/}" title="{dede:field.url/}" target="_blank">{dede:field.title/}</a>
  53. </td>
  54. <td>{dede:field.filesize function='GetFileSize(@me)'/}</td>
  55. <td>{dede:field.adminname function="UploadAdmin(@me,$fields['membername'])"/}</td>
  56. <td>{dede:field.uptime function="MyDate('Y-m-d H:i:s',@me)"/}</td>
  57. <td>{dede:field.mediatype function="MediaType(@me,$fields['url'])"/}</td>
  58. <td>
  59. <a href="media_edit.php?aid={dede:field.aid/}&dopost=edit" class="btn btn-light btn-sm"><i class="fa fa-pencil-square"></i> 修改</a>
  60. <a href="media_edit.php?aid={dede:field.aid/}&dopost=del" class="btn btn-danger btn-sm"><i class="fa fa-trash"></i> 删除</a>
  61. </td>
  62. </tr>
  63. {/dede:datalist}
  64. <tr>
  65. <td colspan="7">
  66. <button type="button" name="b4" onclick="AllSel();" class="btn btn-success btn-sm">全选</button>
  67. <button type="button" name="b5" onclick="NoneSel();" class="btn btn-success btn-sm">取消</button>
  68. <button type="button" name="b6" onclick="DelSel();" class="btn btn-danger btn-sm">删除</button>
  69. </td>
  70. </tr>
  71. <tr>
  72. <td bgcolor="#f8fafb" colspan="7" align="center">{dede:pagelist listsize='6'/}</td>
  73. </tr>
  74. </table>
  75. </form>
  76. <script>
  77. //获得选中文件的文件名
  78. function getCheckboxItem() {
  79. var allSel = '';
  80. if (document.form1.aids.value) return document.form1.aids.value;
  81. for (i = 0; i < document.form1.aids.length; i++) {
  82. if (document.form1.aids[i].checked) {
  83. if (allSel == "")
  84. allSel = document.form1.aids[i].value;
  85. else
  86. allSel = allSel + "," + document.form1.aids[i].value;
  87. }
  88. }
  89. return allSel;
  90. }
  91. function AllSel() {
  92. for (i = 0; i < document.form1.aids.length; i++) {
  93. document.form1.aids[i].checked = true;
  94. }
  95. }
  96. function NoneSel() {
  97. for (i = 0; i < document.form1.aids.length; i++) {
  98. document.form1.aids[i].checked = false;
  99. }
  100. }
  101. function DelSel() {
  102. var nid = getCheckboxItem();
  103. if (nid == "") {
  104. alert("请选择项目");
  105. return;
  106. }
  107. location.href = "media_edit.php?dopost=del&ids=" + nid;
  108. }
  109. </script>
  110. </body>
  111. </html>