{js:my97date}

<div class="headbar">
	<div class="position"><span>营销</span><span>></span><span>代金券管理</span><span>></span><span>{if:isset($this->ticketRow['id'])}编辑{else:}添加{/if}代金券</span></div>
</div>
<div class="content_box">
	<div class="content form_content">
		<form action="{url:/market/ticket_edit_act}" name='ticket_edit'  method="post">
			<input type='hidden' name='id' />
			<table class="form_table">
				<col width="150px" />
				<col />
				<tr>
					<th>代金券名称：</th>
					<td>
						<input type='text' name='name' class='normal' pattern='required' alt='请填写代金券名称' />
						<label>* 请为此组代金券命名</label>
					</td>
				</tr>
				<tr>
					<th>代金券面额：</th>
					<td><input type='text' class='small' pattern='float' alt='必须填写数字' name='value' />元<label>* 请填写此组代金券所能抵销的金额</label></td>
				</tr>
				<tr>
					<th>有效时间段：</th>
					<td>
						<input type='text' name='start_time' class='Wdate' pattern='datetime' readonly=true onFocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" alt='请填写一个日期' /> ～
						<input type='text' name='end_time' class='Wdate' pattern='datetime' readonly=true onFocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" alt='请填写一个日期' />
						<label>* 此组代金券的使用时间段</label>
					</td>
				</tr>
				<tr>
					<th>兑换所需积分：</th>
					<td><input type='text' class='small' pattern='int' empty alt='必须填写数字' name='point' /><label>设置兑换此代金券所需要的用户积分，如果为空或0则表示此优惠券不支持积分兑换，只支持管理员动手生成</label></td>
				</tr>
				<tr><td></td><td><button class="submit" type='submit'><span>确 定</span></button></td></tr>
			</table>
		</form>
	</div>
</div>

<script type='text/javascript'>
	//表单回填
	var formObj = new Form('ticket_edit');
	formObj.init
	({
		'id':'{$this->ticketRow['id']}',
		'name':'{$this->ticketRow['name']}',
		'start_time':'{$this->ticketRow['start_time']}',
		'end_time':'{$this->ticketRow['end_time']}',
		'value':'{$this->ticketRow['value']}',
		'point':'{$this->ticketRow['point']}'
	});

	//当修改操作时禁止修改金额
	if($('[name="id"]').val())
	{
		$('[name="value"]').attr('readonly',true);
		$('[name="value"]').css('background','#bbb');
	}
</script>