<!--// $Id$ //-->
<script type="text/javascript">
	<!--
	function removeCustomers() {
		document.customerassignments.oper.value="0";
		document.customerassignments.submit();
	}

	function changeMembersNetwork() {
		document.customerassignments.oper.value="2";
		document.customerassignments.submit();
	}

	function changeOthersNetwork() {
		document.customerassignments.oper.value="3";
		document.customerassignments.submit();
	}

	//-->
</script>
<br>
<FORM name="customerassignments" method="POST" action="?m=customergroup&amp;id={$customergroup.id}">
<p style="display: none;">
<INPUT type="submit" class="hiddenbtn">
<INPUT type="hidden" name="oper" value="1">
</p>
<TABLE width="100%" cellpadding="0">
	<TR>
		<TD style="width: 49%;" class="valign-top">
			<TABLE class="lmsbox">
				<THEAD>
				<TR>
					<TD style="width: 100;" class="bold nobr">
						<IMG src="img/customer.gif" alt="">&nbsp;{trans("Group members:")}
					</TD>
				</TR>
				<TR>
					<TD style="width: 100%;" class="text-center">
						{trans("Network:")}
						<SELECT size="1" name="customerassignments[membersnetid]" onchange="javascript:changeMembersNetwork();">
						 	<OPTION value="0" {if !$membersnetid}selected{/if}>{trans("— all networks —")}</OPTION>
							{section name=networks loop=$networks}
							<OPTION value="{$networks[networks].id}" {if $networks[networks].id == $membersnetid}selected{/if}>{$networks[networks].name|truncate:30:"&hellip;":true}</OPTION>
							{/section}
						</SELECT>&nbsp;
					</TD>
				</TR>
				</THEAD>
				<TBODY>
				<TR>
					<TD style="width: 100%;" class="text-center">
						{if $customergroup.customerscount}
						<SELECT size="20" name="customerassignments[gmcustomerid][]" multiple>
							{section name=customer loop=$customergroup.customers}
							<OPTION value="{$customergroup.customers[customer].id}">
							{$customergroup.customers[customer].customername|truncate:40:"&hellip;":true} ({$customergroup.customers[customer].id|string_format:"%04d"})
							</OPTION>
							{/section}
						</SELECT>
						{else}
						<BR>
						<BR>
						<span class="bold">{trans("This group hasn't got any members.")}</span><BR>
						<BR>
						<BR>
						{/if}
					</TD>
				</TR>
				<TR>
					<TD style="width: 100%;" class="text-right nobr">
						<A href="javascript:removeCustomers();">{trans("Delete")} <IMG src="img/cancel.gif" alt=""></A>
					</TD>
				</TR>
				</TBODY>
			</TABLE>
		</TD>
		<TD style="width: 2%;">
		</TD>
		<TD style="width: 49%;" class="valign-top">
			<TABLE class="lmsbox">
				<THEAD>
				<TR>
					<TD style="width: 100%;" class="bold nobr">
						<IMG src="img/customer.gif" alt="">&nbsp;{trans("Add new member(s):")}
					</TD>
				</TR>
				<TR>
					<TD style="width: 100%;" class="text-center">
						{trans("Network:")}
						<SELECT size="1" name="customerassignments[othersnetid]" onchange="javascript:changeOthersNetwork();">
							<OPTION value="0" {if !$othersnetid}selected{/if}>{trans("— all networks —")}</OPTION>
							{section name=networks loop=$networks}
							<OPTION value="{$networks[networks].id}" {if $networks[networks].id == $othersnetid}selected{/if}>{$networks[networks].name|truncate:30:"&hellip;":true}</OPTION>
							{/section}
						</SELECT>&nbsp;
					</TD>
				</TR>
				</THEAD>
				<TBODY>
				<TR>
					<TD style="width: 100%;" class="text-center">
						{if $customerscount}
						<SELECT size="20" name="customerassignments[mcustomerid][]" multiple>
							{section name=customer loop=$customers}
							<OPTION value="{$customers[customer].id}">
							{$customers[customer].customername|truncate:40:"&hellip;":true} ({$customers[customer].id|string_format:"%04d"})
							</OPTION>
							{/section}
						</SELECT>
						{else}
						<BR>
						<BR>
						<span class="bold">{trans("All customers are members of this group.")}</span><BR>
						<BR>
						<BR>
						{/if}
					</TD>
				</TR>
				<TR>
					<TD style="width: 100%;" class="text-right nobr">
						<A href="javascript:document.customerassignments.submit();">{trans("Submit")} <IMG src="img/save.gif" alt=""></A>
					</TD>
				</TR>
				</TBODY>
			</TABLE>
		</TD>
	</TR>
</TABLE>
</FORM>
