AlthaKar

ASP Rescontrol

Jan 1st, 2012
304
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
  2. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  3. <html>
  4. <head>
  5. <title>Invoice</title>
  6.  
  7.  
  8.  
  9. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  10. <meta http-equiv="pragma" content="no-cache,no-follow">
  11.  
  12. <LINK rel="stylesheet" type="text/css" href="../../structure/controlmanagement/res32/style.css">
  13. <LINK rel="stylesheet" type="text/css" href="../../structure/controlmanagement/res32/indexStyle.css">
  14.  
  15. <style type="text/css">
  16. <!--
  17. .style9 {
  18. font-size: 11px;
  19. font-family: Arial, Helvetica, sans-serif;
  20. font-weight: bold;
  21. }
  22. .style1 { font-size: 11px;
  23. font-weight: bold;
  24. }
  25. .style15 {
  26. font-family: Arial, Helvetica, sans-serif;
  27. font-size: 10px;
  28. }
  29. .style16 {font-size: 10px}
  30. .style17 {font-family: Arial, Helvetica, sans-serif}
  31. -->
  32. </style>
  33.  
  34.  
  35. </head>
  36.  
  37. <body class="bdy1" topmargin="0" leftmargin="0" bgcolor="#0066CC">
  38. <p>
  39.  
  40.  
  41. </p>
  42. <table width="630" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFBEF">
  43. <tr>
  44. <td bgcolor="#FFE49D">
  45. <div align="right"><a style="cursor:hand" onClick="javascript:window.print()"><img src="../hPrin.gif" alt="Print Me" width="19" height="21"></a></div></td>
  46. </tr>
  47. <tr>
  48. <td bgcolor="#FFE49D">
  49. <table width="99%" border="0" cellspacing="0" cellpadding="0">
  50. <tr>
  51. <td width="20%" class="style9"><div align="center"><img src="../logo.jpg" width="97" height="124"></div></td>
  52. <td width="74%" class="style9"><div align="right"><span class="style1">
  53. <script language="javascript" src="../../structure/controlmanagement/res32/scripts/comp.js"></script>
  54. </span></div></td>
  55. <td width="6%" class="style9">&nbsp;</td>
  56. </tr>
  57. </table></td>
  58. </tr>
  59. <tr>
  60. <td bgcolor="#FFE49D"><hr></td>
  61. </tr>
  62. <tr>
  63. <td>&nbsp;</td>
  64. </tr>
  65. <tr>
  66. <td>
  67. <%
  68.  
  69. function DecryptData(s)
  70. dim sp
  71. dim dStr
  72. dim decry_strat
  73. dim decry_str
  74. dim decr
  75. dim i,temp
  76. dStr=s
  77. sp=split(dStr,"Z")
  78. decry_strat=eval(mid(sp(0),2,1))
  79. decr=decry_strat
  80. 'Response.write Chr(sp(1))
  81. 'Response.Write ubound(sp)
  82. for i=2 to ubound(sp)
  83. decry_str=decry_str & chr(cint("&H" + sp(i-1))-decr)
  84. decr=decr + decry_strat
  85. next
  86.  
  87. DecryptData =decry_str
  88. end function
  89. 'response.write DecryptData(strReverse(request.QueryString("id")))
  90. dim reserveId,spTb,cCurr,canxw,numad,cy1,cy2
  91. ' reserveId = request.QueryString("resId")
  92. reserveId = DecryptData(strReverse(request.QueryString("id")))
  93.  
  94. if reserveId = "" then
  95. ' response.write typename(request.QueryString("resId"))
  96. else
  97.  
  98. ' response.Write Server.MapPath("../../access_db/PeterEngland.mdb")
  99.  
  100. ' reserveId = 75
  101.  
  102. spTb = "&nbsp;&nbsp;&nbsp&nbsp;&nbsp;"
  103.  
  104.  
  105. dim con,rec,sql_srchstring
  106. Set con = Server.CreateObject("ADODB.Connection")
  107. con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="& Server.MapPath("../../access_db/PeterEngland.mdb")& ";Jet OLEDB:Database Password=arabia70_"
  108. Set rec = Server.CreateObject("ADODB.Recordset")
  109.  
  110. sql_srchstring = "select * from Tbl_Reservation_Info,Tbl_Res_RateInfo where Tbl_Reservation_Info.Res_Invoice_Id="& int(reserveId) &" and Tbl_Reservation_Info.Res_Id= Tbl_Res_RateInfo.Trv_ResId"
  111. rec.open sql_srchstring ,con,1,3
  112. cCurr = rec.fields("Res_Currency")
  113. setCurrency(cCurr)
  114.  
  115. canxw = rec.fields("Res_Canx")
  116. canw = rec.fields("Res_Cancel_Waiver")
  117.  
  118. ' numad = rec.fields("Res_Currency")
  119. tfs = rec.fields("Res_Trfs")
  120. canxTot = rec.fields("Res_Canx")
  121. tfsTot = rec.fields("Res_Trfs")
  122.  
  123. paySrc = rec.fields("Res_Cc_name")
  124. paySurch = rec.fields("Res_Cc_charge")
  125. paySurchg = rec.fields("Res_Cc_Amount")
  126. grTot = rec.fields("Res_Grand_Total")
  127. netTot = rec.fields("Res_Net_Tot")
  128.  
  129. misc1 = rec.fields("Res_Misc1")
  130. misc2 = rec.fields("Res_Misc2")
  131.  
  132. misct1 = rec.fields("Res_Text1")
  133. misct2 = rec.fields("Res_Text2")
  134.  
  135. if rec.fields("Res_Invoice_Id") <> 0 then
  136. response.write "<center><h3>INVOICE</h3></center>"
  137. else
  138. response.write "<center><h3>PROFORMA INVOICE</h3></center>"
  139. end if
  140.  
  141. function setCurrency(cR)
  142. if cR = "GBP" then
  143. cy1 = "Pounds"
  144. cy2 = "Pence"
  145. elseif cR = "AED" then
  146. cy1 = "Dirhams"
  147. cy2 = "Fils"
  148. elseif cR = "USD" then
  149. cy1 = "Dollars"
  150. cy2 = "Cents"
  151.  
  152. end if
  153. end function
  154.  
  155. function getRAgtName(agId)
  156.  
  157. Set recA = Server.CreateObject("ADODB.Recordset")
  158. sql_srchstring = "select * from Tbl_Identity where Identity_Id=" & agId
  159. recA.open sql_srchstring ,con,1,3
  160.  
  161. getRAgtName = recA.fields(1)
  162. recA.close
  163. end function
  164.  
  165. response.Write "<table BORDER=0 class = 'tdPerson' width=630 border=0 ALIGN=CENTER><tr><td><table>" ' Personal Info
  166. 'response.write "<tr><td>Personal Information</td></tr>"
  167. response.write "<tr><td>"& rec.fields("Res_Title") &" "& rec.fields("Res_Name") &"</td></tr>"
  168. response.write "<tr><td>"& rec.fields("Res_Cc_Billing") &"</td></tr>"
  169. response.write "<tr><td>"& rec.fields("Res_Country") &"</td></tr>"
  170. response.write "<tr><td>Tel : "& rec.fields("Res_Office_Tel") &"</td></tr>"
  171. response.write "<tr><td>Fax : "& rec.fields("Res_Fax") &"</td></tr>"
  172. response.write "<tr><td>Email : <a href=mailto:"& rec.fields("Res_Email") & ">"& rec.fields("Res_Email") &"</a></td></tr>"
  173. 'response.write "<tr><td>Ident : "& rec.fields("Res_Staff_Id") &"</td></tr>"
  174.  
  175. response.write "<tr><td>Flight Details : "& rec.fields("Res_Flight_Details") &"</td></tr></table></td>"
  176.  
  177. response.Write "<td valign=bottom><table >"
  178. response.write "<tr><td>&nbsp;</td></tr>"
  179. if rec.fields("Res_Invoice_Id") = 0 then
  180. response.write "<tr><td>Invoice No. : MH - "& rec.fields("Res_Id") & "</td></tr>"
  181. else
  182. response.write "<tr><td>Invoice No. : MH - "& rec.fields("Res_Invoice_Id") & "</td></tr>"
  183. end if
  184. response.write "<tr><td>"& formatDateTime(rec.fields("Res_Date"),1) &"</td></tr>"
  185. ' response.write "<tr><td>Status : Proforma</td></tr>"
  186. response.write "<tr><td>Booking taken by : "& getRAgtName(rec.fields("Res_Agent")) &"</td></tr>"
  187. 'response.write "<tr><td>Agent : "& getTAgtName(rec.fields("Res_Travel_Agent")) &"</td></tr>"
  188. response.Write "<tr><td>&nbsp</td></tr>"
  189. ' response.Write "<tr><td> Payment Type : "& paySrc &"</td></tr>"
  190. ' response.Write "<tr><td> Payment Id : "& payNum &"</td></tr>"
  191. 'response.Write "<tr><td> Payment Exp : "& payExp &"</td></tr>"
  192. response.write "<tr><td></td></tr></table>"
  193.  
  194. response.Write "</td></tr></table><hr>"
  195.  
  196.  
  197. '...................................................................................................................
  198. response.Write "<table width=500 border=0 align=center><tr>" ' invice tabel starts
  199.  
  200. response.write "<td width=500>" ' first colum starts here
  201. setInvoice
  202. setMisccharges
  203. response.write "</td>"
  204.  
  205. 'response.write "<td>" ' second colum starts here
  206. 'response.write "</td>"
  207.  
  208. response.Write "</tr></table><hr>" ' invoice tbl ends here
  209.  
  210. function setInvoice
  211. while not rec.eof
  212. response.Write "<table border=0 class='tblCommon' width=500>"
  213. response.Write "<tr><td>"& listHotelName(rec.fields("Trv_Hotel")) &"</td></tr>"
  214. numAd = rec.fields("Trv_Adults")
  215. response.Write "<tr><td>Arrival : "& formatDateTime(rec.fields("Trv_Arrival"),1) & spTb &" Departure : "& formatDateTime(rec.fields("Trv_Depart"),1) &"</td></tr>"
  216. response.Write "<tr><td>"& spTb & "Meal Plan : " & rec.fields("Trv_MealPlan") &" </td></tr>"
  217. listRoomdetails(rec.fields("Trv_ResHotelId"))
  218. response.Write "</table><br>"
  219. rec.movenext
  220. wend
  221. end function
  222.  
  223. function setMisccharges
  224. response.Write "<table border=0 class='tblCommon' width=500 valign=bottom>"
  225.  
  226. response.Write "<tr><td align=right width=420>Transfers : "& cCurr &" "& tfs & spTb &"</td><td align=right ><b>"& tfsTot &".00</b></td></tr>"
  227. if canw <> "" then
  228. response.Write "<tr><td align=right width=420>"& canw & spTb & " </td><td align=right><b>"& canxw &".00</b></td></tr>"
  229. end if
  230.  
  231. if misc1 <> "0" then
  232. response.Write "<tr><td align=right width=420>"& misct1 & spTb &" </td><td align=right><b>"& misc1 &".00</b></td></tr>"
  233. end if
  234. if misc2 <> "0" then
  235. response.Write "<tr><td align=right width=420>"& misct2 & spTb &" </td><td align=right><b>"& misc2 &".00</b></td></tr>"
  236. end if
  237. response.Write "<tr><td>"&spTb &"</td></tr>"
  238. response.Write "<tr><td align=right width=420>Grand Total"& spTb &" </td><td align=right><b>"& grTot &".00</b></td></tr>"
  239. if paySurch <> 0 then
  240. response.Write "<tr><td align=right width=420>Payment by "& paySrc &"&nbsp;( Surcharge : "& paySurch &"%)</td><td align=right><b>"& paySurchg &"</b></td></tr>"
  241. else
  242. response.Write "<tr><td align=right width=420>Payment by "& paySrc &"&nbsp;( No Surcharges)</td align=right><td>0.00</td></tr>"
  243. end if
  244. response.Write "<tr><td align=right width=420><b>Net Total</b>"& spTb &" </td><td align=right ><b>"& netTot &"</b></td></tr>"
  245. response.Write "</table><table class='tblCommon' align=right><tr><td><b>"& ConvertCurrencyToEnglish(netTot) &"</b></td></tr></table>"
  246. end function
  247.  
  248. function listRoomdetails(htlId)
  249. ' response.write htlId
  250. dim con1,rec1,sql_srchstring1
  251. Set con1 = Server.CreateObject("ADODB.Connection")
  252. con1.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="& Server.MapPath("../../access_db/PeterEngland.mdb")& ";Jet OLEDB:Database Password=arabia70_"
  253. Set rec1 = Server.CreateObject("ADODB.Recordset")
  254. sql_srchstring1 = "select * from Tbl_Res_RoomInfo where Tbl_Res_RoomInfo.Htl_Res=" & htlId
  255. rec1.open sql_srchstring1,con1,1,3
  256. ' response.Write rec1.recordcount
  257. while not rec1.eof
  258. response.Write "<tr><td width=420>"& spTb & rec1.fields(2) & "&nbsp;&nbsp;&nbsp;" & rec1.fields(3) & " rooms X " & rec1.fields(4) & " nights X "& cCurr & "&nbsp" & rec1.fields(5) &" per room per night</td><td align=right><b>"& rec1.fields(6) &".00</b></td></tr>"
  259.  
  260. rec1.movenext
  261. wend
  262. end function
  263.  
  264. function listHotelName(htlId)
  265. ' response.write htlId
  266. dim con1,rec1
  267. Set con1 = Server.CreateObject("ADODB.Connection")
  268. con1.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="& Server.MapPath("../../access_db/PeterEngland.mdb")& ";Jet OLEDB:Database Password=arabia70_"
  269. Set rec1 = Server.CreateObject("ADODB.Recordset")
  270. qry = "select * from Tbl_Hotel_Info where Tbl_Hotel_Info.Htl_Id=" & htlId
  271. rec1.open qry,con1,1,3
  272. response.Write "<tr><td><b>"& rec1.fields(1) &"</b></td></tr>"
  273. response.Write "<tr><td>"& rec1.fields(3) & " " & rec1.fields(2) &"</td></tr>"
  274. rec1.close
  275. con1.close
  276. end function
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284. Function ConvertCurrencyToEnglish(ByVal strAmount)
  285. Dim Temp, Cy2
  286. Dim Dollars, Cents
  287. Dim DecimalPlace, Count
  288.  
  289. ReDim Place(9)
  290. Place(2) = " Thousand "
  291. Place(3) = " Million "
  292. Place(4) = " Billion "
  293. Place(5) = " Trillion "
  294.  
  295.  
  296.  
  297. ' Convert strAmount to a string, trimming extra spaces.
  298. strAmount = Trim(cStr(strAmount))
  299.  
  300. ' Find decimal place.
  301. DecimalPlace = InStr(strAmount, ".")
  302.  
  303. ' If we find decimal place...
  304. If DecimalPlace > 0 Then
  305. ' Convert cents
  306. Temp = Left(Mid(strAmount, DecimalPlace + 1) & "00", 2)
  307. Cents = ConvertTens(Temp)
  308.  
  309. ' Strip off cents from remainder to convert.
  310. strAmount = Trim(Left(strAmount, DecimalPlace - 1))
  311. End If
  312.  
  313. Count = 1
  314. Do While strAmount <> ""
  315. ' Convert last 3 digits of strAmount to English dollars.
  316. Temp = ConvertHundreds(Right(strAmount, 3))
  317. If Temp <> "" Then Dollars = Temp & Place(Count) & Dollars
  318. If Len(strAmount) > 3 Then
  319. ' Remove last 3 converted digits from strAmount.
  320. strAmount = Left(strAmount, Len(strAmount) - 3)
  321. Else
  322. strAmount = ""
  323. End If
  324. Count = Count + 1
  325. Loop
  326.  
  327. ' Clean up dollars.
  328. Select Case Dollars
  329. Case ""
  330. Dollars = cy1
  331. Case "One"
  332. Dollars = cy1
  333. Case Else
  334. Dollars = Dollars & " "& cy1
  335. End Select
  336.  
  337.  
  338. ' Clean up cents.
  339. if cCurr = "USD" then
  340. cy2 = "Cents"
  341. elseif cCurr = "AED" then
  342. cy2 = "Fils"
  343. else
  344. cy2 = "Pence"
  345. end if
  346.  
  347. Select Case Cents
  348. Case ""
  349. ' Cents = " And No Cents"
  350. Case "One"
  351. Cents = cy2
  352. Case Else
  353. Cents = " And " & Cents & cy2
  354. End Select
  355.  
  356. ConvertCurrencyToEnglish = Dollars & Cents
  357. End Function
  358.  
  359.  
  360.  
  361. Private Function ConvertHundreds(ByVal strAmount)
  362. Dim Result
  363.  
  364. ' Exit if there is nothing to convert.
  365. If eVal(strAmount) = 0 Then Exit Function
  366.  
  367. ' Append leading zeros to number.
  368. strAmount = Right("000" & strAmount, 3)
  369.  
  370. ' Do we have a hundreds place digit to convert?
  371. If Left(strAmount, 1) <> "0" Then
  372. Result = ConvertDigit(Left(strAmount, 1)) & " Hundred "
  373. End If
  374.  
  375. ' Do we have a tens place digit to convert?
  376. If Mid(strAmount, 2, 1) <> "0" Then
  377. Result = Result & ConvertTens(Mid(strAmount, 2))
  378. Else
  379. ' If not, then convert the ones place digit.
  380. Result = Result & ConvertDigit(Mid(strAmount, 3))
  381. End If
  382.  
  383. ConvertHundreds = Trim(Result)
  384. End Function
  385.  
  386.  
  387.  
  388. Private Function ConvertTens(ByVal MyTens)
  389. Dim Result
  390.  
  391. ' Is value between 10 and 19?
  392. If eVal(Left(MyTens, 1)) = 1 Then
  393. Select Case eVal(MyTens)
  394. Case 10: Result = "Ten"
  395. Case 11: Result = "Eleven"
  396. Case 12: Result = "Twelve"
  397. Case 13: Result = "Thirteen"
  398. Case 14: Result = "Fourteen"
  399. Case 15: Result = "Fifteen"
  400. Case 16: Result = "Sixteen"
  401. Case 17: Result = "Seventeen"
  402. Case 18: Result = "Eighteen"
  403. Case 19: Result = "Nineteen"
  404. Case Else
  405. End Select
  406. Else
  407. ' .. otherwise it's between 20 and 99.
  408. Select Case eVal(Left(MyTens, 1))
  409. Case 2: Result = "Twenty "
  410. Case 3: Result = "Thirty "
  411. Case 4: Result = "Forty "
  412. Case 5: Result = "Fifty "
  413. Case 6: Result = "Sixty "
  414. Case 7: Result = "Seventy "
  415. Case 8: Result = "Eighty "
  416. Case 9: Result = "Ninety "
  417. Case Else
  418. End Select
  419.  
  420. ' Convert ones place digit.
  421. Result = Result & ConvertDigit(Right(MyTens, 1))
  422. End If
  423.  
  424. ConvertTens = Result
  425. End Function
  426.  
  427.  
  428.  
  429. Private Function ConvertDigit(ByVal MyDigit)
  430. Select Case eVal(MyDigit)
  431. Case 1: ConvertDigit = "One"
  432. Case 2: ConvertDigit = "Two"
  433. Case 3: ConvertDigit = "Three"
  434. Case 4: ConvertDigit = "Four"
  435. Case 5: ConvertDigit = "Five"
  436. Case 6: ConvertDigit = "Six"
  437. Case 7: ConvertDigit = "Seven"
  438. Case 8: ConvertDigit = "Eight"
  439. Case 9: ConvertDigit = "Nine"
  440. Case Else: ConvertDigit = ""
  441. End Select
  442. End Function
  443.  
  444.  
  445. end if
  446.  
  447. %></td>
  448. </tr>
  449. <tr>
  450. <td><div align="center">
  451. <table width="99%" border="0" cellpadding="0" cellspacing="0">
  452. <tr>
  453. <td><ul><li class="style16">
  454. <div align="left"><span class="style17">Cancellation requests should be made 3 days prior to arrival.If we receive your notification of cancellation or booking amendment request after 1 day prior to your check-in date, cancellation fees will be charged as stipulated by the respective hotel. Please note cancellation fees may range from the equivalent of one night stay up to the full amount for the entire stay. Depending on the nature of the amendment request, our standard cancellation conditions may apply. Please note that no refunds will be made for no-shows or early check-outs.</span></div>
  455. </li>
  456. <li class="style15">
  457. <div align="left">The Hotel Voucher will be made out to the guest name as defined in your booking and must be presented upon check-in at the hotel. </div>
  458. </li>
  459. <li class="style15">
  460. <div align="left">For Airport transfers, flight details must be adviced / updated with us. Early check-in subject to availability. </div>
  461. </li>
  462. <li class="style15">
  463. <div align="left"><span class="style17">It is our sincere intention to provide you with the best service possible. For issues related to your booking or for any urgent enquiries, we encourage you to call 7 days / 24 hours on <strong>00-971-50-6791104</strong></span><br>
  464. </div>
  465. </li>
  466. </ul></td>
  467. </tr>
  468. <tr>
  469. <td>&nbsp;</td>
  470. </tr>
  471. </table>
  472. </div></td>
  473. </tr>
  474. </table>
  475. </body>
  476. </html>
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×