Advertisement
Guest User

Untitled

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