国内流行的内容管理系统(CMS)多端全媒体解决方案 https://www.dedebiz.com
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

97 řádky
4.2KB

  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. <ol class="breadcrumb">
  16. <li class="breadcrumb-item"><a href="index_body.php">后台面板</a></li>
  17. <li class="breadcrumb-item"><a href="media_main.php">附件管理</a></li>
  18. <li class="breadcrumb-item active">添加附件</li>
  19. </ol>
  20. <div class="card shadow-sm">
  21. <div class="card-header">添加附件</div>
  22. <div class="card-body">
  23. <form name="form1" action="media_add.php" method="post" enctype="multipart/form-data">
  24. <input type="hidden" name="dopost" value="upload">
  25. <input type="hidden" name="_csrf_token" value="<?php echo $GLOBALS['csrf_token'];?>">
  26. <div class="table-responsive">
  27. <table class="table table-borderless">
  28. <tbody>
  29. <tr>
  30. <td width="260">附件类型</td>
  31. <td>
  32. <label><input type="radio" name="mediatype" value="1" checked> 图片</label>
  33. <label><input type="radio" name="mediatype" value="2"> FLASH</label>
  34. <label><input type="radio" name="mediatype" value="3"> 视频音频</label>
  35. <label><input type="radio" name="mediatype" value="4"> 附件其它</label>
  36. </td>
  37. </tr>
  38. <tr>
  39. <td>附件标题</td>
  40. <td><input type="text" name="title" id="title" class="admin-input-lg" required></td>
  41. </tr>
  42. <tr>
  43. <td>附加参数</td>
  44. <td>
  45. <label>宽:<input type="text" name="mediawidth" id="mediawidth" class="admin-input-sm" placeholder="附件像素宽度"></label>
  46. <label>高:<input type="text" name="mediaheight" id="mediaheight" class="admin-input-sm" placeholder="附件像高宽度"></label>
  47. <label>播放时间:<input type="text" name="playtime" id="mediawidth3" class="admin-input-sm" placeholder="附件播放分钟"></label>
  48. </td>
  49. </tr>
  50. <tr>
  51. <td>上传附件</td>
  52. <td>
  53. <label>数量:<input type="text" name="picnum" id="picnum" value="5" class="admin-input-sm"></label>
  54. <a href="javascript:MakeUpload();" class="btn btn-success btn-sm">添加</a>
  55. <a href="javascript:ResetUpload();" class="btn btn-success btn-sm">恢复</a>
  56. </td>
  57. </tr>
  58. <tr>
  59. <td colspan="2">
  60. <p><label>附件1:<input type="file" name="upfile1" id="upfile1" class="admin-input-lg"></label></p>
  61. <p><label>附件2:<input type="file" name="upfile2" id="upfile2" class="admin-input-lg"></label></p>
  62. <p><label>附件3:<input type="file" name="upfile3" id="upfile3" class="admin-input-lg"></label></p>
  63. <p><label>附件4:<input type="file" name="upfile4" id="upfile4" class="admin-input-lg"></label></p>
  64. <p><label>附件5:<input type="file" name="upfile5" id="upfile5" class="admin-input-lg"></label></p>
  65. <div id="uploadfield"></div>
  66. </td>
  67. </tr>
  68. <tr>
  69. <td colspan="2" align="center">
  70. <button type="submit" class="btn btn-success btn-sm">保存</button>
  71. <button type="reset" class="btn btn-outline-success btn-sm">重置</button>
  72. </td>
  73. </tr>
  74. </tbody>
  75. </table>
  76. </div>
  77. </form>
  78. </div>
  79. </div>
  80. <script>
  81. var startNum = 6;
  82. function MakeUpload() {
  83. var upfield = document.getElementById("uploadfield");
  84. var endNum = Number(document.form1.picnum.value) + startNum;
  85. if (endNum > 30) endNum = 30;
  86. for (startNum; startNum <= endNum; startNum++) {
  87. upfield.innerHTML += "<div class='mb-3'><label>附件" + startNum + ":<input type='file' name='upfile" + startNum + "' class='admin-input-lg'></label></div>";
  88. }
  89. }
  90. function ResetUpload() {
  91. var upfield = document.getElementById("uploadfield");
  92. upfield.innerHTML = '';
  93. startNum = 2;
  94. }
  95. </script>
  96. </body>
  97. </html>