Advertisement
Guest User

Untitled

a guest
May 18th, 2017
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <%
  2. ' global variables
  3. dim strDesc
  4. dim ucost
  5. dim strSKU
  6. dim iQty
  7.  
  8. sub initGlobals()
  9.     ucost = 0
  10.     strDesc = ""   
  11.     strSKU = ""
  12.     iQty = 0
  13.     end sub
  14.    
  15. function getsku()
  16.     dim  adoCon
  17.     dim rs
  18.     dim strSQL
  19.    
  20.     set adoCon =  Server.CreateObject("ADODB.Connection")
  21.     adoCon.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("dbInventory.mdb")
  22.     set rs = Server.CreateObject("ADODB.Recordset")
  23.     strSKU = request("txtSKU")
  24.     strSQL =  "SELECT * FROM tblSKU WHERE SKU='"+request("txtSKU")+"'"
  25.     rs.open strsql, adoCon
  26.     initGlobals()
  27.     if not rs.eof then
  28.         ucost = rs("UCOST")
  29.         strDesc = rs("Desc")
  30.         strSKU = rs("SKU")
  31.         iQty = request("txtQty")
  32.         rs.close
  33.     end if
  34.     set rs = nothing
  35.     set adoCon = nothing
  36. end function
  37. call getsku()
  38. %>
  39. <html>
  40. <head>
  41. <style>
  42. th, td {
  43. border:black solid 1px;
  44. font-size:14pt;
  45. };
  46. input {
  47. border:0;
  48. color:white;
  49. background-color:grey;
  50. width:100%;
  51. font-size:14pt;
  52. text-align:left;
  53. };
  54. .btn {
  55. border:0;
  56. color:white;
  57. background-color:black;
  58. text-align:center;
  59. vertical-align:middle;
  60. font-size:18pt;
  61. margin-top:0;
  62. margin-bottom:0;
  63. }
  64. </style>
  65.  
  66. <script type="text/vbs">
  67. </script>
  68. </head>
  69. <!--Create a form to access the database.
  70. There will be 2 input boxes, one for the SKU number and one for quantity.
  71. There will be 3 output boxes, one for the Description, one for the Subtotal
  72. (price x quantity), and one for the Total Cost (a sales tax of 7% added to the subtotal).
  73. There will be 1 button to retrieve the data and display the result (Description, Subtotal and Total Cost). -->
  74. <body>
  75. <div style="width:100%">
  76. <form id="frmPOS" style="width:100%">
  77. <center>
  78. <table style="width:50%;border:black solid 1px;margin-left:auto;margin-right:auto">
  79. <cols style="width:30%;">
  80. <cols style="width:35%;">
  81. <cols style="width:35%;">
  82. <tr>
  83. <th>SKU</th>
  84. <th>Quantity</th>
  85. <td style="background-color:black;" rowspan="3"><input class="btn"  type="submit" id="btnRecord" value = "Total" /></td>
  86. </tr>
  87. <tr>
  88. <td><input type="text" id="txtSKU"  name="txtSKU" value="<%=strSKU%>"/></td>
  89. <td><input type="text" id="txtQty"    name="txtQty"    value="<%=cstr(iQty)%>"/></td>
  90. </tr>
  91. <tr>
  92. <th>Description</th>
  93. <th>Sub-Total</th>
  94. </td>
  95. </tr>
  96. <tr>
  97. <td><input  type="text" id="Desc" value="<%=strDesc%>"/></td>
  98. <td><input  type="text" id="SubTotal" value="<%=cstr(iQty * ucost)%>" /></td>
  99. <td><input  style="text-align:right;font-size:150%" type="text" id="Total" value="<%=FormatCurrency(cstr(iQty * ucost * 1.07))%>" /></td>
  100. </tr>
  101. </table>
  102. </center>
  103. </form>
  104. </div>
  105. </body>
  106. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement