Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

154 lines
3.8 KiB

  1. <%@LANGUAGE=JScript CODEPAGE=1252 %>
  2. <html>
  3. <head>
  4. <TITLE>Add/Edit Contact</TITLE>
  5. <!-- #INCLUDE FILE='Global_ServerUtils.asp' -->
  6. <!-- #INCLUDE FILE='Global_DBUtils.asp' -->
  7. <link rel="stylesheet" TYPE="text/css" HREF="/main.css">
  8. <link rel="stylesheet" TYPE="text/css" HREF="/CustomStyles.css">
  9. <meta http-equiv="Content-Type" CONTENT="text/html; charset=iso-8859-1" />
  10. </head>
  11. <body bgcolor='#ffffff' topmargin='0' leftmargin='0' marginheight='0' marginwidth='0' tabindex=0>
  12. <%
  13. var bNewItem = false
  14. var ProductID = new Number( Request.QueryString("Val") )
  15. var ProductName = Request.Form( "ProductName" )
  16. var RecordAction = Request.Form( "RecordAction" )
  17. var rsProductData
  18. if ( -1 == ProductID )
  19. bNewItem = true
  20. g_DBConn = GetDBConnection( Application("SOLUTIONS3") )
  21. if ( String( RecordAction ) != "undefined" )
  22. {
  23. try
  24. {
  25. var ProductID = Request.Form("ProductID")
  26. var Query = "SEP_SetProductData " + ProductID + ",'" + ProductName + "'"
  27. var rsResults = g_DBConn.Execute( Query )
  28. //g_DBConn.close()
  29. Response.Write("<script language=javascript>window.parent.frames(\"sepLeftNav\").document.location.reload()</script>")
  30. var ProductID = new Number( rsResults("ProductID") )
  31. bNewItem=false //trick it into thinking that there is a new record
  32. }
  33. catch ( err )
  34. {
  35. Response.Write( "Could not execute SEP_SetProductData(...)<BR>" )
  36. Response.Write( "Query: " + Query + "<BR>" )
  37. Response.Write( "[" + err.number + "] " + err.description )
  38. Response.End
  39. }
  40. }
  41. else
  42. RecordAction = 0
  43. //Response.Write("Record Action: " + RecordAction +"<BR>" )
  44. if ( String(ProductID) != "undefined" && bNewItem == false )
  45. {
  46. if ( ProductID != 0 )
  47. {
  48. try
  49. {
  50. rsProductData = g_DBConn.Execute( "SEP_GetProductData " + ProductID )
  51. ProductName = new String( rsProductData("ProductName") )
  52. g_DBConn.Close()
  53. }
  54. catch ( err )
  55. {
  56. Response.Write( "Could not execute SEP_GetProductData(...)<BR>" )
  57. Response.Write( "[" + err.number + "] " + err.description )
  58. Response.End
  59. }
  60. }
  61. else
  62. bNewItem=true
  63. }
  64. else
  65. bNewItem=true
  66. //if bNewTemplate is true then create a new template
  67. if ( bNewItem )
  68. {
  69. ProductName = "New Product"
  70. ProductID=-1
  71. }
  72. %>
  73. <SCRIPT LANGUAGE=Javascript>
  74. if ( <%=RecordAction%> )
  75. window.close()
  76. function SubmitForm()
  77. {
  78. if ( frmProduct.ProductName.value == "" || frmProduct.ProductName.value == "New Product" )
  79. {
  80. alert("You must enter a product name")
  81. return
  82. }
  83. frmProduct.submit()
  84. }
  85. function fnUpdate()
  86. {
  87. ProductID = window.parent.frames("sepLeftNav").document.getElementsByName( "ProductID" ).ProductID.value
  88. window.location = "http://<%=g_ServerName%>/SEP_EditProduct.asp?Val=" + ProductID
  89. }
  90. </SCRIPT>
  91. <FORM ID=frmProduct ACTION="SEP_EditProduct.asp" METHOD=POST>
  92. <INPUT TYPE=HIDDEN VALUE="1" NAME="RecordAction">
  93. <INPUT TYPE=HIDDEN ID=ProductID NAME=ProductID READONLY VALUE=<%=ProductID%>>
  94. <table width='50%'>
  95. <tr>
  96. <td>
  97. <p class='clsPTitle'>Edit/Add Product Information</p>
  98. </td>
  99. </tr>
  100. <tr>
  101. <td>
  102. <table class="clsTableInfo" border="0" cellpadding="2" cellspacing="0" style='border:1px solid #6681d9;'>
  103. <tr>
  104. <td align="left" nowrap class="clsTDInfo">
  105. Product
  106. </td>
  107. </tr>
  108. <tr>
  109. <td class='sys-table-cell-bgcolor1'>Product Name</td>
  110. <td class='sys-table-cell-bgcolor1'>
  111. <input class='clsResponseInput2' ID=ProductName NAME=ProductName TYPE=TEXT MAXLENGTH=32 SIZE=32 VALUE="<%=ProductName%>" >
  112. </td>
  113. </tr>
  114. <tr>
  115. <td>
  116. <INPUT class='clsButton' type='button' value='Submit' OnClick="SubmitForm()">
  117. </td>
  118. </tr>
  119. </table>
  120. </td>
  121. </tr>
  122. </table>
  123. </form>
  124. </BODY>
  125. </HTML>