|
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
- <title>添加投票</title>
- <link rel="stylesheet" href="/static/web/css/font-awesome.min.css">
- <link rel="stylesheet" href="/static/web/css/bootstrap.min.css">
- <link rel="stylesheet" href="/static/web/css/admin.css">
- <link rel="stylesheet" href="/static/web/css/daterangepicker.css">
- <script src="/static/web/js/jquery.min.js"></script>
- <script src="/static/web/js/bootstrap.min.js"></script>
- <script src="/static/web/js/moment.min.js"></script>
- <script src="/static/web/js/daterangepicker.js"></script>
- <script src="/static/web/js/admin.main.js"></script>
- <script>
- var i = 1;
- function AddItem() {
- i++;
- if (i > 15) {
- ShowMsg("最多添加15个选项");
- return;
- }
- var htmldata = "<div class='my-2'>选项" + i + ":<input type='text' name='voteitem" + i + "' class='admin-input-lg'></div>";
- jQuery("#voteitem").append(htmldata);
- }
- function ResetItem() {
- i = 1;
- var obj = document.getElementById("voteitem");
- obj.innerHTML = "<div class='my-2'>选项1:<input type='text' name='voteitem1' class='admin-input-lg'></div>";
- }
- </script>
- </head>
- <body>
- <div class="container-fluid">
- <ol class="breadcrumb">
- <li class="breadcrumb-item"><a href="index_body.php">后台面板</a></li>
- <li class="breadcrumb-item"><a href="vote_main.php">投票管理</a></li>
- <li class="breadcrumb-item active">添加投票</li>
- </ol>
- <div class="card shadow-sm">
- <div class="card-header">添加投票</div>
- <div class="card-body">
- <form name="form1" action="vote_add.php" method="post">
- <input type="hidden" name="dopost" value="save">
- <input type="hidden" name="isarc" value="<?php echo $isarc;?>">
- <input type="hidden" name="_csrf_token" value="<?php echo $GLOBALS['csrf_token'];?>">
- <div class="table-responsive">
- <table class="table table-borderless">
- <tbody>
- <tr>
- <td width="260">投票名称</td>
- <td><input type="text" name="votename" id="votename" class="admin-input-lg" required></td>
- </tr>
- <tr>
- <td>开始时间</td>
- <td><input type="text" name="starttime" id="starttime" value="<?php echo $startDay?>" class="admin-input-lg dateico datepicker1"></td>
- </tr>
- <tr>
- <td>结束时间</td>
- <td><input type="text" name="endtime" id="endtime" value="<?php echo $endDay?>" class="admin-input-lg dateico datepicker1"></td>
- </tr>
- <tr>
- <td>是否允许游客投票</td>
- <td>
- <label><input type="radio" name="isallow" value="0"> 是</label>
- <label><input type="radio" name="isallow" value="1" checked> 否</label>
- </td>
- </tr>
- <tr>
- <td>是否允许查看投票</td>
- <td>
- <label><input type="radio" name="view" value="0"> 是</label>
- <label><input type="radio" name="view" value="1" checked> 否</label>
- </td>
- </tr>
- <tr>
- <td>投票时间间隔</td>
- <td><input type="text" name="spec" class="admin-input-lg">(N天后可再次投票,0表示此ip地址只能投一次)</td>
- </tr>
- <tr>
- <td>是否多选</td>
- <td>
- <label><input type="radio" name="ismore" value="0" checked> 单选</label>
- <label><input type="radio" name="ismore" value="1"> 多选</label>
- </td>
- </tr>
- <tr>
- <td>投票项</td>
- <td>
- <button type="button" name="bbb" class="btn btn-success btn-sm" onclick="AddItem();">添加</button>
- <button type="button" name="bbb2" class="btn btn-outline-success btn-sm" onclick="ResetItem();">重置</button>
- </td>
- </tr>
- <tr>
- <td></td>
- <td>
- <div id="voteitem">选项1:<input type="text" name="voteitem1" id="voteitem1" class="admin-input-lg"></div>
- </td>
- </tr>
- <tr>
- <td>是否启用</td>
- <td>
- <label><input type="radio" name="isenable" value="0" checked> 是</label>
- <label><input type="radio" name="isenable" value="1"> 否</label>
- </td>
- </tr>
- <tr>
- <td colspan="2" align="center">
- <button type="submit" class="btn btn-success btn-sm">保存</button>
- <button type="reset" class="btn btn-outline-success btn-sm">重置</button>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- </form>
- </div>
- </div>
- </div>
- <script>
- $(document).ready(function() {
- $('.datepicker1').daterangepicker({
- "singleDatePicker": true,
- "autoApply": true,
- "showDropdowns": true,
- "linkedCalendars": false,
- "timePicker": true,
- "timePicker24Hour": true,
- "showCustomRangeLabel": false,
- ranges: {
- '今日': [moment(), moment()],
- '昨日': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
- '本月': [moment().startOf('month'), moment().startOf('month')],
- '上月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').startOf('month')]
- },
- "locale": {
- format: 'YYYY-MM-DD HH:mm',
- applyLabel: '确定',
- cancelLabel: '取消',
- daysOfWeek: ['日', '一', '二', '三', '四', '五', '六'],
- monthNames: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
- firstDay: 1
- }
- }, function(start) {
- $(this).val(start.format("YYYY-MM-DD HH:mm"));
- });
- });
- </script>
- </body>
- </html>
|