403Webshell
Server IP : 103.118.17.23  /  Your IP : 216.73.216.169
Web Server : Microsoft-IIS/10.0
System : Windows NT RESELLERPLESK22 10.0 build 20348 (Windows Server 2016) AMD64
User : IWAM_plesk(default) ( 0)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  E:/Inetpub/vhosts/mesa.org.in/httpdocs/panel/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : E:/Inetpub/vhosts/mesa.org.in/httpdocs/panel/Videosview.asp
<%@ CodePage="65001" %>
<%
Response.Buffer = EW_RESPONSE_BUFFER
%>
<!--#include file="ewcfg.asp"-->
<!--#include file="Videosinfo.asp"-->
<!--#include file="aspfn.asp"-->
<!--#include file="userfn.asp"-->
<% Call ew_Header(False, EW_CHARSET, False) %>
<%

' Define page object
Dim Videos_view
Set Videos_view = New cVideos_view
Set Page = Videos_view

' Page init processing
Call Videos_view.Page_Init

' Page main
Call Videos_view.Page_Main

' Global Page Rendering event (in userfn*.asp)
Page_Rendering()

' Page Render event
Videos_view.Page_Render()
%>
<!--#include file="header.asp"-->
<% If Videos.Export = "" Then %>
<script type="text/javascript">
// Form object
var CurrentPageID = EW_PAGE_ID = "view";
var CurrentForm = fVideosview = new ew_Form("fVideosview", "view");
// Form_CustomValidate event
fVideosview.Form_CustomValidate = 
 function(fobj) { // DO NOT CHANGE THIS LINE!
 	// Your custom validation code here, return false if invalid. 
 	return true;
 }
// Use JavaScript validation or not
<% If EW_CLIENT_VALIDATE Then %>
fVideosview.ValidateRequired = true; // Use JavaScript validation
<% Else %>
fVideosview.ValidateRequired = false; // No JavaScript validation
<% End If %>
// Dynamic selection lists
fVideosview.Lists["x_Enable"] = {"LinkField":"","Ajax":null,"AutoFill":false,"DisplayFields":["","","",""],"ParentFields":[],"ChildFields":[],"FilterFields":[],"Options":[],"Template":""};
fVideosview.Lists["x_Enable"].Options = <%= ew_ArrayToJson(Videos.Enable.Options(False)) %>;
fVideosview.Lists["x_Home_Enable"] = {"LinkField":"","Ajax":null,"AutoFill":false,"DisplayFields":["","","",""],"ParentFields":[],"ChildFields":[],"FilterFields":[],"Options":[],"Template":""};
fVideosview.Lists["x_Home_Enable"].Options = <%= ew_ArrayToJson(Videos.Home_Enable.Options(False)) %>;
<% Set arAS = Nothing %>
// Form object for search
</script>
<script type="text/javascript">
// Write your client script here, no need to add script tags.
</script>
<% End If %>
<% If Videos.Export = "" Then %>
<div class="ewToolbar">
<%
	Call Videos_view.ExportOptions.Render("body", "", "", "", "", "")
	Call Videos_view.ActionOptions.Render("body", "", "", "", "", "")
	Call Videos_view.DetailOptions.Render("body", "", "", "", "", "")
%>
<div class="clearfix"></div>
</div>
<% End If %>
<% Call Videos_view.ShowPageHeader %>
<% Call Videos_view.ShowMessage %>
<form name="fVideosview" id="fVideosview" class="form-inline ewForm ewViewForm" action="<%= ew_CurrentPage %>" method="post">
<% If Videos_view.CheckToken Then %>
<input type="hidden" name="<%= EW_TOKEN_NAME %>" value="<%= Videos_view.Token %>">
<% End If %>
<input type="hidden" name="t" value="Videos">
<input type="hidden" name="modal" value="<%= ew_IIf(Videos_view.IsModal, "1", "0") %>">
<table class="table table-striped table-bordered table-hover table-condensed ewViewTable">
<% If Videos.ID.Visible Then ' ID %>
	<tr id="r_ID">
		<td class="col-sm-2"><span id="elh_Videos_ID"><%= Videos.ID.FldCaption %></span></td>
		<td data-name="ID"<%= Videos.ID.CellAttributes %>>
<span id="el_Videos_ID" class="form-group">
<span<%= Videos.ID.ViewAttributes %>>
<%= Videos.ID.ViewValue %>
</span>
</span>
</td>
	</tr>
<% End If %>
<% If Videos.Movie_Title.Visible Then ' Movie_Title %>
	<tr id="r_Movie_Title">
		<td class="col-sm-2"><span id="elh_Videos_Movie_Title"><%= Videos.Movie_Title.FldCaption %></span></td>
		<td data-name="Movie_Title"<%= Videos.Movie_Title.CellAttributes %>>
<span id="el_Videos_Movie_Title" class="form-group">
<span<%= Videos.Movie_Title.ViewAttributes %>>
<%= Videos.Movie_Title.ViewValue %>
</span>
</span>
</td>
	</tr>
<% End If %>
<% If Videos.URL.Visible Then ' URL %>
	<tr id="r_URL">
		<td class="col-sm-2"><span id="elh_Videos_URL"><%= Videos.URL.FldCaption %></span></td>
		<td data-name="URL"<%= Videos.URL.CellAttributes %>>
<span id="el_Videos_URL" class="form-group">
<span<%= Videos.URL.ViewAttributes %>>
<%= Videos.URL.ViewValue %>
</span>
</span>
</td>
	</tr>
<% End If %>
<% If Videos.Enable.Visible Then ' Enable %>
	<tr id="r_Enable">
		<td class="col-sm-2"><span id="elh_Videos_Enable"><%= Videos.Enable.FldCaption %></span></td>
		<td data-name="Enable"<%= Videos.Enable.CellAttributes %>>
<span id="el_Videos_Enable" class="form-group">
<span<%= Videos.Enable.ViewAttributes %>>
<%= Videos.Enable.ViewValue %>
</span>
</span>
</td>
	</tr>
<% End If %>
<% If Videos.Home_Enable.Visible Then ' Home_Enable %>
	<tr id="r_Home_Enable">
		<td class="col-sm-2"><span id="elh_Videos_Home_Enable"><%= Videos.Home_Enable.FldCaption %></span></td>
		<td data-name="Home_Enable"<%= Videos.Home_Enable.CellAttributes %>>
<span id="el_Videos_Home_Enable" class="form-group">
<span<%= Videos.Home_Enable.ViewAttributes %>>
<%= Videos.Home_Enable.ViewValue %>
</span>
</span>
</td>
	</tr>
<% End If %>
<% If Videos.Sequence.Visible Then ' Sequence %>
	<tr id="r_Sequence">
		<td class="col-sm-2"><span id="elh_Videos_Sequence"><%= Videos.Sequence.FldCaption %></span></td>
		<td data-name="Sequence"<%= Videos.Sequence.CellAttributes %>>
<span id="el_Videos_Sequence" class="form-group">
<span<%= Videos.Sequence.ViewAttributes %>>
<%= Videos.Sequence.ViewValue %>
</span>
</span>
</td>
	</tr>
<% End If %>
</table>
</form>
<% If Videos.Export <> "" Then %>
<script type="text/javascript">
ew_ApplyTemplate("body", "", "Videosview", "<%= Videos.CustomExport %>");
</script>
<% End If %>
<% If Videos.Export = "" Then %>
<script type="text/javascript">
fVideosview.Init();
</script>
<% End If %>
<%
Call Videos_view.ShowPageFooter
If EW_DEBUG_ENABLED Then Response.Write ew_DebugMsg()
%>
<% If Videos.Export = "" Then %>
<script type="text/javascript">
// Write your table-specific startup script here
// document.write("page loaded");
</script>
<% End If %>
<!--#include file="footer.asp"-->
<%

' Clean up and drop page object
Call Videos_view.Page_Terminate("")
Set Videos_view = Nothing
%>
<%

'
' Page Class
'
Class cVideos_view

	' Page ID
	Public Property Get PageID
		PageID = "view"
	End Property

	' Project ID
	Public Property Get ProjectID
		ProjectID = "panel"
	End Property

	' Table Name
	Public Property Get TableName
		TableName = "Videos"
	End Property

	' Page Object Name
	Public Property Get PageObjName
		PageObjName = "Videos_view"
	End Property

	' Field (ID)
	Public Property Get ID
		Set ID = Videos.ID
	End Property

	' Field (Movie_Title)
	Public Property Get Movie_Title
		Set Movie_Title = Videos.Movie_Title
	End Property

	' Field (URL)
	Public Property Get URL
		Set URL = Videos.URL
	End Property

	' Field (Enable)
	Public Property Get Enable
		Set Enable = Videos.Enable
	End Property

	' Field (Home_Enable)
	Public Property Get Home_Enable
		Set Home_Enable = Videos.Home_Enable
	End Property

	' Field (Sequence)
	Public Property Get Sequence
		Set Sequence = Videos.Sequence
	End Property

	' Get field object dictionary (ASP)
	Public Property Get Fields
		Set Fields = Videos.Fields
	End Property

	' Get field object by name (alias of Fields) (ASP)
	Public Function GetField(Name)
		Set GetField = Fields.Get(Name)
	End Function

	' Get field object by parm (ASP)
	Public Function GetFieldByParm(Parm)
		Dim keys, key
		keys = Fields.Keys()
		For Each key In keys
			If Fields.Get(key).FldParm = Parm Then
				Set GetFieldByParm = Fields.Get(key)
				Exit Function
			End If
		Next
		Set GetFieldByParm = Nothing
	End Function

	' Export document (ASP)
	Dim ExportDoc

	' Page headings
	Dim Heading
	Dim Subheading

	' Page heading
	Function PageHeading()
		PageHeading = ""
		If Heading <> "" Then
			PageHeading = Heading
		ElseIf ew_NotEmpty(Videos) Then
			PageHeading = Videos.TableCaption
		End If
	End Function

	' Page subheading
	Function PageSubheading()
		If Subheading <> "" Then
			PageSubheading = Subheading
		Else
			PageSubheading = ""
			If TableName <> "" Then
				PageSubheading = Language.Phrase(PageID)
			End If
		End If
	End Function

	' Page Name
	Public Property Get PageName
		PageName = ew_CurrentPage()
	End Property

	' Page Url
	Public Property Get PageUrl
		PageUrl = ew_CurrentPage() & "?"
		If Videos.UseTokenInUrl Then PageUrl = PageUrl & "t=" & Videos.TableVar & "&" ' add page token
	End Property

	' Common URLs
	Dim AddUrl
	Dim EditUrl
	Dim CopyUrl
	Dim DeleteUrl
	Dim ViewUrl
	Dim ListUrl

	' Export URLs
	Dim ExportPrintUrl
	Dim ExportHtmlUrl
	Dim ExportExcelUrl
	Dim ExportWordUrl
	Dim ExportXmlUrl
	Dim ExportCsvUrl
	Dim ExportPdfUrl

	' Custom export
	Dim ExportExcelCustom
	Dim ExportWordCustom
	Dim ExportPdfCustom
	Dim ExportEmailCustom

	' Inline URLs
	Dim InlineAddUrl
	Dim InlineCopyUrl
	Dim InlineEditUrl
	Dim GridAddUrl
	Dim GridEditUrl
	Dim MultiDeleteUrl
	Dim MultiUpdateUrl

	' Message
	Public Property Get Message
		Message = Session(EW_SESSION_MESSAGE)
	End Property

	Public Property Let Message(v)
		Dim msg
		msg = Session(EW_SESSION_MESSAGE)
		Call ew_AddMessage(msg, v)
		Session(EW_SESSION_MESSAGE) = msg
	End Property

	Public Property Get FailureMessage
		FailureMessage = Session(EW_SESSION_FAILURE_MESSAGE)
	End Property

	Public Property Let FailureMessage(v)
		Dim msg
		msg = Session(EW_SESSION_FAILURE_MESSAGE)
		Call ew_AddMessage(msg, v)
		Session(EW_SESSION_FAILURE_MESSAGE) = msg
	End Property

	Public Property Get SuccessMessage
		SuccessMessage = Session(EW_SESSION_SUCCESS_MESSAGE)
	End Property

	Public Property Let SuccessMessage(v)
		Dim msg
		msg = Session(EW_SESSION_SUCCESS_MESSAGE)
		Call ew_AddMessage(msg, v)
		Session(EW_SESSION_SUCCESS_MESSAGE) = msg
	End Property

	Public Property Get WarningMessage
		WarningMessage = Session(EW_SESSION_WARNING_MESSAGE)
	End Property

	Public Property Let WarningMessage(v)
		Dim msg
		msg = Session(EW_SESSION_WARNING_MESSAGE)
		Call ew_AddMessage(msg, v)
		Session(EW_SESSION_WARNING_MESSAGE) = msg
	End Property

	' Methods to clear message
	Public Sub ClearMessage()
		Session(EW_SESSION_MESSAGE) = ""
	End Sub

	Public Sub ClearFailureMessage()
		Session(EW_SESSION_FAILURE_MESSAGE) = ""
	End Sub

	Public Sub ClearSuccessMessage()
		Session(EW_SESSION_SUCCESS_MESSAGE) = ""
	End Sub

	Public Sub ClearWarningMessage()
		Session(EW_SESSION_WARNING_MESSAGE) = ""
	End Sub

	Public Sub ClearMessages()
		Session(EW_SESSION_MESSAGE) = ""
		Session(EW_SESSION_FAILURE_MESSAGE) = ""
		Session(EW_SESSION_SUCCESS_MESSAGE) = ""
		Session(EW_SESSION_WARNING_MESSAGE) = ""
	End Sub

	' Show Message
	Public Sub ShowMessage()
		Dim hidden, html, sMessage
		hidden = False
		html = ""

		' Message
		sMessage = Message
		Call Message_Showing(sMessage, "")
		If sMessage <> "" Then ' Message in Session, display
			If Not hidden Then sMessage = "<button type=""button"" class=""close"" data-dismiss=""alert"">&times;</button>" & sMessage
			html = html & "<div class=""alert alert-info ewInfo"">" & sMessage & "</div>"
			Session(EW_SESSION_MESSAGE) = "" ' Clear message in Session
		End If

		' Warning message
		Dim sWarningMessage
		sWarningMessage = WarningMessage
		Call Message_Showing(sWarningMessage, "warning")
		If sWarningMessage <> "" Then ' Message in Session, display
			If Not hidden Then sWarningMessage = "<button type=""button"" class=""close"" data-dismiss=""alert"">&times;</button>" & sWarningMessage
			html = html & "<div class=""alert alert-warning ewWarning"">" & sWarningMessage & "</div>"
			Session(EW_SESSION_WARNING_MESSAGE) = "" ' Clear message in Session
		End If

		' Success message
		Dim sSuccessMessage
		sSuccessMessage = SuccessMessage
		Call Message_Showing(sSuccessMessage, "success")
		If sSuccessMessage <> "" Then ' Message in Session, display
			If Not hidden Then sSuccessMessage = "<button type=""button"" class=""close"" data-dismiss=""alert"">&times;</button>" & sSuccessMessage
			html = html & "<div class=""alert alert-success ewSuccess"">" & sSuccessMessage & "</div>"
			Session(EW_SESSION_SUCCESS_MESSAGE) = "" ' Clear message in Session
		End If

		' Failure message
		Dim sErrorMessage
		sErrorMessage = FailureMessage
		Call Message_Showing(sErrorMessage, "failure")
		If sErrorMessage <> "" Then ' Message in Session, display
			If Not hidden Then sErrorMessage = "<button type=""button"" class=""close"" data-dismiss=""alert"">&times;</button>" & sErrorMessage
			html = html & "<div class=""alert alert-danger ewError"">" & sErrorMessage & "</div>"
			Session(EW_SESSION_FAILURE_MESSAGE) = "" ' Clear message in Session
		End If
		Response.Write "<div class=""ewMessageDialog""" & ew_IIf(hidden, " style=""display: none;""", "") & ">" & html & "</div>"
	End Sub
	Dim PageHeader
	Dim PageFooter

	' Show Page Header
	Public Sub ShowPageHeader()
		Dim sHeader
		sHeader = PageHeader
		Call Page_DataRendering(sHeader)
		If sHeader <> "" Then ' Header exists, display
			Response.Write "<p>" & sHeader & "</p>"
		End If
	End Sub

	' Show Page Footer
	Public Sub ShowPageFooter()
		Dim sFooter
		sFooter = PageFooter
		Call Page_DataRendered(sFooter)
		If sFooter <> "" Then ' Footer exists, display
			Response.Write "<p>" & sFooter & "</p>"
		End If
	End Sub

	'
	' Validate Page request
	'
	Public Function IsPageRequest()
		If Videos.UseTokenInUrl Then
			IsPageRequest = False
			If ew_NotEmpty(ObjForm) Then
				IsPageRequest = (Videos.TableVar = ObjForm.GetValue("t"))
			End If
			If Request.QueryString("t").Count > 0 Then
				IsPageRequest = (Videos.TableVar = Request.QueryString("t"))
			End If
		Else
			IsPageRequest = True
		End If
	End Function
	Dim Token
	Dim CheckToken
	Dim TokenTimeout

	' Valid Post
	Function ValidPost()
		If Not CheckToken Or Not ew_IsPost() Then
			ValidPost = True
			Exit Function
		End If
		If Request.Form(EW_TOKEN_NAME).Count = 0 Then
			ValidPost = False
			Exit Function
		End If
		ValidPost = ew_CheckToken(Request.Form(EW_TOKEN_NAME),TokenTimeout)
	End Function

	' Create Token
	Sub CreateToken()
		If CheckToken And Token = "" Then
			Token = ew_CreateToken()
			gsToken = Token ' Save to global variable
		End If
	End Sub

	'
	' Class initialize
	'
	Private Sub Class_Initialize()
		Session.LCID = 1033 ' Always use US locale id
		If IsEmpty(StartTimer) Then StartTimer = Timer ' Init start time

		' Check Token
		Token = ""
		CheckToken = EW_CHECK_TOKEN
		TokenTimeout = 0
		TokenTimeout = ew_SessionTimeoutTime()

		' Initialize language object
		If IsEmpty(Language) Then
			Set Language = New cLanguage
			Call Language.LoadPhrases
		End If

		' Initialize table object
		If IsEmpty(Videos) Then Set Videos = New cVideos
		Set Table = Videos
		ExportExcelCustom = False
		ExportWordCustom = False
		ExportPdfCustom = True ' Always use ew_ApplyTemplate
		ExportEmailCustom = True ' Always use ew_ApplyTemplate

		' Initialize URLs
		Dim KeyUrl
		KeyUrl = ""
		Set RecKey = Dictionary()
		If Request.QueryString("ID").Count > 0 Then
			Call RecKey.Add("ID", Request.QueryString("ID"))
			KeyUrl = KeyUrl & "&amp;ID=" & ew_UrlEncode(Request.QueryString("ID"))
		End If
		ExportPrintUrl = PageUrl & "export=print" & KeyUrl
		ExportHtmlUrl = PageUrl & "export=html" & KeyUrl
		ExportExcelUrl = PageUrl & "export=excel" & KeyUrl
		ExportWordUrl = PageUrl & "export=word" & KeyUrl
		ExportXmlUrl = PageUrl & "export=xml" & KeyUrl
		ExportCsvUrl = PageUrl & "export=csv" & KeyUrl
		ExportPdfUrl = PageUrl & "export=pdf" & KeyUrl

		' Initialize form object
		Set ObjForm = Nothing

		' Get resize object
		Call ew_GetResizeObj

		' Intialize page id (for backward compatibility)
		EW_PAGE_ID = "view"

		' Initialize table name (for backward compatibility)
		EW_TABLE_NAME = "Videos"

		' Debug message
		Call ew_LoadDebugMsg

		' Open connection to the database
		If IsEmpty(Conn) Then
			Set Conn = ew_Connect(Videos.TableDBID)
		End If

		' Export options
		Set ExportOptions = New cListOptions
		ExportOptions.TableVar = Videos.TableVar
		ExportOptions.Tag = "div"
		ExportOptions.TagClassName = "ewExportOption"

		' Other options
		Set ActionOptions = New cListOptions
		ActionOptions.Tag = "div"
		ActionOptions.TagClassName = "ewActionOption"
		Set DetailOptions = New cListOptions
		DetailOptions.Tag = "div"
		DetailOptions.TagClassName = "ewDetailOption"
	End Sub

	'
	' Page_Init
	'
	Sub Page_Init()

		' Is modal
		IsModal = (Request.QueryString("modal") = "1" Or Request.Form("modal") = "1")

		' User profile
		Set UserProfile = New cUserProfile

		' Security
		Set Security = New cAdvancedSecurity
		If Not Security.IsLoggedIn() Then Security.AutoLogin()
		Call Security.LoadCurrentUserLevel(ProjectID & TableName)
		If Not Security.CanView Then
			Call Security.SaveLastUrl
			If Security.CanList Then
				Call Page_Terminate(ew_GetUrl("Videoslist.asp"))
			Else
				Call Page_Terminate(ew_GetUrl("login.asp"))
			End If
		End If
		Call Videos.ID.SetVisibility(Videos)
		If Videos.IsAdd() Or Videos.IsCopy() Or Videos.IsGridAdd() Then
			Videos.ID.Visible = False
		End If
		Call Videos.Movie_Title.SetVisibility(Videos)
		Call Videos.URL.SetVisibility(Videos)
		Call Videos.Enable.SetVisibility(Videos)
		Call Videos.Home_Enable.SetVisibility(Videos)
		Call Videos.Sequence.SetVisibility(Videos)

		' Global page loading event (in userfn*.asp)
		Call Page_Loading

		' Page load event, used in current page
		Call Page_Load

		' Check token
		If Not ValidPost() Then
			Response.Write Language.Phrase("InvalidPostRequest")
			Call Page_Terminate("")
			Response.End
		End If

		' Create Token
		Call CreateToken
	End Sub

	'
	' Page_Terminate
	'
	Sub Page_Terminate(url)
		If Request.Form("customexport")&"" = "" Then

			' Page unload event, used in current page
			Call Page_Unload

			' Global page unloaded event (in userfn*.asp)
			Call Page_Unloaded
		End If

		' Export
		If ew_NotEmpty(Videos) Then
			If Videos.Export <> "" And Request.Form("data").Count > 0 Then
				Dim sContent
				sContent = Request.Form("data")
				gsExportFile = Request.Form("filename")
				If gsExportFile = "" Then gsExportFile = Videos.TableVar
				If Videos.Export = "pdf" Then
					Call ExportPdf(sContent)
				ElseIf Videos.Export = "email" Then
					Response.Write ExportEmail(sContent)
				ElseIf Videos.Export = "excel" Then
					Call ExportExcel(sContent)
				ElseIf Videos.Export = "word" Then
					Call ExportWord(sContent)
				End If
			End If
		End If
		Dim sRedirectUrl
		sRedirectUrl = url
		Call Page_Redirecting(sRedirectUrl)
		Call ew_CloseConn ' Close Connection
		Set Security = Nothing
		Set ObjForm = Nothing
		Set gResizeObj = Nothing

		' Go to URL if specified
		If gsExport & "" = "" Then
			If sRedirectUrl <> "" Then
				If Response.Buffer Then Response.Clear

				' Handle modal response
				If IsModal Then ' Show as modal
					Dim row, pageName
					Set row = Dictionary()
					Call row.Add("url", sRedirectURL)
					Call row.Add("modal", "1")
					pageName = ew_GetPageName(sRedirectURL)
					If pageName <> Videos.ListUrl Then ' Not List page
						Call row.Add("caption", Videos.GetModalCaption(pageName))
						If pageName = "Videosview.asp" Then
							Call row.Add("view", "1")
						End If
					Else 'List page should not be shown as modal => error
						Call row.Add("error", FailureMessage)
						Call ClearFailureMessage
					End If
					Call ResponseJson
					Response.Write "[" & row.ToJson() & "]"
					Set row = Nothing
					Response.End
				Else
					Call ew_SaveDebugMsg
					Response.Redirect sRedirectUrl
				End If
			End If
		End If
		Set Videos = Nothing
		Call ew_CleanUp
	End Sub

	'
	' Page_Terminate (End)
	'

	Dim DbMasterFilter, DbDetailFilter
	Dim DisplayRecs ' Number of display records
	Dim StartRec, StopRec, TotalRecs, RecRange
	Dim AutoHidePager
	Dim RecCnt
	Dim RecKey
	Dim IsModal
	Dim ExportOptions ' Export options
	Dim DetailOptions ' Other options (detail)
	Dim ActionOptions ' Other options (action)
	Dim Recordset

	'
	' Page main
	'
	Sub Page_Main()

		' Paging variables
		DisplayRecs = 1
		RecRange = 10
		AutoHidePager = EW_AUTO_HIDE_PAGER

		' Load current record
		Dim bLoadCurrentRecord
		bLoadCurrentRecord = False

		' Check modal
		If IsModal Then gbSkipHeaderFooter = True
		Dim sReturnUrl
		sReturnUrl = ""
		Dim bMatchRecord
		bMatchRecord = False
		If IsPageRequest Then ' Validate request
			If Request.QueryString("ID").Count > 0 Then
				Videos.ID.QueryStringValue = Request.QueryString("ID")
			ElseIf Request.Form("ID").Count > 0 Then
				Videos.ID.FormValue = Request.Form("ID")
			Else
				sReturnUrl = "Videoslist.asp" ' Return to list
			End If

			' Get action
			Videos.CurrentAction = "I" ' Display form
			Select Case Videos.CurrentAction
				Case "I" ' Get a record to display
					If Not LoadRow() Then ' Load record based on key
						If SuccessMessage = "" And FailureMessage = "" Then
							FailureMessage = Language.Phrase("NoRecord") ' Set no record message
						End If
						sReturnUrl = "Videoslist.asp" ' No matching record, return to list
					End If
			End Select
		Else
			sReturnUrl = "Videoslist.asp" ' Not page request, return to list
		End If
		If sReturnUrl <> "" Then Call Page_Terminate(sReturnUrl)

		' Set up Breadcrumb
		If Videos.Export = "" Then
			Call SetupBreadcrumb
		End If

		' Render row
		Videos.RowType = EW_ROWTYPE_VIEW
		Call Videos.ResetAttrs
		Call RenderRow
	End Sub

	' Set up other options
	Sub SetupOtherOptions()
		Dim opt, item, addcaption
		Set opt = ActionOptions

		' Add
		Set item = opt.Add("add")
		addcaption = ew_HtmlTitle(Language.Phrase("ViewPageAddLink"))
		If IsModal Then ' Modal
			item.Body = "<a class=""ewAction ewAdd"" title=""" & addcaption & """ data-caption=""" & addcaption & """ href=""javascript:void(0);"" onclick=""ew_ModalDialogShow({lnk:this,url:'" & ew_HtmlEncode(AddUrl) & "'});"">" & Language.Phrase("ViewPageAddLink") & "</a>"
		Else
			item.Body = "<a class=""ewAction ewAdd"" title=""" & addcaption & """ data-caption=""" & addcaption & """ href=""" & ew_HtmlEncode(AddUrl) & """>" & Language.Phrase("ViewPageAddLink") & "</a>"
			item.Visible = (AddUrl <> "" And Security.IsLoggedIn())
		End If

		' Edit
		Dim editcaption
		Set item = opt.Add("edit")
		editcaption = ew_HtmlTitle(Language.Phrase("ViewPageEditLink"))
		If IsModal Then ' Modal
			item.Body = "<a class=""ewAction ewEdit"" title=""" & editcaption & """ data-caption=""" & editcaption & """ href=""javascript:void(0);"" onclick=""ew_ModalDialogShow({lnk:this,url:'" & ew_HtmlEncode(EditUrl) & "'});"">" & Language.Phrase("ViewPageEditLink") & "</a>"
		Else
			item.Body = "<a class=""ewAction ewEdit"" title=""" & editcaption & """ data-caption=""" & editcaption & """ href=""" & ew_HtmlEncode(EditUrl) & """>" & Language.Phrase("ViewPageEditLink") & "</a>"
			item.Visible = (EditUrl <> "" And Security.IsLoggedIn())
		End If

		' Delete
		Set item = opt.Add("delete")
		If IsModal Then ' Handle as inline delete
			item.Body = "<a onclick=""return ew_ConfirmDelete(this);"" class=""ewAction ewDelete"" title=""" & ew_HtmlTitle(Language.Phrase("ViewPageDeleteLink")) & """ data-caption=""" & ew_HtmlTitle(Language.Phrase("ViewPageDeleteLink")) & """ href=""" & ew_HtmlEncode(ew_UrlAddQuery(DeleteUrl, "a_delete=1")) & """>" & Language.Phrase("ViewPageDeleteLink") & "</a>"
		Else
			item.Body = "<a class=""ewAction ewDelete"" title=""" & ew_HtmlTitle(Language.Phrase("ViewPageDeleteLink")) & """ data-caption=""" & ew_HtmlTitle(Language.Phrase("ViewPageDeleteLink")) & """ href=""" & ew_HtmlEncode(DeleteUrl) & """>" & Language.Phrase("ViewPageDeleteLink") & "</a>"
		End If
		item.Visible = (DeleteUrl <> "" And Security.IsLoggedIn())

		' Set up options default
		Set opt = ActionOptions
		opt.DropDownButtonPhrase = Language.Phrase("ButtonActions")
		opt.UseImageAndText = True
		opt.UseDropDownButton = False
		opt.UseButtonGroup = True
		Set item = opt.Add(opt.GroupOptionName)
		item.Body = ""
		item.Visible = False
	End Sub
	Dim Pager

	'
	' Set up Starting Record parameters based on Pager Navigation
	'
	Sub SetupStartRec()
		Dim PageNo

		' Exit if DisplayRecs = 0
		If DisplayRecs = 0 Then Exit Sub
		If IsPageRequest Then ' Validate request

			' Check for a START parameter
			If Request.QueryString(EW_TABLE_START_REC).Count > 0 Then
				StartRec = Request.QueryString(EW_TABLE_START_REC)
				Videos.StartRecordNumber = StartRec
			ElseIf Request.QueryString(EW_TABLE_PAGE_NO).Count > 0 Then
				PageNo = Request.QueryString(EW_TABLE_PAGE_NO)
				If IsNumeric(PageNo) Then
					StartRec = (PageNo-1)*DisplayRecs+1
					If StartRec <= 0 Then
						StartRec = 1
					ElseIf StartRec >= ((TotalRecs-1)\DisplayRecs)*DisplayRecs+1 Then
						StartRec = ((TotalRecs-1)\DisplayRecs)*DisplayRecs+1
					End If
					Videos.StartRecordNumber = StartRec
				End If
			End If
		End If
		StartRec = Videos.StartRecordNumber

		' Check if correct start record counter
		If Not IsNumeric(StartRec) Or StartRec = "" Then ' Avoid invalid start record counter
			StartRec = 1 ' Reset start record counter
			Videos.StartRecordNumber = StartRec
		ElseIf CLng(StartRec) > CLng(TotalRecs) Then ' Avoid starting record > total records
			StartRec = ((TotalRecs-1)\DisplayRecs)*DisplayRecs+1 ' Point to last page first record
			Videos.StartRecordNumber = StartRec
		ElseIf (StartRec-1) Mod DisplayRecs <> 0 Then
			StartRec = ((StartRec-1)\DisplayRecs)*DisplayRecs+1 ' Point to page boundary
			Videos.StartRecordNumber = StartRec
		End If
	End Sub

	'
	' Load row based on key values
	'
	Function LoadRow()
		Dim RsRow, sSql, sFilter
		sFilter = Videos.KeyFilter

		' Call Row Selecting event
		Call Videos.Row_Selecting(sFilter)

		' Load SQL based on filter
		Videos.CurrentFilter = sFilter
		sSql = Videos.SQL
		Call ew_SetDebugMsg("LoadRow: " & sSql) ' Show SQL for debugging
		Set RsRow = ew_LoadRowByDbid(sSql, Videos.TableDBID)
		If RsRow.EOF Then
			LoadRow = False
		Else
			LoadRow = True
			RsRow.MoveFirst
			Call LoadRowValues(RsRow) ' Load row values
		End If
		RsRow.Close
		Set RsRow = Nothing
	End Function

	'
	' Load row values from recordset
	'
	Sub LoadRowValues(RsRow)
		Dim sDetailFilter
		If Not EW_DEBUG_ENABLED Then On Error Resume Next
		If IsNull(RsRow) Then
			Set RsRow = NewRow()
		End If

		' Call Row Selected event
		Call Videos.Row_Selected(RsRow)
		If ew_Empty(RsRow) Then Exit Sub
		If RsRow.EOF Then Exit Sub
		Videos.ID.DbValue = RsRow("ID")
		Videos.Movie_Title.DbValue = RsRow("Movie_Title")
		Videos.URL.DbValue = RsRow("URL")
		Videos.Enable.DbValue = RsRow("Enable")
		Videos.Home_Enable.DbValue = RsRow("Home_Enable")
		Videos.Sequence.DbValue = RsRow("Sequence")
	End Sub

	' Return a row with default values
	Function NewRow
		Dim cnn, rs, sSql, sFilter

		' Clear any previous errors
		Err.Clear
		Set cnn = Videos.TableConnection
		sFilter = Videos.CurrentFilter
		Videos.CurrentFilter = "(0 = 1)"
		sSql = Videos.SQL
		Videos.CurrentFilter = sFilter
		Set rs = Server.CreateObject("ADODB.Recordset")
		rs.CursorLocation = 3 ' adUseClient
		Call ew_SetDebugMsg("NewRow: " & sSql) ' Show SQL for debugging
		rs.Open sSql, cnn, 3, 4 ' adOpenStatic, adLockBatchOptimistic

		' Disconnect the Recordset
		Set rs.ActiveConnection = Nothing

		' Add new record
		rs.AddNew
		rs("Movie_Title") = Null
		rs("URL") = Null
		rs("Enable") = Null
		rs("Home_Enable") = Null
		rs("Sequence") = Null

		' Return the recordset
		If Err.Number = 0 Then
			Set NewRow = rs
		Else
			Set NewRow = Nothing
		End If
	End Function

	' Load DbValue from recordset
	Sub LoadDbValues(Rs)
		If Not EW_DEBUG_ENABLED Then On Error Resume Next
		If ew_Empty(Rs) Then Exit Sub
		If Rs.EOF Then Exit Sub
		Videos.ID.m_DbValue = Rs("ID")
		Videos.Movie_Title.m_DbValue = Rs("Movie_Title")
		Videos.URL.m_DbValue = Rs("URL")
		Videos.Enable.m_DbValue = Rs("Enable")
		Videos.Home_Enable.m_DbValue = Rs("Home_Enable")
		Videos.Sequence.m_DbValue = Rs("Sequence")
	End Sub

	'
	' Render row values based on field settings
	'
	Sub RenderRow()

		' Initialize URLs
		AddUrl = Videos.AddUrl("")
		EditUrl = Videos.EditUrl("")
		CopyUrl = Videos.CopyUrl("")
		DeleteUrl = Videos.DeleteUrl
		ListUrl = Videos.ListUrl
		Call SetupOtherOptions

		' Call Row Rendering event
		Call Videos.Row_Rendering

		'
		' Common render codes for all row types
		'
		' ID
		' Movie_Title
		' URL
		' Enable
		' Home_Enable
		' Sequence
		'
		' View Row
		'

		If Videos.RowType = EW_ROWTYPE_VIEW Then ' View row

			' ID
			Videos.ID.ViewValue = Videos.ID.CurrentValue
			Videos.ID.ViewCustomAttributes = ""

			' Movie_Title
			Videos.Movie_Title.ViewValue = Videos.Movie_Title.CurrentValue
			Videos.Movie_Title.ViewCustomAttributes = ""

			' URL
			Videos.URL.ViewValue = Videos.URL.CurrentValue
			Videos.URL.ViewCustomAttributes = ""

			' Enable
			If Not IsNull(Videos.Enable.CurrentValue) Then
				Videos.Enable.ViewValue = Videos.Enable.OptionCaption(Videos.Enable.CurrentValue)
			Else
				Videos.Enable.ViewValue = Null
			End If
			Videos.Enable.ViewCustomAttributes = ""

			' Home_Enable
			If Not IsNull(Videos.Home_Enable.CurrentValue) Then
				Videos.Home_Enable.ViewValue = Videos.Home_Enable.OptionCaption(Videos.Home_Enable.CurrentValue)
			Else
				Videos.Home_Enable.ViewValue = Null
			End If
			Videos.Home_Enable.ViewCustomAttributes = ""

			' Sequence
			Videos.Sequence.ViewValue = Videos.Sequence.CurrentValue
			Videos.Sequence.ViewCustomAttributes = ""

			' View refer script
			' ID

			Videos.ID.LinkCustomAttributes = ""
			Videos.ID.HrefValue = ""
			Videos.ID.TooltipValue = ""

			' Movie_Title
			Videos.Movie_Title.LinkCustomAttributes = ""
			Videos.Movie_Title.HrefValue = ""
			Videos.Movie_Title.TooltipValue = ""

			' URL
			Videos.URL.LinkCustomAttributes = ""
			Videos.URL.HrefValue = ""
			Videos.URL.TooltipValue = ""

			' Enable
			Videos.Enable.LinkCustomAttributes = ""
			Videos.Enable.HrefValue = ""
			Videos.Enable.TooltipValue = ""

			' Home_Enable
			Videos.Home_Enable.LinkCustomAttributes = ""
			Videos.Home_Enable.HrefValue = ""
			Videos.Home_Enable.TooltipValue = ""

			' Sequence
			Videos.Sequence.LinkCustomAttributes = ""
			Videos.Sequence.HrefValue = ""
			Videos.Sequence.TooltipValue = ""
		End If

		' Call Row Rendered event
		If Videos.RowType <> EW_ROWTYPE_AGGREGATEINIT Then
			Call Videos.Row_Rendered
		End If
	End Sub

	' Set up Breadcrumb
	Sub SetupBreadcrumb()
		Dim PageId, url
		Set Breadcrumb = New cBreadcrumb
		url = Mid(ew_CurrentUrl(), InStrRev(ew_CurrentUrl(), "/") + 1)
		Call Breadcrumb.Add("list", Videos.TableVar, Videos.AddMasterUrl("Videoslist.asp"), "", Videos.TableVar, True)
		PageId = "view"
		Call Breadcrumb.Add("view", PageId, url, "", "", False)
	End Sub

	' Setup lookup filters of a field
	Sub SetupLookupFilters(fld, pageId)
		pageId = ew_IIf(ew_EmptyStr(pageId), Videos_view.PageID, pageId)
		Select Case fld.FldVar
		End Select
	End Sub

	' Setup AutoSuggest filters of a field
	Sub SetupAutoSuggestFilters(fld, pageId)
		pageId = ew_IIF(ew_EmptyStr(pageId), Videos_view.PageID, pageId)
		Select Case fld.FldVar
		End Select
	End Sub

	Sub ExportPdf(html)
		Response.Write html
	End Sub

	' Page Load event
	Sub Page_Load()

		'Response.Write "Page Load"
	End Sub

	' Page Unload event
	Sub Page_Unload()

		'Response.Write "Page Unload"
	End Sub

	' Page Redirecting event
	Sub Page_Redirecting(url)

		'url = newurl
	End Sub

	' Message Showing event
	' typ = ""|"success"|"failure"|"warning"
	Sub Message_Showing(msg, typ)

		' Example:
		'If typ = "success" Then
		'	msg = "your success message"
		'ElseIf typ = "failure" Then
		'	msg = "your failure message"
		'ElseIf typ = "warning" Then
		'	msg = "your warning message"
		'Else
		'	msg = "your message"
		'End If

	End Sub

	' Page Render event
	Sub Page_Render()

		'Response.Write "Page Render"
	End Sub

	' Page Data Rendering event
	Sub Page_DataRendering(header)

		' Example:
		'header = "your header"

	End Sub

	' Page Data Rendered event
	Sub Page_DataRendered(footer)

		' Example:
		'footer = "your footer"

	End Sub

	' Page Exporting event
	' ExportDoc = export document object
	Function Page_Exporting()

		'ExportDoc.Text = "my header" ' Export header
		'Page_Exporting = False ' Return False to skip default export and use Row_Export event

		Page_Exporting = True ' Return True to use default export and skip Row_Export event
	End Function

	' Row Export event
	' ExportDoc = export document object
	Sub Row_Export(rs)

		'ExportDoc.Text = ExportDoc.Text & "my content" ' Build HTML with field value: rs("MyField") or MyField.ViewValue
	End Sub

	' Page Exported event
	' ExportDoc = export document object
	Sub Page_Exported()

		'ExportDoc.Text = ExportDoc.Text & "my footer" ' Export footer
		'Response.Write ExportDoc.Text

	End Sub
End Class
%>

Youez - 2016 - github.com/yon3zu
LinuXploit