<!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">
	</head>
	<body>
		<form name="form1" action="member_type.php" method="post">
			<input type="hidden" name="dopost" value="save">
			<table class="table shadow-sm my-3">
				<tr>
					<td colspan="5">会员等级分类</td>
				</tr>
				<tr>
					<td width="26%" align="center">产品名称</td>
					<td width="16%" align="center">会员级别</td>
					<td width="16%" align="center">产品价格（元）</td>
					<td width="16%" align="center">会员期限(天)</td>
					<td align="center">状态</td>
				</tr>
				<?php
				$dsql->SetQuery("SELECT * FROM `#@__member_type`");
				$dsql->Execute();
				$k=0;
				while($row = $dsql->GetObject())
				{
				$k++;
				?>
				<input type="hidden" name="ID_<?php echo $k?>" value="<?php echo $row->aid?>">
				<tr align="center">
					<td><input type="text" name="pname_<?php echo $k?>" value="<?php echo $row->pname?>" id="pname_<?php echo $k?>" class="admin-input-lg"></td>
					<td>
						<select name="rank_<?php echo $k?>" id="rank_<?php echo $k?>" class="admin-input-sm">
							<?php
							foreach($arcranks as $kkk=>$vvv){
								if ($row->rank==$kkk) echo "<option value='{$kkk}' selected>{$vvv}</option>";
								else echo "<option value='{$kkk}'>{$vvv}</option>";
							}
							?>
						</select>
					</td>
					<td><input type="text" name="money_<?php echo $k?>" value="<?php echo $row->money?>" id="money_<?php echo $k?>" class="admin-input-sm"></td>
					<td>
						<select name="exptime_<?php echo $k?>" id="exptime_<?php echo $k?>" class="admin-input-sm">
							<?php
							foreach($times as $kkk=>$vvv){
								if ($row->exptime==$kkk) echo "<option value='{$kkk}' selected>{$vvv}</option>";
								else echo "<option value='{$kkk}'>{$vvv}</option>";
							}
							?>
						</select>
					</td>
					<td><input type="checkbox" name="check_<?php echo $k?>" id="check_<?php echo $k?>" value="1" checked> 保留</td>
				</tr>
				<?php }?>
				<input type="hidden" name="idend" value="<?php echo $k?>">
				<tr align="center">
					<td><input type="text" name="pname_new" id="pname_new" class="admin-input-lg"></td>
					<td>
						<select name="rank_new" id="rank_new" class="admin-input-sm">
							<?php
							foreach($arcranks as $kkk=>$vvv){
								echo "<option value='{$kkk}'>{$vvv}</option>";
							}
							?>
						</select>
					</td>
					<td><input type="text" name="money_new" id="money_new" class="admin-input-sm" value="100"></td>
					<td>
						<select name="exptime_new" id="exptime_new" class="admin-input-sm">
							<?php
							foreach($times as $kkk=>$vvv){
								echo "<option value='{$kkk}'>{$vvv}</option>";
							}
							?>
						</select>
					</td>
					<td align="center"><input type="checkbox" name="check_new" id="check_new" value="1" checked> 新增</td>
				</tr>
				<tr>
					<td colspan="5" align="center"><button type="submit" class="btn btn-success btn-sm">保存</button></td>
				</tr>
			</table>
		</form>
	</body>
</html>