From 115eccdfe3f653fcd67adbac3561bd4dce32df3b Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Sun, 8 Apr 2012 14:02:37 +0100 Subject: [PATCH] Changes to JS code for deciding on band --- application/views/qso/index.php | 88 ++++++++++++++++----------------- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/application/views/qso/index.php b/application/views/qso/index.php index 69299bae..d74beaec 100644 --- a/application/views/qso/index.php +++ b/application/views/qso/index.php @@ -297,43 +297,43 @@ // Get frequency $.get('radio/frequency/' + $('select.radios option:selected').val(), function(result) { $('#frequency').val(result); - if(result >= "100000" && result <= "200000") { - $(".band").val('160m'); - } - if(result >= "300000" && result <= "400000") { - $(".band").val('80m'); - } - if(result >= "525000" && result <= "54500") { - $(".band").val('60m'); - } - if(result >= "700000" && result <= "750000") { - $(".band").val('40m'); - } - if(result >= "1000000" && result <= "110000") { - $(".band").val('30m'); - } if(result >= "1400000" && result <= "1440000") { $(".band").val('20m'); } - if(result >= "1800000" && result <= "1900000") { + else if(result >= "1800000" && result <= "1900000") { $(".band").val('17m'); } - if(result >= "2100000" && result <= "2160000") { + else if(result >= "181000" && result <= "200000") { + $(".band").val('160m'); + } + else if(result >= "300000" && result <= "400000") { + $(".band").val('80m'); + } + else if(result >= "525000" && result <= "54500") { + $(".band").val('60m'); + } + else if(result >= "700000" && result <= "750000") { + $(".band").val('40m'); + } + else if(result >= "1000000" && result <= "110000") { + $(".band").val('30m'); + } + else if(result >= "2100000" && result <= "2160000") { $(".band").val('15m'); } - if(result >= "2400000" && result <= "2500000") { + else if(result >= "2400000" && result <= "2500000") { $(".band").val('12m'); } - if(result >= "2800000" && result <= "3000000") { + else if(result >= "2800000" && result <= "3000000") { $(".band").val('10m'); } - if(result >= "5000000" && result <= "5600000") { + else if(result >= "5000000" && result <= "5600000") { $(".band").val('6m'); } - if(result >= "14400000" && result <= "14700000") { + else if(result >= "14400000" && result <= "14700000") { $(".band").val('2m'); } - if(result >= "43000000" && result <= "44000000") { + else if(result >= "43000000" && result <= "44000000") { $(".band").val('70cm'); } }); @@ -356,43 +356,43 @@ // Get frequency $.get('radio/frequency/' + $('select.radios option:selected').val(), function(result) { $('#frequency').val(result); - if(result >= "100000" && result <= "200000") { - $(".band").val('160m'); - } - if(result >= "300000" && result <= "400000") { - $(".band").val('80m'); - } - if(result >= "525000" && result <= "54500") { - $(".band").val('60m'); - } - if(result >= "700000" && result <= "750000") { - $(".band").val('40m'); - } - if(result >= "1000000" && result <= "110000") { - $(".band").val('30m'); - } if(result >= "1400000" && result <= "1440000") { $(".band").val('20m'); } - if(result >= "1800000" && result <= "1900000") { + else if(result >= "1800000" && result <= "1900000") { $(".band").val('17m'); } - if(result >= "2100000" && result <= "2160000") { + else if(result >= "181000" && result <= "200000") { + $(".band").val('160m'); + } + else if(result >= "300000" && result <= "400000") { + $(".band").val('80m'); + } + else if(result >= "525000" && result <= "54500") { + $(".band").val('60m'); + } + else if(result >= "700000" && result <= "750000") { + $(".band").val('40m'); + } + else if(result >= "1000000" && result <= "110000") { + $(".band").val('30m'); + } + else if(result >= "2100000" && result <= "2160000") { $(".band").val('15m'); } - if(result >= "2400000" && result <= "2500000") { + else if(result >= "2400000" && result <= "2500000") { $(".band").val('12m'); } - if(result >= "2800000" && result <= "3000000") { + else if(result >= "2800000" && result <= "3000000") { $(".band").val('10m'); } - if(result >= "5000000" && result <= "5600000") { + else if(result >= "5000000" && result <= "5600000") { $(".band").val('6m'); } - if(result >= "14400000" && result <= "14700000") { + else if(result >= "14400000" && result <= "14700000") { $(".band").val('2m'); } - if(result >= "43000000" && result <= "44000000") { + else if(result >= "43000000" && result <= "44000000") { $(".band").val('70cm'); } });