<% Dim objComm, objConn, objRs Dim objPdf dim strSQL, arrRows Dim intLanguage Set objConn = CreateObject("ADODB.Connection") objConn.Open = Application("DB01") If (objConn.Errors.Count > 0) Then For Each objErr in objConn.Errors If (objErr.Number <> 0) Then If (IsObject(objConn)) Then objConn.Close Set objConn = Nothing End If If (IsObject(objErr)) Then Set objErr = Nothing End If Response.Status = "400 Bad Request" Response.End End If Next End If ' 8 italiano ' 38 inglese If (objEcommerce.GLanguage = "{23BAA650-0A12-4414-8EAE-6E77BD13ACFF}") Then intLanguage = 8 Else intLanguage = 38 End If strSql = "SELECT value " & _ "FROM tblcontents co " & _ "WHERE contentid = " & intLanguage Set objComm = CreateObject("ADODB.Command") objComm.ActiveConnection = objConn objComm.CommandType = adCmdText objComm.CommandText = strSql Set objRs = CreateObject("ADODB.RecordSet") Set objRs = objComm.Execute If (objConn.Errors.Count > 0) Then For Each objErr in objConn.Errors If (objErr.Number <> 0) Then If (IsObject(objConn)) Then objConn.Close Set objConn = Nothing End If If (IsObject(objComm)) Then Set objComm = Nothing End If If (IsObject(objErr)) Then Set objErr = Nothing End If If (IsObject(objRs)) Then Set objRs = Nothing End If Response.Status = "400 Bad Request" Response.End End If Next End If If (objRs.State > 0) Then If ((Not objRs.BOF) And (Not objRs.EOF)) Then arrRows = objRs.GetRows objRs.Close Else arrRows = -1 End If Else arrRows = -1 End If If (IsArray(arrRows)) Then Set objPdf = CreateJsObject("FPDF") objPdf.CreatePDF() objPdf.SetPath("/system/engine/fpdf/") objPdf.Open() objPdf.SetLeftMargin(5) objPdf.AddPage("P") objPdf.AutoPageBreak = True objPdf.PageBreakTrigger = 280 objPdf.SetDisplayMode("fullpage") objPdf.lMargin = 10 objPdf.rMargin = 10 objPdf.SetXY 10, 10 objPdf.SetXY 10, 10 objPdf.Image "/pages/ecommerce/promo/1.jpg",0,10,74,17,"JPG" objPdf.SetTextColor "0", "0", "0" objPdf.SetFont "Arial", "B", 12 objPdf.SetXY 10, 35 objPdf.SetFont "Arial", "", 6.5 objPdf.MultiCell 190, 3.2, HTMLDecode(RemoveHTML(arrRows(0, 0))), 0, "J" objPdf.Close() Response.Clear objPdf.Output End If If (IsObject(objRs)) Then Set objRs = Nothing End If If (IsObject(objComm)) Then Set objComm = Nothing End If If (IsObject(objConn)) Then Set objConn = Nothing End If Function RemoveHTML(strText) Dim RegEx Set RegEx = New RegExp RegEx.Pattern = "<[^>]*>" regEx.Global = True RemoveHTML = RegEx.Replace(strText, "") End Function Function HTMLDecode(sText) sText = Replace(sText, """, Chr(34)) sText = Replace(sText, "<" , Chr(60)) sText = Replace(sText, ">" , Chr(62)) sText = Replace(sText, "&" , Chr(38)) sText = Replace(sText, " ", Chr(32)) sText = Replace(stext, "à", Chr(224)) stext = replace(stext, "è", Chr(232)) stext = replace(stext, "é", Chr(233)) stext = replace(stext, "ì", chr(236)) stext = replace(stext, "ò", chr(242)) stext = replace(stext, "ù", chr(249)) stext = replace(stext, "“", chr(147)) stext = replace(stext, "’", "'") stext = replace(stext, "”", chr(148)) stext = replace(stext, "€", Chr(128)) stext = replace(stext, "–", chr(150)) HTMLDecode = sText End Function %>