| Server IP : 103.118.17.23 / Your IP : 216.73.216.188 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 : |
<%@ CodePage="65001" %>
<%
Response.Buffer = EW_RESPONSE_BUFFER
%>
<!--#include file="ewcfg.asp"-->
<!--#include file="Home_Contentsinfo.asp"-->
<!--#include file="aspfn.asp"-->
<!--#include file="userfn.asp"-->
<% Call ew_Header(False, EW_CHARSET, False) %>
<%
' Define page object
Dim Home_Contents_add
Set Home_Contents_add = New cHome_Contents_add
Set Page = Home_Contents_add
' Page init processing
Call Home_Contents_add.Page_Init
' Page main
Call Home_Contents_add.Page_Main
' Global Page Rendering event (in userfn*.asp)
Page_Rendering()
' Page Render event
Home_Contents_add.Page_Render()
%>
<!--#include file="header.asp"-->
<script type="text/javascript">
// Form object
var CurrentPageID = EW_PAGE_ID = "add";
var CurrentForm = fHome_Contentsadd = new ew_Form("fHome_Contentsadd", "add");
// Validate form
fHome_Contentsadd.Validate = function() {
if (!this.ValidateRequired)
return true; // Ignore validation
var $ = jQuery, fobj = this.GetForm(), $fobj = $(fobj);
if ($fobj.find("#a_confirm").val() == "F")
return true;
var elm, felm, uelm, addcnt = 0;
var $k = $fobj.find("#" + this.FormKeyCountName); // Get key_count
var rowcnt = ($k[0]) ? parseInt($k.val(), 10) : 1;
var startcnt = (rowcnt == 0) ? 0 : 1; // Check rowcnt == 0 => Inline-Add
var gridinsert = $fobj.find("#a_list").val() == "gridinsert";
for (var i = startcnt; i <= rowcnt; i++) {
var infix = ($k[0]) ? String(i) : "";
$fobj.data("rowindex", infix);
elm = this.GetElements("x" + infix + "_Page_Name");
if (elm && !ew_IsHidden(elm) && !ew_HasValue(elm))
return this.OnError(elm, "<%= ew_JsEncode2(Replace(Home_Contents.Page_Name.ReqErrMsg, "%s", Home_Contents.Page_Name.FldCaption)) %>");
elm = this.GetElements("x" + infix + "_Description");
if (elm && !ew_IsHidden(elm) && !ew_HasValue(elm))
return this.OnError(elm, "<%= ew_JsEncode2(Replace(Home_Contents.Description.ReqErrMsg, "%s", Home_Contents.Description.FldCaption)) %>");
elm = this.GetElements("x" + infix + "_Enable");
if (elm && !ew_IsHidden(elm) && !ew_HasValue(elm))
return this.OnError(elm, "<%= ew_JsEncode2(Replace(Home_Contents.Enable.ReqErrMsg, "%s", Home_Contents.Enable.FldCaption)) %>");
elm = this.GetElements("x" + infix + "_Sequence");
if (elm && !ew_CheckInteger(elm.value))
return this.OnError(elm, "<%= ew_JsEncode2(Home_Contents.Sequence.FldErrMsg) %>");
// Fire Form_CustomValidate event
if (!this.Form_CustomValidate(fobj))
return false;
}
// Process detail forms
var dfs = $fobj.find("input[name='detailpage']").get();
for (var i = 0; i < dfs.length; i++) {
var df = dfs[i], val = df.value;
if (val && ewForms[val])
if (!ewForms[val].Validate())
return false;
}
return true;
}
// Form_CustomValidate event
fHome_Contentsadd.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 %>
fHome_Contentsadd.ValidateRequired = true; // Use JavaScript validation
<% Else %>
fHome_Contentsadd.ValidateRequired = false; // No JavaScript validation
<% End If %>
// Dynamic selection lists
fHome_Contentsadd.Lists["x_Enable"] = {"LinkField":"","Ajax":null,"AutoFill":false,"DisplayFields":["","","",""],"ParentFields":[],"ChildFields":[],"FilterFields":[],"Options":[],"Template":""};
fHome_Contentsadd.Lists["x_Enable"].Options = <%= ew_ArrayToJson(Home_Contents.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>
<% Call Home_Contents_add.ShowPageHeader %>
<% Call Home_Contents_add.ShowMessage %>
<form name="fHome_Contentsadd" id="fHome_Contentsadd" class="<%= Home_Contents_add.FormClassName %>" action="<%= ew_CurrentPage() %>" method="post">
<% If Home_Contents_add.CheckToken Then %>
<input type="hidden" name="<%= EW_TOKEN_NAME %>" value="<%= Home_Contents_add.Token %>">
<% End If %>
<input type="hidden" name="t" value="Home_Contents">
<input type="hidden" name="a_add" id="a_add" value="A">
<input type="hidden" name="modal" value="<%= ew_IIf(Home_Contents_add.IsModal, "1", "0") %>">
<div class="ewAddDiv"><!-- page* -->
<% If Home_Contents.Page_Name.Visible Then ' Page_Name %>
<div id="r_Page_Name" class="form-group">
<label id="elh_Home_Contents_Page_Name" for="x_Page_Name" class="<%= Home_Contents.LeftColumnClass %>"><%= Home_Contents.Page_Name.FldCaption %><%= Language.Phrase("FieldRequiredIndicator") %></label>
<div class="<%= Home_Contents.RightColumnClass %>"><div<%= Home_Contents.Page_Name.CellAttributes %>>
<span id="el_Home_Contents_Page_Name">
<input type="text" data-table="Home_Contents" data-field="x_Page_Name" name="x_Page_Name" id="x_Page_Name" size="30" maxlength="255" placeholder="<%= Home_Contents.Page_Name.PlaceHolder %>" value="<%= Home_Contents.Page_Name.EditValue %>"<%= Home_Contents.Page_Name.EditAttributes %>>
</span>
<%= Home_Contents.Page_Name.CustomMsg %></div></div>
</div>
<% End If %>
<% If Home_Contents.Title.Visible Then ' Title %>
<div id="r_Title" class="form-group">
<label id="elh_Home_Contents_Title" for="x_Title" class="<%= Home_Contents.LeftColumnClass %>"><%= Home_Contents.Title.FldCaption %></label>
<div class="<%= Home_Contents.RightColumnClass %>"><div<%= Home_Contents.Title.CellAttributes %>>
<span id="el_Home_Contents_Title">
<input type="text" data-table="Home_Contents" data-field="x_Title" name="x_Title" id="x_Title" size="30" maxlength="255" placeholder="<%= Home_Contents.Title.PlaceHolder %>" value="<%= Home_Contents.Title.EditValue %>"<%= Home_Contents.Title.EditAttributes %>>
</span>
<%= Home_Contents.Title.CustomMsg %></div></div>
</div>
<% End If %>
<% If Home_Contents.Description.Visible Then ' Description %>
<div id="r_Description" class="form-group">
<label id="elh_Home_Contents_Description" for="x_Description" class="<%= Home_Contents.LeftColumnClass %>"><%= Home_Contents.Description.FldCaption %><%= Language.Phrase("FieldRequiredIndicator") %></label>
<div class="<%= Home_Contents.RightColumnClass %>"><div<%= Home_Contents.Description.CellAttributes %>>
<span id="el_Home_Contents_Description">
<textarea data-table="Home_Contents" data-field="x_Description" name="x_Description" id="x_Description" cols="35" rows="4" placeholder="<%= Home_Contents.Description.PlaceHolder %>"<%= Home_Contents.Description.EditAttributes %>><%= Home_Contents.Description.EditValue %></textarea>
</span><script>
CKEDITOR.replace( 'x_Description' ,{
filebrowserBrowseUrl : 'dreameditor/data/dialog.php?type=2&editor=ckeditor&fldr=',
filebrowserUploadUrl : 'dreameditor/data/dialog.php?type=2&editor=ckeditor&fldr=',
filebrowserImageBrowseUrl : 'dreameditor/data/dialog.php?type=1&editor=ckeditor&fldr='
});
</script>
<%= Home_Contents.Description.CustomMsg %></div></div>
</div>
<% End If %>
<% If Home_Contents.Enable.Visible Then ' Enable %>
<div id="r_Enable" class="form-group">
<label id="elh_Home_Contents_Enable" class="<%= Home_Contents.LeftColumnClass %>"><%= Home_Contents.Enable.FldCaption %><%= Language.Phrase("FieldRequiredIndicator") %></label>
<div class="<%= Home_Contents.RightColumnClass %>"><div<%= Home_Contents.Enable.CellAttributes %>>
<span id="el_Home_Contents_Enable">
<div id="tp_x_Enable" class="ewTemplate"><input type="radio" data-table="Home_Contents" data-field="x_Enable" data-value-separator="<%= Home_Contents.Enable.DisplayValueSeparatorAttribute %>" name="x_Enable" id="x_Enable" value="{value}"<%= Home_Contents.Enable.EditAttributes %>></div>
<div id="dsl_x_Enable" data-repeatcolumn="5" class="ewItemList" style="display: none;"><div>
<%= Home_Contents.Enable.RadioButtonListHtml(False, "x_Enable", -1, Home_Contents) %>
</div></div>
</span>
<%= Home_Contents.Enable.CustomMsg %></div></div>
</div>
<% End If %>
<% If Home_Contents.Sequence.Visible Then ' Sequence %>
<div id="r_Sequence" class="form-group">
<label id="elh_Home_Contents_Sequence" for="x_Sequence" class="<%= Home_Contents.LeftColumnClass %>"><%= Home_Contents.Sequence.FldCaption %></label>
<div class="<%= Home_Contents.RightColumnClass %>"><div<%= Home_Contents.Sequence.CellAttributes %>>
<span id="el_Home_Contents_Sequence">
<input type="text" data-table="Home_Contents" data-field="x_Sequence" name="x_Sequence" id="x_Sequence" size="30" placeholder="<%= Home_Contents.Sequence.PlaceHolder %>" value="<%= Home_Contents.Sequence.EditValue %>"<%= Home_Contents.Sequence.EditAttributes %>>
</span>
<%= Home_Contents.Sequence.CustomMsg %></div></div>
</div>
<% End If %>
</div><!-- /page* -->
<% If Not Home_Contents_add.IsModal Then %>
<div class="form-group"><!-- buttons .form-group -->
<div class="<%= Home_Contents.OffsetColumnClass %>"><!-- buttons offset -->
<button class="btn btn-primary ewButton" name="btnAction" id="btnAction" type="submit"><%= Language.Phrase("AddBtn") %></button>
<button class="btn btn-default ewButton" name="btnCancel" id="btnCancel" type="button" data-href="<%= Home_Contents.ReturnUrl %>"><%= Language.Phrase("CancelBtn") %></button>
</div><!-- /buttons offset -->
</div><!-- /buttons .form-group -->
<% End If %>
</form>
<script type="text/javascript">
fHome_Contentsadd.Init();
</script>
<%
Call Home_Contents_add.ShowPageFooter
If EW_DEBUG_ENABLED Then Response.Write ew_DebugMsg()
%>
<script type="text/javascript">
// Write your table-specific startup script here
// document.write("page loaded");
</script>
<!--#include file="footer.asp"-->
<%
' Clean up and drop page object
Call Home_Contents_add.Page_Terminate("")
Set Home_Contents_add = Nothing
%>
<%
'
' Page Class
'
Class cHome_Contents_add
' Page ID
Public Property Get PageID
PageID = "add"
End Property
' Project ID
Public Property Get ProjectID
ProjectID = "panel"
End Property
' Table Name
Public Property Get TableName
TableName = "Home_Contents"
End Property
' Page Object Name
Public Property Get PageObjName
PageObjName = "Home_Contents_add"
End Property
' Field (ID)
Public Property Get ID
Set ID = Home_Contents.ID
End Property
' Field (Page_Name)
Public Property Get Page_Name
Set Page_Name = Home_Contents.Page_Name
End Property
' Field (Title)
Public Property Get Title
Set Title = Home_Contents.Title
End Property
' Field (Description)
Public Property Get Description
Set Description = Home_Contents.Description
End Property
' Field (Enable)
Public Property Get Enable
Set Enable = Home_Contents.Enable
End Property
' Field (Sequence)
Public Property Get Sequence
Set Sequence = Home_Contents.Sequence
End Property
' Field (IP)
Public Property Get IP
Set IP = Home_Contents.IP
End Property
' Field (Date)
Public Property Get zDate
Set zDate = Home_Contents.zDate
End Property
' Field (Username)
Public Property Get Username
Set Username = Home_Contents.Username
End Property
' Get field object dictionary (ASP)
Public Property Get Fields
Set Fields = Home_Contents.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(Home_Contents) Then
PageHeading = Home_Contents.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 Home_Contents.UseTokenInUrl Then PageUrl = PageUrl & "t=" & Home_Contents.TableVar & "&" ' add page token
End Property
' 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"">×</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"">×</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"">×</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"">×</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 Home_Contents.UseTokenInUrl Then
IsPageRequest = False
If ew_NotEmpty(ObjForm) Then
IsPageRequest = (Home_Contents.TableVar = ObjForm.GetValue("t"))
End If
If Request.QueryString("t").Count > 0 Then
IsPageRequest = (Home_Contents.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(Home_Contents) Then Set Home_Contents = New cHome_Contents
Set Table = Home_Contents
' Initialize URLs
' Initialize form object
Set ObjForm = Nothing
' Get resize object
Call ew_GetResizeObj
' Intialize page id (for backward compatibility)
EW_PAGE_ID = "add"
' Initialize table name (for backward compatibility)
EW_TABLE_NAME = "Home_Contents"
' Debug message
Call ew_LoadDebugMsg
' Open connection to the database
If IsEmpty(Conn) Then
Set Conn = ew_Connect(Home_Contents.TableDBID)
End If
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.CanAdd Then
Call Security.SaveLastUrl
If Security.CanList Then
Call Page_Terminate(ew_GetUrl("Home_Contentslist.asp"))
Else
Call Page_Terminate(ew_GetUrl("login.asp"))
End If
End If
' Create form object
Set ObjForm = New cFormObj
Home_Contents.CurrentAction = ew_IIf(Request.QueryString("a").Count > 0, Request.QueryString("a") & "", ObjForm.GetValue("a_list") & "") ' Set up current action
Call Home_Contents.Page_Name.SetVisibility(Home_Contents)
Call Home_Contents.Title.SetVisibility(Home_Contents)
Call Home_Contents.Description.SetVisibility(Home_Contents)
Call Home_Contents.Enable.SetVisibility(Home_Contents)
Call Home_Contents.Sequence.SetVisibility(Home_Contents)
Call Home_Contents.IP.SetVisibility(Home_Contents)
Call Home_Contents.zDate.SetVisibility(Home_Contents)
Call Home_Contents.Username.SetVisibility(Home_Contents)
' 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
' Process auto fill
Dim results
If Request.Form("ajax") = "autofill" Then
results = Home_Contents.GetAutoFill(Request.Form("name"), Request.Form("q"))
If results <> "" Then
' Clean output buffer
If Response.Buffer Then Response.Clear
Response.Write results
Call Page_Terminate("")
Response.End
End If
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(Home_Contents) Then
If Home_Contents.Export <> "" And Request.Form("data").Count > 0 Then
Dim sContent
sContent = Request.Form("data")
gsExportFile = Request.Form("filename")
If gsExportFile = "" Then gsExportFile = Home_Contents.TableVar
If Home_Contents.Export = "pdf" Then
Call ExportPdf(sContent)
ElseIf Home_Contents.Export = "email" Then
Response.Write ExportEmail(sContent)
ElseIf Home_Contents.Export = "excel" Then
Call ExportExcel(sContent)
ElseIf Home_Contents.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 <> Home_Contents.ListUrl Then ' Not List page
Call row.Add("caption", Home_Contents.GetModalCaption(pageName))
If pageName = "Home_Contentsview.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 Home_Contents = Nothing
Call ew_CleanUp
End Sub
'
' Page_Terminate (End)
'
Dim FormClassName
Dim IsModal
Dim IsMobileOrModal
Dim DbMasterFilter, DbDetailFilter
Dim StartRec
Dim Priv
Dim OldRecordset
Dim CopyRecord
'
' Page main
'
Sub Page_Main()
IsMobileOrModal = False
If IsModal Then gbSkipHeaderFooter = True
FormClassName = "ewForm ewAddForm form-horizontal"
' Set up current action
If ObjForm.GetValue("a_add")&"" <> "" Then
Home_Contents.CurrentAction = ObjForm.GetValue("a_add") ' Get form action
' Not post back
Else
' Load key values from QueryString
CopyRecord = True
If Request.QueryString("ID").Count > 0 Then
Home_Contents.ID.QueryStringValue = Request.QueryString("ID")
Call Home_Contents.SetKey("ID", Home_Contents.ID.CurrentValue) ' Set up key
Else
Call Home_Contents.SetKey("ID", "") ' Clear key
CopyRecord = False
End If
If CopyRecord Then
Home_Contents.CurrentAction = "C" ' Copy Record
Else
Home_Contents.CurrentAction = "I" ' Display Blank Record
End If
End If
Dim loaded
loaded = LoadOldRecord() ' Load old recordset
' Load form values
If ObjForm.GetValue("a_add")&"" <> "" Then
Call LoadFormValues ' Load form values
End If
' Validate form if post back
If ObjForm.GetValue("a_add")&"" <> "" Then
If Not ValidateForm() Then
Home_Contents.CurrentAction = "I" ' Form error, reset action
Home_Contents.EventCancelled = True ' Event cancelled
Call RestoreFormValues ' Restore form values
FailureMessage = gsFormError
End If
End If
' Perform current action
Select Case Home_Contents.CurrentAction
Case "I" ' Blank record
Case "C" ' Copy an existing record
If Not loaded Then ' Record not loaded
If FailureMessage = "" Then FailureMessage = Language.Phrase("NoRecord") ' No record found
Call Page_Terminate("Home_Contentslist.asp") ' No matching record, return to list
End If
Case "A" ' Add new record
Home_Contents.SendEmail = True ' Send email on add success
If AddRow(OldRecordset) Then ' Add successful
If SuccessMessage = "" Then SuccessMessage = Language.Phrase("AddSuccess") ' Set up success message
Dim sReturnUrl
sReturnUrl = Home_Contents.ReturnUrl
If ew_GetPageName(sReturnUrl) = "Home_Contentslist.asp" Then
sReturnUrl = Home_Contents.AddMasterUrl(sReturnUrl) ' List page, return to List page with correct master key if necessary
ElseIf ew_GetPageName(sReturnUrl) = "Home_Contentsview.asp" Then
sReturnUrl = Home_Contents.ViewUrl("") ' View paging, return to View page with keyurl directly
End If
Call Page_Terminate(sReturnUrl) ' Clean up and return
Else
Home_Contents.EventCancelled = True ' Event cancelled
Call RestoreFormValues ' Add failed, restore form values
End If
End Select
' Set up Breadcrumb
Call SetupBreadcrumb
' Render row based on row type
Home_Contents.RowType = EW_ROWTYPE_ADD ' Render add type
' Render row
Call Home_Contents.ResetAttrs
Call RenderRow
End Sub
'
' Get upload files
'
Sub GetUploadFiles()
' Get upload data
End Sub
'
' Load default values
'
Sub LoadDefaultValues()
Home_Contents.ID.CurrentValue = Null
Home_Contents.ID.OldValue = Home_Contents.ID.CurrentValue
Home_Contents.Page_Name.CurrentValue = Null
Home_Contents.Page_Name.OldValue = Home_Contents.Page_Name.CurrentValue
Home_Contents.Title.CurrentValue = Null
Home_Contents.Title.OldValue = Home_Contents.Title.CurrentValue
Home_Contents.Description.CurrentValue = Null
Home_Contents.Description.OldValue = Home_Contents.Description.CurrentValue
Home_Contents.Enable.CurrentValue = Null
Home_Contents.Enable.OldValue = Home_Contents.Enable.CurrentValue
Home_Contents.Sequence.CurrentValue = Null
Home_Contents.Sequence.OldValue = Home_Contents.Sequence.CurrentValue
Home_Contents.IP.CurrentValue = Null
Home_Contents.IP.OldValue = Home_Contents.IP.CurrentValue
Home_Contents.zDate.CurrentValue = Null
Home_Contents.zDate.OldValue = Home_Contents.zDate.CurrentValue
Home_Contents.Username.CurrentValue = Null
Home_Contents.Username.OldValue = Home_Contents.Username.CurrentValue
End Sub
'
' Load form values
'
Sub LoadFormValues()
' Load values from form
If Not Home_Contents.Page_Name.FldIsDetailKey Then Home_Contents.Page_Name.FormValue = ObjForm.GetValue("x_Page_Name")
If Not Home_Contents.Title.FldIsDetailKey Then Home_Contents.Title.FormValue = ObjForm.GetValue("x_Title")
If Not Home_Contents.Description.FldIsDetailKey Then Home_Contents.Description.FormValue = ObjForm.GetValue("x_Description")
If Not Home_Contents.Enable.FldIsDetailKey Then Home_Contents.Enable.FormValue = ObjForm.GetValue("x_Enable")
If Not Home_Contents.Sequence.FldIsDetailKey Then Home_Contents.Sequence.FormValue = ObjForm.GetValue("x_Sequence")
If Not Home_Contents.IP.FldIsDetailKey Then Home_Contents.IP.FormValue = ObjForm.GetValue("x_IP")
If Not Home_Contents.zDate.FldIsDetailKey Then Home_Contents.zDate.FormValue = ObjForm.GetValue("x_zDate")
If Not Home_Contents.zDate.FldIsDetailKey Then Home_Contents.zDate.CurrentValue = ew_UnFormatDateTime(Home_Contents.zDate.CurrentValue, 0)
If Not Home_Contents.Username.FldIsDetailKey Then Home_Contents.Username.FormValue = ObjForm.GetValue("x_Username")
End Sub
'
' Restore form values
'
Sub RestoreFormValues()
Home_Contents.Page_Name.CurrentValue = Home_Contents.Page_Name.FormValue
Home_Contents.Title.CurrentValue = Home_Contents.Title.FormValue
Home_Contents.Description.CurrentValue = Home_Contents.Description.FormValue
Home_Contents.Enable.CurrentValue = Home_Contents.Enable.FormValue
Home_Contents.Sequence.CurrentValue = Home_Contents.Sequence.FormValue
Home_Contents.IP.CurrentValue = Home_Contents.IP.FormValue
Home_Contents.zDate.CurrentValue = Home_Contents.zDate.FormValue
Home_Contents.zDate.CurrentValue = ew_UnFormatDateTime(Home_Contents.zDate.CurrentValue, 0)
Home_Contents.Username.CurrentValue = Home_Contents.Username.FormValue
End Sub
'
' Load row based on key values
'
Function LoadRow()
Dim RsRow, sSql, sFilter
sFilter = Home_Contents.KeyFilter
' Call Row Selecting event
Call Home_Contents.Row_Selecting(sFilter)
' Load SQL based on filter
Home_Contents.CurrentFilter = sFilter
sSql = Home_Contents.SQL
Call ew_SetDebugMsg("LoadRow: " & sSql) ' Show SQL for debugging
Set RsRow = ew_LoadRowByDbid(sSql, Home_Contents.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 Home_Contents.Row_Selected(RsRow)
If ew_Empty(RsRow) Then Exit Sub
If RsRow.EOF Then Exit Sub
Home_Contents.ID.DbValue = RsRow("ID")
Home_Contents.Page_Name.DbValue = RsRow("Page_Name")
Home_Contents.Title.DbValue = RsRow("Title")
Home_Contents.Description.DbValue = RsRow("Description")
Home_Contents.Enable.DbValue = RsRow("Enable")
Home_Contents.Sequence.DbValue = RsRow("Sequence")
Home_Contents.IP.DbValue = RsRow("IP")
Home_Contents.zDate.DbValue = RsRow("Date")
Home_Contents.Username.DbValue = RsRow("Username")
End Sub
' Return a row with default values
Function NewRow
Call LoadDefaultValues
Dim cnn, rs, sSql, sFilter
' Clear any previous errors
Err.Clear
Set cnn = Home_Contents.TableConnection
sFilter = Home_Contents.CurrentFilter
Home_Contents.CurrentFilter = "(0 = 1)"
sSql = Home_Contents.SQL
Home_Contents.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("Page_Name") = Home_Contents.Page_Name.CurrentValue
rs("Title") = Home_Contents.Title.CurrentValue
rs("Description") = Home_Contents.Description.CurrentValue
rs("Enable") = Home_Contents.Enable.CurrentValue
rs("Sequence") = Home_Contents.Sequence.CurrentValue
rs("IP") = Home_Contents.IP.CurrentValue
rs("Date") = Home_Contents.zDate.CurrentValue
rs("Username") = Home_Contents.Username.CurrentValue
' 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
Home_Contents.ID.m_DbValue = Rs("ID")
Home_Contents.Page_Name.m_DbValue = Rs("Page_Name")
Home_Contents.Title.m_DbValue = Rs("Title")
Home_Contents.Description.m_DbValue = Rs("Description")
Home_Contents.Enable.m_DbValue = Rs("Enable")
Home_Contents.Sequence.m_DbValue = Rs("Sequence")
Home_Contents.IP.m_DbValue = Rs("IP")
Home_Contents.zDate.m_DbValue = Rs("Date")
Home_Contents.Username.m_DbValue = Rs("Username")
End Sub
' Load old record
Function LoadOldRecord()
' Load key values from Session
Dim bValidKey
bValidKey = True
If Home_Contents.GetKey("ID")&"" <> "" Then
Home_Contents.ID.CurrentValue = Home_Contents.GetKey("ID") ' ID
Else
bValidKey = False
End If
' Load old record
OldRecordset = Null
If bValidKey Then
Home_Contents.CurrentFilter = Home_Contents.KeyFilter
Dim sSql
sSql = Home_Contents.SQL
Set OldRecordset = ew_LoadRecordsetByDbid(sSql, Home_Contents.TableDBID)
End If
Call LoadRowValues(OldRecordset) ' Load row values
LoadOldRecord = bValidKey
End Function
'
' Render row values based on field settings
'
Sub RenderRow()
' Initialize URLs
' Call Row Rendering event
Call Home_Contents.Row_Rendering
'
' Common render codes for all row types
'
' ID
' Page_Name
' Title
' Description
' Enable
' Sequence
' IP
' Date
' Username
'
' View Row
'
If Home_Contents.RowType = EW_ROWTYPE_VIEW Then ' View row
' ID
Home_Contents.ID.ViewValue = Home_Contents.ID.CurrentValue
Home_Contents.ID.ViewCustomAttributes = ""
' Page_Name
Home_Contents.Page_Name.ViewValue = Home_Contents.Page_Name.CurrentValue
Home_Contents.Page_Name.ViewCustomAttributes = ""
' Title
Home_Contents.Title.ViewValue = Home_Contents.Title.CurrentValue
Home_Contents.Title.ViewCustomAttributes = ""
' Description
Home_Contents.Description.ViewValue = Home_Contents.Description.CurrentValue
Home_Contents.Description.ViewCustomAttributes = ""
' Enable
If Not IsNull(Home_Contents.Enable.CurrentValue) Then
Home_Contents.Enable.ViewValue = Home_Contents.Enable.OptionCaption(Home_Contents.Enable.CurrentValue)
Else
Home_Contents.Enable.ViewValue = Null
End If
Home_Contents.Enable.ViewCustomAttributes = ""
' Sequence
Home_Contents.Sequence.ViewValue = Home_Contents.Sequence.CurrentValue
Home_Contents.Sequence.ViewCustomAttributes = ""
' IP
Home_Contents.IP.ViewValue = Home_Contents.IP.CurrentValue
Home_Contents.IP.ViewCustomAttributes = ""
' Date
Home_Contents.zDate.ViewValue = Home_Contents.zDate.CurrentValue
Home_Contents.zDate.ViewValue = ew_FormatDateTime(Home_Contents.zDate.ViewValue, 0)
Home_Contents.zDate.ViewCustomAttributes = ""
' Username
Home_Contents.Username.ViewValue = Home_Contents.Username.CurrentValue
Home_Contents.Username.ViewCustomAttributes = ""
' View refer script
' Page_Name
Home_Contents.Page_Name.LinkCustomAttributes = ""
Home_Contents.Page_Name.HrefValue = ""
Home_Contents.Page_Name.TooltipValue = ""
' Title
Home_Contents.Title.LinkCustomAttributes = ""
Home_Contents.Title.HrefValue = ""
Home_Contents.Title.TooltipValue = ""
' Description
Home_Contents.Description.LinkCustomAttributes = ""
Home_Contents.Description.HrefValue = ""
Home_Contents.Description.TooltipValue = ""
' Enable
Home_Contents.Enable.LinkCustomAttributes = ""
Home_Contents.Enable.HrefValue = ""
Home_Contents.Enable.TooltipValue = ""
' Sequence
Home_Contents.Sequence.LinkCustomAttributes = ""
Home_Contents.Sequence.HrefValue = ""
Home_Contents.Sequence.TooltipValue = ""
' IP
Home_Contents.IP.LinkCustomAttributes = ""
Home_Contents.IP.HrefValue = ""
Home_Contents.IP.TooltipValue = ""
' Date
Home_Contents.zDate.LinkCustomAttributes = ""
Home_Contents.zDate.HrefValue = ""
Home_Contents.zDate.TooltipValue = ""
' Username
Home_Contents.Username.LinkCustomAttributes = ""
Home_Contents.Username.HrefValue = ""
Home_Contents.Username.TooltipValue = ""
'
' Add Row
'
ElseIf Home_Contents.RowType = EW_ROWTYPE_ADD Then ' Add row
' Page_Name
Call Home_Contents.Page_Name.EditAttrs.UpdateAttribute("class", "form-control")
Home_Contents.Page_Name.EditCustomAttributes = ""
Home_Contents.Page_Name.EditValue = ew_HtmlEncode(Home_Contents.Page_Name.CurrentValue)
Home_Contents.Page_Name.PlaceHolder = ew_HtmlEncode(ew_RemoveHtml(Home_Contents.Page_Name.FldCaption))
' Title
Call Home_Contents.Title.EditAttrs.UpdateAttribute("class", "form-control")
Home_Contents.Title.EditCustomAttributes = ""
Home_Contents.Title.EditValue = ew_HtmlEncode(Home_Contents.Title.CurrentValue)
Home_Contents.Title.PlaceHolder = ew_HtmlEncode(ew_RemoveHtml(Home_Contents.Title.FldCaption))
' Description
Call Home_Contents.Description.EditAttrs.UpdateAttribute("class", "form-control")
Home_Contents.Description.EditCustomAttributes = ""
Home_Contents.Description.EditValue = ew_HtmlEncode(Home_Contents.Description.CurrentValue)
Home_Contents.Description.PlaceHolder = ew_HtmlEncode(ew_RemoveHtml(Home_Contents.Description.FldCaption))
' Enable
Home_Contents.Enable.EditCustomAttributes = ""
Home_Contents.Enable.EditValue = Home_Contents.Enable.Options(False)
' Sequence
Call Home_Contents.Sequence.EditAttrs.UpdateAttribute("class", "form-control")
Home_Contents.Sequence.EditCustomAttributes = ""
Home_Contents.Sequence.EditValue = ew_HtmlEncode(Home_Contents.Sequence.CurrentValue)
Home_Contents.Sequence.PlaceHolder = ew_HtmlEncode(ew_RemoveHtml(Home_Contents.Sequence.FldCaption))
' IP
' Date
' Username
' Add refer script
' Page_Name
Home_Contents.Page_Name.LinkCustomAttributes = ""
Home_Contents.Page_Name.HrefValue = ""
' Title
Home_Contents.Title.LinkCustomAttributes = ""
Home_Contents.Title.HrefValue = ""
' Description
Home_Contents.Description.LinkCustomAttributes = ""
Home_Contents.Description.HrefValue = ""
' Enable
Home_Contents.Enable.LinkCustomAttributes = ""
Home_Contents.Enable.HrefValue = ""
' Sequence
Home_Contents.Sequence.LinkCustomAttributes = ""
Home_Contents.Sequence.HrefValue = ""
' IP
Home_Contents.IP.LinkCustomAttributes = ""
Home_Contents.IP.HrefValue = ""
' Date
Home_Contents.zDate.LinkCustomAttributes = ""
Home_Contents.zDate.HrefValue = ""
' Username
Home_Contents.Username.LinkCustomAttributes = ""
Home_Contents.Username.HrefValue = ""
End If
If Home_Contents.RowType = EW_ROWTYPE_ADD Or Home_Contents.RowType = EW_ROWTYPE_EDIT Or Home_Contents.RowType = EW_ROWTYPE_SEARCH Then ' Add/Edit/Search row
Call Home_Contents.SetupFieldTitles
End If
' Call Row Rendered event
If Home_Contents.RowType <> EW_ROWTYPE_AGGREGATEINIT Then
Call Home_Contents.Row_Rendered
End If
End Sub
'
' Validate form
'
Function ValidateForm()
' Initialize
gsFormError = ""
' Check if validation required
If Not EW_SERVER_VALIDATE Then
ValidateForm = (gsFormError = "")
Exit Function
End If
If Not Home_Contents.Page_Name.FldIsDetailKey And Not IsNull(Home_Contents.Page_Name.FormValue) And Home_Contents.Page_Name.FormValue&"" = "" Then
Call ew_AddMessage(gsFormError, Replace(Home_Contents.Page_Name.ReqErrMsg, "%s", Home_Contents.Page_Name.FldCaption))
End If
If Not Home_Contents.Description.FldIsDetailKey And Not IsNull(Home_Contents.Description.FormValue) And Home_Contents.Description.FormValue&"" = "" Then
Call ew_AddMessage(gsFormError, Replace(Home_Contents.Description.ReqErrMsg, "%s", Home_Contents.Description.FldCaption))
End If
If Home_Contents.Enable.FormValue&"" = "" Then
Call ew_AddMessage(gsFormError, Replace(Home_Contents.Enable.ReqErrMsg, "%s", Home_Contents.Enable.FldCaption))
End If
If Not ew_CheckInteger(Home_Contents.Sequence.FormValue) Then
Call ew_AddMessage(gsFormError, Home_Contents.Sequence.FldErrMsg)
End If
' Return validate result
ValidateForm = (gsFormError = "")
' Call Form Custom Validate event
Dim sFormCustomError
sFormCustomError = ""
ValidateForm = ValidateForm And Form_CustomValidate(sFormCustomError)
If sFormCustomError <> "" Then
Call ew_AddMessage(gsFormError, sFormCustomError)
End If
End Function
'
' Add record
'
Function AddRow(RsOld)
If Not EW_DEBUG_ENABLED Then On Error Resume Next
Dim cnn, Rs, sSql, sFilter
Dim RsNew
Dim bInsertRow
Dim RsChk
Dim sIdxErrMsg
' Clear any previous errors
Err.Clear
Dim RsMaster, sMasterUserIdMsg, sMasterFilter, bCheckMasterRecord, bValidMasterKey
Set cnn = Home_Contents.TableConnection
' Load db values from rsold
Call LoadDbValues(RsOld)
If Not IsNull(RsOld) Then
End If
' Add new record
sFilter = "(0 = 1)"
Home_Contents.CurrentFilter = sFilter
sSql = Home_Contents.UpdateTableSQL
Set Rs = Server.CreateObject("ADODB.Recordset")
Rs.CursorLocation = Home_Contents.TableCursorLocation
Call ew_SetDebugMsg("AddRow: " & sSql) ' Show SQL for debugging
Rs.Open sSql, cnn, 1, Home_Contents.TableRecordsetLockType
Rs.AddNew
If Err.Number <> 0 Then
Message = Err.Description
Rs.Close
Set Rs = Nothing
AddRow = False
Exit Function
End If
' Field Page_Name
Call Home_Contents.Page_Name.SetDbValue(Rs, Home_Contents.Page_Name.CurrentValue, Null, False)
' Field Title
Call Home_Contents.Title.SetDbValue(Rs, Home_Contents.Title.CurrentValue, Null, False)
' Field Description
Call Home_Contents.Description.SetDbValue(Rs, Home_Contents.Description.CurrentValue, Null, False)
' Field Enable
Call Home_Contents.Enable.SetDbValue(Rs, Home_Contents.Enable.CurrentValue, Null, False)
' Field Sequence
Call Home_Contents.Sequence.SetDbValue(Rs, Home_Contents.Sequence.CurrentValue, Null, False)
' Field IP
Call Home_Contents.IP.SetDbValue(Rs, ew_CurrentUserIP, Null, False)
' Field Date
Call Home_Contents.zDate.SetDbValue(Rs, ew_CurrentDate, Null, False)
' Field Username
Call Home_Contents.Username.SetDbValue(Rs, CurrentUserName, Null, False)
' Check recordset update error
If Err.Number <> 0 Then
FailureMessage = Err.Description
Rs.Close
Set Rs = Nothing
AddRow = False
Exit Function
End If
' Call Row Inserting event
bInsertRow = Home_Contents.Row_Inserting(RsOld, Rs)
If bInsertRow Then
' Clone new recordset object
Set RsNew = ew_CloneRs(Rs)
Call ew_SetDebugMsg("Insert: " & ew_HtmlEncode(ew_RecordToJson(RsNew))) ' Show data for debugging
Rs.Update
If Err.Number <> 0 Then
FailureMessage = Err.Description
AddRow = False
Else
AddRow = True
End If
If AddRow Then
Home_Contents.ID.DbValue = RsNew("ID") ' Get insert id if necessary
End If
Else
Rs.CancelUpdate
' Set up error message
If SuccessMessage <> "" Or FailureMessage <> "" Then
' Use the message, do nothing
ElseIf Home_Contents.CancelMessage <> "" Then
FailureMessage = Home_Contents.CancelMessage
Home_Contents.CancelMessage = ""
Else
FailureMessage = Language.Phrase("InsertCancelled")
End If
AddRow = False
End If
Rs.Close
Set Rs = Nothing
If AddRow Then
' Call Row Inserted event
Call Home_Contents.Row_Inserted(RsOld, RsNew)
End If
If ew_NotEmpty(RsNew) Then
RsNew.Close
Set RsNew = Nothing
End If
End Function
' Set up Breadcrumb
Sub SetupBreadcrumb()
Dim PageId, url
Set Breadcrumb = New cBreadcrumb
url = Mid(ew_CurrentUrl(), InStrRev(ew_CurrentUrl(), "/") + 1)
Call Breadcrumb.Add("list", Home_Contents.TableVar, Home_Contents.AddMasterUrl("Home_Contentslist.asp"), "", Home_Contents.TableVar, True)
PageId = ew_IIf(Home_Contents.CurrentAction = "C", "Copy", "Add")
Call Breadcrumb.Add("add", PageId, url, "", "", False)
End Sub
' Setup lookup filters of a field
Sub SetupLookupFilters(fld, pageId)
pageId = ew_IIf(ew_EmptyStr(pageId), Home_Contents_add.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), Home_Contents_add.PageID, pageId)
Select Case fld.FldVar
End Select
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
' Form Custom Validate event
Function Form_CustomValidate(CustomError)
'Return error message in CustomError
Form_CustomValidate = True
End Function
End Class
%>