% '************************************************************************* 'Retrieve the latest rates sub getRates Dim data(20,20) '************************************************************************* 'Do any updates If inEditMode Then Dim k : k =1 '************************************************************************* 'Loop through any items in the Request For Each x In Request.Form Dim dItem : dItem = CStr(x) Dim dCount : dCount = Request.Form(x).Count Dim dValue If dCount > 1 Then dValue = Request.Form(x)(1) Else dValue = Request.Form(x) End iF Dim idNumber If (InStr(dItem,"lang_") > 0 ) Then idNumber = Mid(dItem,6,Len(dItem)) sqlStr = "update t_text set r_text = '" &Replace(dValue,"'","''")&"' where r_id = " & idNumber objConn.Execute(sqlStr) ElseIf (InStr(dItem,"rate_") > 0 ) Then idNumber = Mid(dItem,6,Len(dItem)) sqlStr = "update t_rates set r_price = '" &Replace(dValue,"'","''")&"' where r_id = " & idNumber objConn.Execute(sqlStr) End IF Next End If 'End Updates '************************************************************************* '************************************************************************* 'Set the inital values for the table data(0,0) = "Room Type" data(0,1) = " " data(1,1) = "Euro €" data(2,1) = "Euro €" data(3,1) = "Euro €" data(4,1) = "Euro €" Dim colCount : colCount = 1 Dim rowCount : rowCount = 2 '************************************************************************* 'Retrieve all the dates in the database sqlStr = "select * from t_dates order by r_order ASC" set recordSet = Server.CreateObject("ADODB.RecordSet") set recordSet = objConn.Execute(sqlStr) '************************************************************************* 'If in Edit mde, supploy a form for the user to update with If inEditMode Then Response.Write("
") End IF end sub '************************************************************************* 'getText(Reference ID, Language) 'Returns the Text stored in the database corresponding to the Reference ID and language function getText(refId,refLangId) Dim pStr : pStr= "" If refId <> "" Then Dim langRecordSet set langRecordSet = Server.CreateObject("ADODB.RecordSet") set langRecordSet = objConn.Execute("select r_id, r_text from t_text where r_reference = " & refId &" AND r_language = " & refLangId) if NOT langRecordSet.EOF Then Dim langId : langId = langRecordSet("r_id") Dim langText : langText = langRecordSet("r_text") If inEditMode Then pStr = "" Else pStr = langText End If Else pStr = "" End If langRecordSet.Close Set langRecordSet = nothing Else pStr="" End IF getText = pStr end function %>