// *** Insert Record: construct a sql insert statement and execute it MM_editAction = CGI.SCRIPT_NAME; If (CGI.QUERY_STRING NEQ "") MM_editAction = MM_editAction & "?" & CGI.QUERY_STRING; If (IsDefined("MM_insert")) { MM_datasource = "dunce"; MM_username = ""; MM_password = ""; MM_tableName = "foo_Class"; MM_fields = "Classtitle,Classtitle,',none,'',ClassDescription,ClassDescription,',none,''"; MM_redirectPage = "EditClass.txt"; // create the insert sql statement MM_tableValues=""; MM_dbValues=""; MM_fieldsArray = ListToArray(MM_fields,","); For (i=1; i+4 LE ArrayLen(MM_fieldsArray); i=i+5) { FormVal = IIf(IsDefined(MM_fieldsArray[i]),"FORM." & MM_fieldsArray[i],DE("")); Delim = IIf(MM_fieldsArray[i+2] NEQ "none","MM_fieldsArray[i+2]",DE("")); AltVal = IIf(MM_fieldsArray[i+3] NEQ "none","MM_fieldsArray[i+3]",DE("")); EmptyVal = IIf(MM_fieldsArray[i+4] NEQ "none","MM_fieldsArray[i+4]",DE("")); If (FormVal EQ "") { FormVal = EmptyVal; } Else { If (AltVal NEQ "") { FormVal = AltVal; } Else If (Delim EQ "'") { // escape quotes FormVal = "'" & Replace(FormVal,"'","''","ALL") & "'"; } Else { FormVal = Delim & FormVal & Delim; } } If (i GT 1) { MM_tableValues = MM_tableValues & ","; MM_dbValues = MM_dbValues & ","; } MM_tableValues = MM_tableValues & MM_fieldsArray[i+1]; MM_dbValues = MM_dbValues & FormVal; } MM_insertStr = "insert into " & MM_tableName & " (" & MM_tableValues & ") values (" & MM_dbValues & ")"; // build the redirect URL If (MM_redirectPage EQ "") MM_redirectPage = CGI.SCRIPT_NAME; If (Find("?", MM_redirectPage) EQ 0 AND CGI.QUERY_STRING NEQ "") MM_redirectPage = MM_redirectPage & "?" & CGI.QUERY_STRING; } // *** Delete Record: construct a sql delete statement and execute it MM_editAction = CGI.SCRIPT_NAME; If (CGI.QUERY_STRING NEQ "") MM_editAction = MM_editAction & "?" & CGI.QUERY_STRING; If (IsDefined("MM_delete") AND IsDefined("MM_recordId")) { MM_datasource = "dunce"; MM_username = ""; MM_password = ""; MM_tableName = "foo_Class"; MM_tableCol = "ClassEye"; MM_recordId = "" & MM_recordId & ""; MM_redirectPage = "EditClass.txt"; // create the delete sql statement MM_deleteStr = "delete from " & MM_tableName & " where " & MM_tableCol & " = " & MM_recordId; // build the redirect URL If (MM_redirectPage eq "") MM_redirectPage = CGI.SCRIPT_NAME; If (Find("?", MM_redirectPage) EQ 0 AND CGI.QUERY_STRING NEQ "") MM_redirectPage = MM_redirectPage & "?" & CGI.QUERY_STRING; } // *** Update Record: construct a sql update statement and execute it MM_editAction = CGI.SCRIPT_NAME; If (CGI.QUERY_STRING NEQ "") MM_editAction = MM_editAction & "?" & CGI.QUERY_STRING; If (IsDefined("MM_update") AND IsDefined("MM_recordId")) { MM_datasource = "dunce"; MM_username = ""; MM_password = ""; MM_tableName = "foo_Class"; MM_tableCol = "ClassEye"; MM_recordId = "" & MM_recordId & ""; MM_fields = "Classtitle,Classtitle,',none,'',ClassDescription,ClassDescription,',none,''"; MM_redirectPage = "Class_Insert.txt"; // create the update sql statement MM_updateStr = "update " & MM_tableName & " set "; MM_fieldsArray = ListToArray(MM_fields,","); For (i=1; i+4 LE ArrayLen(MM_fieldsArray); i=i+5) { FormVal = IIf(IsDefined(MM_fieldsArray[i]),"FORM." & MM_fieldsArray[i],DE("")); Delim = IIf(MM_fieldsArray[i+2] NEQ "none","MM_fieldsArray[i+2]",DE("")); AltVal = IIf(MM_fieldsArray[i+3] NEQ "none","MM_fieldsArray[i+3]",DE("")); EmptyVal = IIf(MM_fieldsArray[i+4] NEQ "none","MM_fieldsArray[i+4]",DE("")); If (FormVal EQ "") { FormVal = EmptyVal; } Else { If (AltVal NEQ "") { FormVal = AltVal; } Else If (Delim EQ "'") { // escape quotes FormVal = "'" & Replace(FormVal,"'","''","ALL") & "'"; } Else { FormVal = Delim & FormVal & Delim; } } If (i GT 1) MM_updateStr = MM_updateStr & ","; MM_updateStr = MM_updateStr & MM_fieldsArray[i+1] & " = " & FormVal; } MM_updateStr = MM_updateStr & " where " & MM_tableCol & " = " & MM_recordId; // build the redirect URL If (MM_redirectPage EQ "") MM_redirectPage = CGI.SCRIPT_NAME; If (Find("?", MM_redirectPage) EQ 0 AND CGI.QUERY_STRING NEQ "") MM_redirectPage = MM_redirectPage & "?" & CGI.QUERY_STRING; } #PreserveSingleQuotes(MM_insertStr)# #PreserveSingleQuotes(MM_deleteStr)# #PreserveSingleQuotes(MM_updateStr)# SELECT ClassEye, Classtitle, ClassDescription FROM foo_Class WHERE ClassEye = #editClass__MMColParam# MM_paramName = ""; // *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters // create the list of parameters which should not be maintained MM_removeList = "&index="; If (MM_paramName NEQ "") MM_removeList = MM_removeList & "&" & MM_paramName & "="; MM_keepURL=""; MM_keepForm=""; MM_keepBoth=""; MM_keepNone=""; // add the existing URL parameters to the MM_keepURL string MM_params=ListToArray(CGI.QUERY_STRING,"&"); For (i=1; i LTE ArrayLen(MM_params); i=i+1) { If (FindNoCase("&" & GetToken(MM_params[i],1,"=") & "=",MM_removeList) Is 0) MM_keepURL = MM_keepURL & "&" & MM_params[i]; } // add the existing Form variables to the MM_keepForm string If (IsDefined("FORM.FieldNames")) { MM_params=ListToArray(FORM.FieldNames,","); For (i=1; i LTE ArrayLen(MM_params); i=i+1) { If (FindNoCase("&" & MM_params[i] & "=",MM_removeList) Is 0) MM_keepForm = MM_keepForm & "&" & LCase(MM_params[i]) & "=" & URLEncodedFormat(Evaluate("FORM." & MM_params[i])); } } // create the Form + URL string and remove the intial '&' from each of the strings MM_keepBoth = MM_keepURL & MM_keepForm; If (MM_keepURL NEQ "") MM_keepURL = RemoveChars(MM_keepURL,1,1); If (MM_keepForm NEQ "") MM_keepForm = RemoveChars(MM_keepForm,1,1); If (MM_keepBoth NEQ "") MM_keepBoth = RemoveChars(MM_keepBoth,1,1);

#editClass.Classtitle#

Edit Classes
title :
Description :
 

#editClass.Classtitle#
#ParagraphFormat(editClass.ClassDescription)#