<%
response.Charset="utf-8"
session.CodePage=65001
num=request("num")
invoicenumber=request("invoicenumber")
invoicedate=request("invoicedate")
customer=request("customer")
cp1=request("cp1")
cp2=request("cp2")
str=str&"<style type=""text/css"">"
str=str&"<!--"
str=str&".STYLE1 {"
str=str&" font-size: 36px;"
str=str&" font-weight: bold;"
str=str&"}"
str=str&".ddline {"
str=str&" border-bottom-width: 1px;"
str=str&" border-bottom-style: double;"
str=str&" border-bottom-color: #000000;"
str=str&"}"
str=str&".bline {"
str=str&" border-bottom-width: 1px;"
str=str&" border-bottom-style: solid;"
str=str&" border-bottom-color: #000000;"
str=str&"}"
str=str&".tdline {"
str=str&" border-top-width: 1px;"
str=str&" border-bottom-width: 1px;"
str=str&" border-top-style: solid;"
str=str&" border-bottom-style: solid;"
str=str&" border-top-color: #000000;"
str=str&" border-bottom-color: #000000;"
str=str&"}"
str=str&".tddline {"
str=str&" border-top-width: 1px;"
str=str&" border-bottom-width: 1px;"
str=str&" border-top-style: solid;"
str=str&" border-bottom-style: double;"
str=str&" border-top-color: #000000;"
str=str&" border-bottom-color: #000000;"
str=str&"}"
str=str&"-->"
str=str&"</style>"
str=str&"<table cellpadding='2' cellspacing='0' width='600'>"
str=str&"<tr height='34'>"
str=str&"<td height='34' colspan='4' align='center'><span class=""STYLE1""><u>Invoice</u></span></td>"
str=str&" </tr>"
str=str&"<tr height='22'>"
str=str&"<td colspan='4' height='22'><strong>From</strong></td>"
str=str&"</tr>"
str=str&"<tr height='22'>"
str=str&"<td height='22' rowspan=7 valign='top' width=300>"&replace(request("txt"),vbcrlf,"<br>")&"</td>"
str=str&"<td align='left' width=120><strong>Invoice No.:</strong></td>"
str=str&"<td></td>"
str=str&" <td align='left' width=120><strong>Date :</strong></td>"
str=str&" </tr>"
str=str&"<tr height='22'>"
str=str&"<td>"&invoicenumber&"</td>"
str=str&"<td ></td>"
str=str&"<td align='left' >"&invoicedate&"</td>"
str=str&" </tr>"
str=str&" <tr height='22'>"''''''''''
str=str&"<td><strong>Phone</strong></td>"
str=str&"<td></td>"
str=str&" <td></td>"
str=str&" </tr>"
str=str&"<tr height='22'>"'''''''''''''''''''''
str=str&" <td>(852) 8172 3606</td>"
str=str&" <td></td>"
str=str&" <td></td>"
str=str&" </tr>"
str=str&"<tr height='22'>"
str=str&"<td></td>"
str=str&"<td></td>"
str=str&"<td></td>"
str=str&"</tr>"
str=str&"<tr height='22'>"
str=str&"<td><strong>Contact Person</strong></td>"
str=str&"<td></td>"
str=str&"<td></td>"
str=str&" </tr>"
str=str&"<tr height='22'>"
str=str&" <td>DAISY MA</td>"
str=str&"<td></td>"
str=str&" <td></td>"
str=str&"</tr>"
str=str&"<tr height='22'>"
str=str&" <td colspan='4' height='22'><strong>TO</strong></td>"
str=str&"</tr>"
str=str&"<tr>"
str=str&"<td align='left'>"&replace(customer,chr(13),"<br>")&"</td>"
str=str&"<td></td>"
str=str&"<td></td>"
str=str&"<td></td>"
str=str&"</tr>"
str=str&"<tr height='22'>"
str=str&" <td height='22'> </td>"
str=str&" <td colspan='3'>HS CODE :?"
str=str&""&request("HSCODE")
str=str&""
str=str&"</td>"
str=str&"</tr>"
str=str&"<tr height='22'>"
str=str&" <td height='22' width='300'> </td>"
str=str&"<td></td>"
str=str&"<td></td>"
str=str&"<td></td>"
str=str&"</tr>"
str=str&"<tr height='22'>"
str=str&" <td height='22' class='tdline'><strong>Item Description?</strong></td>"
str=str&" <td class='tdline'><strong>Price?</strong></td>"
str=str&" <td class='tdline'><strong>Quantity</strong></td>"
str=str&"<td class='tdline'>?<strong>Sub Total?</strong></td>"
str=str&" </tr>"
for i=0 to num
if request("title_"&i)<>"" then
str=str&"<tr height='30'>"
str=str&" <td height='30'>"&request("title_"&i)&"</td>"
str=str&"<td align='left'>"&request("price_"&i)&"</td>"
str=str&"<td align='left'>"&request("qty_"&i)&"</td>"
str=str&" <td align='left'>"&request("sub_"&i)&"</td>"
str=str&" </tr>"
end if
next
str=str&" <tr height='23'>"
str=str&"<td height='23' align='right'><strong>TOTAL :?</strong></td>"
str=str&" <td></td>"'''''''''''''''''''''''''''
str=str&"<td></td>"
str=str&"<td class='tddline' align='left'>"&request("total")&"</td>"
str=str&" </tr>"
str=str&"<tr height='22'>"
str=str&" <td height='22' class='bline'>"&replace(request("remark"),chr(13),"<br>")&"</td>"
str=str&"<td></td>"
str=str&"<td></td>"
str=str&"<td></td>"
str=str&"</tr>"
Shipping=trim(request("Shipping"))
if Shipping<>"" then
if shipping="" then
shipping=0
end if
end if
if shipping="" then
shipping=0
end if
str=str&" <tr height='23'>"
str=str&"<td height='23' align='right'><strong>Shipping :?</strong></td>"
str=str&" <td></td>"'''''''''''''''''''''''''''
str=str&"<td></td>"
str=str&"<td class='tddline' align='left'>"&shipping&"</td>"
str=str&" </tr>"
insurance=trim(request("insurance"))
if insurance<>"" then
insurance=replace(insurance,currFlag,"")
if insurance="" then
insurance=0
end if
end if
if insurance="" then
insurance=0
end if
str=str&" <tr height='23'>"
str=str&"<td height='23' align='right'><strong>Insurance :?</strong></td>"
str=str&" <td></td>"'''''''''''''''''''''''''''
str=str&"<td></td>"
str=str&"<td class='tddline' align='left'>"&insurance&"</td>"
str=str&" </tr>"
str=str&"<tr height='23'>"
str=str&"<td height='23' class='ddline'>TOTAL VALUE :?"
str=str&""&request("total2")&"</td>"
str=str&"<td></td>"
str=str&"<td></td>"
str=str&"<td></td>"
str=str&"</tr>"
str=str&"<tr height='23'>"
str=str&"<td height='23'></td>"
str=str&"<td></td>"
str=str&"<td></td>"
str=str&" <td></td>"
str=str&"</tr>"
str=str&"<tr height='30'>"
str=str&"<td height='30' colspan='2'>Signature</td>"
str=str&"<td></td>"
str=str&"<td></td>"
str=str&" </tr>"
str=str&"<tr height='22'>"
str=str&"<td height='22'> </td>"
str=str&"<td></td>"
str=str&"<td></td>"
str=str&"<td></td>"
str=str&"</tr>"
str=str&"<tr height='22'>"
str=str&"<td height='22'></td>"
str=str&"<td></td>"'''''''''''''''''
str=str&"<td></td>"
str=str&"<td></td>"
str=str&" </tr>"
str=str&"<tr height='23'>"
str=str&" <td height='23' class='bline'> </td>"'''''''
str=str&"<td></td>"
str=str&"<td></td>"
str=str&"<td></td>"
str=str&"</tr>"
str=str&"<tr height='22'>"
str=str&"<td height='22'></td>"
str=str&"<td></td>"
str=str&"<td></td>"
str=str&"<td></td>"
str=str&" </tr>"
str=str&"</table>"
Set fso = server.CreateObject("Scripting.FileSystemObject")
writeFileName=Server.Mappath("invoice.xls")
Set writefiletemp = fso.CreateTextFile(writeFileName,true,-1)
'response.Write Tempfiletemp.readall
writefiletemp.write str
'response.end()
'filetemp.close
writefiletemp.close()
set fso=nothing
dim URL,Realurl
Filename="invoice.xls"
if Filename<>"" then
Realurl=server.MapPath(Filename)
else
Response.end
end if
'response.Write realurl
'response.end
set Fso=server.CreateObject("scripting.filesystemobject")
set Finfo=Fso.GetFile(Realurl)
Fsize=Finfo.size
Fname=replace(request("so"),"/","")&".xls"
set Finfo=nothing
set Fso=nothing
set FStream=server.CreateObject("adodb.stream")
FStream.Open
FStream.Type=1
FStream.LoadFromFile(Realurl)
'response.End()
ContentType = "application/octet-stream"
Response.AddHeader "Content-Disposition", "attachment; filename="&FName
Response.AddHeader "Content-Length", Fsize
Response.CharSet="gb2312"
Response.ContentType=ContentType
Response.BinaryWrite FStream.Read
Response.Flush
FStream.Close
set FStream=nothing
%>