Jeg kan ikke rigtigt få det til at virke, det er nok bare mig der ikke sætter det ind det rigtigt sted :-)
<%
Session.LCID = 1030
call openConn()
Function pad(input)
If int(input) < 10 Then
pad = \"0\" & input
Else
pad = input
End If
End Function
Function Formatdate(theDate)
Formatdate = pad(day(thedate)) & \"-\" & pad(month(thedate)) & \"-\" & year(thedate)
End Function
Function Formattime(TheTime)
Formattime = pad(hour(theTime)) & \".\" & pad(minute(theTime))
End Function
Function Formatdatetime(ThedateTime)
Formatdatetime = pad(day(thedate)) & \"-\" & pad(month(thedate)) & \"-\" & year(thedate) & \"-\" & pad(hour(theTime)) & \".\" & pad(minute(theTime))
End Function
kundenr = Request.form(\"kundenr\")
ordre= Request.form(\"ordre\")
SQLstmt = \"select * from orders where ophone like \" & Request(\"kundenr\") & \" and orderID = \" & Request(\"ordre\") & \" \"
Set RS = Conn.Execute(SQLstmt)
SQLstm = \"select * from oitems where orderID like \'%\" & Request(\"ordre\") & \"%\'\"
Set oRS = Conn.Execute(SQLstm)
%>
<!-- #include file=\"ttsup.asp\" -->
<%
Sub Bekraeftet
bekraefet = rs(\"oBekraeftet\")
if bekraefet =\"False\" then
%>
<form action=\"ttbek.asp\" method=\"post\">
<input type=\"hidden\" name=\"ordre\" value=\"<%= RS(\"orderID\") %>\">
<input type=\"hidden\" name=\"Bekr\" value=\"1\">
<input type=\"hidden\" name=\"kundenr\" value=\"<%= RS(\"ophone\") %>\">
<center><input type=\"submit\" class=\"FlatButton\" name=\"submit\" value=\"Bekræft ordre\">
</form>
<%
else
%>
<center><font size=\"4\" color=\"#008000\"><b>Denne ordre er bekræftet <%= Formatdate(RS(\"obekraeftelsesdato\")) %> <%= Formattime(RS(\"obekraeftelsesdato\")) %></b></font></center>
<%
end if
end sub
%>
<%
If Not RS.EOF Then
call Bekraeftet
%>
<table border=\"0\" width=\"712\">
<tr>
<td width=\"704\">
<table border=\"1\" width=\"731\" bordercolordark=\"#CCCCCC\" bordercolorlight=\"#E2E2E2\" height=\"320\">
<tr>
<td bgcolor=\"#E2E2E2\" width=\"108\" height=\"23\"><b>Ordre nr.</b></td>
<td bgcolor=\"#E2E2E2\" width=\"223\" height=\"23\"><input type=\"text\" name=\"t\" size=\"30\" value=\"<%= RS(\"orderID\") %>\"></td>
<td bgcolor=\"#E2E2E2\" height=\"23\" width=\"128\"> </td>
<td bgcolor=\"#E2E2E2\" width=\"233\" height=\"23\"> </td>
</tr>
<tr>
<td bgcolor=\"#E2E2E2\" width=\"108\" height=\"23\"><b>Kunde nr.</b></td>
<td bgcolor=\"#E2E2E2\" width=\"223\" height=\"23\"><input type=\"text\" name=\"t\" size=\"30\" value=\"<%= RS(\"ophone\") %>\"></td>
<td bgcolor=\"#E2E2E2\" height=\"23\" width=\"128\"><b>Betaling</b></td>
<td bgcolor=\"#E2E2E2\" width=\"233\" height=\"23\"><input type=\"text\" name=\"t\" size=\"30\" value=\"<%= RS(\"oshipmethodtype\") %>\"></td>
</tr>
<tr>
<td bgcolor=\"#E2E2E2\" width=\"108\" height=\"25\"><b>Firma</b></td>
<td bgcolor=\"#E2E2E2\" width=\"223\" height=\"25\"><input type=\"text\" name=\"t\" size=\"30\" value=\"<%= RS(\"ocompany\") %>\"></td>
<td bgcolor=\"#E2E2E2\" height=\"25\" width=\"128\"><%
shipmet = rs(\"oshipmethodtype\")
if shipmet = \"Forudbetaling - Bank\" then
%>
<b>Indbetaling reg.</b>
<%
else
%>
<B> </b>
<%
end if
%>
</td>
<td bgcolor=\"#E2E2E2\" width=\"233\" height=\"25\"><%
shipmet = rs(\"oshipmethodtype\")
if shipmet = \"Forudbetaling - Bank\" then
%>
<input type=\"text\" name=\"t\" size=\"30\" value=\"<%= RS(\"indreg\") %>\"></td>
<%
else
%>
<B>
<td width=\"5\"> </b>
<%
end if
%>
</tr>
<tr>
<td bgcolor=\"#E2E2E2\" width=\"108\" height=\"23\"><b>Navn</b></td>
<td bgcolor=\"#E2E2E2\" width=\"223\" height=\"23\"><input type=\"text\" name=\"t\" size=\"30\" value=\"<%= RS(\"ofirstname\") %> <%= RS(\"olastname\") %>\"></td>
<td bgcolor=\"#E2E2E2\" height=\"23\" width=\"128\"> </td>
<td bgcolor=\"#E2E2E2\" width=\"233\" height=\"23\"> </td>
</tr>
<tr>
<td bgcolor=\"#E2E2E2\" width=\"108\" height=\"23\"><b>Adresse</b></td>
<td bgcolor=\"#E2E2E2\" width=\"223\" height=\"23\"><input type=\"text\" name=\"t\" size=\"30\" value=\"<%= RS(\"oaddress\") %>\"></td>
<td bgcolor=\"#E2E2E2\" height=\"23\" width=\"128\"> </td>
<td bgcolor=\"#E2E2E2\" width=\"233\" height=\"23\"> </td>
</tr>
<tr>
<td bgcolor=\"#E2E2E2\" width=\"108\" height=\"23\"><b>Post nr. & by</b></td>
<td bgcolor=\"#E2E2E2\" width=\"223\" height=\"23\"><input type=\"text\" name=\"t\" size=\"30\" value=\"<%= RS(\"opostcode\") %> <%= RS(\"ocity\") %>\"></td>
<td bgcolor=\"#E2E2E2\" height=\"23\" width=\"128\"><b>E-mail adresse</b></td>
<td bgcolor=\"#E2E2E2\" width=\"233\" height=\"23\"><input type=\"text\" name=\"t\" size=\"30\" value=\"<%= RS(\"oemail\") %>\"></td>
</tr>
<tr>
<td bgcolor=\"#E2E2E2\" width=\"337\" height=\"23\" colspan=\"2\" align=\"center\"><b>Leveringsadressen</b></td>
<td bgcolor=\"#E2E2E2\" height=\"23\" width=\"128\"> </td>
<td bgcolor=\"#E2E2E2\" width=\"233\" height=\"23\"> </td>
</tr>
<tr>
<td bgcolor=\"#E2E2E2\" width=\"108\" height=\"23\"><b>Firma</b></td>
<td bgcolor=\"#E2E2E2\" width=\"223\" height=\"23\"><input type=\"text\" name=\"t\" size=\"30\" value=\"<%= RS(\"oshipcompany\") %>\"></td>
<td bgcolor=\"#E2E2E2\" height=\"23\" width=\"128\"> </td>
<td bgcolor=\"#E2E2E2\" width=\"233\" height=\"23\"> </td>
</tr>
<tr>
<td bgcolor=\"#E2E2E2\" width=\"108\" height=\"23\"><b>Navn</b></td>
<td bgcolor=\"#E2E2E2\" width=\"223\" height=\"23\"><input type=\"text\" name=\"t\" size=\"30\" value=\"<%= rs(\"oshipname\") %>\"></td>
<td bgcolor=\"#E2E2E2\" height=\"23\" width=\"128\"> </td>
<td bgcolor=\"#E2E2E2\" width=\"233\" height=\"23\"> </td>
</tr>
<tr>
<td bgcolor=\"#E2E2E2\" width=\"108\" height=\"22\"><b>Adresse</b></td>
<td bgcolor=\"#E2E2E2\" width=\"223\" height=\"22\"><input type=\"text\" name=\"t\" size=\"30\" value=\"<%= RS(\"oshipaddress\") %>\"></td>
<td bgcolor=\"#E2E2E2\" height=\"22\" width=\"128\"> </td>
<td bgcolor=\"#E2E2E2\" width=\"233\" height=\"22\"> </td>
</tr>
<tr>
<td bgcolor=\"#E2E2E2\" width=\"108\" height=\"23\"><b>Post & By</b></td>
<td bgcolor=\"#E2E2E2\" width=\"223\" height=\"23\"><input type=\"text\" name=\"t\" size=\"30\" value=\"<%= RS(\"oshipzip\") %> <%= RS(\"oshiptown\") %>\"></td>
<td bgcolor=\"#E2E2E2\" height=\"23\" width=\"128\"> </td>
<td bgcolor=\"#E2E2E2\" width=\"233\" height=\"23\"> </td>
</tr>
</table>
</td>
</tr>
<%
end if
If Not oRS.EOF Then
%>
<tr>
<td width=\"704\">
<table border=\"1\" bordercolorlight=\"#CCCCCC\" bordercolordark=\"#CCCCCC\" bgcolor=\"#CCCCCC\" width=\"700\">
<tr>
<th bgcolor=\"#E2E2E2\" width=\"301\">Vare</th>
<th bgcolor=\"#E2E2E2\" width=\"61\">Antal</th>
<th bgcolor=\"#E2E2E2\" width=\"61\">Pris </th>
<th bgcolor=\"#E2E2E2\" width=\"61\">ank. <sup>1</sup></th>
<th bgcolor=\"#E2E2E2\" width=\"65\">Sendt</th>
<th bgcolor=\"#E2E2E2\" width=\"129\">Pakkenr</th>
</tr>
</table>
<%
Do While Not oRS.EOF
%>
<table border=\"1\" bordercolorlight=\"#CCCCCC\" bordercolordark=\"#CCCCCC\" bgcolor=\"#CCCCCC\" width=\"700\">
<tr>
<td bgcolor=\"#E2E2E2\" width=\"301\"><SMALL><%= oRS(\"itemname\") %></SMALL></td>
<td bgcolor=\"#E2E2E2\" width=\"61\"><p align=\"center\"><SMALL><%= oRS(\"numitems\") %></SMALL></td>
<td bgcolor=\"#E2E2E2\" width=\"61\"><p align=\"center\"><SMALL><%= oRS(\"unitprice\") %>,-</SMALL></p></td>
<td bgcolor=\"#E2E2E2\" width=\"61\"><p align=\"center\"><SMALL><%= oRS(\"ank\") %></SMALL></p></td>
<td bgcolor=\"#E2E2E2\" width=\"65\" align=\"center\"><SMALL><%= RS(\"oshippeddate\") %></SMALL></td>
<td bgcolor=\"#E2E2E2\" width=\"129\" align=\"center\"><SMALL><a href=\"
http://www2.postdanmark.dk/gtt/owa/packgtt.list?i_stregkode=<%= RS(\"pakkenr\") %>\" target=\"_blank\"><font color=\"#000000\"><%= RS(\"pakkenr\") %></font></a></SMALL></td>
</tr>
<tr>
<td bgcolor=\"#CCCCCC\" width=\"301\"> </td>
<td bgcolor=\"#E2E2E2\" width=\"183\" colspan=\"3\"><SMALL>Din bestillingsdato</SMALL></td>
<td bgcolor=\"#E2E2E2\" width=\"194\" align=\"center\" colspan=\"2\"><% call bestillingsdato %></td>
</tr>
<tr>
<td bgcolor=\"#CCCCCC\" width=\"301\"> </td>
<td bgcolor=\"#E2E2E2\" width=\"183\" colspan=\"3\"><SMALL>Din bekræftelsesdato</SMALL></td>
<td bgcolor=\"#E2E2E2\" align=\"center\" width=\"194\" colspan=\"2\"><% call bekraeftelsesdato %></td>
</tr>
<tr>
<td bgcolor=\"#CCCCCC\" width=\"301\"> </td>
<td bgcolor=\"#E2E2E2\" width=\"183\" colspan=\"3\"><SMALL>Vores bestilingsdato</SMALL></td>
<td bgcolor=\"#E2E2E2\" align=\"center\" width=\"194\" colspan=\"2\">
<%
voresbest = ors(\"voresbestilingsdato\")
if voresbest = \"0\" then
%>
<font color=\"#BA2727\"><SMALL><b>Endnu ikke bestilt</b></SMALL></font>
<%
end if
if voresbest = \"1\" then
%>
<span style=\"background-color: #00FF00\"><SMALL><B> På lager i forvejen </b></SMALL></span>
<%
end if
if voresbest > \"2\" then
%>
<span style=\"background-color: #00FF00\"><SMALL><B> <%= Formatdate(oRS(\"voresbestilingsdato\")) %> <%= Formattime(oRS(\"voresbestilingsdato\")) %> </b></SMALL></span>
<%
end if %>
</td>
</tr>
<tr>
<td bgcolor=\"#CCCCCC\" width=\"301\"> </td>
<td bgcolor=\"#E2E2E2\" width=\"183\" colspan=\"3\"><SMALL>Bekræftet hos vores leverandør</SMALL></td>
<td bgcolor=\"#E2E2E2\" align=\"center\" width=\"194\" colspan=\"2\">
<%
Bekraeft = ors(\"Bekraeftethos\")
if Bekraeft = \"0\" then
%>
<font color=\"#BA2727\"><SMALL><b>Endnu ikke bekræftet</b></SMALL></font>
<%
end if
if Bekraeft = \"1\" then
%>
<span style=\"background-color: #00FF00\"><SMALL><B> På lager i forvejen </b></SMALL></span>
<%
end if
if Bekraeft > \"2\" then
%>
<span style=\"background-color: #00FF00\"><SMALL><B> <%= Formatdate(oRS(\"voresbestilingsdato\")) %> <%= Formattime(oRS(\"voresbestilingsdato\")) %> </b></SMALL></span>
<%
end if
%>
</td>
</tr>
<tr>
<td bgcolor=\"#CCCCCC\" width=\"301\"> </td>
<td bgcolor=\"#E2E2E2\" width=\"183\" colspan=\"3\"><SMALL>Reserveret til din ordre</SMALL></td>
<td bgcolor=\"#E2E2E2\" align=\"center\" width=\"194\" colspan=\"2\">
<%
reserve = ors(\"reserveret\")
if reserve = \"0\" then
%>
<font color=\"#BA2727\"><SMALL><b>Endnu ikke på lager</b></SMALL></font>
<%
end if
if reserve = \"1\" then
%>
<font color=\"#BA2727\"><SMALL><b>Endnu ikke reserveret</b></SMALL></font>
<%
end if
if reserve > \"2\" then
%>
<span style=\"background-color: #00FF00\"><SMALL><B> <%= Formatdate(oRS(\"reserveret\")) %> <%= Formattime(oRS(\"reserveret\")) %> </b></SMALL></span>
<%
end if
%>
</td>
</tr>
<tr>
<td bgcolor=\"#CCCCCC\" width=\"301\"> </td>
<td bgcolor=\"#E2E2E2\" width=\"183\" colspan=\"3\"><SMALL>Udtaget fra lager</SMALL></td>
<td bgcolor=\"#E2E2E2\" align=\"center\" width=\"194\" colspan=\"2\"><%
udtage = rs(\"udtaget\")
if udtage = \"0\" then
%>
<font color=\"#BA2727\"><SMALL><b>Endnu ikke udtaget</b></SMALL></font>
<%
end if
if udtage = \"1\" then
%>
<span style=\"background-color: #00FF00\"><SMALL><B> På lager i forvejen </b></SMALL></span>
<%
end if
if udtage > \"2\" then
%>
<span style=\"background-color: #00FF00\"><SMALL><B> <%= Formatdate(RS(\"udtaget\")) %> <%= Formattime(RS(\"udtaget\")) %> </b></SMALL></span>
<%
end if
%>
</td>
</tr>
<tr>
<td bgcolor=\"#CCCCCC\" width=\"301\"> </td>
<td bgcolor=\"#E2E2E2\" width=\"183\" colspan=\"3\"><SMALL>Faktureret</SMALL></td>
<td bgcolor=\"#E2E2E2\" align=\"center\" width=\"194\" colspan=\"2\"><% call faktureret %></td>
</tr>
</table>
<%
oRS.MoveNext
Loop
End If
%>
<%
If Not RS.EOF Then
%>
<tr>
<td width=\"704\">
<table border=\"1\" bordercolordark=\"#CCCCCC\" bordercolorlight=\"#CCCCCC\" width=\"346\" bgcolor=\"#CCCCCC\">
<tr>
<td bgcolor=\"#E2E2E2\" width=\"236\"><font size=\"3\">Fragt</font></td>
<td bgcolor=\"#E2E2E2\" width=\"94\" align=\"right\"><%= FormatCurrency(RS(\"oshipcost\"),2) %></td>
</tr>
<tr>
<td bgcolor=\"#E2E2E2\" width=\"236\"><font size=\"3\">Beløb inkl. fragt</font></td>
<td bgcolor=\"#E2E2E2\" width=\"94\" align=\"right\"><%= FormatCurrency(RS(\"orderamount\"),2) %></td>
</tr>
</table>
</table>
<%
End if
%>
<p><SMALL>* 1 Denne dato er den forventede dato, for levering fra vores leverandør. Står der ??-?? er datoen ukendt.</SMALL>
</p>
</body>