<!--#include file="../../owFunctions/I_GeneralFunctions.asp"-->
<!--#include file="../header.asp"-->
<%
	'************************************************************************************
	'*																					*
	'*	MODIFICATION TO THIS SCRIPT OR ANY FILES INCLUDED WITH 							*
	'*		ONEWORLDSTORE IS DONE AT YOUR OWN RISK!										*
	'*	Product  : OneWorldStore														*
	'*	Version  : 9.0000																*
	'*	Modified : June 2004															*
	'*	Copyright:	Copyright (C) 2004 OneWorldStore.Com								*
	'*				Registration Number: 1024507										*
	'*				http://strategis.ic.gc.ca/											*
	'*																					*
	'************************************************************************************
	
	set rsStoreData3	= CreateObject("ADODB.Recordset")
	sIDOptionGroup		= CONVERSION_SQLEncode2(request("idOptionGroup"),10)
	
	if sIDOptionGroup="" then
		Call owMessage(LANG_DT( "OPTION_SPECIFYID", "Please specify group id." ), C_ERROR)
	Else
		%>
		<script language = "javascript">
	
			<%If ( bRefresh = "TRUE" ) Then%>
			parent.owBodyTopNav.location="owBodyTopNav.asp?sPage=ListCurrentGroupAssignments&sMessage=<%=Server.URLEncode(LANG_DT( "CHANGES_SAVED", "** Changes saved **" ))%>"
			<%Else%>
			parent.owBodyTopNav.location="owBodyTopNav.asp?sPage=ListCurrentGroupAssignments"
			<%End If%>
			parent.owBodyFooter.location="owBodyFooter.asp?sAction=Null"
			
		</script>
	
		<body onLoad = 'toForm()' style="font-family: Arial; font-size: 11px;" topmargin="0" leftmargin="0" bgcolor=C3DAF9>
			<table border="0" cellpadding="0" cellspacing="0" width="100%" style="padding:5px; FONT-WEIGHT: bold; FONT-SIZE: 11px; COLOR: #808080" bgcolor="#ffffff"><tr><td>
			<table border="0" cellpadding="0" cellspacing="0" width="100%" style="FONT-WEIGHT: bold; FONT-SIZE: 11px; COLOR: #808080" bgcolor="#ffffff">
				<tr>
					<td>
						<%
						sSQLText = "SELECT * FROM options"
						Call DB_getFromDatabase(sSQLText, rsStoreData3, "") 
						if not rsStoreData3.eof then
							%>
							<FORM ACTION="owAddAssignmentExec.asp" method="post" name="AddAssignment">
							<INPUT TYPE="hidden" NAME="idOptionGroup" VALUE="<%response.write sIDOptionGroup%>">
							Assign new options<br>
							<select name="idOption" onChange="AddAssignment.submit();">
								<option value=''>Please Select</option>
								<%do while not rsStoreData3.eof
									sSQLText = "SELECT idOption FROM options_optionsGroups WHERE idOptionGroup=" &sIDOptionGroup& " AND idOption ="& rsStoreData3("idOption")
									Call DB_getFromDatabase(sSQLText, rsStoreData2, "") 
									if rsStoreData2.eof then
										%>
										<option value='<%response.write rsStoreData3("idOption")%>'><%=rsStoreData3("optionDescrip")%></option>
										<%
									end if
									Call DB_closeRecordset(rsStoreData2)
								rsStoreData3.movenext
								loop%>
							</SELECT>
							</FORM>
							<%
						end if
						Call DB_closeRecordset(rsStoreData3)
						%>
					</td>
				</tr>
				<%
				sSQLText = "SELECT * FROM options_optionsGroups, options, optionsGroups WHERE options_optionsGroups.idOption = options.idOption AND optionsGroups.idOptionGroup = options_optionsGroups.idOptionGroup AND options_optionsGroups.idOptionGroup = " & sIDOptionGroup
				Call DB_getFromDatabase(sSQLText, rsStoreData, "") 
				If ( NOT rsStoreData.EOF ) Then
				%>
				<tr>
					<td colspan=2>
						<%response.write rsStoreData("optionGroupDesc")%> currently assigned options:
						<hr size=1 color=2A5CB2>
					</td>
				</tr>
				<tr>
					<td valign=top>
						<table border="0" cellpadding="0" cellspacing="0" width="100%" style="FONT-WEIGHT: bold; FONT-SIZE: 11px; COLOR: #808080" bgcolor="#ffffff">
						<%do while not rsStoreData.eof%> 
							<tr>
								<td>
									<%=rsStoreData("optionDescrip")%> 
								</td>
								<td>
									<%
									Select Case Trim(rsStoreData("Type"))
										Case "Radio"
											Response.Write LANG_DT( "OPTION_RADIO", "Radio Buttons" )
										Case "Checkbox"
											Response.Write LANG_DT( "OPTION_CHECKBOX", "Checkboxes" )
										Case "Dropdown"
											Response.Write LANG_DT( "OPTION_DROPDOWN", "Dropdown List" )
										Case "Text"
											Response.Write LANG_DT( "OPTION_TEXT", "Text Field" )
										Case "Memo"
											Response.Write LANG_DT( "OPTION_MEMO", "Memo Field" )
										Case "File"
											Response.Write LANG_DT( "OPTION_FILE", "File Upload" )
										Case "Multipick"
											Response.Write LANG_DT( "OPTION_MULTIPICK", "Multipick Pick List" )
									End Select
									%>
								</td>
								<td>
									<a href="owRemoveAssignmentExec.asp?idOption=<%=rsStoreData("idOption")%>&idOptionGroup=<%=sIDOptionGroup%>">Remove</a>
								</td>
							</tr>
							<%
							rsStoreData.movenext
						loop
						Call DB_closeRecordset(rsStoreData)
						%>
						</table>
					</td>
				</tr>
				<%
				end if
				set rsStoreData3 = Nothing
				%>
			</td></tr></table>
			</table>
			<%
	end if%>	
	<!--#include file="../footer.asp"-->