<%+header%>

<script type="text/javascript">//<![CDATA[


XHR.poll(0, '<%=build_url("admin/modem/3ginfo/devicedata")%>', null,
		function(x, data)
		{


					var icon2;
					var p = (data.signal);

					// conn data status
					var conn;
					var cn = (data.status)
					if (cn == "CONNECTED")
					conn = "<%:CONNECTED%>";
					else
					conn = "<%:DISCONNECTED%>";

					if (data.signal < 0)
						icon2 = "<%=resource%>/icons/3ginfo-0.png";
					else if (data.signal == 0)
						icon2 = "<%=resource%>/icons/3ginfo-0.png";
					else if (data.signal < 20)
						icon2 = "<%=resource%>/icons/3ginfo-0-20.png";
					else if (data.signal < 40)
						icon2 = "<%=resource%>/icons/3ginfo-20-40.png";
					else if (data.signal < 60)
						icon2 = "<%=resource%>/icons/3ginfo-40-60.png";
					else if (data.signal < 80)
						icon2 = "<%=resource%>/icons/3ginfo-60-80.png";
					else
						icon2 = "<%=resource%>/icons/3ginfo-80-100.png";

					if (e = document.getElementById('signal'))
					if (e)
						e.innerHTML = String.format('<medium>%d%%</medium></br>' + '<img style="padding-left: 10px;" src="%s"/>', p, icon2);


			if (e = document.getElementById('statu'))
				{

						e.innerHTML = (conn);

				}

			if (e = document.getElementById('conn_tim'))
			 	e.innerHTML = String.format(data.conn_time);

			if (e = document.getElementById('iface_rx'))
			 	e.innerHTML = String.format(data.iface_rx);

			if (e = document.getElementById('iface_tx'))
			 	e.innerHTML = String.format(data.iface_tx);

			if (e = document.getElementById('mod'))
			 	e.innerHTML = String.format(data.mode);

			if (e = document.getElementById('operato'))
			 	e.innerHTML = String.format(data.operator_name);

			if (e = document.getElementById('signa'))
			 	e.innerHTML = String.format(data.signal+"%");

			if (e = document.getElementById('devic'))
			 	e.innerHTML = String.format(data.device);


			if (e = document.getElementById('omcc'))
			 	e.innerHTML = String.format(data.operator_mcc  + " " + data.operator_mnc);

			if (e = document.getElementById('cs'))
			 	e.innerHTML = String.format(data.csq);

			if (e = document.getElementById('rss'))
			 	e.innerHTML = String.format(data.rssi + " dBm");

			if (e = document.getElementById('rsc'))
			 	e.innerHTML = String.format(data.rscp + " dBm");

			if (e = document.getElementById('eci'))
			 	e.innerHTML = String.format(data.ecio + " dB");

			if (e = document.getElementById('rsr'))
			 	e.innerHTML = String.format(data.rsrp + " dBm");

			if (e = document.getElementById('sinrr'))
			 	e.innerHTML = String.format(data.sinr + " dB");

			if (e = document.getElementById('lac_he'))
			 	e.innerHTML = String.format(data.lac_hex  + ' (' + data.lac_dec + ')' );


			if (e = document.getElementById('cid_he'))
			 	e.innerHTML = String.format(data.cid_hex   + ' (' + data.cid_dec + ')' );


			if (e = document.getElementById('rsrqq'))
			 	e.innerHTML = String.format(data.rsrq + " dB");

			if (e = document.getElementById('tacc'))
			 	e.innerHTML = String.format(data.tac_hex   + ' (' + data.tac_dec + ')' );

		}
	);
//]]></script>

<div class="cbi-section">

	<h2>3ginfo</h2>
	<h4><%:Information about 3G/4G connection%></h4>

	<div class="table" width="100%">

		<div class="tr"><div class="td left" width="33%"><%:Status:%></div><div class="td left" id="statu">-</div></div>
		<div class="tr"><div class="td left" width="33%"><%:Connection time:%></div><div class="td left" id="conn_tim">-</div></div>
		<div class="tr"><div class="td left" width="33%"><%:Downloaded:%></div><div class="td left" id="iface_rx">-</div></div>
		<div class="tr"><div class="td left" width="33%"><%:Uploaded:%></div><div class="td left" id="iface_tx">-</div></div>
		<div class="tr"><div class="td left" width="33%"><%:Mode:%></div><div class="td left" id="mod">-</div></div>
		<div class="tr"><div class="td left" width="33%"><%:Operator:%></div><div class="td left" id="operato">-</div></div>

		<div class="tr"><div class="td left" width="33%"><%:Signal strength:%></div><div class="td left" id="signal">-</div></div>

		<div class="tr"><div class="td left" width="33%"><%:Modem type:%></div><div class="td left" id="devic">-</div></div>
		<div class="tr"><div class="td left" width="33%"></div><div class="td left"></div></div>
	</div>
<div style="float: left;"><div class="ifacebadge"><a href="https://eko.one.pl/forum/viewtopic.php?pid=240837#p240837">e1</a></div>&nbsp;&nbsp;&nbsp;</div>

<details>
    <summary><%:Additional information%></summary>

	<div class="table" width="100%"></div>

	<div class="table" width="100%">
		<div class="tr"><div class="td left" width="33%">MCC MNC: </div><div class="td left" id="omcc">-</div></div>
		<div class="tr"><div class="td left" width="33%">CSQ: </div><div class="td left" id="cs">-</div></div>
		<div class="tr"><div class="td left" width="33%">RSSI: </div><div class="td left" id="rss">-</div></div>
		<div class="tr"><div class="td left" width="33%">RSCP: </div><div class="td left" id="rsc">-</div></div>
		<div class="tr"><div class="td left" width="33%">Ec/IO: </div><div class="td left" id="eci">-</div></div>
		<div class="tr"><div class="td left" width="33%">RSRP: </div><div class="td left" id="rsr">-</div></div>
		<div class="tr"><div class="td left" width="33%">SINR: </div><div class="td left" id="sinrr">-</div></div>
		<div class="tr"><div class="td left" width="33%">RSRQ: </div><div class="td left" id="rsrqq">-</div></div>
		<div class="tr"><div class="td left" width="33%">LAC: </div><div class="td left" id="lac_he">-</div></div>
		<div class="tr"><div class="td left" width="33%">CID: </div><div class="td left" id="cid_he">-</div></div>
		<div class="tr"><div class="td left" width="33%">TAC: </div><div class="td left" id="tacc">-</div></div>
		<div class="tr"><div class="td left" width="33%"></div><div class="td left"></div></div>

	</div>

</div>

</details>


<%+footer%>
