<!--#include file="../include/Conn.jsp"-->
<!--#include file="Admin_IsLogin.jsp" -->
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="Images/Style.css" rel="stylesheet" type="text/css">
</head>
<body>
<%
	admin_flag=",0|18|0,"
	if instr(session("flag"),admin_flag)=0 or isnull(session("flag"))=true then
	Response.write "<br><br><br><br><b><font color=red>对不起，您没有管理本页面的权限!</font></B>"
	Response.end
	end if
%>
<form name="myform" method="post" action="SaveAward.jsp?action=edit&id=<%=request("id")%>" OnSubmit="return checkkk()" >
  <%dim rs1
set rs1=server.CreateObject("adodb.recordset")
rs1.open "select * from T_jp where jpid="&request("id"),conn,1,1%>
  <table cellpadding="3" cellspacing="1" border="0" width="100%" class="tableBorder" align=center>
    <tr> 
      <th class="tableHeaderText" colspan=2>修改奖品</th>
    </tr>
    <tr> 
      <td width="30%" align="right" class="forumRowHighlight">奖品名称： </td>
      <td width="70%"  class="forumRowHighlight"> <input name="jpname" type="text" id="jpname" size="30" value="<%=trim(rs1("jpname"))%>"> 
      </td>
    </tr>
    <tr> 
      <td class="forumRowHighlight" align="right">&nbsp; </td>
      <td class="forumRowHighlight">　　　所需积分 
        <input name="point" type="text" id="point" size="6" onKeyPress	= "return regInput(this,	/^\d*\.?\d{0,2}$/,		String.fromCharCode(event.keyCode))" 
		onpaste		= "return regInput(this,	/^\d*\.?\d{0,2}$/,		window.clipboardData.getData('Text'))"
		ondrop		= "return regInput(this,	/^\d*\.?\d{0,2}$/,		event.dataTransfer.getData('Text'))" value="<%=trim(rs1("point"))%>"> 
      </td>
    </tr>
    <tr> 
      <td align="right" class="forumRowHighlight">奖品数量： </td>
      <td class="forumRowHighlight">奖品数量 
        <input name="count" type="text" id="count" size="6" onKeyPress	= "return regInput(this,	/^\d*\.?\d{0,2}$/,		String.fromCharCode(event.keyCode))" 
		onpaste		= "return regInput(this,	/^\d*\.?\d{0,2}$/,		window.clipboardData.getData('Text'))"
		ondrop		= "return regInput(this,	/^\d*\.?\d{0,2}$/,		event.dataTransfer.getData('Text'))" value="<%=trim(rs1("count"))%>" 
      </td>
    </tr>
    <tr> 
      <td class="forumRowHighlight"align="right">奖品说明： </td>
      <td class="forumRowHighlight"> <textarea name="jpcontent" cols="46" rows="8" id="jpcontent"><%=trim(rs1("jpcontent"))%></textarea> 
      </td>
    </tr>
    <tr> 
      <td class="forumRowHighlight" colspan="2"> <div align="center"> 
          <input name="xianshi" type="checkbox" id="xianshi" value="1" <%if rs1("xianshi")=1 then%>checked<%end if%>>
          显示（不选为隐藏） 
          <input class=button type="submit" name="Submit" value="修 改">
        </div></td>
    </tr>
  </table>
  <%rs1.close
		set rs1=nothing%>
</form>

</body>
</html>

<SCRIPT LANGUAGE="JavaScript">
<!--
function checkkk()
{
     if(checkspace(document.myform.bookname.value)) {
	document.myform.jpname.focus();
    alert("请输入奖品名称！");
	return false;
  }
     if(checkspace(document.myform.point.value)) {
	document.myform.point.focus();
    alert("请输入所需金币！");
	return false;
  }
       if(checkspace(document.myform.count.value)) {
	document.myform.count.focus();
    alert("请输入奖品数量！");
	return false;
  }
}
function checkspace(checkstr) {
  var str = '';
  for(i = 0; i < checkstr.length; i++) {
    str = str + ' ';
  }
  return (str == checkstr);
}
//-->
</script>
<script>
	function regInput(obj, reg, inputStr)
	{
		var docSel	= document.selection.createRange()
		if (docSel.parentElement().tagName != "INPUT")	return false
		oSel = docSel.duplicate()
		oSel.text = ""
		var srcRange	= obj.createTextRange()
		oSel.setEndPoint("StartToStart", srcRange)
		var str = oSel.text + inputStr + srcRange.text.substr(oSel.text.length)
		return reg.test(str)
	}
</script>
