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 : |
<%@ CodePage="65001" %> <% Response.Buffer = EW_RESPONSE_BUFFER %> <!--#include file="ewcfg.asp"--> <!--#include file="testimonialsinfo.asp"--> <!--#include file="aspfn.asp"--> <!--#include file="userfn.asp"--> <% Call ew_Header(False, EW_CHARSET, False) %> <% ' Define page object Dim testimonials_list Set testimonials_list = New ctestimonials_list Set Page = testimonials_list ' Page init processing Call testimonials_list.Page_Init ' Page main Call testimonials_list.Page_Main ' Global Page Rendering event (in userfn*.asp) Page_Rendering() ' Page Render event testimonials_list.Page_Render() %> <!--#include file="header.asp"--> <% If testimonials.Export = "" Then %> <script type="text/javascript"> // Form object var CurrentPageID = EW_PAGE_ID = "list"; var CurrentForm = ftestimonialslist = new ew_Form("ftestimonialslist", "list"); ftestimonialslist.FormKeyCountName = '<%= testimonials_list.FormKeyCountName %>'; // Form_CustomValidate event ftestimonialslist.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 %> ftestimonialslist.ValidateRequired = true; // Use JavaScript validation <% Else %> ftestimonialslist.ValidateRequired = false; // No JavaScript validation <% End If %> // Dynamic selection lists <% Set arAS = Nothing %> // Form object for search var CurrentSearchForm = ftestimonialslistsrch = new ew_Form("ftestimonialslistsrch"); </script> <script type="text/javascript"> // Write your client script here, no need to add script tags. </script> <% End If %> <% If testimonials.Export = "" Then %> <div class="ewToolbar"> <% If testimonials_list.TotalRecs > 0 And testimonials_list.ExportOptions.Visible Then %> <% Call testimonials_list.ExportOptions.Render("body", "", "", "", "", "") %> <% End If %> <% If testimonials_list.SearchOptions.Visible Then %> <% Call testimonials_list.SearchOptions.Render("body", "", "", "", "", "") %> <% End If %> <% If testimonials_list.FilterOptions.Visible Then %> <% Call testimonials_list.FilterOptions.Render("body", "", "", "", "", "") %> <% End If %> <div class="clearfix"></div> </div> <% End If %> <% If testimonials.Export = "" Or EW_EXPORT_MASTER_RECORD And testimonials.Export = "print" Then %> <% End If %> <% 'testimonials_list.TotalRecs = testimonials_list.Recordset.RecordCount ' Already loaded ' ASP testimonials_list.StartRec = 1 If testimonials_list.DisplayRecs <= 0 Then ' Display all records testimonials_list.DisplayRecs = testimonials_list.TotalRecs End If If Not (testimonials.ExportAll And testimonials.Export <> "") Then Call testimonials_list.SetupStartRec ' Set up start record position End If ' Load records ' ASP Set testimonials_list.Recordset = testimonials_list.LoadRecordset(testimonials_list.StartRec-1, testimonials_list.DisplayRecs) ' Set no record found message If testimonials.CurrentAction = "" And testimonials_list.TotalRecs = 0 Then If testimonials_list.SearchWhere = "0=101" Then testimonials_list.WarningMessage = Language.Phrase("EnterSearchCriteria") Else testimonials_list.WarningMessage = Language.Phrase("NoRecord") End If End If Call testimonials_list.RenderOtherOptions %> <% If Security.IsLoggedIn() Then %> <% If testimonials.Export = "" And testimonials.CurrentAction = "" Then %> <form name="ftestimonialslistsrch" id="ftestimonialslistsrch" class="form-inline ewForm ewExtSearchForm" action="<%= ew_CurrentPage %>"> <% SearchPanelClass = ew_IIf(testimonials_list.SearchWhere <> "", " in", " in") %> <div id="ftestimonialslistsrch_SearchPanel" class="ewSearchPanel collapse<%= SearchPanelClass %>"> <input type="hidden" name="cmd" value="search"> <input type="hidden" name="t" value="testimonials"> <div class="ewBasicSearch"> <div id="xsr_1" class="ewRow"> <div class="ewQuickSearch input-group"> <input type="text" name="<%= EW_TABLE_BASIC_SEARCH %>" id="<%= EW_TABLE_BASIC_SEARCH %>" class="form-control" value="<%= ew_HtmlEncode(testimonials.BasicSearch.getKeyword()) %>" placeholder="<%= ew_HtmlEncode(Language.Phrase("Search")) %>"> <input type="hidden" name="<%= EW_TABLE_BASIC_SEARCH_TYPE %>" id="<%= EW_TABLE_BASIC_SEARCH_TYPE %>" value="<%= ew_HtmlEncode(testimonials.BasicSearch.getSearchType()) %>"> <div class="input-group-btn"> <button type="button" data-toggle="dropdown" class="btn btn-default"><span id="searchtype"><%= testimonials.BasicSearch.getSearchTypeNameShort() %></span><span class="caret"></span></button> <ul class="dropdown-menu pull-right" role="menu"> <li<% If testimonials.BasicSearch.getSearchType() = "" Then Response.Write " class=""active""" %>><a href="javascript:void(0);" onclick="ew_SetSearchType(this)"><%= Language.Phrase("QuickSearchAuto") %></a></li> <li<% If testimonials.BasicSearch.getSearchType() = "=" Then Response.Write " class=""active""" %>><a href="javascript:void(0);" onclick="ew_SetSearchType(this,'=')"><%= Language.Phrase("QuickSearchExact") %></a></li> <li<% If testimonials.BasicSearch.getSearchType() = "AND" Then Response.Write " class=""active""" %>><a href="javascript:void(0);" onclick="ew_SetSearchType(this,'AND')"><%= Language.Phrase("QuickSearchAll") %></a></li> <li<% If testimonials.BasicSearch.getSearchType() = "OR" Then Response.Write " class=""active""" %>><a href="javascript:void(0);" onclick="ew_SetSearchType(this,'OR')"><%= Language.Phrase("QuickSearchAny") %></a></li> </ul> <button class="btn btn-primary ewButton" name="btnsubmit" id="btnsubmit" type="submit"><%= Language.Phrase("SearchBtn") %></button> </div> </div> </div> </div> </div> </form> <% End If %> <% End If %> <% Call testimonials_list.ShowPageHeader %> <% Call testimonials_list.ShowMessage %> <% If testimonials_list.TotalRecs > 0 Or testimonials.CurrentAction <> "" Then %> <div class="box ewBox ewGrid<% If testimonials.IsAddOrEdit() Then %> ewGridAddEdit<% End If %> testimonials"> <% If testimonials.Export = "" Then %> <div class="box-header ewGridUpperPanel"> <% If testimonials.CurrentAction <> "gridadd" And testimonials.CurrentAction <> "gridedit" Then %> <form name="ewPagerForm" class="form-inline ewForm ewPagerForm" action="<%= ew_CurrentPage %>"> <% If ew_Empty(testimonials_list.Pager) Then Set testimonials_list.Pager = ew_NewNumericPagerBase(testimonials_list.StartRec, testimonials_list.DisplayRecs, testimonials_list.TotalRecs, testimonials_list.RecRange, testimonials_list.AutoHidePager) %> <% If testimonials_list.Pager.RecordCount > 0 And testimonials_list.Pager.Visible Then %> <div class="ewPager"> <div class="ewNumericPage"><ul class="pagination"> <% If testimonials_list.Pager.FirstButton.Enabled Then %> <li><a href="<%= testimonials_list.PageUrl %>start=<%= testimonials_list.Pager.FirstButton.Start %>"><%= Language.Phrase("PagerFirst") %></a></li> <% End If %> <% If testimonials_list.Pager.PrevButton.Enabled Then %> <li><a href="<%= testimonials_list.PageUrl %>start=<%= testimonials_list.Pager.PrevButton.Start %>"><%= Language.Phrase("PagerPrevious") %></a></li> <% End If %> <% For Each PagerItem In testimonials_list.Pager.Items %> <li<% if Not PagerItem.Enabled Then Response.Write " class=""active""" End If %>><a href="<% If PagerItem.Enabled Then Response.Write testimonials_list.PageUrl & "start=" & PagerItem.Start Else Response.Write "#" End If %>"><%= PagerItem.Text %></a></li> <% Next %> <% If testimonials_list.Pager.NextButton.Enabled Then %> <li><a href="<%= testimonials_list.PageUrl %>start=<%= testimonials_list.Pager.NextButton.Start %>"><%= Language.Phrase("PagerNext") %></a></li> <% End If %> <% If testimonials_list.Pager.LastButton.Enabled Then %> <li><a href="<%= testimonials_list.PageUrl %>start=<%= testimonials_list.Pager.LastButton.Start %>"><%= Language.Phrase("PagerLast") %></a></li> <% End If %> </ul></div> </div> <% End If %> <% If testimonials_list.Pager.RecordCount > 0 Then %> <div class="ewPager ewRec"> <span><%= Language.Phrase("Record") %> <%= testimonials_list.Pager.FromIndex %> <%= Language.Phrase("To") %> <%= testimonials_list.Pager.ToIndex %> <%= Language.Phrase("Of") %> <%= testimonials_list.Pager.RecordCount %></span> </div> <% End If %> </form> <% End If %> <div class="ewListOtherOptions"> <% Call testimonials_list.AddEditOptions.Render("body", "", "", "", "", "") Call testimonials_list.DetailOptions.Render("body", "", "", "", "", "") Call testimonials_list.ActionOptions.Render("body", "", "", "", "", "") %> </div> <div class="clearfix"></div> </div> <% End If %> <form name="ftestimonialslist" id="ftestimonialslist" class="form-inline ewForm ewListForm" action="<%= ew_CurrentPage %>" method="post"> <% If testimonials_list.CheckToken Then %> <input type="hidden" name="<%= EW_TOKEN_NAME %>" value="<%= testimonials_list.Token %>"> <% End If %> <input type="hidden" name="t" value="testimonials"> <div id="gmp_testimonials" class="<% If ew_IsResponsiveLayout() Then %>table-responsive <% End If %>ewGridMiddlePanel"> <% If testimonials_list.TotalRecs > 0 Or testimonials.CurrentAction = "gridedit" Then %> <table id="tbl_testimonialslist" class="table ewTable"> <thead> <tr class="ewTableHeader"> <% ' Header row testimonials.RowType = EW_ROWTYPE_HEADER Call testimonials_list.RenderListOptions ' Render list options (header, left) Call testimonials_list.ListOptions.Render("header", "left", "", "", "", "") %> <% If testimonials.ID.Visible Then ' ID %> <% If testimonials.SortUrl(testimonials.ID) = "" Then %> <th data-name="ID" class="<%= testimonials.ID.HeaderCellClass() %>"><div id="elh_testimonials_ID" class="testimonials_ID"><div class="ewTableHeaderCaption"><%= testimonials.ID.FldCaption %></div></div></th> <% Else %> <th data-name="ID" class="<%= testimonials.ID.HeaderCellClass() %>"><div class="ewPointer" onclick="ew_Sort(event,'<%= testimonials.SortUrl(testimonials.ID) %>',1);"><div id="elh_testimonials_ID" class="testimonials_ID"> <div class="ewTableHeaderBtn"><span class="ewTableHeaderCaption"><%= testimonials.ID.FldCaption %></span><span class="ewTableHeaderSort"><% If testimonials.ID.Sort = "ASC" Then %><span class="caret ewSortUp"></span><% ElseIf testimonials.ID.Sort = "DESC" Then %><span class="caret"></span><% End If %></span></div> </div></div></th> <% End If %> <% End If %> <% If testimonials.Opinion.Visible Then ' Opinion %> <% If testimonials.SortUrl(testimonials.Opinion) = "" Then %> <th data-name="Opinion" class="<%= testimonials.Opinion.HeaderCellClass() %>"><div id="elh_testimonials_Opinion" class="testimonials_Opinion"><div class="ewTableHeaderCaption"><%= testimonials.Opinion.FldCaption %></div></div></th> <% Else %> <th data-name="Opinion" class="<%= testimonials.Opinion.HeaderCellClass() %>"><div class="ewPointer" onclick="ew_Sort(event,'<%= testimonials.SortUrl(testimonials.Opinion) %>',1);"><div id="elh_testimonials_Opinion" class="testimonials_Opinion"> <div class="ewTableHeaderBtn"><span class="ewTableHeaderCaption"><%= testimonials.Opinion.FldCaption %><%= Language.Phrase("SrchLegend") %></span><span class="ewTableHeaderSort"><% If testimonials.Opinion.Sort = "ASC" Then %><span class="caret ewSortUp"></span><% ElseIf testimonials.Opinion.Sort = "DESC" Then %><span class="caret"></span><% End If %></span></div> </div></div></th> <% End If %> <% End If %> <% ' Render list options (header, right) Call testimonials_list.ListOptions.Render("header", "right", "", "", "", "") %> </tr> </thead> <tbody><!-- Table body --> <% If testimonials.ExportAll And testimonials.Export <> "" Then testimonials_list.StopRec = testimonials_list.TotalRecs Else ' Set the last record to display If testimonials_list.TotalRecs > testimonials_list.StartRec + testimonials_list.DisplayRecs - 1 Then testimonials_list.StopRec = testimonials_list.StartRec + testimonials_list.DisplayRecs - 1 Else testimonials_list.StopRec = testimonials_list.TotalRecs End If End If ' Move to first record testimonials_list.RecCnt = testimonials_list.StartRec - 1 If Not testimonials_list.Recordset.EOF Then ' Already positioned at first record, no need to move 'testimonials_list.Recordset.MoveFirst 'If testimonials_list.StartRec > 1 Then testimonials_list.Recordset.Move testimonials_list.StartRec - 1 ElseIf Not testimonials.AllowAddDeleteRow And testimonials_list.StopRec = 0 Then testimonials_list.StopRec = testimonials.GridAddRowCount End If ' Initialize Aggregate testimonials.RowType = EW_ROWTYPE_AGGREGATEINIT Call testimonials.ResetAttrs Call testimonials_list.RenderRow testimonials_list.RowCnt = 0 Do While CLng(testimonials_list.RecCnt) < CLng(testimonials_list.StopRec) testimonials_list.RecCnt = testimonials_list.RecCnt + 1 If CLng(testimonials_list.RecCnt) >= CLng(testimonials_list.StartRec) Then testimonials_list.RowCnt = testimonials_list.RowCnt + 1 ' Set up key count testimonials_list.KeyCount = testimonials_list.RowIndex Call testimonials.ResetAttrs testimonials.CssClass = "" If testimonials.CurrentAction = "gridadd" Then Else Call testimonials_list.LoadRowValues(testimonials_list.Recordset) ' Load row values End If testimonials.RowType = EW_ROWTYPE_VIEW ' Render view ' Set up row id / data-rowindex Call testimonials.RowAttrs.AddAttributes(Array(Array("data-rowindex", testimonials_list.RowCnt), Array("id", "r" & testimonials_list.RowCnt & "_testimonials"), Array("data-rowtype", testimonials.RowType))) ' Render row Call testimonials_list.RenderRow ' Render list options Call testimonials_list.RenderListOptions %> <tr<%= testimonials.RowAttributes %>> <% ' Render list options (body, left) Call testimonials_list.ListOptions.Render("body", "left", testimonials_list.RowCnt, "", "", "") %> <% If testimonials.ID.Visible Then ' ID %> <td data-name="ID"<%= testimonials.ID.CellAttributes %>> <span id="el<%= testimonials_list.RowCnt %>_testimonials_ID" class="testimonials_ID"> <span<%= testimonials.ID.ViewAttributes %>> <%= testimonials.ID.ListViewValue %> </span> </span> </td> <% End If %> <% If testimonials.Opinion.Visible Then ' Opinion %> <td data-name="Opinion"<%= testimonials.Opinion.CellAttributes %>> <span id="el<%= testimonials_list.RowCnt %>_testimonials_Opinion" class="testimonials_Opinion"> <span<%= testimonials.Opinion.ViewAttributes %>> <%= testimonials.Opinion.ListViewValue %> </span> </span> </td> <% End If %> <% ' Render list options (body, right) Call testimonials_list.ListOptions.Render("body", "right", testimonials_list.RowCnt, "", "", "") %> </tr> <% End If If testimonials.CurrentAction <> "gridadd" Then testimonials_list.Recordset.MoveNext End If Loop %> </tbody> </table> <% End If %> <% If testimonials.CurrentAction = "" Then %> <input type="hidden" name="a_list" id="a_list" value=""> <% End If %> </div> </form> <% ' Close recordset and connection testimonials_list.Recordset.Close Set testimonials_list.Recordset = Nothing %> <% If testimonials.Export = "" Then %> <div class="box-footer ewGridLowerPanel"> <% If testimonials.CurrentAction <> "gridadd" And testimonials.CurrentAction <> "gridedit" Then %> <form name="ewPagerForm" class="ewForm form-inline ewPagerForm" action="<%= ew_CurrentPage %>"> <% If ew_Empty(testimonials_list.Pager) Then Set testimonials_list.Pager = ew_NewNumericPagerBase(testimonials_list.StartRec, testimonials_list.DisplayRecs, testimonials_list.TotalRecs, testimonials_list.RecRange, testimonials_list.AutoHidePager) %> <% If testimonials_list.Pager.RecordCount > 0 And testimonials_list.Pager.Visible Then %> <div class="ewPager"> <div class="ewNumericPage"><ul class="pagination"> <% If testimonials_list.Pager.FirstButton.Enabled Then %> <li><a href="<%= testimonials_list.PageUrl %>start=<%= testimonials_list.Pager.FirstButton.Start %>"><%= Language.Phrase("PagerFirst") %></a></li> <% End If %> <% If testimonials_list.Pager.PrevButton.Enabled Then %> <li><a href="<%= testimonials_list.PageUrl %>start=<%= testimonials_list.Pager.PrevButton.Start %>"><%= Language.Phrase("PagerPrevious") %></a></li> <% End If %> <% For Each PagerItem In testimonials_list.Pager.Items %> <li<% if Not PagerItem.Enabled Then Response.Write " class=""active""" End If %>><a href="<% If PagerItem.Enabled Then Response.Write testimonials_list.PageUrl & "start=" & PagerItem.Start Else Response.Write "#" End If %>"><%= PagerItem.Text %></a></li> <% Next %> <% If testimonials_list.Pager.NextButton.Enabled Then %> <li><a href="<%= testimonials_list.PageUrl %>start=<%= testimonials_list.Pager.NextButton.Start %>"><%= Language.Phrase("PagerNext") %></a></li> <% End If %> <% If testimonials_list.Pager.LastButton.Enabled Then %> <li><a href="<%= testimonials_list.PageUrl %>start=<%= testimonials_list.Pager.LastButton.Start %>"><%= Language.Phrase("PagerLast") %></a></li> <% End If %> </ul></div> </div> <% End If %> <% If testimonials_list.Pager.RecordCount > 0 Then %> <div class="ewPager ewRec"> <span><%= Language.Phrase("Record") %> <%= testimonials_list.Pager.FromIndex %> <%= Language.Phrase("To") %> <%= testimonials_list.Pager.ToIndex %> <%= Language.Phrase("Of") %> <%= testimonials_list.Pager.RecordCount %></span> </div> <% End If %> </form> <% End If %> <div class="ewListOtherOptions"> <% Call testimonials_list.AddEditOptions.Render("body", "bottom", "", "", "", "") Call testimonials_list.DetailOptions.Render("body", "bottom", "", "", "", "") Call testimonials_list.ActionOptions.Render("body", "bottom", "", "", "", "") %> </div> <div class="clearfix"></div> </div> <% End If %> </div> <% End If %> <% If testimonials_list.TotalRecs = 0 And testimonials.CurrentAction = "" Then ' Show other options %> <div class="ewListOtherOptions"> <% Call testimonials_list.AddEditOptions.Render("body", "", "", "", "", "") Call testimonials_list.DetailOptions.Render("body", "", "", "", "", "") Call testimonials_list.ActionOptions.Render("body", "", "", "", "", "") %> </div> <div class="clearfix"></div> <% End If %> <% If testimonials.Export <> "" Then %> <script type="text/javascript"> ew_ApplyTemplate("body", "", "testimonialslist", "<%= testimonials.CustomExport %>"); </script> <% End If %> <% If testimonials.Export = "" Then %> <script type="text/javascript"> ftestimonialslistsrch.FilterList = <%= testimonials_list.GetFilterList() %>; ftestimonialslistsrch.Init(); ftestimonialslist.Init(); </script> <% End If %> <% Call testimonials_list.ShowPageFooter If EW_DEBUG_ENABLED Then Response.Write ew_DebugMsg() %> <% If testimonials.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 testimonials_list.Page_Terminate("") Set testimonials_list = Nothing %> <% ' ' Page Class ' Class ctestimonials_list ' Page ID Public Property Get PageID PageID = "list" End Property ' Project ID Public Property Get ProjectID ProjectID = "panel" End Property ' Table Name Public Property Get TableName TableName = "testimonials" End Property ' Page Object Name Public Property Get PageObjName PageObjName = "testimonials_list" End Property ' Field (ID) Public Property Get ID Set ID = testimonials.ID End Property ' Field (Opinion) Public Property Get Opinion Set Opinion = testimonials.Opinion End Property ' Field (Name) Public Property Get Name Set Name = testimonials.Name End Property ' Field (Designation) Public Property Get Designation Set Designation = testimonials.Designation End Property ' Field (Photo) Public Property Get Photo Set Photo = testimonials.Photo End Property ' Field (Enable) Public Property Get Enable Set Enable = testimonials.Enable End Property ' Get field object dictionary (ASP) Public Property Get Fields Set Fields = testimonials.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 ' Custom actions (ASP) Dim CustomActions ' Export document (ASP) Dim ExportDoc ' Grid form hidden field names Dim FormName Dim FormActionName Dim FormKeyName Dim FormOldKeyName Dim FormBlankRowName Dim FormKeyCountName ' Page headings Dim Heading Dim Subheading ' Page heading Function PageHeading() PageHeading = "" If Heading <> "" Then PageHeading = Heading ElseIf ew_NotEmpty(testimonials) Then PageHeading = testimonials.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 testimonials.UseTokenInUrl Then PageUrl = PageUrl & "t=" & testimonials.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"">×</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 testimonials.UseTokenInUrl Then IsPageRequest = False If ew_NotEmpty(ObjForm) Then IsPageRequest = (testimonials.TableVar = ObjForm.GetValue("t")) End If If Request.QueryString("t").Count > 0 Then IsPageRequest = (testimonials.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 ' Grid form hidden field names FormName = "ftestimonialslist" FormActionName = "k_action" FormKeyName = "k_key" FormOldKeyName = "k_oldkey" FormBlankRowName = "k_blankrow" FormKeyCountName = "key_count" ' 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(testimonials) Then Set testimonials = New ctestimonials Set Table = testimonials ExportExcelCustom = False ExportWordCustom = False ExportPdfCustom = True ' Always use ew_ApplyTemplate ExportEmailCustom = True ' Always use ew_ApplyTemplate ' Initialize URLs ExportPrintUrl = PageUrl & "export=print" ExportExcelUrl = PageUrl & "export=excel" ExportWordUrl = PageUrl & "export=word" ExportHtmlUrl = PageUrl & "export=html" ExportXmlUrl = PageUrl & "export=xml" ExportCsvUrl = PageUrl & "export=csv" ExportPdfUrl = PageUrl & "export=pdf" AddUrl = "testimonialsadd.asp" InlineAddUrl = PageUrl & "a=add" GridAddUrl = PageUrl & "a=gridadd" GridEditUrl = PageUrl & "a=gridedit" MultiDeleteUrl = "testimonialsdelete.asp" MultiUpdateUrl = "testimonialsupdate.asp" ' Initialize form object Set ObjForm = Nothing ' Get resize object Call ew_GetResizeObj ' Intialize page id (for backward compatibility) EW_PAGE_ID = "list" ' Initialize table name (for backward compatibility) EW_TABLE_NAME = "testimonials" ' Debug message Call ew_LoadDebugMsg ' Open connection to the database If IsEmpty(Conn) Then Set Conn = ew_Connect(testimonials.TableDBID) End If ' List options Set ListOptions = New cListOptions ListOptions.TableVar = testimonials.TableVar ' Custom actions Set CustomActions = Dictionary() ' Export options Set ExportOptions = New cListOptions ExportOptions.TableVar = testimonials.TableVar ExportOptions.Tag = "div" ExportOptions.TagClassName = "ewExportOption" ' Other options Set AddEditOptions = New cListOptions AddEditOptions.Tag = "div" AddEditOptions.TagClassName = "ewAddEditOption" Set DetailOptions = New cListOptions DetailOptions.Tag = "div" DetailOptions.TagClassName = "ewDetailOption" Set ActionOptions = New cListOptions ActionOptions.Tag = "div" ActionOptions.TagClassName = "ewActionOption" ' Filter options Set FilterOptions = New cListOptions FilterOptions.Tag = "div" FilterOptions.TagClassName = "ewFilterOption ftestimonialslistsrch" ' List actions Set ListActions = New cListActions End Sub ' ' Page_Init ' Sub Page_Init() ' 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.CanList Then Call Security.SaveLastUrl Call Page_Terminate(ew_GetUrl("default.asp")) End If ' Get grid add count Dim gridaddcnt gridaddcnt = Request.QueryString(EW_TABLE_GRID_ADD_ROW_COUNT) If IsNumeric(gridaddcnt) Then If gridaddcnt > 0 Then testimonials.GridAddRowCount = gridaddcnt End If End If ' Set up list options Call SetupListOptions Call testimonials.ID.SetVisibility(testimonials) If testimonials.IsAdd() Or testimonials.IsCopy() Or testimonials.IsGridAdd() Then testimonials.ID.Visible = False End If Call testimonials.Opinion.SetVisibility(testimonials) ' 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 = testimonials.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 ' Setup other options Call SetupOtherOptions ' Set up custom action (backward compatibility) Dim sKey, sAction For Each sKey In CustomActions.Keys() sAction = CustomActions.Get(sKey) Call ListActions.Add(sKey, sAction, True, EW_ACTION_POSTBACK, EW_ACTION_MULTIPLE, "", "glyphicon glyphicon-star ewIcon") Next ' Show checkbox column if multiple action Dim listact For i = 0 to ListActions.Count - 1 Set listact = ListActions(i) If listact.SelectType = EW_ACTION_MULTIPLE And listact.Allow Then ListOptions("checkbox").Visible = True Exit For End If Next 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(testimonials) Then If testimonials.Export <> "" And Request.Form("data").Count > 0 Then Dim sContent sContent = Request.Form("data") gsExportFile = Request.Form("filename") If gsExportFile = "" Then gsExportFile = testimonials.TableVar If testimonials.Export = "pdf" Then Call ExportPdf(sContent) ElseIf testimonials.Export = "email" Then Response.Write ExportEmail(sContent) ElseIf testimonials.Export = "excel" Then Call ExportExcel(sContent) ElseIf testimonials.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 ListOptions = Nothing Set CustomActions = Nothing ' ASP Set ObjForm = Nothing Set gResizeObj = Nothing ' Go to URL if specified If gsExport & "" = "" Then If sRedirectUrl <> "" Then If Response.Buffer Then Response.Clear Call ew_SaveDebugMsg Response.Redirect sRedirectUrl End If End If Set testimonials = Nothing Call ew_CleanUp End Sub ' ' Page_Terminate (End) ' Dim ListOptions ' List options Dim ExportOptions ' Export options Dim SearchOptions ' Search options Dim AddEditOptions ' Other options (add edit) Dim DetailOptions ' Other options (detail) Dim ActionOptions ' Other options (action) Dim FilterOptions ' Filter options Dim ListActions ' List actions Dim SelectedCount Dim SelectedIndex Dim DisplayRecs ' Number of display records Dim StartRec, StopRec, TotalRecs, RecRange Dim AutoHidePager, AutoHidePageSizeSelector Dim DefaultSearchWhere ' Default search WHERE clause Dim SearchWhere Dim RecCnt Dim EditRowCnt Dim StartRowCnt Dim RowCnt, RowIndex Dim Attrs Dim RecPerRow Dim MultiColumnClass Dim MultiColumnEditClass Dim MultiColumnCnt Dim MultiColumnEditCnt Dim GridCnt Dim ColCnt Dim KeyCount Dim RowAction Dim RowOldKey ' Row old key (for copy) Dim DbMasterFilter, DbDetailFilter Dim MasterRecordExists Dim MultiSelectKey Dim Command Dim RestoreSearch Dim Recordset, OldRecordset, DetailPages ' ' Page main ' Sub Page_Main() SelectedCount = 0 SelectedIndex = 0 DisplayRecs = 20 RecRange = 10 AutoHidePager = EW_AUTO_HIDE_PAGER AutoHidePageSizeSelector = EW_AUTO_HIDE_PAGE_SIZE_SELECTOR RecCnt = 0 ' Record count KeyCount = 0 ' Key count StartRowCnt = 1 ' Search filters Dim sSrchAdvanced, sSrchBasic, sFilter sSrchAdvanced = "" ' Advanced search filter sSrchBasic = "" ' Basic search filter SearchWhere = "" ' Search where clause DefaultSearchWhere = "" sFilter = "" ' Restore search RestoreSearch = False ' Get command Command = LCase(Request.QueryString("cmd")&"") ' Master/Detail DbMasterFilter = "" ' Master filter DbDetailFilter = "" ' Detail filter If IsPageRequest Then ' Validate request ' Process list action first If ProcessListAction() Then ' Ajax request Call Page_Terminate("") Response.End End If ' Handle reset command Call ResetCmd ' Set up Breadcrumb If testimonials.Export = "" Then Call SetupBreadcrumb End If ' Hide list options If testimonials.Export <> "" Then Call ListOptions.HideAllOptions(Array("sequence")) ListOptions.UseDropDownButton = False ' Disable drop down button ListOptions.UseButtonGroup = False ' Disable button group ElseIf testimonials.CurrentAction = "gridadd" Or testimonials.CurrentAction = "gridedit" Then Call ListOptions.HideAllOptions(Array()) ListOptions.UseDropDownButton = False ' Disable drop down button ListOptions.UseButtonGroup = False ' Disable button group End If ' Hide options If testimonials.Export <> "" Or testimonials.CurrentAction <> "" Then Call ExportOptions.HideAllOptions(Array()) Call FilterOptions.HideAllOptions(Array()) End If ' Hide other options If testimonials.Export <> "" Then Call AddEditOptions.HideAllOptions(Array()) Call DetailOptions.HideAllOptions(Array()) Call ActionOptions.HideAllOptions(Array()) End If ' Get default search criteria Call ew_AddFilter(DefaultSearchWhere, BasicSearchWhere(True)) ' Get basic search values Call LoadBasicSearchValues ' Restore filter list Call ProcessFilterList ' Restore search parms from Session if not searching / reset / export If (testimonials.Export <> "" Or Command <> "search" And Command <> "reset" And Command <> "resetall") And Command <> "json" And CheckSearchParms() Then Call RestoreSearchParms End If ' Call Recordset SearchValidated event Call testimonials.Recordset_SearchValidated() ' Set Up Sorting Order Call SetupSortOrder ' Get basic search criteria If gsSearchError = "" Then sSrchBasic = BasicSearchWhere(False) End If End If ' End Validate Request ' Restore display records If Command <> "json" And testimonials.RecordsPerPage <> "" Then DisplayRecs = testimonials.RecordsPerPage ' Restore from Session Else DisplayRecs = 20 ' Load default End If ' Load Sorting Order If Command <> "json" Then Call LoadSortOrder ' Load search default if no existing search criteria If Not CheckSearchParms() Then ' Load basic search from default testimonials.BasicSearch.Keyword = testimonials.BasicSearch.KeywordDefault testimonials.BasicSearch.SearchType = testimonials.BasicSearch.SearchTypeDefault Call testimonials.BasicSearch.setSearchType(testimonials.BasicSearch.SearchTypeDefault) If testimonials.BasicSearch.Keyword <> "" Then sSrchBasic = BasicSearchWhere(False) End If End If ' Build search criteria Call ew_AddFilter(SearchWhere, sSrchAdvanced) Call ew_AddFilter(SearchWhere, sSrchBasic) ' Call Recordset Searching event Call testimonials.Recordset_Searching(SearchWhere) ' Save search criteria If Command = "search" And Not RestoreSearch Then testimonials.SearchWhere = SearchWhere ' Save to Session StartRec = 1 ' Reset start record counter testimonials.StartRecordNumber = StartRec ElseIf Command <> "json" Then SearchWhere = testimonials.SearchWhere End If sFilter = "" Call ew_AddFilter(sFilter, DbDetailFilter) Call ew_AddFilter(sFilter, SearchWhere) ' Set up filter If Command = "json" Then testimonials.UseSessionForListSQL = False ' Do not use session for ListSQL testimonials.CurrentFilter = sFilter Else testimonials.SessionWhere = sFilter testimonials.CurrentFilter = "" End If ' Load record count first ' ASP TotalRecs = testimonials.ListRecordCount() ' Search options Call SetupSearchOptions End Sub ' ' Build filter for all keys ' Function BuildKeyFilter() Dim rowindex, sThisKey Dim sKey Dim sWrkFilter, sFilter sWrkFilter = "" ' Update row index and get row key rowindex = 1 ObjForm.Index = rowindex sThisKey = ObjForm.GetValue("k_key") & "" Do While sThisKey <> "" If SetupKeyValues(sThisKey) Then sFilter = testimonials.KeyFilter If sWrkFilter <> "" Then sWrkFilter = sWrkFilter & " OR " sWrkFilter = sWrkFilter & sFilter Else sWrkFilter = "0=1" Exit Do End If ' Update row index and get row key rowindex = rowindex + 1 ' Next row ObjForm.Index = rowindex sThisKey = ObjForm.GetValue("k_key") & "" Loop BuildKeyFilter = sWrkFilter End Function ' ' Set up key values ' Function SetupKeyValues(key) Dim arrKeyFlds arrKeyFlds = Split(key&"", EW_COMPOSITE_KEY_SEPARATOR) If UBound(arrKeyFlds) >= 0 Then testimonials.ID.FormValue = arrKeyFlds(0) If Not IsNumeric(testimonials.ID.FormValue) Then SetupKeyValues = False Exit Function End If End If SetupKeyValues = True End Function ' Get list of filters Function GetFilterList() ' Initialize Dim sFilterList, sWrk, sSavedFilterList ' Initialize sFilterList = "" sSavedFilterList = "" sFilterList = ew_Concat(sFilterList, testimonials.ID.AdvancedSearch.ToJson(), ",") ' Field ID sFilterList = ew_Concat(sFilterList, testimonials.Opinion.AdvancedSearch.ToJson(), ",") ' Field Opinion sFilterList = ew_Concat(sFilterList, testimonials.Name.AdvancedSearch.ToJson(), ",") ' Field Name sFilterList = ew_Concat(sFilterList, testimonials.Designation.AdvancedSearch.ToJson(), ",") ' Field Designation sFilterList = ew_Concat(sFilterList, testimonials.Photo.AdvancedSearch.ToJson(), ",") ' Field Photo sFilterList = ew_Concat(sFilterList, testimonials.Enable.AdvancedSearch.ToJson(), ",") ' Field Enable If testimonials.BasicSearch.Keyword <> "" Then sWrk = """" & EW_TABLE_BASIC_SEARCH & """:""" & ew_JsEncode2(testimonials.BasicSearch.Keyword) & """,""" & EW_TABLE_BASIC_SEARCH_TYPE & """:""" & ew_JsEncode2(testimonials.BasicSearch.SearchType) & """" sFilterList = ew_Concat(sFilterList, sWrk, ",") End If sFilterList = ew_RegExReplace(",$", sFilterList, "") ' Return filter list in json If sFilterList <> "" Then sFilterList = """data"":{" & sFilterList & "}" End If If sSavedFilterList <> "" Then If sFilterList <> "" Then sFilterList = sFilterList & "," End If sFilterList = sFilterList & """filters"":" & sSavedFilterList End If GetFilterList = ew_IIf(sFilterList <> "", "{" & sFilterList & "}" , "null") End Function ' Process filter list Sub ProcessFilterList() Dim filters, result If Request.Form("ajax") = "savefilters" Then filters = Request.Form("filters") Call UserProfile.SetSearchFilters(CurrentUserName(), "ftestimonialslistsrch", filters) ' Clean output buffer If Response.Buffer Then Response.Clear Set result = Dictionary() Call result.Add("success", True) Call ResponseJson Response.Write "[" & result.ToJson() & "]" Set result = Nothing Call Page_Terminate("") Response.End ElseIf Request.Form("cmd") = "resetfilter" Then RestoreFilterList() End If End Sub ' Restore list of filters Function RestoreFilterList() Dim filter ' Return if not reset filter If Request.Form("cmd") & "" <> "resetfilter" Then RestoreFilterList = False Exit Function End If If Request.form("filter").Count > 0 Then Set filter = ew_JsonDecode(Request.Form("filter")) Command = "search" ' Field ID If filter.Exists("x_ID") Then testimonials.ID.AdvancedSearch.SearchValue = filter("x_ID") End If If filter.Exists("z_ID") Then testimonials.ID.AdvancedSearch.SearchOperator = filter("z_ID") End If If filter.Exists("v_ID") Then testimonials.ID.AdvancedSearch.SearchCondition = filter("v_ID") End If If filter.Exists("y_ID") Then testimonials.ID.AdvancedSearch.SearchValue2 = filter("y_ID") End If If filter.Exists("w_ID") Then testimonials.ID.AdvancedSearch.SearchOperator2 = filter("w_ID") End If Call testimonials.ID.AdvancedSearch.Save ' Field Opinion If filter.Exists("x_Opinion") Then testimonials.Opinion.AdvancedSearch.SearchValue = filter("x_Opinion") End If If filter.Exists("z_Opinion") Then testimonials.Opinion.AdvancedSearch.SearchOperator = filter("z_Opinion") End If If filter.Exists("v_Opinion") Then testimonials.Opinion.AdvancedSearch.SearchCondition = filter("v_Opinion") End If If filter.Exists("y_Opinion") Then testimonials.Opinion.AdvancedSearch.SearchValue2 = filter("y_Opinion") End If If filter.Exists("w_Opinion") Then testimonials.Opinion.AdvancedSearch.SearchOperator2 = filter("w_Opinion") End If Call testimonials.Opinion.AdvancedSearch.Save ' Field Name If filter.Exists("x_Name") Then testimonials.Name.AdvancedSearch.SearchValue = filter("x_Name") End If If filter.Exists("z_Name") Then testimonials.Name.AdvancedSearch.SearchOperator = filter("z_Name") End If If filter.Exists("v_Name") Then testimonials.Name.AdvancedSearch.SearchCondition = filter("v_Name") End If If filter.Exists("y_Name") Then testimonials.Name.AdvancedSearch.SearchValue2 = filter("y_Name") End If If filter.Exists("w_Name") Then testimonials.Name.AdvancedSearch.SearchOperator2 = filter("w_Name") End If Call testimonials.Name.AdvancedSearch.Save ' Field Designation If filter.Exists("x_Designation") Then testimonials.Designation.AdvancedSearch.SearchValue = filter("x_Designation") End If If filter.Exists("z_Designation") Then testimonials.Designation.AdvancedSearch.SearchOperator = filter("z_Designation") End If If filter.Exists("v_Designation") Then testimonials.Designation.AdvancedSearch.SearchCondition = filter("v_Designation") End If If filter.Exists("y_Designation") Then testimonials.Designation.AdvancedSearch.SearchValue2 = filter("y_Designation") End If If filter.Exists("w_Designation") Then testimonials.Designation.AdvancedSearch.SearchOperator2 = filter("w_Designation") End If Call testimonials.Designation.AdvancedSearch.Save ' Field Photo If filter.Exists("x_Photo") Then testimonials.Photo.AdvancedSearch.SearchValue = filter("x_Photo") End If If filter.Exists("z_Photo") Then testimonials.Photo.AdvancedSearch.SearchOperator = filter("z_Photo") End If If filter.Exists("v_Photo") Then testimonials.Photo.AdvancedSearch.SearchCondition = filter("v_Photo") End If If filter.Exists("y_Photo") Then testimonials.Photo.AdvancedSearch.SearchValue2 = filter("y_Photo") End If If filter.Exists("w_Photo") Then testimonials.Photo.AdvancedSearch.SearchOperator2 = filter("w_Photo") End If Call testimonials.Photo.AdvancedSearch.Save ' Field Enable If filter.Exists("x_Enable") Then testimonials.Enable.AdvancedSearch.SearchValue = filter("x_Enable") End If If filter.Exists("z_Enable") Then testimonials.Enable.AdvancedSearch.SearchOperator = filter("z_Enable") End If If filter.Exists("v_Enable") Then testimonials.Enable.AdvancedSearch.SearchCondition = filter("v_Enable") End If If filter.Exists("y_Enable") Then testimonials.Enable.AdvancedSearch.SearchValue2 = filter("y_Enable") End If If filter.Exists("w_Enable") Then testimonials.Enable.AdvancedSearch.SearchOperator2 = filter("w_Enable") End If Call testimonials.Enable.AdvancedSearch.Save If filter.Exists(EW_TABLE_BASIC_SEARCH) Then Call testimonials.BasicSearch.setKeyword(filter(EW_TABLE_BASIC_SEARCH)) End If If filter.Exists(EW_TABLE_BASIC_SEARCH_TYPE) Then Call testimonials.BasicSearch.setSearchType(filter(EW_TABLE_BASIC_SEARCH_TYPE)) End If Set filter = Nothing End If End Function ' ' Return basic search SQL ' Function BasicSearchSQL(arKeywords, typ) Dim sWhere sWhere = "" Call BuildBasicSearchSQL(sWhere, testimonials.Opinion, arKeywords, typ) Call BuildBasicSearchSQL(sWhere, testimonials.Name, arKeywords, typ) Call BuildBasicSearchSQL(sWhere, testimonials.Designation, arKeywords, typ) Call BuildBasicSearchSQL(sWhere, testimonials.Photo, arKeywords, typ) Call BuildBasicSearchSQL(sWhere, testimonials.Enable, arKeywords, typ) BasicSearchSQL = sWhere End Function ' ' Build basic search SQL ' Sub BuildBasicSearchSQL(Where, Fld, arKeywords, typ) Dim sDefcond, arSQL, arCond, cnt, i, j, ar Dim Keyword, sWrk, sFldExpression, bQuoted, sSql sDefCond = ew_IIf(typ = "OR", "OR", "AND") arSQL = Array() ' Array for SQL parts arCond = Array() ' Array for search conditions cnt = UBound(arKeywords)+1 j = 0 ' Number of SQL parts For i = 0 to cnt-1 Keyword = arKeywords(i) Keyword = Trim(Keyword) If EW_BASIC_SEARCH_IGNORE_PATTERN <> "" Then Keyword = ew_RegExReplace(EW_BASIC_SEARCH_IGNORE_PATTERN, Keyword, "\") ar = Split(Keyword, "\") Else ar = Array(Keyword) End If For Each Keyword In ar If Keyword <> "" Then sWrk = "" If Keyword = "OR" And typ = "" Then If j > 0 Then arCond(j-1) = "OR" End If ElseIf Keyword = EW_NULL_VALUE Then sWrk = Fld.FldExpression & " IS NULL" ElseIf Keyword = EW_NOT_NULL_VALUE Then sWrk = Fld.FldExpression & " IS NOT NULL" ElseIf Fld.FldIsVirtual Then sWrk = Fld.FldVirtualExpression & ew_Like(ew_QuotedValueBase("%" & Keyword & "%", EW_DATATYPE_STRING, testimonials.TableDBID), testimonials.TableDBID) ElseIf Fld.FldDataType <> EW_DATATYPE_NUMBER Or IsNumeric(Keyword) Then sWrk = Fld.FldBasicSearchExpression & ew_Like(ew_QuotedValueBase("%" & Keyword & "%", EW_DATATYPE_STRING, testimonials.TableDBID), testimonials.TableDBID) End If If sWrk <> "" Then If j > 0 Then ReDim Preserve arSQL(j) ReDim Preserve arCond(j) Else ReDim arSQL(0) ReDim arCond(0) End If arSQL(j) = sWrk arCond(j) = sDefCond j = j + 1 End If End If Next Next cnt = UBound(arSQL)+1 bQuoted = False sSql = "" If cnt > 0 Then For i = 0 to cnt-2 If arCond(i) = "OR" Then If Not bQuoted Then sSql = sSql & "(" bQuoted = True End If sSql = sSql & arSQL(i) If bQuoted And arCond(i) <> "OR" Then sSql = sSql & ")" bQuoted = False End If sSql = sSql & " " & arCond(i) & " " Next sSql = sSql & arSQL(cnt-1) If bQuoted Then sSql = sSql & ")" End If End If If sSql <> "" Then If Where <> "" Then Where = Where & " OR " Where = Where & "(" & sSql & ")" End If End Sub ' ' Return Basic Search Where based on search keyword and type ' Function BasicSearchWhere(bDefault) Dim sSearchStr, sSearchKeyword, sSearchType Dim sSearch, arKeyword, sKeyword, ar, Match, Matches, p, str, i sSearchStr = "" sSearchKeyword = ew_IIf(bDefault, testimonials.BasicSearch.KeywordDefault, testimonials.BasicSearch.Keyword) sSearchType = ew_IIf(bDefault, testimonials.BasicSearch.SearchTypeDefault, testimonials.BasicSearch.SearchType) ' Get search SQL If sSearchKeyword <> "" Then ar = testimonials.BasicSearch.KeywordList(bDefault) ' Search keyword in any fields If (sSearchType = "OR" Or sSearchType = "AND") And testimonials.BasicSearch.BasicSearchAnyFields Then For i = 0 to UBound(ar) sKeyword = ar(i) If sKeyword <> "" Then If sSearchStr <> "" Then sSearchStr = sSearchStr & " " & sSearchType & " " sSearchStr = sSearchStr & "(" & BasicSearchSQL(Array(sKeyword), sSearchType) & ")" End If Next Else sSearchStr = BasicSearchSQL(ar, sSearchType) End If If Not bDefault And ew_InArray(Command, Array("", "reset", "resetall")) Then Command = "search" End If If Not bDefault And Command = "search" Then Call testimonials.BasicSearch.setKeyword(sSearchKeyword) Call testimonials.BasicSearch.setSearchType(sSearchType) End If BasicSearchWhere = sSearchStr End Function ' Check if search parm exists Function CheckSearchParms() ' Check basic search If testimonials.BasicSearch.IssetSession() Then CheckSearchParms = True Exit Function End If CheckSearchParms = False End Function ' Clear all search parameters Sub ResetSearchParms() ' Clear search where SearchWhere = "" testimonials.SearchWhere = SearchWhere ' Clear basic search parameters Call ResetBasicSearchParms End Sub ' Load advanced search default values Function LoadAdvancedSearchDefault() LoadAdvancedSearchDefault = False End Function ' Clear all basic search parameters Sub ResetBasicSearchParms() Call testimonials.BasicSearch.UnsetSession End Sub ' ' Restore all search parameters ' Sub RestoreSearchParms() ' Restore search flag RestoreSearch = True ' Restore basic search values Call testimonials.BasicSearch.Load() End Sub ' ' Set up Sort parameters based on Sort Links clicked ' Sub SetupSortOrder() Dim sOrderBy Dim sSortField, sLastSort, sThisSort Dim bCtrl ' Check for an Order parameter If Request.QueryString("order").Count > 0 Then testimonials.CurrentOrder = Request.QueryString("order") testimonials.CurrentOrderType = Request.QueryString("ordertype") ' Field ID Call testimonials.UpdateSort(testimonials.ID) ' Field Opinion Call testimonials.UpdateSort(testimonials.Opinion) testimonials.StartRecordNumber = 1 ' Reset start position End If End Sub ' ' Load Sort Order parameters ' Sub LoadSortOrder() Dim sOrderBy sOrderBy = testimonials.SessionOrderBy ' Get order by from Session If sOrderBy = "" Then If testimonials.SqlOrderBy <> "" Then sOrderBy = testimonials.SqlOrderBy testimonials.SessionOrderBy = sOrderBy End If End If End Sub ' ' Reset command based on querystring parameter "cmd" ' Sub ResetCmd() ' Check if reset command If Left(Command,5) = "reset" Then ' Reset search criteria If Command = "reset" Or Command = "resetall" Then Call ResetSearchParms End If ' Reset Sort Criteria If Command = "resetsort" Then Dim sOrderBy sOrderBy = "" testimonials.SessionOrderBy = sOrderBy testimonials.ID.Sort = "" testimonials.Opinion.Sort = "" End If ' Reset start position StartRec = 1 testimonials.StartRecordNumber = StartRec End If End Sub ' Set up list options Sub SetupListOptions() Dim item ' Add group option item Set item = ListOptions.Add(ListOptions.GroupOptionName) item.Body = "" item.OnLeft = False item.Visible = False ' View Set item = ListOptions.Add("view") item.CssClass = "text-nowrap;" item.Visible = Security.IsLoggedIn() item.OnLeft = False ' Edit Set item = ListOptions.Add("edit") item.CssClass = "text-nowrap;" item.Visible = Security.IsLoggedIn() item.OnLeft = False ' List actions Set item = ListOptions.Add("listactions") item.CssClass = "text-nowrap;" item.OnLeft = False item.Visible = False item.ShowInButtonGroup = False item.ShowInDropDown = False ' Checkbox Set item = ListOptions.Add("checkbox") item.Visible = Security.IsLoggedIn() item.OnLeft = False item.Header = "<input type=""checkbox"" name=""key"" id=""key"" onclick=""ew_SelectAllKey(this);"">" item.ShowInDropDown = False item.ShowInButtonGroup = False ' Drop down button for ListOptions ListOptions.UseImageAndText = True ListOptions.UseDropDownButton = False ListOptions.DropDownButtonPhrase = Language.Phrase("ButtonListOptions") ListOptions.UseButtonGroup = False If ListOptions.UseButtonGroup And ew_IsMobile() Then ListOptions.UseDropDownButton = True End If ListOptions.ButtonClass = "btn-sm" ' Class for button group Call ListOptions_Load Call SetupListOptionsExt ' Set up group item visibility ListOptions(ListOptions.GroupOptionName).Visible = ListOptions.GroupOptionVisible End Sub ' Render list options Sub RenderListOptions() Dim item, links, cancelurl Call ListOptions.LoadDefault ' Call ListOptions_Rendering event Call ListOptions_Rendering Dim viewcaption viewcaption = ew_HtmlTitle(Language.Phrase("ViewLink")) If Security.IsLoggedIn() Then ListOptions("view").Body = "<a class=""ewRowLink ewView"" title=""" & viewcaption & """ data-caption=""" & viewcaption & """ href=""" & ew_HtmlEncode(ViewUrl) & """>" & Language.Phrase("ViewLink") & "</a>" Else ListOptions("view").Body = "" End If Dim editcaption Set item = ListOptions("edit") editcaption = ew_HtmlTitle(Language.Phrase("EditLink")) If Security.IsLoggedIn() Then item.Body = "<a class=""ewRowLink ewEdit"" title=""" & editcaption & """ data-caption=""" & editcaption & """ href=""" & ew_HtmlEncode(EditUrl) & """>" & Language.Phrase("EditLink") & "</a>" Else item.Body = "" End If ' Set up list action buttons Dim oListOpt, body, content, link Dim listact, action, caption, icon Set oListOpt = ListOptions("listactions") If ew_NotEmpty(oListOpt) And testimonials.Export = "" And testimonials.CurrentAction = "" Then body = "" links = Array() For i = 0 to ListActions.Count - 1 Set listact = ListActions(i) If listact.SelectType = EW_ACTION_SINGLE And listact.Allow Then action = listact.Action caption = listact.Caption icon = ew_IIf(listact.Icon <> "", "<span class=""" & ew_HtmlEncode(Replace(listact.Icon, " ewIcon", "")) & """ data-caption=""" & ew_HtmlTitle(caption) & """></span> " , "") If UBound(links) < 0 Then ReDim links(0) Else ReDim Preserve links(UBound(links)+1) End If links(UBound(links)) = "<li><a class=""ewAction ewListAction"" data-action=""" & ew_HtmlEncode(action) & """ data-caption=""" & ew_HtmlTitle(caption) & """ href="""" onclick=""ew_SubmitAction(event,jQuery.extend({key:" & testimonials.KeyToJson() & ",data:{rnd:" & ew_Random() & "}}," & listact.ToJson(True) & "));return false;"">" & icon & listact.Caption & "</a></li>" If UBound(links) = 0 Then ' Single button body = "<a class=""ewAction ewListAction"" data-action=""" & ew_HtmlEncode(action) & """ title=""" & ew_HtmlTitle(caption) & """ data-caption=""" & ew_HtmlTitle(caption) & """ href="""" onclick=""ew_SubmitAction(event,jQuery.extend({key:" & testimonials.KeyToJson() & ",data:{rnd:" & ew_Random() & "}}," & listact.ToJson(True) & "));return false;"">" & Language.Phrase("ListActionButton") & "</a>" End If End If Next If UBound(links) > 0 Then ' More than one buttons, use dropdown body = "<button class=""dropdown-toggle btn btn-default btn-sm ewActions"" title=""" & ew_HtmlTitle(Language.Phrase("ListActionButton")) & """ data-toggle=""dropdown"">" & Language.Phrase("ListActionButton") & "<b class=""caret""></b></button>" content = "" For Each link In links content = content & "<li>" & link & "</li>" Next body = body & "<ul class=""dropdown-menu" & ew_IIf(oListOpt.OnLeft, "", " dropdown-menu-right") & """>" & content & "</ul>" body = "<div class=""btn-group"">" & body & "</div>" End If If UBound(links) >= 0 Then oListOpt.Body = body oListOpt.Visible = True End If End If ListOptions("checkbox").Body = "<input type=""checkbox"" name=""key_m"" class=""ewMultiSelect"" value=""" & ew_HtmlEncode(testimonials.ID.CurrentValue) & """ onclick=""ew_ClickMultiCheckbox(event);"">" Call RenderListOptionsExt Call ListOptions_Rendered End Sub ' Set up other options Sub SetupOtherOptions() Dim opt, item, DetailTableLink, ar, i, caption, url, addcaption Set opt = AddEditOptions ' Add Set item = opt.Add("add") addcaption = ew_HtmlTitle(Language.Phrase("AddLink")) item.Body = "<a class=""ewAddEdit ewAdd"" title=""" & addcaption & """ data-caption=""" & addcaption & """ href=""" & ew_HtmlEncode(AddUrl) & """>" & Language.Phrase("AddLink") & "</a>" item.Visible = (AddUrl <> "" And Security.IsLoggedIn()) Set opt = ActionOptions ' Add multi delete Set item = opt.Add("multidelete") item.Body = "<a class=""ewAction ewMultiDelete"" title=""" & ew_HtmlTitle(Language.Phrase("DeleteSelectedLink")) & """ data-caption=""" & ew_HtmlTitle(Language.Phrase("DeleteSelectedLink")) & """ href="""" onclick=""ew_SubmitAction(event,{f:document.ftestimonialslist,url:'" & MultiDeleteUrl & "'});return false;"">" & Language.Phrase("DeleteSelectedLink") & "</a>" item.Visible = (Security.IsLoggedIn()) ' Set up options default Set opt = AddEditOptions opt.UseImageAndText = True opt.DropDownButtonPhrase = Language.Phrase("ButtonAddEdit") opt.UseDropDownButton = False opt.UseButtonGroup = True opt.ButtonClass = "btn-sm" ' Class for button group Set item = opt.Add(opt.GroupOptionName) item.Body = "" item.Visible = False Set opt = DetailOptions opt.UseImageAndText = True opt.DropDownButtonPhrase = Language.Phrase("ButtonDetails") opt.UseDropDownButton = False opt.UseButtonGroup = True opt.ButtonClass = "btn-sm" ' Class for button group Set item = opt.Add(opt.GroupOptionName) item.Body = "" item.Visible = False Set opt = ActionOptions opt.UseImageAndText = True opt.DropDownButtonPhrase = Language.Phrase("ButtonActions") opt.UseDropDownButton = False opt.UseButtonGroup = True opt.ButtonClass = "btn-sm" ' Class for button group Set item = opt.Add(opt.GroupOptionName) item.Body = "" item.Visible = False ' Filter button Set opt = FilterOptions Set item = opt.Add("savecurrentfilter") item.Body = "<a class=""ewSaveFilter"" data-form=""ftestimonialslistsrch"" href=""#"">" & Language.Phrase("SaveCurrentFilter") & "</a>" item.Visible = True Set item = opt.Add("deletefilter") item.Body = "<a class=""ewDeleteFilter"" data-form=""ftestimonialslistsrch"" href=""#"">" & Language.Phrase("DeleteFilter") & "</a>" item.Visible = True opt.UseDropDownButton = True opt.UseButtonGroup = Not FilterOptions.UseDropDownButton opt.DropDownButtonPhrase = Language.Phrase("Filters") ' Add group option item Set item = opt.Add(FilterOptions.GroupOptionName) item.Body = "" item.Visible = False End Sub ' Render other options Sub RenderOtherOptions() Dim opt, item, i, action, caption, icon, Name, cancelurl Set opt = ActionOptions opt.UseImageAndText = True ' Set up list action buttons Dim listact For i = 0 to ListActions.Count - 1 Set listact = ListActions(i) If listact.SelectType = EW_ACTION_MULTIPLE Then action = listact.Action caption = listact.Caption icon = ew_IIf(listact.Icon <> "", "<span class=""" & ew_HtmlEncode(listact.Icon) & """ data-caption=""" & ew_HtmlEncode(caption) & """></span> ", caption) Set item = opt.Add("custom_" & Action) item.Body = "<a class=""ewAction ewListAction"" title=""" & ew_HtmlEncode(caption) & """ data-caption=""" & ew_HtmlEncode(caption) & """ href="""" onclick=""ew_SubmitAction(event,jQuery.extend({f:document.ftestimonialslist}," & listact.ToJson(True) & "));return false;"">" & icon & "</a>" item.Visible = listact.Allow End If Next ' Hide grid edit and other options If TotalRecs <= 0 Then Set opt = AddEditOptions Set item = opt("gridedit") If ew_NotEmpty(item) Then item.Visible = False Set opt = ActionOptions Call opt.HideAllOptions(Array()) End If End Sub ' Process list action Function ProcessListAction() Dim userlist, user, sFilter, UserAction, Processed, ActionCaption userlist = "" user = "" sFilter = testimonials.GetKeyFilter UserAction = Request.Form("useraction") & "" Processed = False If sFilter <> "" And UserAction <> "" Then ' Check permission first Dim listact ActionCaption = UserAction If ListActions.Exists(UserAction) Then Set listact = ListActions(UserAction) ActionCaption = listact.Caption If Not listact.Allow Then errmsg = Replace(Language.Phrase("CustomActionNotAllowed"), "%s", ActionCaption) If Request.Form("ajax") = UserAction Then ' Ajax Response.Write "<p class=""text-danger"">" & errmsg & "</p>" Else FailureMessage = errmsg End If ProcessListAction = False End If End If Dim cnn, sSql testimonials.CurrentFilter = sFilter sSql = testimonials.SQL Set cnn = testimonials.TableConnection cnn.BeginTrans testimonials.CurrentAction = UserAction ' Load recordset Dim Rs Set Rs = ew_LoadRecordsetByDbid(sSql, testimonials.TableDBID) If Not Rs.EOF Then Rs.MoveFirst ' Call row custom action event SelectedCount = Rs.RecordCount SelectedIndex = 0 Do While Not Rs.EOF SelectedIndex = SelectedIndex + 1 Processed = Row_CustomAction(UserAction, Rs) If Not Processed Then Exit Do End If Rs.MoveNext Loop Rs.Close Set Rs = Nothing If Processed Then cnn.CommitTrans ' Commit the changes If SuccessMessage = "" Then SuccessMessage = Replace(Language.Phrase("CustomActionCompleted"), "%s", ActionCaption) ' Set up success message End If Else cnn.RollbackTrans ' Rollback transaction ' Set up error message If SuccessMessage <> "" Or FailureMessage <> "" Then ' Use the message, do nothing ElseIf testimonials.CancelMessage <> "" Then FailureMessage = testimonials.CancelMessage testimonials.CancelMessage = "" Else FailureMessage = Replace(Language.Phrase("CustomActionFailed"), "%s", ActionCaption) End If End If testimonials.CurrentAction = "" ' Clear action If Request.Form("ajax") = UserAction Then ' Ajax If SuccessMessage <> "" Then Response.Write "<p class=""text-success"">" & SuccessMessage & "</p>" Call ClearSuccessMessage ' Clear message End If If FailureMessage <> "" Then Response.Write "<p class=""text-danger"">" & FailureMessage & "</p>" Call ClearFailureMessage ' Clear message End If ProcessListAction = True End If Else ProcessListAction = False ' Not ajax request End If End Function ' Set up search options Sub SetupSearchOptions() Dim item, SearchToggleClass Set SearchOptions = New cListOptions SearchOptions.TableVar = testimonials.TableVar ExportOptions.Tag = "div" SearchOptions.TagClassName = "ewSearchOption" ' Search button Set item = SearchOptions.Add("searchtoggle") SearchToggleClass = ew_IIf(SearchWhere <> "", " active", " active") item.Body = "<button type=""button"" class=""btn btn-default ewSearchToggle" & SearchToggleClass & """ title=""" & Language.Phrase("SearchPanel") & """ data-caption=""" & Language.Phrase("SearchPanel") & """ data-toggle=""button"" data-form=""ftestimonialslistsrch"">" & Language.Phrase("SearchLink") & "</button>" item.Visible = True ' Show all button Set item = SearchOptions.Add("showall") item.Body = "<a class=""btn btn-default ewShowAll"" title=""" & Language.Phrase("ShowAll") & """ data-caption=""" & Language.Phrase("ShowAll") & """ href=""" & PageUrl & "cmd=reset"">" & Language.Phrase("ShowAllBtn") & "</a>" item.Visible = (SearchWhere <> DefaultSearchWhere And SearchWhere <> "0=101") ' Button group for search SearchOptions.UseDropDownButton = False SearchOptions.UseImageAndText = True SearchOptions.UseButtonGroup = True SearchOptions.DropDownButtonPhrase = Language.Phrase("ButtonSearch") ' Add group option item Set item = SearchOptions.Add(SearchOptions.GroupOptionName) item.Body = "" item.Visible = False ' Hide search options If testimonials.Export <> "" Or testimonials.CurrentAction <> "" Then Call SearchOptions.HideAllOptions(Array()) End If End Sub Sub SetupListOptionsExt() End Sub Sub RenderListOptionsExt() 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) testimonials.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 testimonials.StartRecordNumber = StartRec End If End If End If StartRec = testimonials.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 testimonials.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 testimonials.StartRecordNumber = StartRec ElseIf (StartRec-1) Mod DisplayRecs <> 0 Then StartRec = ((StartRec-1)\DisplayRecs)*DisplayRecs+1 ' Point to page boundary testimonials.StartRecordNumber = StartRec End If End Sub ' ' Load basic search values ' Sub LoadBasicSearchValues() testimonials.BasicSearch.Keyword = Request.QueryString(EW_TABLE_BASIC_SEARCH)&"" If testimonials.BasicSearch.Keyword <> "" And Command = "" Then Command = "search" testimonials.BasicSearch.SearchType = Request.QueryString(EW_TABLE_BASIC_SEARCH_TYPE)&"" End Sub ' ' Load recordset ' Function LoadRecordset(offset, rowcnt) Dim sSql, rs, useSelectLimit, dbType, hasOrderBy useSelectLimit = rowcnt > 0 And offset >= 0 dbType = ew_GetConnectionType(testimonials.TableDBID) If dbType = "MSSQL" Then If ew_IsMsSql2012(testimonials.TableDBID) Then dbType = "MSSQL2012" ' ASP End If ' Load List page SQL sSql = testimonials.ListSQL If useSelectLimit Then hasOrderBy = testimonials.SqlOrderBy <> "" Or testimonials.SessionOrderBy <> "" sSql = ew_GetSelectLimitSql(sSql, rowcnt, offset, hasOrderBy, dbType) End If ' Load recordset Set rs = ew_LoadRecordsetByDbid(sSql, testimonials.TableDBID) If Not useSelectLimit Or dbType <> "MSSQL2012" And dbType <> "MYSQL" And dbType <> "POSTGRESQL" Then ' ASP If offset > 0 And Not rs.EOF Then rs.Move offset End If ' Call Recordset Selected event Call testimonials.Recordset_Selected(rs) Set LoadRecordset = rs End Function ' ' Load row based on key values ' Function LoadRow() Dim RsRow, sSql, sFilter sFilter = testimonials.KeyFilter ' Call Row Selecting event Call testimonials.Row_Selecting(sFilter) ' Load SQL based on filter testimonials.CurrentFilter = sFilter sSql = testimonials.SQL Call ew_SetDebugMsg("LoadRow: " & sSql) ' Show SQL for debugging Set RsRow = ew_LoadRowByDbid(sSql, testimonials.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 testimonials.Row_Selected(RsRow) If ew_Empty(RsRow) Then Exit Sub If RsRow.EOF Then Exit Sub testimonials.ID.DbValue = RsRow("ID") testimonials.Opinion.DbValue = RsRow("Opinion") testimonials.Name.DbValue = RsRow("Name") testimonials.Designation.DbValue = RsRow("Designation") testimonials.Photo.Upload.DbValue = RsRow("Photo") testimonials.Photo.DbValue = testimonials.Photo.Upload.DbValue testimonials.Enable.DbValue = RsRow("Enable") End Sub ' Return a row with default values Function NewRow Dim cnn, rs, sSql, sFilter ' Clear any previous errors Err.Clear Set cnn = testimonials.TableConnection sFilter = testimonials.CurrentFilter testimonials.CurrentFilter = "(0 = 1)" sSql = testimonials.SQL testimonials.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("Opinion") = Null rs("Name") = Null rs("Designation") = Null rs("Photo") = Null rs("Enable") = 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 testimonials.ID.m_DbValue = Rs("ID") testimonials.Opinion.m_DbValue = Rs("Opinion") testimonials.Name.m_DbValue = Rs("Name") testimonials.Designation.m_DbValue = Rs("Designation") testimonials.Photo.Upload.DbValue = Rs("Photo") testimonials.Enable.m_DbValue = Rs("Enable") End Sub ' Load old record Function LoadOldRecord() ' Load key values from Session Dim bValidKey bValidKey = True If testimonials.GetKey("ID")&"" <> "" Then testimonials.ID.CurrentValue = testimonials.GetKey("ID") ' ID Else bValidKey = False End If ' Load old record OldRecordset = Null If bValidKey Then testimonials.CurrentFilter = testimonials.KeyFilter Dim sSql sSql = testimonials.SQL Set OldRecordset = ew_LoadRecordsetByDbid(sSql, testimonials.TableDBID) End If Call LoadRowValues(OldRecordset) ' Load row values LoadOldRecord = bValidKey End Function ' ' Render row values based on field settings ' Sub RenderRow() ' Initialize URLs ViewUrl = testimonials.ViewUrl("") EditUrl = testimonials.EditUrl("") InlineEditUrl = testimonials.InlineEditUrl CopyUrl = testimonials.CopyUrl("") InlineCopyUrl = testimonials.InlineCopyUrl DeleteUrl = testimonials.DeleteUrl ' Call Row Rendering event Call testimonials.Row_Rendering ' ' Common render codes for all row types ' ' ID ' Opinion ' Name ' Designation ' Photo ' Enable ' ' View Row ' If testimonials.RowType = EW_ROWTYPE_VIEW Then ' View row ' ID testimonials.ID.ViewValue = testimonials.ID.CurrentValue testimonials.ID.ViewCustomAttributes = "" ' Opinion testimonials.Opinion.ViewValue = testimonials.Opinion.CurrentValue testimonials.Opinion.ViewCustomAttributes = "" ' Name testimonials.Name.ViewValue = testimonials.Name.CurrentValue testimonials.Name.ViewCustomAttributes = "" ' Designation testimonials.Designation.ViewValue = testimonials.Designation.CurrentValue testimonials.Designation.ViewCustomAttributes = "" ' Photo testimonials.Photo.UploadPath = "../uploads/testimonials" If Not ew_Empty(testimonials.Photo.Upload.DbValue) Then testimonials.Photo.ViewValue = testimonials.Photo.Upload.DbValue testimonials.Photo.ViewValue = testimonials.Photo.Upload.DbValue Else testimonials.Photo.ViewValue = "" End If testimonials.Photo.ViewCustomAttributes = "" ' Enable If Not IsNull(testimonials.Enable.CurrentValue) Then testimonials.Enable.ViewValue = testimonials.Enable.OptionCaption(testimonials.Enable.CurrentValue) Else testimonials.Enable.ViewValue = Null End If testimonials.Enable.ViewCustomAttributes = "" ' View refer script ' ID testimonials.ID.LinkCustomAttributes = "" testimonials.ID.HrefValue = "" testimonials.ID.TooltipValue = "" ' Opinion testimonials.Opinion.LinkCustomAttributes = "" testimonials.Opinion.HrefValue = "" testimonials.Opinion.TooltipValue = "" End If ' Call Row Rendered event If testimonials.RowType <> EW_ROWTYPE_AGGREGATEINIT Then Call testimonials.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) url = ew_RegExReplace("\?cmd=reset(all){0,1}$", url, "") ' Remove cmd=reset / cmd=resetall Call Breadcrumb.Add("list", testimonials.TableVar, url, "", testimonials.TableVar, True) End Sub ' Setup lookup filters of a field Sub SetupLookupFilters(fld, pageId) pageId = ew_IIf(ew_EmptyStr(pageId), testimonials_list.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), testimonials_list.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 ' Form Custom Validate event Function Form_CustomValidate(CustomError) 'Return error message in CustomError Form_CustomValidate = True End Function ' ListOptions Load event Sub ListOptions_Load() 'Example: ' Dim opt ' Set opt = ListOptions.Add("new") ' opt.OnLeft = True ' Link on left ' Call opt.MoveTo(0) ' Move to first column End Sub ' ListOptions Rendering event Sub ListOptions_Rendering() 'Example: ' xxx.DetailAdd = (...condition...) ' Set to True or False conditionally ' xxx.DetailEdit = (...condition...) ' Set to True or False conditionally ' xxx.DetailView = (...condition...) ' Set to True or False conditionally End Sub ' ListOptions Rendered event Sub ListOptions_Rendered() 'Example: 'ListOptions.GetItem("new").Body = "xxx" End Sub ' Row Custom Action event Function Row_CustomAction(action, rs) ' Return False to abort Row_CustomAction = True End Function ' 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 %>