Example #1
0
    $iota_nr = "";
    $loc = "";
    $itu = "";
    $waz = "";
    $qsls = "";
    $qslr = "";
}
if (isset($_POST['frequency_input'])) {
    $freq = htmlentities($_POST["frequency_input"]);
    $freq = str_replace(',', '.', $freq);
    $freq = validate_freq($freq);
}
if (isset($_POST['band_input'])) {
    if ($_POST['band_input'] != 'select') {
        $band = htmlentities($_POST["band_input"]);
        $freq = band_to_freq($band);
    } elseif (!empty($freq)) {
        $band = freq_to_band($freq);
    }
}
if (isset($_POST["iota_input"])) {
    $iota_nr = strtoupper(htmlentities($_POST["iota_input"]));
}
if (isset($_POST["manager_input"])) {
    $manager = strtoupper(htmlentities($_POST["manager_input"]));
}
if (isset($_POST["itu_input"])) {
    $itu = htmlentities($_POST["itu_input"]);
}
if (isset($_POST["waz_input"])) {
    $waz = htmlentities($_POST["waz_input"]);
Example #2
0
function validate_freq($freq)
{
    switch ($freq) {
        //check for lazy WARC band frequency input
        case '10':
            return band_to_freq('30M');
            break;
        case '18':
            return band_to_freq('17M');
            break;
        case '24':
            return band_to_freq('12M');
        case '':
            return NULL;
            //Check if frequency input was in kHz, if true, convert to MHz
        //Check if frequency input was in kHz, if true, convert to MHz
        default:
            if (!freq_to_band($freq)) {
                //kHz/1000 = MHz
                $newfreq = $freq / 1000;
                if (freq_to_band($newfreq)) {
                    return $newfreq;
                }
            }
            return $freq;
            break;
    }
}