<!DOCTYPE html>
<html>
<head>
  <meta charset="<?php echo $cfg_soft_lang; ?>">
  <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
  <title>会员管理-积分头衔设置</title>
  <script src="../static/web/js/jquery.min.js"></script>
  <script src="js/main.js"></script>
  <script>
    function CheckAll(form, prefix, checkall) {
      var checkall = checkall ? checkall : 'chkall';
      for (var i = 0; i < form.elements.length; i++) {
        var e = form.elements[i];
        if (e.name && e.name != checkall && (!prefix || (prefix && e.name.match(prefix)))) {
          e.checked = form.elements[checkall].checked;
        }
      }
    }
  </script>
  <link rel="stylesheet" href="../static/web/css/bootstrap.min.css">
  <link rel="stylesheet" href="../static/web/font/css/font-awesome.min.css">
  <link rel="stylesheet" href="../static/web/css/admin.css">
</head>
<body>
  <form action="member_scores.php" method="post">
    <input name="action" type="hidden" value="save">
    <table width="98%" cellpadding="1" cellspacing="1" align="center" class="tbtitle mt-3 mb-3" style="border:1px solid #dee2e6;border-bottom:0">
      <tr>
        <td width="100%" height="26" background="../static/web/img/tbg.gif" style="padding-left:10px"><a href="member_main.php">会员管理</a> &gt; 积分头衔设置</td>
      </tr>
    </table>
    <table width="98%" cellpadding="1" cellspacing="1" align="center" class="table maintable">
      <tr>
        <td width="6%" align="center" valign="middle" bgcolor="#FEFCEF">
          <input type="checkbox" name="chkall" id="chkall" onClick="CheckAll(this.form)" class='np'>
          删</td>
        <td width="23%" align="center" bgcolor="#FEFCEF">积分大于</td>
        <td width="30%" align="center" bgcolor="#FEFCEF">星星数</td>
        <td width="23%" align="center" bgcolor="#FEFCEF">级别头衔</td>
        <td width="30%" align="center" bgcolor="#FEFCEF">是否默认</td>
      </tr>
      <?php
		  foreach($Scores as $v){	
		  ?>
      <tr onmousemove="javascript:this.bgColor='#F8FCF1';" onmouseout="javascript:this.bgColor='#ffffff';">
        <td align="center"><input name="Ids-<?php echo $v['id']?>" type="checkbox" id="Ids-<?php echo $v['id']?>" value="1" class='np'></td>
        <td align="center"><input name="integral-<?php echo $v['id']?>" type="text" id="integral-<?php echo $v['id']?>" value="<?php echo $v['integral']?>" style="width:160px"></td>
        <td align="center"><input name="icon-<?php echo $v['id']?>" type="text" id="icon-<?php echo $v['id']?>" value="<?php echo $v['icon']?>" style="width:60px"></td>
        <td align="center"><input name="titles-<?php echo $v['id']?>" type="text" id="titles-<?php echo $v['id']?>" value="<?php echo $v['titles']?>" style="width:160px"></td>
        <td align="center">
          <select name="isdefault-<?php echo $v['id']?>" id="isdefault-<?php echo $v['id']?>">
            <option value="1" <?php if($v['isdefault']) echo " selected='selected'"; ?>>是</option>
            <option value="0" <?php if(!$v['isdefault']) echo " selected='selected'"; ?>>否</option>
          </select>
        </td>
      </tr>
      <?php
		  }
		  ?>
      <tr>
        <td>新增：</td>
        <td align="center"><input name="add_integral" type="text" id="add_integral" style="width:160px"></td>
        <td align="center"><input name="add_icon" type="text" id="add_icon" style="width:60px"></td>
        <td align="center"><input name="add_titles" type="text" id="add_titles" style="width:160px"></td>
        <td align="center">
          <select name="add_isdefault" id="add_isdefault">
            <option value="1">是</option>
            <option value="0">否</option>
          </select>
        </td>
      </tr>
      <tr>
        <td colspan="5" align="center" class="py-3">
          <button type="submit" class="btn btn-success btn-sm">提交</button>
        </td>
      </tr>
    </table>
  </form>
</body>
</html>