<!DOCTYPE html>
<!--// $Id$ //-->
<html><head>
<meta name="GENERATOR" content="LMS {$layout.lmsv}">
{include file="language.html"}
<title>LMS – {if $layout.pagetitle != ""}{$layout.pagetitle}{/if}</title>
{include file="jquery.html" language=Localisation::getCurrentHtmlLanguage() lms_language=Localisation::getCurrentUiLanguage()}
<link href="css/style.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="js/common.js"></script>
{if $js}<script type="text/javascript">
<!--
	{$js}
//-->
</script>{/if}
</head>
{if ! $part}
<frameset name="all" frameborder="0" framespacing="0" ROWS="36,*">
	<frame scrolling="no" frameborder="0" marginheight="0" marginwidth="0" name="top" noresize src="?m=choosecustomer&p=top">
	<frame scrolling="always" frameborder="0" marginheight="0" marginwidth="0" name="main" noresize src="?m=choosecustomer&p=main">
</frameset>
{/if}
{if $part == "top"}
<body class="lms-ui-popup">
<form name="search" method="post" action="?m=choosecustomer&p=main" target="main">
<input type="submit" class="hiddenbtn">
<table cellpadding="5" width="100%">
	<tr>
		<td class="fall dark" align="center" nowrap>
			<img src="img/customer.gif" alt="">
			<input type="text" class="lms-ui-deferred-submit" name="searchcustomer" value="{$searchcustomer}" size="20">
			<img src="img/node.gif" alt="">
			<input type="text" class="lms-ui-deferred-submit" name="searchnode" value="{$searchnode}" size="20">
		</td>
	</tr>
</table>
</form>
<script type="text/javascript">
<!--
document.search.searchcustomer.focus();
//-->
</script>
</body>
{/if}
{if $part == "main"}
<body class="lms-ui-popup">
<table cellpadding="3" width="100%">
	{cycle values="light,lucid" print=false}
	{section name=customerlist loop=$customerlist}
	<tr class="highlight {cycle}"  >
		<td {$customerlist[customerlist].id} style="vertical-align: top;" onClick="sendvalue(targetfield,'{$customerlist[customerlist].id}');">
			<b>{$customerlist[customerlist].customername}</b>
			({$customerlist[customerlist].id|string_format:"%04d"})<br>
			{$customerlist[customerlist].address}{if $customerlist[customerlist].city != ""},{/if} {$customerlist[customerlist].zip} {$customerlist[customerlist].city}
		</td>
		<td style="width: 1%;" class="text-right valign-top nobr" onClick="sendvalue(targetfield,'{$customerlist[customerlist].id}');">
			{foreach from=$customerlist[customerlist].nodes item=node}
			{$node.name}
			{/foreach}
		</td>
		<td align="right" nowrap style="vertical-align: top;" onClick="sendvalue(targetfield,'{$customerlist[customerlist].id}');">
			{if $customerlist[customerlist].balance < 0}<span class="lms-ui-alert">{/if}{$customerlist[customerlist].balance|money_format}{if $customerlist[customerlist].balance < 0}</span>{/if}
		</td>
	</tr>
	{sectionelse}
	<tr>
		<td colspan="3" class="empty-table">
			<p>
			{if $searchcustomer || $searchnode}
				{trans("No such customers matching search criteria.")}
			{else}
				{trans("Enter customer and/or node data and press Enter.")}
			{/if}
			</p>
		</td>
	</tr>
	{/section}
</table>
</body>
{/if}
</html>
