<%@ Language = 'VbScript' LCID=1049 CodePage=1251 EnableSessionState=True%> <% Option Explicit %> <% Response.CharSet = "windows-1251" %> <% cnn.Open Application("ConnectionString") Randomize 'defining the global variables dim site_id, page_id, strSQL site_id=51 page_id=249 Dim QP_IsInStageMode QP_IsInStageMode = False 'define response properties Response.AddHeader "publisher", "Quantum Art's Q-Publishing 7.6 Wed, 16 Sep 2009 11:27:34 GMT" Response.Expires = -1000 Response.CacheControl = "Private" Response.AddHeader "Pragma", "no-cache" Response.AddHeader "cache-control", "no-cache, no-store, must-revalidate" dim upload_url, base_upload_url, published_status_type_id, object_call_depth Dim AbsUploadURL, UploadURLPrefix, PublishedStatusName Dim QP_IsInFrontend QP_IsInFrontend = True dim object_call_stack(20) upload_url = "/eng/upload/images" site_url = "/eng/live/" base_upload_url = "/eng/upload/" object_call_depth = 0 published_status_type_id=GetMaximumWeightStatusTypeId(51) PublishedStatusName=GetMaximumWeightStatusTypeName(51) FillValues Private Sub object1123O() err.clear %><% Server.ScriptTimeout = 10000 AddValue "file", "timetable.mdb" Object("Закачка") if Value("failed") <> "1" then Object("Импорт") end if %><% If Err.Number <> 0 Then Response.write("Unable to display object 'управление' correctly!
Details
: " & err.description) End If End Sub Private Sub object1124O() err.clear %><% dim objFTP Set objFTP = Server.CreateObject("NIBLACK.ASPFTP") objFTP.lTransferType = 2 'BINARY objFTP.sServerName = "post.akdal.ru" objFTP.sUserID = "quantumart" objFTP.sPassword = "#qart1234" objFTP.bPassiveMode = True If objFTP.bConnect Then Response.Write("Connected") & "
" Response.Write(Application("import_dir") & Value("file")) & "
" If objFTP.bGetFile(Value("file"), Application("import_dir") & Value("file")) Then Response.Write("OK") else Response.Write objFtp.sError AddValue "failed", "1" end if else Response.Write objFtp.sError & "OBLOM" AddValue "failed", "1" end if Set objFTP = Nothing %><% If Err.Number <> 0 Then Response.write("Unable to display object 'закачка' correctly!
Details
: " & err.description) End If End Sub Private Sub object1126O() err.clear %><% dim connection, SQL, RS, contentName Set connection = Server.CreateObject("ADODB.Connection") connection.ConnectionString = "DSN=akdal_timetable;" connection.Open contentName = "Расписание" SQL = "delete from content_item where content_item_id in (select content_item_id from content_" & GetContentId(contentName) & ")" cnn.Execute(SQL) SQL = "select * from [Timetable_web]" Set RS = connection.Execute(SQL) While not(RS.EOF) AddValue FieldName(contentName,"Рейс"), RS.Fields("REIS") AddValue FieldName(contentName,"Московское_время_вылета"), RS.Fields("TIME1_MOW") AddValue FieldName(contentName,"Московское_время_прибытия"), RS.Fields("TIME2_MOW") AddValue FieldName(contentName,"Класс"), RS.Fields("CLASS_RUS") AddValue FieldName(contentName,"Class"), RS.Fields("CLASS_ENG") AddValue FieldName(contentName,"Аэропорт_вылета"), RS.Fields("AIRPORT1_RUS") AddValue FieldName(contentName,"Аэропорт_прибытия"), RS.Fields("AIRPORT2_RUS") AddValue FieldName(contentName,"Take_off_Airport"), RS.Fields("AIRPORT1_ENG") AddValue FieldName(contentName,"Arrival_Airport"), RS.Fields("AIRPORT2_ENG") AddValue FieldName(contentName,"Местное_время_вылета"), RS.Fields("TIME1_LOCAL") AddValue FieldName(contentName,"Местное_время_прибытия"), RS.Fields("TIME2_LOCAL") AddValue FieldName(contentName,"День_недели"), RS.Fields("WEEKDAY") AddValue FieldName(contentName,"Тип_самолета"), RS.Fields("TBC") AddValue FieldName(contentName,"Aircraft_type"), RS.Fields("TBC_ENG") AddValue FieldName(contentName,"Действительно_с"), RS.Fields("INNV") AddValue FieldName(contentName,"Действительно_до"), RS.Fields("OFNV") AddFormToContent contentName, "Published" Response.Write Value("content_item_id") & vbNewLine RS.MoveNext Wend RS.Close Set RS = Nothing connection.Close Set connection = Nothing %><% If Err.Number <> 0 Then Response.write("Unable to display object 'импорт' correctly!
Details
: " & err.description) End If End Sub Private Sub CallStackOverflow() Response.Write "Object Call Stack Overflow
Call Stack:
" dim i for i=1 to 20 Response.Write object_call_stack(i)&"
" next Response.End End Sub Private Function ObjectNS(name) Object(name) End Function Private Function Object(name) object_call_depth = object_call_depth + 1 if object_call_depth > 20 then CallStackOverflow object_call_stack(object_call_depth) = name Select Case Trim(lCase(name)) Case Trim("управление") object1123O Case Trim("закачка") object1124O Case Trim("импорт") object1126O Case Else Response.Write "Object " & name & " not found.
" End Select object_call_depth = object_call_depth - 1 End Function Function LangObject (objectName) Dim lang lang = Value ("lang") if ( lang = "en" or lang = "am" ) then Object (objectName & "_" & lang) else Object (objectName) end if End Function %> <% Object("Управление") %> <% DisposeValues cnn.Close %>