Avatar billede badman1 Nybegynder
20. maj 2002 - 11:10 Der er 13 kommentarer

hente felt fra db og sende via jmail

hej
har et problem
sidder og roder med noget eshop
og har lavet det sådan så oplysniger på kuden bliver sendt til admin, men vil også se gerne have sendt ordren med via jmail så admin kan se hvad der er bestilt hvordan gøres det

det er de her ting jeg gerne vil have sendt med

rsItem("orderID") = intOrderID
rsItem("productID") = itemInfo(0)
rsItem("quantity") = itemInfo(1)

kan ikke lige finde ud af hvordan det kan gøres
da man jo ikke bare kan skrive selve feltnavnet det kommer der ikek noget ud af
Avatar billede rxftp Nybegynder
20. maj 2002 - 11:13 #1
øøh? er det ikke bare at sætte et mail script ind før/efter du indsætter i din DB? Du skal jo bare bryge de samme variabler du brugte i DB'en?
Avatar billede medions Nybegynder
20. maj 2002 - 11:13 #2
<%
Set JMail = Server.CreateObject("JMail.SMTPMail")
JMail.ContentType = "text/html"
JMail.ServerAddress = "mail.domain.dk"
JMail.Priority = 1
JMail.Sender = "afsender@email.adr"
JMail.AddRecipientEx "modtager@email.adr", "Modtagers navn"
Jmail.AddRecipientCC "andenmodtager@email.adr"
Jmail.AddRecipientBCC "skjultmodtager@email.adr"
JMail.Subject = "Sååå er der post!"
JMail.Body = intOrderID & vbCrLf & itemInfo(0) & vbCrLf & itemInfo(1)
JMail.Execute
Set JMail = Nothing

//>Rune
%>
Avatar billede medions Nybegynder
20. maj 2002 - 11:14 #3
Denne skal indsættes der hvor du vil ha' det sendt! -husk lige at rette scriptet til dine egne oplysninger!

//>Rune
Avatar billede badman1 Nybegynder
20. maj 2002 - 12:16 #4
det virkede ikke det med at skrive intOrderID & vbCrLf & itemInfo(0) & vbCrLf & itemInfo(1)
det skrev jeg jo også i den sidste linie af mit indlæg :)
hvis jeg bruger
JMail.Body = intOrderID & vbCrLf & itemInfo(0) & vbCrLf & itemInfo(1)
skriver den bare
31
69
1
og det passer ikke :)
er der nogen som har andre forslag
Avatar billede badman1 Nybegynder
20. maj 2002 - 12:17 #5
oglige til info
så virkede det med oplysningerne for kunden de bliver sendt
Avatar billede medions Nybegynder
20. maj 2002 - 12:21 #6
jamen så er det jo fordi du har givet os forkerte oplysninger...! - der hvor du vil ha' det du modtager med mail, skal stå under .Body, og så må du jo selv kende til dine variabler hvad de hedder og hvad de indeholder!

//>Rune
Avatar billede badman1 Nybegynder
20. maj 2002 - 19:38 #7
ja ok
der gik vist lige kludder i det :)
prøver lige igen

det er dem her jeg gerne vil have sendt via jmail

intProdID = rsProd("productID")
                strProdName = rsProdInfo("productdesc")
                intPrice = formatNumber(rsProdInfo("productPrice"), 2)
                intQuant = rsProd("quantity")
                intExtPrice = formatNumber((intPrice * intQuant), 2)
                intTotal = intTotal + intExtPrice

men de ligge i checkout.asp
og jmail ligger i validateorder.asp
men af en aller anden grund så bliver de variabler tomme når de bliver skrevet ud via mail  i validateorder.asp
ved så ikke om det kan have noget at gøre med at selve ordren bliver submittet i checkout.asp og det så måske er derfor at de varabler bliver tomme

jmail i validateorder.asp

Set JMail = Server.CreateObject("JMail.SMTPMail")
        JMail.ContentTransferEncoding = "8bit"
        JMail.Charset = "ISO-8859-1"
        JMail.Priority = 1
        JMail.ServerAddress = "mail.tiscali.dk"
        JMail.Sender = "email addy"
        JMail.Subject = "Ny ordre "
            JMail.Body = "Der er kommet en ny ordre " & vbCrLf & vbCrLf & strfirst & " " & strlast & vbCrLf & strAddress1 & vbCrLf & strAddress2 &  vbCrLf & strPostalCode & " " & strCity & vbCrLf & strPhone & vbCrLf & strEmail & vbCrLf & strShipMethod & vbCrLf
            JMail.Body = JMail.Body + vbCrLf & "Kundens ordre:" & vbCrLf  her skulle ordren så være
            JMail.AddRecipient request("ad1")
        ' Send it...
        JMail.Execute
        set JMail = nothing
Avatar billede rxftp Nybegynder
20. maj 2002 - 19:44 #8
ok.
Du submitter din form på checkout.asp som bliver sendt videre til validateorder.asp (Action="validateorder.asp"). På denne side henter du variablerne ud vha Request.Form (hvis du bruger post i din form) når du har dine variabler køre du dem bare ind i din DB og din Jmail Body... Så burde den være der?
Avatar billede badman1 Nybegynder
20. maj 2002 - 20:11 #9
det er kun ordren der bliver submittet til vilidateorder
i validateorder skal kunden så skrive navn osv

smider lige de 2 filer her

validateorder.asp

<%@ Language=VBScript %>
<%


%>
<% pageTitle = "Bekræft Ordre" %>
<!--#include file="adovbs.inc"-->
<!--#include file="db.asp"-->

<font face="Arial">
<%
'displays header on form field validation pages
function displayHeader()
    Response.Write "<html>"
    Response.Write "<head>"
    Response.Write "<body>"
    Response.Write "<table border='0'>"
    Response.Write "<tr>"
    Response.Write "<td valign='middle' nowrap>" 
    Response.Write "" & "<br><br>" 
    Response.Write ""
    Response.Write "</td>"
    Response.Write "</tr>"
    Response.Write "</table>"
    Response.Write "<hr color='#cccccc' size='1' noshade>"
    Response.Write "<div align = 'center'>"
end function

'Validate user entries in form fields and generate error pages
For Each key in Request.Form
        strName = key
        strValue = Request.Form(key)
        Session(strName) = strValue
    Next

    strFirst = Request.Form("strFirst")
    strLast = Request.Form("strLast")
    strEmail = Request.Form("strEmail")
    strAddress1 = Request.Form("strAddress1")
    strAddress2 = Request.Form("strAddress2")
    strCity = Request.Form("strCity")
    strPostalCode = Request.Form("strPostalCode")
    strCountry = Request.Form("strCountry")
    strPhone = Request.Form("strPhone")
    strShipFirst = Request.Form("strShipFirst")
    strShipLast = Request.Form("strShipLast")
    strShipAddress = Request.Form("strShipAddress")
    strShipCity = Request.Form("strShipCity")
    strShipPostalCode = Request.Form("strShipPostalCode")
    strShipCountry = Request.Form("strShipCountry")
    strShipMethod = Request.Form("strShipMethod")
    strCcType = Request.Form("strCcType")
    cctype = Request.Form("strCcType")
    strNameOnCc = Request.Form("strNameOnCc")
    dtmCcExpire = Request.Form("dtmCcExpire")
    strCcNumber = Request.Form("strCcNumber")
    number = Request.Form("strCcNumber")
    strCcBillAddress = Request.Form("strCcBillAddress")
   

If strFirst = "" then
    displayHeader()
    Response.Write "<font size='4'><b>" & "Indtast fornavn." & "</b><br><br>" & "<font size='2'>" & "Press your browser's " & "<b>back button</b> " & "to return to form." & "<br><br>"
    Response.Write "<hr color='#cccccc' size='1' noshade>"
    Response.End
end if
If strLast = "" then
    displayHeader()
    Response.Write "<font size='4'><b>" & "Indtast efternavn." & "</b><br><br>" & "<font size='2'>" & "Press your browser's " & "<b>back button</b> " & "to return to form." & "<br><br>"
    Response.Write "<hr color='#cccccc' size='1' noshade>"
    Response.End
end if
If strEmail = "" OR len(strEmail) <=7 then
    displayHeader()
    Response.Write "<font size='4'><b>" & "Indtast email addresse:  (navn@ditdomain.dk)." & "</b><br><br>" & "<font size='2'>" & "Press your browser's " & "<b>back button</b> " & "to return to form." & "<br><br>"
    Response.Write "<hr color='#cccccc' size='1' noshade>"
    Response.End
end if
If strEmail = "" Or instr(strEmail, "@") = 0 then
    displayHeader()
    Response.Write "<font size='4'><b>" & "Indtast email addresse:  (navn@dirDomain.dk)." & "</b><br><br>" & "<font size='2'>" & "Press your browser's " & "<b>back button</b> " & "to return to form." & "<br><br>"
    Response.Write "<hr color='#cccccc' size='1' noshade>"
    Response.End
end if
If strAddress1 = "" OR len(strAddress1) <=7 then
    displayHeader()
    Response.Write "<font size='4'><b>" & "Indtast adresse." & "</b><br><br>" & "<font size='2'>" & "Press your browser's " & "<b>back button</b> " & "to return to form." & "<br><br>"
    Response.Write "<hr color='#cccccc' size='1' noshade>"
    Response.End
end if
If strAddress2 = "" OR len(strAddress2) <2 then
    displayHeader()
    Response.Write "<font size='4'><b>" & "Indtast Adresse2 eller skriv NA." & "</b><br><br>" & "<font size='2'>" & "Press your browser's " & "<b>back button</b> " & "to return to form." & "<br><br>"
    Response.Write "<hr color='#cccccc' size='1' noshade>"
    Response.End
end if
If strCity = "" OR len(strCity) <=2 then
    displayHeader()
    Response.Write "<font size='4'><b>" & "Indtast By." & "</b><br><br>" & "<font size='2'>" & "Press your browser's " & "<b>back button</b> " & "to return to form." & "<br><br>"
    Response.Write "<hr color='#cccccc' size='1' noshade>"
    Response.End
end if
If strPostalCode = "" OR len(strPostalCode) <4 then
    displayHeader()
    Response.Write "<font size='4'><b>" & "Indtast postnr." & "</b><br><br>" & "<font size='2'>" & "Press your browser's " & "<b>back button</b> " & "to return to form." & "<br><br>"
    Response.Write "<hr color='#cccccc' size='1' noshade>"
    Response.End
end if
If strCountry = "" OR len(strCountry) <2 then
    displayHeader()
    Response.Write "<font size='4'><b>" & "Indtast land." & "</b><br><br>" & "<font size='2'>" & "Press your browser's " & "<b>back button</b> " & "to return to form." & "<br><br>"
    Response.Write "<hr color='#cccccc' size='1' noshade>"
    Response.End
end if
If strPhone = "" OR len(strPhone) <7 then
    displayHeader()
    Response.Write "<font size='4'><b>" & "Indtast telefonnr." & "</b><br><br>" & "<font size='2'>" & "Press your browser's " & "<b>back button</b> " & "to return to form." & "<br><br>"
    Response.Write "<hr color='#cccccc' size='1' noshade>"
    Response.End
end if

%>
</font>
<%
    set Conn = Server.CreateObject("ADODB.Connection")
    Conn.Open ConString
    ad1 = request("ad1")
    intOrderID = Request.form("intOrderID")

    set rsOrder = Server.CreateObject("ADODB.Recordset")
    rsOrder.Open "SELECT * FROM orders WHERE orderID = " _
        & intOrderID, Conn, adOpenStatic, adLockOptimistic, _
        adCmdText

    if rsOrder.EOF then
        Response.Write "Der er et problem med din ordre "
        Response.Write "Kontakt kundeservice."
    else

        rsOrder("sAmt") = Request.form("intShipping")
        rsOrder("tax") = Request.form("intTax")
        rsOrder("fName") = Request.form("strFirst")
        rsOrder("lName") = Request.form("strLast")
        rsOrder("email") = Request.form("strEmail")
        rsOrder("address1") = Request.form("strAddress1")
        rsOrder("address2") = Request.form("strAddress2")
        rsOrder("city") = Request.form("strCity")
        rsOrder("postalcode") = Request.form("strPostalCode")
        rsOrder("country") = Request.form("strCountry")
        rsOrder("phone") = Request.form("strPhone")
        rsOrder("sfName") = Request.form("strShipFirst")
        rsOrder("slName") = Request.form("strShipLast")
        rsOrder("sAddress") = Request.form("strShipAddress")
        rsOrder("sCity") = Request.form("strShipCity")
        rsOrder("sPostalcode") = Request.form("strShipPostalCode")
        rsOrder("sCountry") = Request.form("strShipCountry")
        rsOrder("total") = Request.form("intTotal")
        rsOrder("ccBillAddress") = Request.form("strCcBillAddress")
        rsOrder("orderDate") = Date
        rsOrder("status") = "COMPLETE"
        rsOrder.Update
       
        Conn.Execute("DELETE FROM itemsOrdered WHERE " _
            & "orderID = " & intOrderID)

        set rsItem = Server.CreateObject("ADODB.Recordset")
        rsItem.Open "itemsOrdered", Conn, adOpenStatic, adLockOptimistic, adCmdTable

        for each item in Request.form("strOrderItem")

            strOrderItem = cstr(item)
            itemInfo = split(strOrderItem, ",")

            rsItem.addNew
            rsItem("orderID") = intOrderID
            rsItem("productID") = itemInfo(0)
            rsItem("quantity") = itemInfo(1)
            rsItem.Update

        next
       
        rsItem.Close
        set rsItem = Nothing
       
        Session.abandon
       
    end if
    rsOrder.Close
    set rsOrder = Nothing

    Conn.Close
    set Conn = Nothing

Set JMail = Server.CreateObject("JMail.SMTPMail")
        JMail.ContentTransferEncoding = "8bit"
        JMail.Charset = "ISO-8859-1"
        JMail.Priority = 1
        JMail.ServerAddress = "mail.tiscali.dk"
        JMail.Sender = "info@badman.dk"
        JMail.Subject = "Ny ordre hos "
            JMail.Body = "Der er kommet en ny ordre " & vbCrLf & vbCrLf & strfirst & " " & strlast & vbCrLf & strAddress1 & vbCrLf & strAddress2 &  vbCrLf & strPostalCode & " " & strCity & vbCrLf & strPhone & vbCrLf & strEmail & vbCrLf & strShipMethod & vbCrLf
            JMail.Body = JMail.Body + vbCrLf & "Kundens ordre:" & vbCrLf &
            JMail.AddRecipient request("ad1")
        ' Send it...
        JMail.Execute
        set JMail = nothing
       
%>


<html>
<head>

<title><%= pageTitle %></title>
<style type="text/css">
<!--
a:link      { color: #808080 }
a:visited    { color: #808080 }
a:hover      { color: #ff9900 }
-->
</style>
</head>

<body bgcolor="#ffffff" topmargin="0" leftmargin="0" marginwidth="0" marginheight="0" text="#808080">
<basefont face="Verdana" size="2">
<table border="0" width="100%" cellpadding="4" cellspacing="1">
  <tr>
    <td valign="top" nowrap></td>
    <td valign="bottom" nowrap align="right"><font face="Verdana" size="1">&nbsp;</font></td>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="#FFFFFF">
  <tr>
    <td bgcolor="#666666" height="20" align="left" valign="middle" nowrap colspan="4">&nbsp;<font color="#FFFFFF" face="Verdana, Arial, Helvetica, sans-serif" size="1"><b><a style="color: #FFFFFF; text-decoration: none" href="http://www.studenterrbog.dk"><img src="images/icon.gif" border="0" align="middle" WIDTH="16" HEIGHT="16"> </a>&nbsp;|
      <b>&nbsp;<a href="default.asp" style="color:#FFFFFF;text-decoration:none;">Til forsiden</a>&nbsp;|
      &nbsp;<a href="mailto:info@" style="color:#FFFFFF;text-decoration:none;">Kundeservice</a>&nbsp;</b></font></td>
  </tr>
</table>
<hr color="#CCCCCC" size="1" noshade>
<table border="0" bgcolor="#FFFFFF" cellpadding="0" cellspacing="0" width="625">
  <tr>
    <td width="128" valign="top" align="center">
      <table border="0" cellspacing="4" cellpadding="4" width="125">
        <tr>
          <td width="128" bgcolor="#FFFFFF"><b><font color="#ff9900" size="3" face="Arial"><i>Shoppen
            </i></font></b><br>
            <br>
            <font face="Verdana" color="#808080" size="1">Vi håber du finder den bog eller bøger som du leder efter. Finder du ikke bogen er du velkommen til at kontakte os. På forhånd tak.
</font><br>
            <br>
            <br>
           
            <font face="Verdana" size="2" color="#808080"><a href="moreinfo.asp"><br>
            <b>Mere info</b><br>
            </a><a href="mailto:info@"><b>Kontakt os</b></a></font><br>
          </td>
        </tr>
      </table>
    <td width="1" bgcolor="#000000"><img src="images/spacer.gif" width="1" height="1" alt border="0"></td>
    <td align="center" valign="middle"><table border="0" cellspacing="4" cellpadding="4"><tr><td align="center">         
<font face="Arial" size="4"><b>       
Din ordre er modtaget<br> </font>

</td>
</tr>
</table>
</p>
<p><font face="Arial" size="4"><b>Tak fordi du handlede hos !</b></font></p>
    </td>
  </tr>
  </table>
  </td>
  </tr>
  </table>
      <hr color="#CCCCCC" size="1" noshade>
     
<table border="0" cellpadding="0" cellspacing="6" width="100%"> 
  <tr>
    <td colspan="3" valign="BOTTOM"><font face="Verdana, Arial, Helvetica" size="1">     
     
      Sidst opdateret: <!--webbot bot="Timestamp" s-type="EDITED" s-format="%A, %B %d, %Y" startspan -->Søndag, 24 februar 2002
<!--webbot bot="Timestamp" endspan i-checksum="49640" -->
      <br>
      </font></td>
  <td colspan="3" align="right" valign="TOP">&nbsp;
  </td>
  </tr>
</table>
</body>
</html>

checkout.asp

<%@ Language=VBScript %>
<% pageTitle = "Gå til kassen" %>
<!-- #include file="db.asp" -->
<!-- #include file="adovbs.inc" -->

<%


   
    set Conn = Server.CreateObject("ADODB.Connection")
    Conn.Open ConString

    if cstr(Session("orderID")) = "" then
%>

<html>
<head>

<title><%= pageTitle %></title>
<style type="text/css">
<!--
a:link      { color: #808080 }
a:visited    { color: #808080 }
a:hover      { color: #ff9900 }
-->
</style>
</head>
<body bgcolor="#ffffff" topmargin="0" leftmargin="0" marginwidth="0" marginheight="0" text="#808080">
<basefont face="Verdana" size="2">
<table border="0" width="100%" cellpadding="4" cellspacing="1">
  <tr>
   
    <td valign="bottom" nowrap align="right"><font face="Verdana" size="1">&nbsp;</font></td>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="#FFFFFF">
  <tr>
    <td bgcolor="#666666" height="20" align="left" valign="middle" nowrap colspan="4">&nbsp;<font color="#FFFFFF" face="Verdana, Arial, Helvetica, sans-serif" size="1"><b><a style="color: #FFFFFF; text-decoration: none" href="http://www./shop/"><img src="images/icon.gif" border="0" align="middle" WIDTH="16" HEIGHT="16"> </a>&nbsp;|
      <b>&nbsp;<a href="default.asp" style="color:#FFFFFF;text-decoration:none;">Til Forsiden</a>&nbsp;|
      &nbsp;<a href="mailto:shop@" style="color:#FFFFFF;text-decoration:none;">Kundeservice</a>&nbsp; |&nbsp;<a href="reviewOrder.asp" style="color:#FFFFFF;text-decoration:none;">Vis kurv</a></b> |&nbsp;<a href="search.asp" style="color:#FFFFFF;text-decoration:none;">
      Søg efter vare</a></b></font></td>
  </tr>
</table>
<hr color="#CCCCCC" size="1" noshade>
<table border="0" bgcolor="#FFFFFF" cellpadding="0" cellspacing="0" width="625">
  <tr>
    <td width="128" valign="top" align="center">
      <table border="0" cellspacing="4" cellpadding="4" width="125">
        <tr>
                  </tr>
      </table>
    <td width="1" bgcolor="#000000"><img src="images/spacer.gif" width="1" height="1" alt border="0"></td>
   
    <td align="center" valign="middle"><table border="0" cellspacing="4" cellpadding="4"><tr><td>         

<%
        Response.Write "<p><font face='Verdana' size='3'><b>"
        Response.Write "Der er ikke nogen ordre.  hvis du har tilføjet "
        Response.Write "produkter til din ordre før, "
        Response.Write "din session timet ud, skal du prøve igen.<br><br>"
        Response.Write "<a href='default.asp'>fortsæt med at handle</a>"
        Response.Write "<b></font></p>"
%>
</td>
  </tr>
  </table>       
</td>
  </tr>
  </table>
    <hr color="#CCCCCC" size="1" noshade>
     
<table border="0" cellpadding="0" cellspacing="6" width="100%"> 
  <tr>
    <td colspan="3" valign="BOTTOM"><font face="Verdana, Arial, Helvetica" size="1">     
     
      Sidst opdateret: <!--webbot bot="Timestamp" s-type="EDITED" s-format="%A, %B %d, %Y" startspan -->Mandag, 19 MAj 2002
<!--webbot bot="Timestamp" endspan i-checksum="49640" -->
     
      <br>
      Hosted by <a href="http://www.viborgnet.dk">Viborgnet</a>,
      ©2002 <a href="http://www./"></a><br>
      </font></td>
  <td colspan="3" align="right" valign="TOP">&nbsp;
  </td>
  </tr>
</table>
</body>
</html>
<% 
else
       
        intOrderID = cstr(Session("orderID"))

        set rsProd = Server.CreateObject("ADODB.Recordset")
        rsProd.Open "SELECT * FROM itemsOrdered " _
            & "WHERE orderID="& intOrderID, _
            Conn, adOpenDynamic, adLockPessimistic, adCmdText
        while not rsProd.EOF

            element = "quant" & rsProd("productID")
            intQuant = Request.form(element)

            if intQuant <> "" and isNumeric(intQuant) then
                if intQuant = 0 then
                    rsProd.Delete
                else
                    rsProd("quantity") = intQuant
                end if
            end if
            rsProd.Update
            rsProd.MoveNext
        wend

        if Request.form("control") = "Opdater Ordre" then

            rsProd.Close
            set rsProd = Nothing
   
            Conn.Close
            set Conn = Nothing

            Response.Redirect "reviewOrder.asp"
        else
       
        if rsProd.BOF and rsProd.EOF then
                rsProd.Close
                set rsProd = Nothing
           
                Conn.Close
                set Conn = Nothing
               
                Session("orderID") = ""
                Response.Redirect "checkout.asp"
           
        else
%>
<html>
<head>

<title><%= pageTitle %></title>
<script LANGUAGE="jscript">

</script>
<style type="text/css">
<!--
a:link      { color: #808080 }
a:visited    { color: #808080 }
a:hover      { color: #ff9900 }
-->
</style>
</head>
<body bgcolor="#ffffff" topmargin="0" leftmargin="0" marginwidth="0" marginheight="0" text="#808080">
<basefont face="Verdana" size="2">
<table border="0" width="100%" cellpadding="4" cellspacing="1">
  <tr>
    <td valign="top" nowrap></td>
    <td valign="bottom" nowrap align="right"><font face="Verdana" size="1">&nbsp;</font></td>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="#FFFFFF">
  <tr>
    <td bgcolor="#666666" height="20" align="left" valign="middle" nowrap colspan="4">&nbsp;<font color="#FFFFFF" face="Verdana, Arial, Helvetica, sans-serif" size="1"><b><a style="color: #FFFFFF; text-decoration: none" href="http://www./shop/"><img src="images/icon.gif" border="0" align="middle" WIDTH="16" HEIGHT="16"></a>&nbsp;|
      <b>&nbsp;<a href="default.asp" style="color:#FFFFFF;text-decoration:none;">Til forsiden</a>&nbsp;|
      &nbsp;<a href="mailto:info@" style="color:#FFFFFF;text-decoration:none;">Kundeservice
      </a>&nbsp; |&nbsp;<a href="reviewOrder.asp" style="color:#FFFFFF;text-decoration:none;">Vis
      kurv</a></b> |&nbsp;<a href="search.asp" style="color:#FFFFFF;text-decoration:none;">
      Søg efter vare.</a></b></font></td>
  </tr>
</table>
<hr color="#CCCCCC" size="1" noshade>
<table border="0" bgcolor="#FFFFFF" cellpadding="0" cellspacing="0" width="700">
  <tr>
    <td width="128" valign="top" align="center">
      <table border="0"  cellspacing="4" cellpadding="4" width="125" >
        <tr>
         
        </tr>
      </table>
   
   
    <p><font face="Verdana" size="4"><strong>Din Ordre</strong></font></p>
            <p><font face="Verdana" size="2">Hvis der er noget forkert, kan du
            <a href="reviewOrder.asp"><b>ændre din ordre</b></a>.</font></p>
            <p>
            <form action="validateOrder.asp" method="post" name="form">
            <input type="hidden" name="intOrderID" value="<%=intOrderID%>">
            <table border="0" cellpadding="3" cellspacing="3" width="100%">
            <tr bgcolor="#ff9900">
                <td width="15%" align="left" valign="middle" nowrap><font color="#FFFFFF" face="Verdana" size="2" style="background-color: #ff9900"><strong>Antal<strong></font></td>
                <td width="15%" align="left" valign="middle" nowrap><font color="#FFFFFF" face="Verdana" size="2" style="background-color: #ff9900"><strong>Produkt <strong></font></td>
                <td width="40%" align="left" valign="middle"><font color="#FFFFFF" face="Verdana" size="2" style="background-color: #ff9900"><strong>Beskrivelse<strong></font></td>
                <td width="15%" align="left" valign="middle" nowrap><font color="#FFFFFF" face="Verdana" size="2" style="background-color: #ff9900"><strong>Pris.<strong></font></td>
                <td width="15%" align="left" valign="middle" nowrap><font color="#FFFFFF" face="Verdana" size="2" style="background-color: #ff9900"><strong>Studiepris<strong></font></td>
            </tr>
<%
            set rsProdInfo = Server.CreateObject("ADODB.Recordset")
            rsProdInfo.Open "products", Conn, adOpenStatic, adLockOptimistic, adCmdTable

            intTotal = 0

            rsProd.MoveFirst
            while not rsProd.EOF
                rsProdInfo.MoveFirst
                rsProdInfo.Find "productID = " & rsProd("productID")
                intProdID = rsProd("productID")
                strProdName = rsProdInfo("productdesc")
                intPrice = formatNumber(rsProdInfo("productPrice"), 2)
                intQuant = rsProd("quantity")
                intExtPrice = formatNumber((intPrice * intQuant), 2)
                intTotal = intTotal + intExtPrice
%>
                <tr>
                    <td width="15%" align="left" valign="middle" nowrap><font face="Verdana" size="2"><%= intQuant %></font></td>
                    <td width="15%" align="left" valign="middle" nowrap><font face="Verdana" size="2"><%= intProdID %></font></td>
                    <td width="40%" align="left" valign="middle" nowrap><font face="Verdana" size="2"><%= strProdName %></font></td>
                    <td width="15%" align="right" valign="middle" nowrap><font face="Verdana" size="2">DKr.<%= intPrice %></font></td>
                    <td width="15%" align="right" valign="middle" nowrap><font face="Verdana" size="2">DKr.<%= intExtPrice %></font></td>
                </tr>
                <input type="hidden" name="strOrderItem" value="<%= intProdID %>,<%= intQuant %>">
<%
                rsProd.MoveNext
            wend                       
%>
<%
            'display total for products in cart
%>                       
            <tr>
                <td colspan="4" align="left" valign="middle" nowrap><font face="Verdana" size="2">Subtotal:</font></td>
                <td align="right" valign="middle" nowrap><font face="Verdana" size="2">
                    DKr.<%= formatNumber(intTotal, 2) %>
                </font></td>
            </tr>
<%
            'add and display amount charged for shipping:
            'in this case it's 5% of total for products in cart
            'change the .05 to meet your requirements
%>                       
            <tr>
                <td colspan="4" align="left" valign="middle" nowrap><font face="Verdana" size="2">Fragt: (7%)</font></td>
                <td align="right" valign="middle" nowrap><font face="Verdana" size="2">
                    DKr.<%= formatNumber((intTotal * .07), 2) %>
                    <input type="hidden" name="intShipping" value="<%= formatNumber((intTotal * .07), 2) %>">
                </font></td>
            </tr>
<%
            'add and display amount charged for sales tax:
            'in this case it's 8% of total for products in cart
            'change the .08 to meet your state/province requirements
%>                         
            <tr>
                <td colspan="4" align="left" valign="middle" nowrap><font face="Verdana" size="2">Moms. (25%):</font></td>
                <td align="right" valign="middle" nowrap><font face="Verdana" size="2">
                    DKr.<%= formatNumber((intTotal * .25), 2) %>
                    <input type="hidden" name="intTax" value="<%= formatNumber((intTotal * .25), 2) %>">
                </font></td>
            </tr>
<%
            'display Grand Total: to get the multiplier 1.0 is the product(s) total plus .25
            'for sales tax and .05 for shipping which equals 1.13. Be sure to change this
            'to meet your requirements
%>             
            <tr>
                <td colspan="4" align="left" valign="middle" nowrap><font face="Verdana" size="2"><b>Total:</b></font></td>
                <td align="right" valign="middle" nowrap><font face="Verdana" size="2"><b>
                    DKr.<%= formatNumber((intTotal*1.32), 2) %>
                    <input type="hidden" name="intTotal" value="<%= formatNumber((intTotal * 1.30), 2) %>">
                </b></font></td>
            </tr>
            </table>       
            <p><font face="Verdana" size="4"><strong>Betaling/Forsendelse</strong></font></p>
            <table width="100%">
            <tr>
                <td bgcolor="#ff9900" colspan="2"><font color="#FFFFFF" face="Verdana" size="2" style="background-color: #ff9900"><strong>Kunde Information</strong></font></td>
            </tr>
            <tr>
                <td><font face="Verdana" size="2">Navn(Fornavn, efternavn): </font></td>
                <td>
                <input type="text" name="strFirst" size="20">
                <input type="text" name="strLast" size="20">
                </td>
            </tr>
            <tr>
                <td><font face="Verdana" size="2">E-mail Addresse: </font></td>
                <td>
                <input type="text" name="strEmail" size="50"><font face="Verdana" size="1">&nbsp;Eksempel: info@</font>
                </td>
            </tr>
            <tr>
                <td><font face="Verdana" size="2">Adresse: </font></td>
                <td>
                <input type="text" name="strAddress1" size="50">
                </td>
            </tr>
            <tr>
                <td><font face="Verdana" size="2">Adresse 2: </font></td>
                <td>
                <input type="text" name="strAddress2" size="50"><font face="Verdana" size="1">&nbsp;Skrive NA hvis du ikke skal bruge den</font>
                </td>
            </tr>
            <tr>
                <td><font face="Verdana" size="2">by, postnr: </font></td>
                <td>
                <input type="text" name="strCity" size="30">
                <input type="text" name="strPostalCode" size="4">
                </td>
            </tr>
            <tr>
                <td><font face="Verdana" size="2">Land: </td>
                <td>
                <input type="text" name="strCountry" size="30">
                </td>
            </tr>
            <tr>
                <td><font face="Verdana" size="2">Telefonnr: </font></td>
                <td>
                <input type="text" name="strPhone" size="12"><font face="Verdana" size="1">&nbsp;Eksempel: 80808080</font>
                </td>
            </tr>
            <tr>
            <td colspan="2"><hr color="#CCCCCC" size="1" noshade></td>
            </tr>
            <tr>
                <td bgcolor="#ff9900" colspan="2"><font color="#FFFFFF" face="Verdana" size="2" style="background-color: #ff9900"><strong>Forsendelse (hvis anderledes end kunde adresse)</strong></font></td>
            </tr>
            <tr>
                <td><font face="Verdana" size="2">Navn(Fornavn, Efternavn): </font></td>
                <td>
                <input type="text" name="strShipFirst" size="20">
                <input type="text" name="strShipLast" size="20">
                </td>
            </tr>
            <tr>
                <td><font face="Verdana" size="2">Addresse: </font></td>
                <td>
                <input type="text" name="strShipAddress" size="40">
                </td>
            </tr>
            <tr>
                <td><font face="Verdana" size="2">By, postnr: </font></td>
                <td>
                <input type="text" name="strShipCity" size="20">
               
                <input type="text" name="strShipPostalCode" size="4">
                </td>
            </tr>
            <tr>
                <td><font face="Verdana" size="2">Land: </td>
                <td>
                <input type="text" name="strShipCountry" size="30">
                <input TYPE="hidden" name="ad1" VALUE="info@badman.dk"></td>
                </td>
            </tr>
            <tr>
            <td colspan="2"><hr color="#CCCCCC" size="1" noshade></td>
            </tr>
            <tr>
                <td bgcolor="#ff9900" colspan="2"><font color="#FFFFFF" face="Verdana" size="2" style="background-color: #ff9900"><strong>Forsendelse</strong></font></td>
            </tr>
            <tr>
                <td colspan="2"><font face="Verdana" size="2">
                <input type="radio" name="strShipMethod" value="efterkrav" > Efterkrav
                <input type="radio" name="strShipMethod" value="Forudbetaling" > Forudbetaling
               
                </font></td>
            </tr>
            <tr>
            <td colspan="2"><hr color="#CCCCCC" size="1" noshade></td>
            </tr>
           
            <tr>
                <td colspan="2" align="center">
                <input type="submit" value="Submit Order" id="submit1" name="submit1">
                </td>
            </tr>
            </table>           
            </form>
        </td>
  </tr>
  </table>
  </td>
  </tr>
  </table>
      <hr color="#CCCCCC" size="1" noshade>
     
<table border="0" cellpadding="0" cellspacing="6" width="100%"> 
  <tr>
    <td colspan="3" valign="BOTTOM"><font face="Verdana, Arial, Helvetica" size="1">     
     
      Sidst opdateret: <!--webbot bot="Timestamp" s-type="EDITED" s-format="%A, %B %d, %Y" startspan -->Søndag, 24 februar 2002
<!--webbot bot="Timestamp" endspan i-checksum="49640" -->
      <br>
      </font></td>
  <td colspan="3" align="right" valign="TOP">&nbsp;
  </td>
  </tr>
</table>
</body>
</html>
<%       
rsProd.Close
set rsProd = Nothing

rsProdInfo.Close
set rsProdInfo = Nothing
        end if
    end if
end if

Conn.Close
set Conn = Nothing

%>
Avatar billede badman1 Nybegynder
23. maj 2002 - 15:14 #10
jeg har fået løst problemet selv
så jeg lukker bare sprøgsmålet
Avatar billede medions Nybegynder
23. maj 2002 - 15:15 #11
så skal vi lige se din løsning! -det er en regl her på eksperten!

//>Rune
Avatar billede badman1 Nybegynder
17. juni 2002 - 16:04 #12
ok
den kommer lige på når jeg kommer hjem fra work :)
Avatar billede kalaharikid Nybegynder
22. april 2003 - 12:43 #13
Du er længe på arbejde, hwar ?
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester