<%@ Language = 'JScript' LCID=1049 CodePage=1251 EnableSessionState=True %> <% Response.Expires = -1000; Response.CacheControl = "Private"; Response.AddHeader("Pragma", "no-cache"); Response.AddHeader("cache-control", "no-cache, no-store, must-revalidate"); Response.CharSet = "windows-1251"; %> <% var _uploadUrl = "/data/"; var _contentStatus = 3; var _languageID = 1; var _pageFile = "info.asp"; if (_rootUrl == undefined) _rootUrl = "/"; %> <% // Object GetInfoPage function GetInfoPage ( /* ... */ ) { // Constructor this.parameters = arguments; %> <% this.id = 0; if (arguments.length > 0 && !isNaN(parseInt(GetInfoPage.arguments[0]))) { this.id = parseInt(GetInfoPage.arguments[0]); } %> <% // Show Function this.Show = ShowGetInfoPage; // Formats this.Default = _GetInfoPage_Default; this.GetTitle = _GetInfoPage_GetTitle; //Recordset this.RS = execSQL("select * from " + _tableName["Информационные страницы"] + " where language_id = " + _languageID + " and status_id >= " + _contentStatus + " and content_id = " + this.id + ""); } function ShowGetInfoPage(sFormat) { if (this.RS.EOF && this.RS.RecordCount > 0) this.RS.MoveFirst(); if (sFormat == undefined) sFormat = "Default"; var _Container = new Object(); var RecordCount = this.RS.RecordCount; var StartPos = 0; var EndPos = this.RS.RecordCount; if (StartPos < RecordCount) this.RS.Move(StartPos); if (EndPos > RecordCount) EndPos = RecordCount; _Container["RecordCount"] = this.RS.RecordCount; _Container["MaxRows"] = EndPos; for (var i = StartPos; i < EndPos; i++) { _Container["CurrentRow"] = i; var _Fields = this.RS.Fields; switch(sFormat) { case "Default": this.Default(_Container, _Fields); break; case "GetTitle": this.GetTitle(_Container, _Fields); break; default: eval("Format_not_found_______GetInfoPage_____" + sFormat + ""); } this.RS.MoveNext(); } } // Format Default function _GetInfoPage_Default(_Container, _Fields) { %>
<%=String(_Fields("Заголовок").Value).toUpperCase()%>
<%=_Fields("Текст").Value%>
<% } // Format GetTitle function _GetInfoPage_GetTitle(_Container, _Fields) { %> <%_SetValue("title", _Fields("Заголовок").Value);%> <% } // Object Title function Title ( /* ... */ ) { // Constructor this.parameters = arguments; %> <% // Show Function this.Show = ShowTitle; // Formats this.Default = _Title_Default; } function ShowTitle(sFormat) { if (sFormat == undefined) sFormat = "Default"; var _Container = new Object(); var _Fields = new Object(); switch(sFormat) { case "Default": this.Default(_Container, _Fields); break; default: eval("Format_not_found_______Title_____" + sFormat + ""); } } // Format Default function _Title_Default(_Container, _Fields) { %> <% var title ="Impex - мебель"; if (!isNaN(_GetValue("view")) && (_GetValue("view") > "")) { new GetInfoPage(_GetValue("view")).Show("GetTitle"); } title += " - " + _GetValue("title", ""); Out(title); %> <% } function _PageCode() { %> <% if (!isNaN(_GetValue("view")) && (_GetValue("view") > "")) { new GetInfoPage(_GetValue("view")).Show(); } %> <% } _TemplateCode(); dbDisconnect(); %>