Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%
- dim strDesc
- dim ucost
- dim strSKU
- dim iQty
- function getsku()
- dim adoCon
- dim rs
- dim strSQL
- set adoCon = Server.CreateObject("ADODB.Connection")
- adoCon.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("dbInventory.mdb")
- set rs = Server.CreateObject("ADODB.Recordset")
- strSKU = request("txtSKU")
- strSQL = "SELECT * FROM tblSKU WHERE SKU='"+request("txtSKU")+"'"
- rs.open strsql, adoCon
- ucost = 0
- strDesc = ""
- if not rs.eof then
- ucost = rs("UCOST")
- strDesc = rs("Desc")
- strSKU = rs("SKU")
- iQty = request("txtQty")
- rs.close
- end if
- set rs = nothing
- set adoCon = nothing
- end function
- call getsku()
- %>
- <html>
- <head>
- <style>
- th, td {
- border:black solid 1px;
- font-size:14pt;
- };
- input {
- border:0;
- color:white;
- background-color:grey;
- width:100%;
- font-size:14pt;
- text-align:left;
- };
- .btn {
- border:0;
- color:white;
- background-color:black;
- text-align:center;
- vertical-align:middle;
- font-size:18pt;
- margin-top:0;
- margin-bottom:0;
- }
- </style>
- <script type="text/vbs">
- </script>
- </head>
- <!--Create a form to access the database.
- There will be 2 input boxes, one for the SKU number and one for quantity.
- There will be 3 output boxes, one for the Description, one for the Subtotal
- (price x quantity), and one for the Total Cost (a sales tax of 7% added to the subtotal).
- There will be 1 button to retrieve the data and display the result (Description, Subtotal and Total Cost). -->
- <body>
- <div style="width:100%">
- <form id="frmPOS" style="width:100%">
- <center>
- <table style="width:50%;border:black solid 1px;margin-left:auto;margin-right:auto">
- <cols style="width:30%;">
- <cols style="width:35%;">
- <cols style="width:35%;">
- <tr>
- <th>SKU</th>
- <th>Quantity</th>
- <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>
- </tr>
- <tr>
- <td><input type="text" id="txtSKU" name="txtSKU" value="<%=strSKU%>"/></td>
- <td><input type="text" id="txtQty" name="txtQty" value="<%=cstr(iQty)%>"/></td>
- </tr>
- <tr>
- <th>Description</th>
- <th>Sub-Total</th>
- </td>
- </tr>
- <tr>
- <td><input type="text" id="Desc" value="<%=strDesc%>"/></td>
- <td><input type="text" id="SubTotal" value="<%=cstr(iQty * ucost)%>" /></td>
- <td><input style="text-align:right;font-size:150%" type="text" id="Total" value="<%=FormatCurrency(cstr(iQty * ucost * 1.07))%>" /></td>
- </tr>
- </table>
- </center>
- </form>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement