<!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>
<title>vodcms.com</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link href="../../images/admin/public.css" rel="stylesheet" type="text/css" />
<link href="../../images/admin/style.css" rel="stylesheet" type="text/css" />
<link href="<?php echo $this->basedir;?>images/admin/public.css" rel="stylesheet" type="text/css" />
<link href="<?php echo $this->basedir;?>images/admin/style.css" rel="stylesheet" type="text/css" />
<script src="<?php echo $this->basedir;?>js/jquery.js" language="javascript"></script>
<script language="javascript">
function show(v){
	if (v == 0){
		$('#pt').show();
		$('#lifetime').hide();
	}else if(v == 1){
		$('#lifetime').show();
		$('#pt').hide();
	}else{
		$('#pt').hide();
		$('#lifetime').hide();
	}
}
function checkSubmit(){
	var obj = document.form1;
	if (obj.usertype.value == 'all'){
		alert('请选择消费类型!');
		obj.usertype.focus();
		return false;
	}
	if (obj.usergroup.value == 'all'){
		alert('请选择权限组!');
		obj.usergroup.focus();
		return false;
	}
	if (obj.usertype.value == 1){
		var day = obj.days.value;
		var re  = /(\d+)/g;
		if (!re.exec(day)){
			alert('请填写观看时间!必须为数字!');
			return false;
		}
	}else{
		var point = parseInt(obj.point.value);
		var re = /(\d+)/g;
		if (!re.exec(point)){
			alert('请填写点数!必须为数字!');
			return false;
		}
	}
	return  true;
}
</script>
<body>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
  <tr align="center" valign="top">
    <td width="*" align="center" valign="top">
	<!-- ######### begin ######### -->
      <div class="Block">
        <div class="BlockBar">设置购买商品价格</div>
        <table cellspacing="1" cellpadding="4" class="tab">
		<form id="form1" name="form1" method="post" action="<?php echo $this->installdir;?>case/modify/" onsubmit="return checkSubmit();">
			   <tr class="row">
				<td width="14%" class="align-right">消费类型：</td>
				<td><select name="usertype" onchange="show(this.value)">
                  <option value="all">请选择消费类型</option>
                  <option value="1" <?php if ($this->modify['usertype'] == 1) echo 'selected="selected"';?> >包月</option>
                  <option value="0" <?php if ($this->modify['usertype'] == 0) echo 'selected="selected"';?> >计点</option>
                </select></td>
			  </tr>
			   <tr class="row">
			     <td class="align-right">权限组：</td>
			     <td><select name="usergroup" id="usergroup">
			       <option value="all">请选择用户组</option><?php echo $this->usergroup;?>
			       </select>			     </td>
	        </tr>
			<tr class="row <?php echo $this->modify['usertype'] ? 'None' : '';?>" id="pt">
			     <td class="align-right">点数：</td>
			     <td><input name="point" type="text" id="point" value="<?php echo $this->modify['point'];?>" />
			     点</td>
	        </tr>
			<tr class="row <?php echo $this->modify['usertype'] ? '' : 'None';?>" id="lifetime">
			     <td class="align-right">观看时间：</td>
			     <td><input name="days" type="text" id="days" value="<?php echo $this->modify['days'];?>" /> 
			     天</td>
	        </tr>
			   <tr class="row">
			     <td class="align-right">价格：</td>
			     <td><input name="money" type="text" id="money" value="<?php echo $this->modify['money'];?>" />
		         *单位元</td>
	        </tr>
			   <tr class="row">
			     <td class="align-right">描述：</td>
			     <td><textarea name="content" cols="50" rows="3" id="content"><?php echo $this->modify['content'];?></textarea></td>
	        </tr>
			   <tr class="row">
			     <td class="align-right">推荐人送点：</td>
			     <td><input name="recommend" type="text" id="recommend" value="<?php echo $this->modify['recommend'];?>" /></td>
	        </tr>
			   <tr class="row">
			     <td class="align-right">&nbsp;</td>
			     <td><input type="submit" class="btn" value=" 修  改 " />&nbsp;<input type="button" class="btn" value=" 返回上一页 " onclick="history.back()" /></td>
	        </tr>
			<input type="hidden" name="id" value="<?php echo $this->modify['id'];?>" />
        </form>
        </table>
      </div>
      <div id="App-Version-Prompt" style="display:none;">
        <div class="space"></div>
        <div class="Block">
          <div class="BlockBar">版本更新信息</div>
          <div class="BlockContent" id="App-Version-Prompt-Body" style="padding:20px 5px 20px 5px; text-align:center; background:#FFFFCC;">loading...</div>
        </div>
      </div>
      <!-- ########## end ########## -->
    </td>
    <td width="5"></td>
    <td width="150" align="center" valign="top">
    <?php
	echo $this->render('menu');
	?>
     </td>
  </tr>
</table>
<?php
echo $this->render('copyright');
?>
</body>
</html>

