Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Desk Order System
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Desk Order System

 Post Reply Post Reply
Author
ngaisteve1 View Drop Down
Groupie
Groupie
Avatar

Joined: 26 December 2002
Location: Malaysia
Status: Offline
Points: 169
Post Options Post Options   Thanks (0) Thanks(0)   Quote ngaisteve1 Quote  Post ReplyReply Direct Link To This Post Topic: Desk Order System
    Posted: 14 January 2004 at 8:50pm

I have a very complicated (for me) logic to think of at this time.

This system is production system (my new project, started a week ago). One of the module is desk order system. The logic is

desk_order: desk_order_id
desk_order_details: desk_order_detail_id, model_id, desk_order_id
model: model_id, desk_order_id

Pseudocode

select * from model
if not eof then
  do while not eof
    select * from desk_order_details where model_id = strModelID (above)
    if not eof then
      do while not eof
        display desk order details record
        next
      loop
    end if
  next
  loop
end if


Actually, I have no problem if I were to either to display all records in group like above and seperate data entry page but the complicated area is combining both in one page. [view my attachment]

When I click Add Item, the empty field should appear in that model_id, not all, which is my current problem at this time.

My code is below (Sorry, if it's too long):

[code]

<%
set rs_model = Server.CreateObject("ADODB.recordset")
sql = "SELECT * FROM model"
sql = sql & " WHERE desk_order_id = " & session("sDeskOrderID") & " "
rs_model.CursorLocation = 3
rs_model.Open sql, conn

if not rs_model.eof then
  Do While not rs_model.eof
    strModelID = rs_model("model_id")
    strModelGName = rs_model("model_g_name")
    strModelCode = rs_model("model_code")
    %>
    <form name=myform action="deskorder_add_3.asp" method=post>
    <tr>
      <td colspan=11><br>Model general name: <%=strModelGName%>
      [ <a href="" class=content>Edit</a>
      | <a href="" class=content>Delete</a>
      | <a href="deskorder_add_3_form.asp?passModelID=<%=strModelID% >&passAddItem=Y" class=content>Add item</a> ]
     </td>
    </tr>
    <tr><td colspan=11>Model code: <%=strModelCode%></td></tr>
    <%
    set rs_desk_order_d = Server.CreateObject("ADODB.recordset")
    sql = "SELECT * FROM desk_order_details"
    sql = sql & " WHERE desk_order_id = " & session("sDeskOrderID") & " "
    sql = sql & " AND model_id = " & strModelID & " "
    rs_desk_order_d.CursorLocation = 3
    rs_desk_order_d.Open sql, conn

    if not rs_desk_order_d.eof then
      DO while not rs_desk_order_d.eof
        %>
        <tr valign=top>
          <td><%=rs_desk_order_d("model_size")%></td> ; ;
          <td><%=rs_desk_order_d("model_size_d")%></td& amp; gt;
          <td><%=rs_desk_order_d("deduction")%></td>
          <td><%=rs_desk_order_d("clr")%></td>
          <td align=right><%=rs_desk_order_d("qty")%></td>
          <td align=right><%=formatnumber(rs_desk_order_d("customer_ price"),2)%></td>
          <%
          if rs_desk_order_d("qty") > 0 then
             strCPrice = rs_desk_order_d("customer_price") * rs_desk_order_d("qty")
          else
             strCPrice = 0
          end if
          %>
          <td align=right><%=formatnumber(strCPrice,2)%></td&a mp;g t;
          <td align=right><%=formatnumber(rs_desk_order_d("factory_p rice"),2)%></td>
          <%
          if rs_desk_order_d("qty") > 0 then
             strFPrice = rs_desk_order_d("factory_price") * rs_desk_order_d("qty")
          else
             strFPrice = 0
          end if
          %>
          <td align=right><%=formatnumber(strFPrice,2)%></td&a mp;g t;
          <td><%=rs_desk_order_d("price_factor")%></td& amp; gt;
          <td>[ <a href="" class=content>Edit</a> | <a href="" class=content>X</a> ]</td>
        </tr>
        <%
        strTQty = strTQty + rs_desk_order_d("qty")
        strTCPrice = cdbl(strTCPrice) + cdbl(strCPrice)
        strTFPrice = cdbl(strTFPrice) + cdbl(strFPrice)
        'if there is at least one record already exist in that model id.
        modelIDtmp = request.querystring("passModelID")
        strPassAddItem = request.querystring("passAddItem")
        if strPassAddItem = "Y" and strmodelID = modelIDtmp then
          %>
          <tr valign=top>
             <td>
               <input type=text name=model_size_fr>
          

Back to Top
ngaisteve1 View Drop Down
Groupie
Groupie
Avatar

Joined: 26 December 2002
Location: Malaysia
Status: Offline
Points: 169
Post Options Post Options   Thanks (0) Thanks(0)   Quote ngaisteve1 Quote  Post ReplyReply Direct Link To This Post Posted: 15 January 2004 at 10:22pm
It's ok guys. I managed to solve it already. Hurray.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.