ChangePrize_AddEdit.asp
上传用户:jisenq
上传日期:2014-06-29
资源大小:7216k
文件大小:7k
源码类别:

数据库编程

开发平台:

ASP/ASPX

  1. <% Option Explicit %>
  2. <!--#include file="../../FS_Inc/Const.asp" -->
  3. <!--#include file="../../FS_InterFace/MF_Function.asp" -->
  4. <!--#include file="../../FS_Inc/Function.asp" -->
  5. <%
  6. 'on error resume next
  7. Dim Conn,User_Conn,PrizeID,ChangePrizeRs,prizeDesc,PrizeName,needPoint,PrizePic,storage,startDate,endDate,provider,perUserNum
  8. Dim i,str_CurrPath
  9. '************************************Update
  10. if Request.QueryString("Act")="editprize" then
  11. PrizeID=NoSqlHack(Request.QueryString("PrizeID"))
  12. MF_Default_Conn
  13. MF_User_Conn
  14. MF_Session_TF
  15. if not MF_Check_Pop_TF("ME_award") then Err_Show 
  16. Set ChangePrizeRs=Server.CreateObject(G_FS_RS)
  17. ChangePrizeRs.open "select prizeID,PrizeName,prizeDesc,PrizePic,NeedPoint,storage,StartDate,EndDate,provider,perUserNum from FS_ME_Prize where prizeID="&NoSqlHack(Request.QueryString("prizeid")),User_Conn,1,1
  18. if not ChangePrizeRs.eof then
  19. PrizeName=ChangePrizeRs("PrizeName")
  20. needPoint=ChangePrizeRs("needPoint")
  21. PrizePic=ChangePrizeRs("PrizePic")
  22. startDate=ChangePrizeRs("startDate")
  23. endDate=ChangePrizeRs("endDate")
  24. prizeDesc=ChangePrizeRs("prizeDesc")
  25. storage=ChangePrizeRs("storage")
  26. provider=ChangePrizeRs("provider")
  27. perUserNum=ChangePrizeRs("perUserNum")
  28. end if
  29. elseif Request.QueryString("Act")="add" then
  30.  startDate=datevalue(Now())
  31.  needPoint=0
  32. end if
  33. str_CurrPath = Replace("/"&G_VIRTUAL_ROOT_DIR &"/"&G_USERFILES_DIR&"/"&Session("FS_UserNumber"),"//","/")
  34. %>
  35. <html xmlns="http://www.w3.org/1999/xhtml">
  36. <HEAD>
  37. <TITLE>FoosunCMS</TITLE>
  38. <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
  39. </HEAD>
  40. <script language="JavaScript" src="../../FS_Inc/PublicJS.js" type="text/JavaScript"></script>
  41. <script language="JavaScript" src="lib/UserJS.js" type="text/JavaScript"></script>
  42. <script language="javascript" src="../../FS_Inc/prototype.js"></script>
  43. <link href="../images/skin/Css_<%=Session("Admin_Style_Num")%>/<%=Session("Admin_Style_Num")%>.css" rel="stylesheet" type="text/css">
  44. <BODY LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 scroll=yes  oncontextmenu="return false;"> 
  45. <%
  46. if NoSqlHack(Request.QueryString("act"))="editprize" then
  47. Response.Write("<form name='PrizePanel' id='PrizePanel' method='post' action='awardAction.asp?act=editPrizeaction&Prizeid="&NoSqlHack(Request.QueryString("Prizeid"))&"'>")
  48. else
  49. Response.Write("<form name='PrizePanel' id='PrizePanel' method='post' action='awardAction.asp?act=addPrizeaction'>")
  50. end if
  51. %>
  52. <table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table"> 
  53.   <tr class="hback">
  54.     <td align="right" class="xingmu" colspan="2"><div align="left">奖品项目设置&nbsp;&nbsp;| &nbsp;<a href="#" onClick="history.back()">后退</a></div></td></tr> 
  55.         <tr class="hback"> 
  56.           <td align="right">兑换物品:</td> 
  57.           <td> <input name="PrizeName" type="text" id="PrizeName" size="50" value="<%=PrizeName%>"/><font color="#FF0000">*</font><span id="PrizeName_Alert"></span></td> 
  58.         </tr> 
  59.       
  60. <tr class="hback">
  61.     <td align="right">需要积分: </td>
  62.     <td><input name="needpoint" type="text" id="needpoint" size="50" value="<%=needPoint%>"  onKeyUp="if(isNaN(value)||event.keyCode==32)execCommand('undo')"  onafterpaste="if(isNaN(value)||event.keyCode==32)execCommand('undo')"><font color="#FF0000">*</font><span id="needpoint_Alert"></span>
  63.     </td>
  64.   </tr>
  65. <tr class="hback">
  66.   <td align="right">物品说明:</td>
  67.   <td><textarea name="PrizeDesc" cols="60" rows="10" id="PrizeDesc"><%=prizeDesc%></textarea></td>
  68. </tr>
  69. <tr class="hback">
  70.     <td align="right">主题图片:</td>
  71.     <td><input name="PrizePic" type="Text" id="PrizePic" size="50" value="<%=PrizePic%>" maxlength="120" ><button onClick="javascript:OpenWindowAndSetValue('../CommPages/SelectManageDir/SelectPic.asp?CurrPath=<% = str_CurrPath %>&f_UserNumber=<% = session("FS_UserNumber")%>',500,320,window,$('PrizePic'));">选择图片</button>
  72.     <span id="UpfileSize_Alert"></span></td>
  73.   </tr>
  74. <tr class="hback">
  75.   <td align="right">物品数量:</td>
  76.   <td><input name="storage" type="text" id="storage" value="<%=storage%>" size="50"  onKeyUp="if(isNaN(value)||event.keyCode==32)execCommand('undo')"  onafterpaste="if(isNaN(value)||event.keyCode==32)execCommand('undo')"><span id="storage_alert"></span></td>
  77. </tr>
  78. <tr class="hback">
  79.   <td align="right">每人兑换限量:</td>
  80.   <td><input name="perUserNum" type="text" id="perUserNum" value="<%=perUserNum%>" size="50"  onKeyUp="if(isNaN(value)||event.keyCode==32)execCommand('undo')"  onafterpaste="if(isNaN(value)||event.keyCode==32)execCommand('undo')"><span id="perUserNum_alert"></span><span id="isRight_alert"></span></td>
  81. </tr>
  82. <tr class="hback">
  83.   <td align="right">物品提供组织:</td>
  84.   <td><input name="provider" type="text" id="provider" value="<%=provider%>" size="50"></td>
  85. </tr>
  86.       <tr class="hback"> 
  87.           <td align="right">开始日期:</td> 
  88.           <td><input name="startDate" type="text" id="startDate" value="<%if Request.QueryString("act")="editprize" then response.Write(startDate) else Response.Write(Datevalue(Now()))%>" size="50" readonly="true"><button onClick="OpenWindowAndSetValue('../CommPages/SelectDate.asp',280,120,window,document.PrizePanel.startDate);document.PrizePanel.startDate.focus();">选择时间</button><font color="#FF0000">*</font><span id="startDate_Alert"></span></td> 
  89.   </tr>
  90.         <tr class="hback">
  91.           <td align="right">截止日期:</td>
  92.           <td><input name="EndDate" type="text" id="EndDate" value="<%=endDate%>" size="50" readonly="true"><button onClick="OpenWindowAndSetValue('../CommPages/SelectDate.asp',280,120,window,document.PrizePanel.EndDate);document.PrizePanel.EndDate.focus();">选择时间</button><font color="#FF0000">*</font><span id="EndDate_Alert"></span></td>
  93.         </tr>
  94.         <tr class="hback">
  95.           <td align="right">&nbsp;</td>
  96.           <td><input type="button" name="Submit" value="保存" onClick="ADDEditPrize()">
  97. &nbsp;          <input type="reset" name="Submit2" value="重置"></td>
  98.         </tr>
  99. </table> 
  100. </form>
  101. </body>
  102. <%
  103. if Request.QueryString("Act")="eidtPrize" then
  104. ChangePrizeRs.close
  105. set ChangePrizeRs=nothing
  106. Conn.close
  107. Set Conn=nothing
  108. User_Conn.close
  109. Set User_Conn=nothing
  110. Set prizeRs=nothing
  111. end if
  112. %>
  113. <script language="JavaScript" type="text/JavaScript">
  114. <!--
  115. function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  116.   if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
  117.     document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  118.   else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
  119. }
  120. MM_reloadPage(true);
  121. //-->
  122. function ADDEditPrize()
  123. {
  124. var flag1=isEmpty("PrizeName","PrizeName_Alert");
  125. var flag2=isEmpty("needpoint","needpoint_Alert");
  126. var flag3=isNumber("needpoint","needpoint_Alert","积分应该为正整数",true);
  127. var flag4=isEmpty("storage","storage_alert");
  128. var flag5=isNumber("storage","storage_Alert","物品数量应该为正整数",true);
  129. var flag6=isEmpty("perUserNum","perUserNum_alert");
  130. var flag7=isNumber("perUserNum","perUserNum_alert","物品数量应该为正整数",true);
  131. var flag8=isEmpty("startDate","startDate_Alert");
  132. var flag9=isEmpty("EndDate","EndDate_Alert");
  133. var flag10=isNumber('needpoint','needpoint_Alert','积分应该为正整数',true);
  134. if(flag1&&flag2&&flag3&&flag4&&flag5&&flag6&&flag7&&flag8&&flag9&&flag10)
  135. {
  136. document.PrizePanel.submit();
  137. }
  138. }
  139. </script>
  140. </html>