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.
 
 
 
 
 
 

94 lines
2.7 KiB

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title></title>
  6. <script src="/web/public/js/jquery-2.2.4.min.js"></script>
  7. </head>
  8. <body>
  9. <style type="text/css">
  10. /* Border styles */
  11. #table-1 thead, #table-1 tr {
  12. border-top-width: 1px;
  13. border-top-style: solid;
  14. border-top-color: rgb(230, 189, 189);
  15. }
  16. #table-1 {
  17. border-bottom-width: 1px;
  18. border-bottom-style: solid;
  19. border-bottom-color: rgb(230, 189, 189);
  20. }
  21. /* Padding and font style */
  22. #table-1 td, #table-1 th {
  23. padding: 5px 10px;
  24. font-size: 12px;
  25. font-family: Verdana;
  26. color: rgb(177, 106, 104);
  27. }
  28. /* Alternating background colors */
  29. #table-1 tr:nth-child(even) {
  30. background: rgb(238, 211, 210)
  31. }
  32. #table-1 tr:nth-child(odd) {
  33. background: #FFF
  34. }
  35. </style>
  36. <div>
  37. <input type="button" value="图文" id="news" class="button" onclick="toUrl('news');"/>
  38. <input type="button" value="图片" id="image" class="button" onclick="toUrl('image');"/>
  39. <input type="button" value="视频" id="video" class="button" onclick="toUrl('video');"/>
  40. <input type="button" value="语音" id="voice" class="button" onclick="toUrl('voice');"/>
  41. <input type="button" value="生成菜单" id="voice" class="button" onclick="setMenu();"/>
  42. <input type="button" value="清除缓存" class="button" onclick="clearCache();"/>
  43. </div>
  44. <input type="hidden" id="hidden" value="<?php echo $type; ?>"/>
  45. <table id="table-1" style="width: 100%;text-align: left;">
  46. <tr>
  47. <th style="width: 500px;text-align: center;">ID</th>
  48. <th>标题</th>
  49. </tr>
  50. <?php
  51. foreach ($list as $val) {
  52. ?>
  53. <tr>
  54. <td><?php echo $val['media_id']; ?></td>
  55. <td><?php echo $val['name']; ?></td>
  56. </tr>
  57. <?php
  58. }
  59. ?>
  60. </table>
  61. <div id="urlText"></div>
  62. <script type="text/javascript">
  63. var type = document.getElementById('hidden').value;
  64. document.getElementById(type).style.color = 'green';
  65. function toUrl(type) {
  66. window.location.href = './get-media?type=' + type;
  67. }
  68. function clearCache() {
  69. window.location.href = './get-media?clear=clear'
  70. }
  71. function setMenu() {
  72. $.ajax({
  73. type: "post",
  74. url: './set-menu',
  75. dataType: 'json',
  76. success: function(res_data) {
  77. if(res_data.errmsg == 'ok') {
  78. alert('设置成功!')
  79. } else {
  80. alert('设置失败!'+res_data.errmsg )
  81. }
  82. },
  83. error: function() {
  84. alert('设置失败');
  85. }
  86. });
  87. }
  88. </script>
  89. </body>
  90. </html>