<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $cfg_soft_lang; ?>">
  <title>投票管理</title>
  <link rel="stylesheet" href="../static/css/bootstrap.min.css">
  <link rel="stylesheet" href="../static/font-awesome/css/font-awesome.min.css">
  <link rel="stylesheet" href="css/base.css">
  <link href="../static/css/daterangepicker.css" rel="stylesheet">
  <script language="javascript" src="../static/js/jquery.js"></script>
  <script language="javascript" src="../static/js/bootstrap.bundle.js"></script>
  <script language="javascript" src="js/main.js"></script>
  <script type="text/javascript" src="../static/js/moment.min.js"></script>
  <script type="text/javascript" src="../static/js/daterangepicker.js"></script>
  <script language="javascript">
    $(document).ready(function () {
      $('.datepicker1').daterangepicker({
        "singleDatePicker": true,
        "autoApply": true,
        "showDropdowns": true,
        "linkedCalendars": false,
        "timePicker": true,
        "timePicker24Hour": true,
        //"timePickerSeconds": 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>
</head>
<body background='images/allbg.gif' leftmargin='8' topmargin='8'>
  <table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#D6D6D6" class="table maintable table-bordered mt-3">
    <tr>
      <td height="26" background="images/tbg.gif" style="padding-left:10px"><a href="vote_main.php"><b>投票管理</b></a> &gt;&gt; 增加投票&nbsp;&nbsp;</td>
    </tr>
    <tr>
      <td height="200" bgcolor="#FFFFFF" valign="top">
        <form name="form1" method="post" action="vote_edit.php">
          <input type="hidden" name="dopost" value="saveedit">
          <input type="hidden" name="aid" value="<?php echo $aid?>">
          <input type="hidden" name="_csrf_token" value="<?php echo $GLOBALS['csrf_token'];?>">
          <table width="100%" border="0" cellspacing="4" cellpadding="4" class="table table-borderless">
            <tr>
              <td width="15%" align="center">投票名称：</td>
              <td width="85%"> <input name="votename" type="text" id="votename" value="<?php echo $row['votename']?>">
              </td>
            </tr>
            <tr>
              <td align="center">投票总人数：</td>
              <td><input name="totalcount" type="text" id="totalcount" value="<?php echo $row['totalcount']?>"></td>
            </tr>
            <tr>
              <td align="center">开始时间：</td>
              <td><input class="datepicker1" name="starttime" type="text" id="starttime" value="<?php echo GetDateMk($row['starttime'])?>"></td>
            </tr>
            <tr>
              <td align="center">结束时间：</td>
              <td><input class="datepicker1" name="endtime" type="text" id="endtime" value="<?php echo GetDateMk($row['endtime'])?>"></td>
            </tr>
            <tr>
              <td align="center">是否允许游客投票：</td>
              <td> <label><input name="isallow" type="radio" class="np" value="0"
                  <?php if($row['isallow']==0) echo " checked"; ?>>
                是</label> 　
                <label><input type="radio" name="isallow" class="np" value="1"
                  <?php if($row['isallow']==1) echo " checked"; ?>>
                否</label></td>
            </tr>
            <tr>
              <td align="center">是否允许查看投票：</td>
              <td> <label><input name="view" type="radio" class="np" value="0" <?php if($row['view']==0) echo " checked"; ?>>
                是</label> 　
                <label><input type="radio" name="view" class="np" value="1" <?php if($row['view']==1) echo " checked"; ?>>
                否</label></td>
            </tr>
            <tr>
              <td align="center">投票时间间隔：</td>
              <td><input name="spec" type="text" value="<?php echo $row['spec'] ?>" class="spec">
                (N天后可再次投票，0 表示此IP地址只能投一次)</td>
            </tr>
            <tr>
              <td align="center">是否多选：</td>
              <td> <label><input name="ismore" type="radio" class="np" value="0"
                  <?php if($row['ismore']==0) echo " checked";?>>
                单选</label>
                <label><input type="radio" name="ismore" class="np" value="1" <?php if($row['ismore']==1) echo " checked";?>>
                多选</label> </td>
            </tr>
            <tr>
              <td align="center">投 票 项：<br>
                (请按相同的形式来增加或修改节点，其中属性：id不能重复) </td>
              <td><textarea name="votenote" rows="8" id="votenote" style="width:80%"><?php echo $row['votenote']?></textarea>
              </td>
            </tr>
            <tr>
              <td align="center">是否启用：</td>
              <td> 
                <label><input name="isenable" type="radio" class="np" value="0"
                  <?php if($row['isenable']==0) echo " checked"; ?>>
                是</label> 　
                <label><input type="radio" name="isenable" class="np" value="1"
                  <?php if($row['isenable']==1) echo " checked"; ?>>
                否</label></td>
            </tr>
            <tr>
              <td height="36">&nbsp;</td>
              <td>
                <button type="submit" name="Submit" class="btn btn-success">保存投票数据</button>
                <button type="button" onclick="history.back()" name="Submit" class="btn btn-success">返回</button>
              </td>
            </tr>
            <tr>
              <td colspan="2">&nbsp;</td>
            </tr>
          </table>
        </form>
      </td>
    </tr>
  </table>
</body>
</html>