{extends file="layout.html"}
{block name=title}LMS: {$layout.pagetitle|striphtml}{/block}
{block name=module_content}
<!--// $Id$ //-->
<H1>{$layout.pagetitle}</H1>
<TABLE class="lmsbox">
    <THEAD>
	<TR {tip text="Click on column name to change sorting order"}>
		<TD WIDTH="92%" NOWRAP>
			<IMG SRC="img/channel.gif" ALT=""> <A href="?m=ewxchlist&o=name{if $listdata.direction == "asc" && $listdata.order == "name"},desc{/if}"><B>{trans("Name:")}</B></A> {if $listdata.order == "name"}<IMG SRC="img/{if $listdata.direction == "desc"}asc{else}desc{/if}_order.gif" alt="">{/if}
		</TD>
		<TD WIDTH="1%" align="right" NOWRAP>
			<A href="?m=ewxchlist&o=id{if $listdata.direction == "asc" && $listdata.order == "id"},desc{/if}">{trans("ID:")}</A> {if $listdata.order == "id"}<IMG SRC="img/{if $listdata.direction == "desc"}asc{else}desc{/if}_order.gif" alt="">{/if}
		</TD>
		<TD WIDTH="1%" align="right" NOWRAP>
			<A href="?m=ewxchlist&o=cid{if $listdata.direction == "asc" && $listdata.order == "cid"},desc{/if}">STMID:</A> {if $listdata.order == "cid"}<IMG SRC="img/{if $listdata.direction == "desc"}asc{else}desc{/if}_order.gif" alt="">{/if}
		</TD>
		<TD WIDTH="1%" align="right" NOWRAP>
			<A href="?m=ewxchlist&o=downceil{if $listdata.direction == "asc" && $listdata.order == "downceil"},desc{/if}">{trans("Downceil:")}</A> {if $listdata.order == "downceil"}<IMG SRC="img/{if $listdata.direction == "desc"}asc{else}desc{/if}_order.gif" alt="">{/if}<BR>
			<A href="?m=ewxchlist&o=upceil{if $listdata.direction == "asc" && $listdata.order == "upceil"},desc{/if}">{trans("Upceil:")}</A> {if $listdata.order == "upceil"}<IMG SRC="img/{if $listdata.direction == "desc"}asc{else}desc{/if}_order.gif" alt="">{/if}
		</TD>
		<TD WIDTH="1%" align="right" NOWRAP>
			<A href="?m=ewxchlist&o=downceil_n{if $listdata.direction == "asc" && $listdata.order == "downceil_n"},desc{/if}">{trans("Night Downceil:")}</A> {if $listdata.order == "downceil_n"}<IMG SRC="img/{if $listdata.direction == "desc"}asc{else}desc{/if}_order.gif" alt="">{/if}<BR>
			<A href="?m=ewxchlist&o=upceil_n{if $listdata.direction == "asc" && $listdata.order == "upceil_n"},desc{/if}">{trans("Night Upceil:")}</A> {if $listdata.order == "upceil_n"}<IMG SRC="img/{if $listdata.direction == "desc"}asc{else}desc{/if}_order.gif" alt="">{/if}
		</TD>
		<TD WIDTH="1%" align="right" NOWRAP>
			<A href="?m=ewxchlist&o=halfduplex{if $listdata.direction == "asc" && $listdata.order == "halfduplex"},desc{/if}">{trans("Half duplex")}:</A> {if $listdata.order == "halfduplex"}<IMG SRC="img/{if $listdata.direction == "desc"}asc{else}desc{/if}_order.gif" alt="">{/if}
		</TD>
		<TD WIDTH="1%" align="right" NOWRAP>
			<A href="?m=ewxchlist&o=devcnt{if $listdata.direction == "asc" && $listdata.order == "devcnt"},desc{/if}">{trans("Devices:")}</A> {if $listdata.order == "devcnt"}<IMG SRC="img/{if $listdata.direction == "desc"}asc{else}desc{/if}_order.gif" alt="">{/if}
		</TD>
		<TD WIDTH="1%" align="right" NOWRAP>
			<A href="?m=ewxchlist&o=nodecnt{if $listdata.direction == "asc" && $listdata.order == "nodecnt"},desc{/if}">{trans("Nodes:")}</A> {if $listdata.order == "nodecnt"}<IMG SRC="img/{if $listdata.direction == "desc"}asc{else}desc{/if}_order.gif" alt="">{/if}
		</TD>
		<TD WIDTH="1%" class="text-right nobr">
			<B>{t a=$listdata.total}Total: $a{/t}</B>
		</TD>
	</TR>
	{if $listdata.total != 0}
        <TR>
	        <TD class="lms-ui-pagination" COLSPAN="9">
	                {include file="scroller.html" loop=$channels}
	        </TD>
	</TR>
        {/if}
    </THEAD>
    <TBODY>
	{cycle values="light,lucid" print=false}
	{section name=channels loop=$channels}
	<TR class="highlight {cycle}"  >
		<TD onClick="return self.location.href='?m=ewxchinfo&id={$channels[channels].id}'">
			<IMG SRC="img/channel.gif" ALT="">&nbsp;{if $channels[channels].id}<B>{$channels[channels].name}</B>{else}[{$channels[channels].name}]{/if}
		</TD>
		<TD align="right" onClick="return self.location.href='?m=ewxchinfo&id={$channels[channels].id}'">
			{if $channels[channels].id}({$channels[channels].id|string_format:"%04d"}){else}-{/if}
		</TD>
		<TD align="right" onClick="return self.location.href='?m=ewxchinfo&id={$channels[channels].id}'">
			{if $channels[channels].cid}[{$channels[channels].cid|string_format:"%04d"}]{else}-{/if}
		</TD>
		<TD align="right" onClick="return self.location.href='?m=ewxchinfo&id={$channels[channels].id}'">
			{$channels[channels].downceil}<BR>
			{$channels[channels].upceil}
		</TD>
		<TD align="right" onClick="return self.location.href='?m=ewxchinfo&id={$channels[channels].id}'">
			{if $channels[channels].downceil_n}{$channels[channels].downceil_n}{else}-{/if}<BR>
			{if $channels[channels].upceil_n}{$channels[channels].upceil_n}{else}-{/if}
		</TD>
		<TD align="right" onClick="return self.location.href='?m=ewxchinfo&id={$channels[channels].id}'">
		    {if $channels[channels].halfduplex}{trans("yes")}{else}{trans("no")}{/if}
		</TD>
		<TD align="right" onClick="return self.location.href='?m=ewxchinfo&id={$channels[channels].id}'">
			{$channels[channels].devcnt|default:0}
			{if $channels[channels].devcnt}
				<img src="img/netdev.gif" alt="" class="lms-ui-hint-rollover"
					data-url="?m=ewxdevlist&id={$channels[channels].id}">
			{/if}
		</TD>
		<TD align="right" onClick="return self.location.href='?m=ewxchinfo&id={$channels[channels].id}'">
			{$channels[channels].nodecnt|default:0}
			{if $channels[channels].nodecnt}
				<img src="img/node.gif" alt="" class="lms-ui-hint-rollover"
					data-url="?m=ewxnodelist&id={$channels[channels].id}">
			{/if}
		</TD>
		<TD class="text-right nobr">
			{if $channels[channels].id}
			<A class="delete-ewxch" HREF="?m=ewxchdel&id={$channels[channels].id}"><IMG SRC="img/delete.gif" alt="{trans("Delete")}" title="{trans("Delete")}"></A>
			<A HREF="?m=ewxchedit&id={$channels[channels].id}"><IMG SRC="img/edit.gif" alt="{trans("Edit")}" title="{trans("Edit")}"></A>
			{/if}
			<A HREF="?m=ewxchinfo&id={$channels[channels].id}"><IMG SRC="img/info.gif" alt="{trans("Info")}" title="{trans("Info")}"></A>
		</TD>
	</TR>
	{sectionelse}
	<tr>
		<td colspan="9" class="empty-table">
			{trans("No such channels in database.")}
		</td>
	</tr>
	{/section}
    </TBODY>
    <TFOOT>
	{if $listdata.total != 0}
        <TR>
	        <TD class="lms-ui-pagination" COLSPAN="9">
	                {include file="scroller.html" loop=$channels}
	        </TD>
	</TR>
        {/if}
	<TR>
		<TD COLSPAN="2" ALIGN="right">
			<IMG SRC="img/info2.gif" ALT="">&nbsp;<B>{t a=$listdata.total}Total: $a{/t}</B>
		</TD>
		<TD COLSPAN="7">
			&nbsp;
		</TD>
	</TR>
    </TFOOT>
</TABLE>
	<script>
		$('.delete-ewxch').click(function() {
			confirmDialog($t("Are you sure, you want to delete this channel?"), this).done(function() {
				location.href = $(this).attr('href');
			});
			return false;
		});
	</script>
{/block}
