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.

153 lines
3.8 KiB

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