<%@ 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=50 page_id=208 Dim QP_IsInStageMode QP_IsInStageMode = False 'define response properties Response.AddHeader "publisher", "Quantum Art's Q-Publishing 7.6 Wed, 16 Sep 2009 11:23: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 = "/upload/images" site_url = "/live/" base_upload_url = "/upload/" object_call_depth = 0 published_status_type_id=GetMaximumWeightStatusTypeId(50) PublishedStatusName=GetMaximumWeightStatusTypeName(50) FillValues Private Sub object941O() err.clear %><% Server.ScriptTimeout = 10000 AddValue "file", "on_line.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 object949O() 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 "FTP Error:" & objFtp.sError & objFtp.sErrorDesc AddValue "failed", "1" end if else Response.Write objFtp.sError & "
" & objFtp.sErrorDesc & "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 object953O() err.clear %><% dim connection, SQL, RS, contentName Set connection = Server.CreateObject("ADODB.Connection") connection.ConnectionString = "DSN=akdal_online;" connection.Open contentName = "Онлайн табло" Object("Номер контента") if Value("content_number") = 0 then contentName = contentName & " 1" end if SQL = "delete from content_item where content_item_id in (select content_item_id from content_" & GetContentId(contentName) & ")" cnn.Execute(SQL) SQL = "select * from on_line" Set RS = connection.Execute(SQL) While not(RS.EOF) AddValue FieldName(contentName,"Дата_вылета"), RS.Fields("date") AddValue FieldName(contentName,"Рейс"), RS.Fields("flight") AddValue FieldName(contentName,"Время_вылета_фактическое"), RS.Fields("time1_fact") AddValue FieldName(contentName,"Время_прибытия_фактическое"), RS.Fields("time2_fact") AddValue FieldName(contentName,"Статус"), RS.Fields("status_rus") AddValue FieldName(contentName,"Аэропорт_вылета_планируемый"), RS.Fields("depart_plan_rus") AddValue FieldName(contentName,"Время_вылета_планируемое"), RS.Fields("time1_plan") AddValue FieldName(contentName,"Время_прибытия_планируемое"), RS.Fields("time2_plan") AddValue FieldName(contentName,"Аэропорт_вылета_фактический"), RS.Fields("depart_fact_rus") AddValue FieldName(contentName,"Аэропорт_прибытия_планируемый"), RS.Fields("appoint_plan_rus") AddValue FieldName(contentName,"Аэропорт_прибытия_фактический"), RS.Fields("appoint_fact_rus") AddValue FieldName(contentName,"Флаг_рейса"), RS.Fields("flag") AddFormToContent contentName, "Published" Response.Write Value("content_item_id") & vbNewLine RS.MoveNext Wend SQL = "update content_data set data = data ^ 1 where content_item_id in (select content_item_id from content_" & GetContentId("Выбор контента") &") and attribute_id = " & FieldID("Выбор контента","Первый") cnn.Execute(SQL) SQL = "update content_data set data = getdate() where content_item_id in (select content_item_id from content_" & GetContentId("Выбор контента") &") and attribute_id = " & FieldID("Выбор контента","Изменено") cnn.Execute(SQL) 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 object944O() err.clear Dim FieldValuesDictionaryLocal, FieldNamesDictionaryLocal, ContainerInfoLocal Dim FieldValuesDictionaryBackup, FieldNamesDictionaryBackup, ContainerInfoBackup Set FieldValuesDictionaryLocal = CreateObject("Scripting.Dictionary") Set FieldNamesDictionaryLocal = CreateObject("Scripting.Dictionary") Set ContainerInfoLocal = New ContainerInfoClass If IsObject(FieldValuesDictionary) Then Set FieldValuesDictionaryBackup = FieldValuesDictionary If IsObject(FieldNamesDictionary) Then Set FieldNamesDictionaryBackup = FieldNamesDictionary If IsObject(ContainerInfo) Then Set ContainerInfoBackup = ContainerInfo Set FieldValuesDictionary = FieldValuesDictionaryLocal Set FieldNamesDictionary = FieldNamesDictionaryLocal Set ContainerInfo = ContainerInfoLocal ContainerInfo.ContentID = 362 ContainerInfo.ContentName = "Выбор контента" AddValue "dynamicContentNameSource", "CONTENT_362 AS c WITH (NOLOCK)" Dim cmd Set cmd = GetContainerCommand(cnn, "c.*" & "" , Value("dynamicContentNameSource") & "" , "c.visible = 1 " & "AND c.status_type_id = 131 " &" and c.archive = 0" & GetContainerFilterExpression(""), GetContainerOrderExpressionNew("",""), 1, 0,0) Set ContainerInfo.RecordSet = Server.CreateObject("ADODB.Recordset") With ContainerInfo.RecordSet .CursorLocation = adUseClient .Open cmd,, adOpenForwardOnly, adLockReadOnly If .State <> adStateClosed Then If Not .EOF Then End If ContainerInfo.Init cmd, 50, 362, 1, 0 While Not .EOF ContainerInfo.Adjust InitFieldValues ContainerInfo.RecordSet ContainerInfo.AdjustUploadUrl %><% AddValue "content_number", Field("Первый") %><% .MoveNext Wend .Close End If End With Set ContainerInfo.RecordSet = Nothing Set cmd = Nothing DisposeContainer If IsObject(FieldValuesDictionaryBackup) Then Set FieldValuesDictionary = FieldValuesDictionaryBackup If IsObject(FieldNamesDictionaryBackup) Then Set FieldNamesDictionary = FieldNamesDictionaryBackup If IsObject(ContainerInfoBackup) Then Set ContainerInfo = ContainerInfoBackup Set FieldValuesDictionaryLocal = Nothing Set FieldNamesDictionaryLocal = Nothing Set ContainerInfoLocal = 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("управление") object941O Case Trim("закачка") object949O Case Trim("импорт") object953O Case Trim("номер контента") object944O 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 %>