PageRenderTime 26ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 0ms

/LN/m008e0803.asp

http://github.com/boss2009/ASP-site
ASP | 178 lines | 170 code | 8 blank | 0 comment | 22 complexity | af219003ba2bdfb79c1208aff889515c MD5 | raw file
  1. <%@language="JAVASCRIPT"%>
  2. <!--#include file="../inc/ASPUtility.inc" -->
  3. <!--#include file="../inc/ASPCheckLogin.inc" -->
  4. <!--#include file="../Connections/cnnASP02.asp" -->
  5. <%
  6. var MM_editAction = Request.ServerVariables("URL");
  7. if (Request.QueryString) {
  8. MM_editAction += "?" + Request.QueryString;
  9. }
  10. var rsLoanDetail = Server.CreateObject("ADODB.Recordset");
  11. rsLoanDetail.ActiveConnection = MM_cnnASP02_STRING;
  12. rsLoanDetail.Source = "{call dbo.cp_loan_request2("+ Request.QueryString("intLoan_Req_id") + ",0,0,0,0,'',0,'',0,0,0,0,0,0,0,'',0,0,1,0,'',1,'Q',0)}";
  13. rsLoanDetail.CursorType = 0;
  14. rsLoanDetail.CursorLocation = 2;
  15. rsLoanDetail.LockType = 3;
  16. rsLoanDetail.Open();
  17. var rsLoan = Server.CreateObject("ADODB.Recordset");
  18. rsLoan.ActiveConnection = MM_cnnASP02_STRING;
  19. rsLoan.Source = "{call dbo.cp_get_loan_ship_name("+ Request.QueryString("intLoan_Req_id") + ",0)}";
  20. rsLoan.CursorType = 0;
  21. rsLoan.CursorLocation = 2;
  22. rsLoan.LockType = 3;
  23. rsLoan.Open();
  24. var intBOShip_dtl_id = 0;
  25. if (!rsLoan.EOF) {
  26. if (rsLoanDetail.Fields.Item("intBOShip_dtl_id").Value != null) intBOShip_dtl_id = rsLoanDetail.Fields.Item("intBOShip_dtl_id").Value;
  27. }
  28. if (String(Request("MM_action")) == "update") {
  29. var rsUpdateSchedule = Server.CreateObject("ADODB.Recordset");
  30. rsUpdateSchedule.ActiveConnection = MM_cnnASP02_STRING;
  31. rsUpdateSchedule.Source = "{call dbo.cp_loan_ship_schedule("+Request.Form("MM_recordId")+","+Request.Form("DeliveryOnSchedule")+","+Request.Form("DeliveryStatus")+","+Request.Form("Shipper")+",'"+Trim(Request.Form("ShipperPhoneAreaCode"))+"','"+Trim(Request.Form("ShipperPhoneNumber"))+"','"+Trim(Request.Form("ShipperPhoneExtension"))+"','E',0)}";
  32. rsUpdateSchedule.CursorType = 0;
  33. rsUpdateSchedule.CursorLocation = 2;
  34. rsUpdateSchedule.LockType = 3;
  35. rsUpdateSchedule.Open();
  36. }
  37. var rsShippingSchedule = Server.CreateObject("ADODB.Recordset");
  38. rsShippingSchedule.ActiveConnection = MM_cnnASP02_STRING;
  39. rsShippingSchedule.Source = "{call dbo.cp_loan_ship_schedule("+intBOShip_dtl_id+",0,0,0,'','','','Q',0)}";
  40. rsShippingSchedule.CursorType = 0;
  41. rsShippingSchedule.CursorLocation = 2;
  42. rsShippingSchedule.LockType = 3;
  43. rsShippingSchedule.Open();
  44. var rsStaff = Server.CreateObject("ADODB.Recordset");
  45. rsStaff.ActiveConnection = MM_cnnASP02_STRING;
  46. rsStaff.Source = "{call dbo.cp_ASP_lkup(10)}";
  47. rsStaff.CursorType = 0;
  48. rsStaff.CursorLocation = 2;
  49. rsStaff.LockType = 3;
  50. rsStaff.Open();
  51. %>
  52. <html>
  53. <head>
  54. <title>Backorder Shipping Schedule</title>
  55. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  56. <link rel="stylesheet" href="../css/MyStyle.css" type="text/css">
  57. <script language="Javascript" src="../js/MyFunctions.js"></script>
  58. <script for="document" event="onkeyup()" language="JavaScript">
  59. if (window.event.ctrlKey) {
  60. switch (window.event.keyCode) {
  61. case 83 :
  62. //alert("S");
  63. Save();
  64. break;
  65. case 76 :
  66. //alert("L");
  67. window.location.href='m008e0801.asp?intLoan_Req_id=<%=Request.QueryString("intLoan_Req_id")%>';
  68. break;
  69. }
  70. }
  71. </script>
  72. <script language="Javascript">
  73. function Init(){
  74. <%
  75. if (!rsShippingSchedule.EOF) {
  76. %>
  77. if (document.frm0803.DeliveryOnSchedule.value=="0") {
  78. document.frm0803.DeliveryStatus.style.visibility = "visible";
  79. } else {
  80. document.frm0803.DeliveryStatus.style.visibility = "hidden";
  81. }
  82. document.frm0803.ScheduledArrivalDate.focus();
  83. <%
  84. }
  85. %>
  86. }
  87. function ChangeDeliveryStatus(){
  88. if (document.frm0803.DeliveryOnSchedule.value=="0") {
  89. document.frm0803.DeliveryStatus.style.visibility = "visible";
  90. document.frm0803.DeliveryStatus.value="1";
  91. } else {
  92. document.frm0803.DeliveryStatus.style.visibility = "hidden";
  93. }
  94. }
  95. function Save(){
  96. document.frm0803.submit();
  97. }
  98. </script>
  99. </head>
  100. <body onLoad="Init();">
  101. <form action="<%=MM_editAction%>" method="POST" name="frm0803">
  102. <h5>Backorder Shipping Schedule</h5>
  103. <hr>
  104. <%
  105. if (rsShippingSchedule.EOF) {
  106. %>
  107. <i>Please go to Method page and save first, before entering shipping schedule.</i>
  108. <%
  109. } else {
  110. %>
  111. <table cellpadding="1" cellspacing="1">
  112. <tr>
  113. <td nowrap>Scheduled Arrival Date:</td>
  114. <td nowrap>
  115. <input type="text" name="ScheduledArrivalDate" value="<%=FilterDate(rsShippingSchedule.Fields.Item("dtsSch_Arv_date").Value)%>" size="11" maxlength="10" readonly style="border: none" tabindex="1" accesskey="F" onChange="FormatDate(this)">
  116. <!-- <span style="font-size: 7pt">(mm/dd/yyyy)</span>-->
  117. </td>
  118. </tr>
  119. <tr>
  120. <td nowrap>Delivery on Schedule:</td>
  121. <td nowrap>
  122. <select name="DeliveryOnSchedule" tabindex="2" onChange="ChangeDeliveryStatus();">
  123. <option value="1" <%=((rsShippingSchedule.Fields.Item("bitIsDlvy_onshdl").Value == "1")?"SELECTED":"")%>>Yes
  124. <option value="0" <%=((rsShippingSchedule.Fields.Item("bitIsDlvy_onshdl").Value != "1")?"SELECTED":"")%>>No
  125. </select>
  126. <select name="DeliveryStatus" tabindex="3">
  127. <option value="1" <%=((rsShippingSchedule.Fields.Item("bitIsDlvy_delay").Value == "1")?"SELECTED":"")%>>Delay
  128. <option value="0" <%=((rsShippingSchedule.Fields.Item("bitIsDlvy_delay").Value != "1")?"SELECTED":"")%>>Delivery Resolved
  129. </select>
  130. </td>
  131. </tr>
  132. <tr>
  133. <td nowrap>Shipper:</td>
  134. <td nowrap><select name="Shipper" tabindex="4" accesskey="L">
  135. <%
  136. var staffid = Session("insStaff_id");
  137. if (rsShippingSchedule.Fields.Item("insMail_Staff_id").Value != null) staffid = rsShippingSchedule.Fields.Item("insMail_Staff_id").Value;
  138. while (!rsStaff.EOF) {
  139. %>
  140. <option value="<%=(rsStaff.Fields.Item("insStaff_id").Value)%>" <%=((rsStaff.Fields.Item("insStaff_id").Value==staffid)?"SELECTED":"")%>><%=(rsStaff.Fields.Item("chvName").Value)%></option>
  141. <%
  142. rsStaff.MoveNext();
  143. }
  144. %>
  145. </select></td>
  146. </tr>
  147. </table>
  148. <hr>
  149. <table cellpadding="1" cellspacing="1">
  150. <tr>
  151. <td><input type="button" value="Save" tabindex="5" onClick="Save();" class="btnstyle"></td>
  152. <td><input type="button" value="Close" tabindex="6" onClick="window.location.href='m008e0801.asp?intLoan_req_id=<%=Request.QueryString("intLoan_req_id")%>';" class="btnstyle"></td>
  153. </tr>
  154. </table>
  155. <input type="hidden name="ShipperPhoneAreaCode" value="<%=rsShippingSchedule.Fields.Item("chvMSPhone_Arcd").value%>">
  156. <input type="hidden" name="ShipperPhoneNumber" value="<%=(rsShippingSchedule.Fields.Item("chvMSPhone_Num").Value)%>">
  157. <input type="hidden" name="ShipperPhoneExtension" value="<%=(rsShippingSchedule.Fields.Item("chvMSPhone_Ext").Value)%>">
  158. <%
  159. }
  160. %>
  161. <input type="hidden" name="MM_action" value="update">
  162. <input type="hidden" name="MM_recordId" value="<%=intBOShip_dtl_id%>">
  163. </form>
  164. </body>
  165. </html>
  166. <%
  167. rsLoan.Close();
  168. rsShippingSchedule.Close();
  169. rsStaff.Close();
  170. %>