国内流行的内容管理系统(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.

151 line
5.7KB

  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. <link rel="stylesheet" href="/static/web/css/daterangepicker.css">
  11. <script src="/static/web/js/jquery.min.js"></script>
  12. <script src="/static/web/js/bootstrap.min.js"></script>
  13. <script src="/static/web/js/moment.min.js"></script>
  14. <script src="/static/web/js/daterangepicker.js"></script>
  15. <script src="/static/web/js/admin.main.js"></script>
  16. <script>
  17. var i = 1;
  18. function AddItem() {
  19. i++;
  20. if (i > 15) {
  21. ShowMsg("最多添加15个选项");
  22. return;
  23. }
  24. var htmldata = "<div class='my-2'>选项" + i + ":<input type='text' name='voteitem" + i + "' class='admin-input-lg'></div>";
  25. jQuery("#voteitem").append(htmldata);
  26. }
  27. function ResetItem() {
  28. i = 1;
  29. var obj = document.getElementById("voteitem");
  30. obj.innerHTML = "<div class='my-2'>选项1:<input type='text' name='voteitem1' class='admin-input-lg'></div>";
  31. }
  32. </script>
  33. </head>
  34. <body>
  35. <div class="container-fluid">
  36. <ol class="breadcrumb">
  37. <li class="breadcrumb-item"><a href="index_body.php">后台面板</a></li>
  38. <li class="breadcrumb-item"><a href="vote_main.php">投票管理</a></li>
  39. <li class="breadcrumb-item active">添加投票</li>
  40. </ol>
  41. <div class="card shadow-sm">
  42. <div class="card-header">添加投票</div>
  43. <div class="card-body">
  44. <form name="form1" action="vote_add.php" method="post">
  45. <input type="hidden" name="dopost" value="save">
  46. <input type="hidden" name="isarc" value="<?php echo $isarc;?>">
  47. <input type="hidden" name="_csrf_token" value="<?php echo $GLOBALS['csrf_token'];?>">
  48. <div class="table-responsive">
  49. <table class="table table-borderless">
  50. <tbody>
  51. <tr>
  52. <td width="260">投票名称</td>
  53. <td><input type="text" name="votename" id="votename" class="admin-input-lg" required></td>
  54. </tr>
  55. <tr>
  56. <td>开始时间</td>
  57. <td><input type="text" name="starttime" id="starttime" value="<?php echo $startDay?>" class="admin-input-lg dateico datepicker1"></td>
  58. </tr>
  59. <tr>
  60. <td>结束时间</td>
  61. <td><input type="text" name="endtime" id="endtime" value="<?php echo $endDay?>" class="admin-input-lg dateico datepicker1"></td>
  62. </tr>
  63. <tr>
  64. <td>是否允许游客投票</td>
  65. <td>
  66. <label><input type="radio" name="isallow" value="0"> 是</label>
  67. <label><input type="radio" name="isallow" value="1" checked> 否</label>
  68. </td>
  69. </tr>
  70. <tr>
  71. <td>是否允许查看投票</td>
  72. <td>
  73. <label><input type="radio" name="view" value="0"> 是</label>
  74. <label><input type="radio" name="view" value="1" checked> 否</label>
  75. </td>
  76. </tr>
  77. <tr>
  78. <td>投票时间间隔</td>
  79. <td><input type="text" name="spec" class="admin-input-lg">(N天后可再次投票,0表示此ip地址只能投一次)</td>
  80. </tr>
  81. <tr>
  82. <td>是否多选</td>
  83. <td>
  84. <label><input type="radio" name="ismore" value="0" checked> 单选</label>
  85. <label><input type="radio" name="ismore" value="1"> 多选</label>
  86. </td>
  87. </tr>
  88. <tr>
  89. <td>投票项</td>
  90. <td>
  91. <button type="button" name="bbb" class="btn btn-success btn-sm" onclick="AddItem();">添加</button>
  92. <button type="button" name="bbb2" class="btn btn-outline-success btn-sm" onclick="ResetItem();">重置</button>
  93. </td>
  94. </tr>
  95. <tr>
  96. <td></td>
  97. <td>
  98. <div id="voteitem">选项1:<input type="text" name="voteitem1" id="voteitem1" class="admin-input-lg"></div>
  99. </td>
  100. </tr>
  101. <tr>
  102. <td>是否启用</td>
  103. <td>
  104. <label><input type="radio" name="isenable" value="0" checked> 是</label>
  105. <label><input type="radio" name="isenable" value="1"> 否</label>
  106. </td>
  107. </tr>
  108. <tr>
  109. <td colspan="2" align="center">
  110. <button type="submit" class="btn btn-success btn-sm">保存</button>
  111. <button type="reset" class="btn btn-outline-success btn-sm">重置</button>
  112. </td>
  113. </tr>
  114. </tbody>
  115. </table>
  116. </div>
  117. </form>
  118. </div>
  119. </div>
  120. </div>
  121. <script>
  122. $(document).ready(function() {
  123. $('.datepicker1').daterangepicker({
  124. "singleDatePicker": true,
  125. "autoApply": true,
  126. "showDropdowns": true,
  127. "linkedCalendars": false,
  128. "timePicker": true,
  129. "timePicker24Hour": true,
  130. "showCustomRangeLabel": false,
  131. ranges: {
  132. '今日': [moment(), moment()],
  133. '昨日': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
  134. '本月': [moment().startOf('month'), moment().startOf('month')],
  135. '上月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').startOf('month')]
  136. },
  137. "locale": {
  138. format: 'YYYY-MM-DD HH:mm',
  139. applyLabel: '确定',
  140. cancelLabel: '取消',
  141. daysOfWeek: ['日', '一', '二', '三', '四', '五', '六'],
  142. monthNames: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
  143. firstDay: 1
  144. }
  145. }, function(start) {
  146. $(this).val(start.format("YYYY-MM-DD HH:mm"));
  147. });
  148. });
  149. </script>
  150. </body>
  151. </html>