<!--// $Id$ //-->
<style>

	#netnodeinfo-services {
		margin-block-start: 0;
		margin-block-end: 0;
		padding-inline-start: 0;
		list-style-type: none;
	}

</style>
<table class="lmsbox">
	<colgroup>
		<col style="width: 1%;">
		<col style="width: 99%;">
	</colgroup>
	<thead>
		<tr{if $devicepanel} class="hand lmsbox-titlebar"  data-lmsbox-content="netnodepanel"{/if}>
			<td>
				{icon name="netnode"}
			</td>
			<td class="nobr">
				<strong>{$nodeinfo.name} ({$nodeinfo.id|string_format:"%04d"})</strong>
			</td>
		</tr>
	</thead>
	<tbody>
		<tr{if $devicepanel} id="netnodepanel" style="display:none;"{/if}>
			<td colspan="2" class="container">
				<table class="lmsbox-inner">
					<colgroup>
						<col style="width: 100%;">
					</colgroup>
					<tr>
						<td class="valign-top">
							<table class="lmsbox-inner">
								<colgroup>
									<col style="width: 1%;">
									<col style="width: 1%;">
									<col style="width: 98%;">
								</colgroup>
								{if $nodeinfo.division}
									<tr>
										<td>
											{icon name="division"}
										</td>
										<td class="nobr">
											<strong>{trans("Division")}</strong>
										</td>
										<td>
											{$nodeinfo.division|escape}
										</td>
									</tr>
								{/if}
								<tr>
									<td>
										{icon name="type"}
									</td>
									<td class="nobr">
										<strong>{trans("Type")}</strong>
									</td>
									<td>
										{$_NETELEMENTTYPES[$nodeinfo.type]}
									</td>
								</tr>
								<tr>
									<td>
										{icon name="status"}
									</td>
									<td class="nobr">
										<strong>{trans("Status")}</strong>
									</td>
									<td>
										{$_NETELEMENTSTATUSES[$nodeinfo.status]}
									</td>
								</tr>

								<tr>
									<td>
										{icon name="invproject"}
									</td>
									<td class="nobr">
										<strong>{trans("Project")}</strong>
									</td>
									<td>
										{if $nodeinfo.invprojectid == ''}
											{trans("none")}
										{else}
											{$nodeinfo.projectname|escape}
										{/if}
									</td>
								</tr>

								{if $nodeinfo.location}
									<tr>
										<td>
											{icon name="home"}
										</td>
										<td class="nobr">
											<strong>{trans("Location")}</strong>
										</td>
										<td>
											{if $nodeinfo.location_name}{$nodeinfo.location_name}, {/if}{$nodeinfo.location}
											{if $nodeinfo.location_borough_name}
												({$nodeinfo.location_state_name} / {$nodeinfo.location_district_name} / {$_BOROUGHTYPES[$nodeinfo.location_borough_type]} {$nodeinfo.location_borough_name})
											{/if}
										</td>
									</tr>
								{/if}

								{if $nodeinfo.longitude || $nodeinfo.latitude}
									<tr>
										<td>
											{icon name="location"}
										</td>
										<td class="nobr">
											<strong>{trans("GPS longitude")}</strong>
										</td>
										<td>
											<input id="longitude" type="hidden" value="{$nodeinfo.longitude}">
											{$nodeinfo.longitude}
										</td>
									</tr>
									<tr>
										<td>
											{icon name="location"}
										</td>
										<td class="nobr">
											<strong>{trans("GPS latitude")}</strong>
										</td>
										<td>
											<input id="latitude" type="hidden" value="{$nodeinfo.latitude}">
											{$nodeinfo.latitude}
										</td>
									</tr>
									<tr>
										<td colspan="2">
										</td>
										<td>
											{button type="link" icon="map" label="Show on map"
												href="?m=netdevmap&lon={$nodeinfo.longitude}&lat={$nodeinfo.latitude}"}
											{show_on_map_button
												type='google'
												latitude=$nodeinfo.latitude
												longitude=$nodeinfo.longitude
												label=true
											}
											{show_on_map_button
												type='geoportal'
												latitude=$nodeinfo.latitude
												longitude=$nodeinfo.longitude
												label=true
											}
											{show_on_map_button
												type='netstork'
												latitude=$nodeinfo.latitude
												longitude=$nodeinfo.longitude
												label=true
											}
										</td>
									</tr>
								{/if}
								<tr>
									<td>
										{icon name="user"}
									</td>
									<td class="nobr">
										<strong>{trans("Ownership")}</strong>
									</td>
									<td>
										{$_NETELEMENTOWNERSHIPS[$nodeinfo.ownership]}
										{if ($nodeinfo.ownership>= $smarty.const.NET_ELEMENT_OWNERSHIP_SHARED)}
											({strip}
											{if empty($foreign_entity)}
												{$nodeninfo.coowner}
											{else}
												{$foreign_entity.name}
												{if !empty($foreign_entity.type)}, {trans("TEN")} {$foreign_entity.id}{/if}
											{/if}
											{/strip})
										{/if}
									</td>
								</tr>
								{if !empty($nodeinfo.ownerid)}
									<tr>
										<td>
											{icon name="customer"}
										</td>
										<td>
											<strong>{trans("Owner")}</strong>
										</td>
										<td>
											<a href="?m=customerinfo&id={$nodeinfo.ownerid}">{$nodeinfo.owner}</a>
										</td>
									</tr>
								{/if}
								<tr>
									<td>
										{icon name="share"}
									</td>
									<td class="nobr">
										<strong>{trans("Sharing surface")}</strong>
									</td>
									<td>
										{if $nodeinfo.uip == 1}
											{icon name="check"}
										{else}
											-
										{/if}
									</td>
								</tr>
								<tr>
									<td>
										{icon name="antenna"}
									</td>
									<td class="nobr">
										<strong>{trans("Antennas installation")}</strong>
									</td>
									<td>
										{if $nodeinfo.miar == 1}
											{icon name="check"}
										{else}
											-
										{/if}
									</td>
								</tr>
								{if !empty($nodeinfo.flags)}
									<tr>
										<td>
											{icon name="options" class="fa-fw"}
										</td>
										<td>
											<strong>{trans("Flags")}</strong>
										</td>
										<td>
											{strip}
												{foreach $nodeinfo.flags as $flag}
													{$_NETWORK_NODE_FLAGS[$flag]}
													{if !$flag@last},{/if}
													<br>
												{/foreach}
											{/strip}
										</td>
									</tr>
								{/if}
								{if !empty($nodeinfo.services)}
									<tr>
										<td class="valign-top">
											{icon name="money" class="fa-fw"}
										</td>
										<td class="valign-top">
											<strong>{trans("Services")}</strong>
										</td>
										<td>
											<ul id="netnodeinfo-services">
												{foreach $nodeinfo.services as $service}
													{strip}
														<li>
															{$_NETWORK_NODE_SERVICES[$service]}
														</li>
													{/strip}
												{/foreach}
											</ul>
										</td>
									</tr>
								{/if}
								{if $nodeinfo.info}
									<tr>
										<td>
											{icon name="note"}
										</td>
										<td>
											<strong>{trans('Note')}</strong>
										</td>
										<td>
											{$nodeinfo.info|escape}
										</td>
									</tr>
								{/if}
								<tr>
									<td>
										{icon name="user"}
									</td>
									<td>
										<strong>{trans('Created')}</strong>
									</td>
									<td>
										{$nodeinfo.createtime|date_format:"Y-m-d (l)"}
									</td>
								</tr>
								<tr>
									<td>
										{icon name="calendar"}
									</td>
									<td>
										<strong>{trans('Last inspection')}</strong>
									</td>
									<td>
										{if $nodeinfo.lastinspectiontime}
											{$nodeinfo.lastinspectiontime|date_format:"Y-m-d (l)"}
										{else}
											-
										{/if}
									</td>
								</tr>
								<tr>
									<td>
										{icon name="phone"}
									</td>
									<td>
										<strong>{trans('Administrative contact')}</strong>
									</td>
									<td>
										{$nodeinfo.admcontact}
									</td>
								</tr>
							</table>
						</td>
					</tr>
				</table>
				{if !$devicepanel}
			</td>
		</tr>
		<tr>
			<td colspan="2" class="lms-ui-box-buttons">
				{/if}
				{button icon="edit" label="Edit" href="?m=netnodeedit&id={$nodeinfo.id}"}
				{button icon="delete" label="Delete" id="delete-netnode" data_name=$nodeinfo.name
					data_href="?m=netnodedel&id={$nodeinfo.id}"}
			</td>
		</tr>
	</tbody>
</table>
{if $devicepanel}
<script>

	if (getCookie('netnodepanel') == '1') {
		$('#netnodepanel').show();
	}

</script>
{/if}
<script>

	$(function() {
		$('#delete-netnode').click(function () {
			var name = $(this).attr('data-name');
			confirmDialog($t("Are you sure, you want to remove net device node '$a' from database?", name), this).done(function () {
				location.href = $(this).attr('data-href');
			});
		});
	});

</script>
