<% Dim fid, objRS, allData, strSql, mode, objCon if request.form<>"" then ' call PGDForm("reg_",false) ' response.end Dim reg_fldTitle:reg_fldTitle = request.form("fldTitle")&"" Dim reg_isActive:reg_isActive = request.form("isActive")&"" Dim reg_onRegister:reg_onRegister = request.form("onRegister")&"" Dim reg_allowHide:reg_allowHide = request.form("allowHide")&"" Dim reg_HTMLValue:reg_HTMLValue = request.form("HTMLValue")&"" Dim reg_allowUpdate:reg_allowUpdate = request.form("allowUpdate")&"" Dim reg_HTMLInterface:reg_HTMLInterface = request.form("HTMLInterface")&"" Dim reg_errorMessage:reg_errorMessage = request.form("errorMessage")&"" Dim reg_regExp:reg_regExp = request.form("regExp")&"" Dim reg_example:reg_example = request.form("example")&"" Dim reg_fid:reg_fid = request.form("fid")&"" Dim reg_submit:reg_submit = request.form("submit") reg_allowUpdate = checkedORNot(reg_allowUpdate) reg_isActive = checkedORNot(reg_isActive) reg_onRegister = checkedORNot(reg_onRegister) 'reg_allowHide = checkedORNot(reg_allowHide) strSql = "Update pgd_regDefinition Set fldTitle='"&SQLAccessInput(reg_fldTitle)&"',"&vbcrlf&_ "allowUpdate = "®_allowUpdate&","&vbcrlf&_ "onRegister = "®_onRegister&","&vbcrlf&_ "allowHide = "®_allowHide&","&vbcrlf&_ "HTMLInterface = "®_HTMLInterface&","&vbcrlf&_ "errorMessage = '"&SQLAccessInput(reg_errorMessage)&"',"&vbcrlf&_ "HTMLValue = '"&SQLAccessInput(reg_HTMLValue)&"',"&vbcrlf&_ "regExp = '"&sqlstrip(reg_regExp)&"',"&vbcrlf&_ "example = '"&SQLAccessInput(reg_example)&"',"&vbcrlf&_ "isActive = "®_isActive&vbcrlf&_ "WHERE fid="®_fid SET objCon = server.createObject("ADODB.connection") with objCon .open datastore .execute strSQL, , adExecuteNoRecords + adCmdtext 'adCmdStoredProc .close end with Set objCon = nothing response.clear if lcase(reg_submit)="apply" then response.redirect ("admin_registration.asp?mode=edit&fid="®_fid) else response.redirect (selfpage) end if response.end end if fid = request.querystring("fid") mode = request.querystring("mode")&"" if mode="move" then Dim dir:dir = request.querystring("dir") strSQL = "Declare @oriSort int "&vbcrlf&_ "Declare @newSort int "&vbcrlf&_ " Declare @withFID int"&vbcrlf&_ " Declare @isActive int"&vbcrlf&_ " SELECT @orisort = sortorder,@isActive=isactive FROM pgd_regDefinition WHERE fid = "&fid& vbcrlf &_ " SELECT top 1 @withFID = FID, @newSort = sortOrder FROM pgd_regDefinition WHERE isActive = @isActive AND sortOrder "&iff(dir="up","<",">")&" @oriSort ORDER BY sortOrder "&iff(dir="up","DESC","ASC")&vbcrlf &_ " if @withFID is NOT NULL Begin"&vbcrlf &_ " Update pgd_regDefinition Set sortOrder = @oriSort WHERE fid = @withFID"&vbcrlf &_ " Update pgd_regDefinition SET sortOrder = @newSort WHERE fid = "&fid&vbcrlf &_ " END" SET objCon = server.createObject("ADODB.connection") with objCon .open datastore .execute strSQL, , adExecuteNoRecords + adCmdtext 'adCmdStoredProc .close end with Set objCon = nothing response.clear response.redirect (selfpage) response.end elseif mode="cleanup" then strSQL = "Update pgd_regFields Set "&request.querystring("fldname")&"='', h_"&request.querystring("fldname")&" = 0" SET objCon = server.createObject("ADODB.connection") with objCon .open datastore .execute strSQL, , adExecuteNoRecords + adCmdtext 'adCmdStoredProc .close end with Set objCon = nothing response.clear response.redirect (selfpage) response.end elseif mode="removeall" then strSQL = "Delete pgd_regFields" SET objCon = server.createObject("ADODB.connection") with objCon .open datastore .execute strSQL, , adExecuteNoRecords + adCmdtext 'adCmdStoredProc .close end with Set objCon = nothing response.clear response.redirect (selfpage) response.end end if Dim blnEditFid:blnEditFid = false if mode = "edit" and len(fid)<>0 then strSQL = "SELECT * FROM pgd_regDefinition WHERE fid= "&cint(fid) blnEditFid = true else strSQL = "SELECT * FROM pgd_regDefinition order by sortorder" end if set objRS = server.createobject("adodb.recordset") with objRS .CacheSize = 37 .open strSql, datastore, , , adCmdText If not (.EOF or .BOF) then allData = .getrows End if .close end with set objRS=nothing Dim iFid %> Custom Registration Fields : <%= OutputCSS() %>
Custom Registration Fields :       Help

<% If blnEditFid then %> <% ' 0 1 2 3 4 5 6 7 8 9 10 11 12 %> <% 'Dim fID, fldName, fldTitle, onRegister, allowUpdate, allowHide, HTMLInterface, HTMLValue, regExp, errorMessage, sortOrder, isActive ,example %>
Edit Registration Field <%= allData(1,0) %>
nowrap valign="top" width="25%" nowrap>Field Title (shown to member)  > " maxlength="50">
nowrap valign="top" nowrap>Shown on registration page?  > class="radiocheck">
nowrap valign="top" nowrap>Can Member Update this field?  > class="radiocheck">
nowrap valign="top" nowrap>Can Member Hide this field?  >
nowrap valign="top" nowrap>HTML Interface?  >
nowrap valign="top">Field Value 
If you choose to use an HTML Interface other than
"Text box", make sure you specify the Field Value.

The format (per line):
value:label
Rendered HTML (Radio button):
<input type="Radio" name="<%= allData(1,0) %>" value="value"> label
>
nowrap valign="top" nowrap>Regular Expression Validation? 
(single and double quotation marks are not allowed)
(separate each expression by ;;)
> " maxlength="250">
nowrap valign="top" nowrap>Error Messages? 
(separate each message by ;;)
> " maxlength="250">
nowrap valign="top" nowrap>Example 
(briefly describe the field)
> " maxlength="100">
nowrap valign="top" nowrap>Is this field active?  > class="radiocheck">


Test Regular Expression <%= allData(1,0) %>
>


.\n\nReady to proceed?')) self.location.href='admin_registration.asp?mode=cleanup&fldname=<%= allData(1,0) %>'"> <% Else %> <% Dim iActive:iActive=1 %> <% for iActive = 1 to 0 step -1%>
<% ' 0 1 2 3 4 5 6 7 8 9 10 11 %> <% 'fID fldName fldTitle onRegister allowUpdate allowHide HTMLInterface HTMLValue regExp errorMessage sortOrder isActive %> <% for iFid = 0 to ubound(allData,2) %> <% If allData(11,iFid)=iActive then %> <% End If %> <% next %>
<%= iff(iActive=1,"Active","Inactive") %> Registration Fields
class="cat" width="20%">Field Name class="cat" width="50%">Field Title class="cat" width="10%" align="center" nowrap>Shown on registration class="cat" width="20%" align="center">Sort Order
nowrap> <%= allData(1,iFid) %> <%= " ("&iff(allData(0,iFid)>32,"large","small")&" field)" %> ><%= HTMLEncode(""&allData(2,iFid)) %> align="center"><%= iff(allData(3,iFid)=1,"","") %> align="center">


<% next %>


<% End If %>