[QRB Link] Added globe link to dashboard, logbook and qso. Spawns QRB window.

pull/1407/head
Andreas 2022-02-19 19:46:07 +01:00
rodzic b94eb1909b
commit 274ecf85cb
5 zmienionych plików z 31 dodań i 12 usunięć

Wyświetl plik

@ -22,12 +22,20 @@ function echo_table_col($row, $name) {
case 'Country': echo '<td>' . ucwords(strtolower(($row->COL_COUNTRY))) . '</td>'; break;
case 'IOTA': echo '<td>' . ($row->COL_IOTA) . '</td>'; break;
case 'SOTA': echo '<td>' . ($row->COL_SOTA_REF) . '</td>'; break;
case 'Grid': echo '<td>'; echo strlen($row->COL_GRIDSQUARE)==0?$row->COL_VUCC_GRIDS:$row->COL_GRIDSQUARE . '</td>'; break;
case 'Grid': echo '<td>'; echoQrbCalcLink($row->COL_VUCC_GRIDS, $row->COL_GRIDSQUARE); echo '</td>'; break;
case 'Band': echo '<td>'; if($row->COL_SAT_NAME != null) { echo $row->COL_SAT_NAME; } else { echo strtolower($row->COL_BAND); } echo '</td>'; break;
case 'State': echo '<td>' . ($row->COL_STATE) . '</td>'; break;
case 'Operator': echo '<td>' . ($row->COL_OPERATOR) . '</td>'; break;
}
}
function echoQrbCalcLink($grid, $vucc) {
if (strlen($grid) != 0) {
echo $grid . ' <a id="edit_qso" href="javascript:spawnQrbCalculator(\'' . $grid . '\')"><i class="fas fa-globe"></i></a>';
} else if (strlen($vucc) != 0) {
echo $vucc .' <a id="edit_qso" href="javascript:spawnQrbCalculator(\'' . $vucc . '\')"><i class="fas fa-globe"></i></a>';
}
}
?>
<div class="container dashboard">
<?php if(($this->config->item('use_auth') && ($this->session->userdata('user_type') >= 2)) || $this->config->item('use_auth') === FALSE) { ?>

Wyświetl plik

@ -430,7 +430,7 @@ document.onkeyup = function(e) {
}
};
function spawnQrbCalculator() {
function spawnQrbCalculator(locator2) {
$.ajax({
url: base_url + 'index.php/qrbcalc',
type: 'post',
@ -442,7 +442,10 @@ function spawnQrbCalculator() {
nl2br: false,
message: html,
onshown: function(dialog) {
if (locator2 !== undefined) {
$("#qrbcalc_locator2").val(locator2);
calculateQrb();
}
},
buttons: [{
label: 'Close',
@ -455,9 +458,9 @@ function spawnQrbCalculator() {
});
}
function calculateQrb(form) {
let locator1 = form.locator1.value;
let locator2 = form.locator2.value;
function calculateQrb() {
let locator1 = $("#qrbcalc_locator1").val();
let locator2 = $("#qrbcalc_locator2").val();
$(".qrbalert").remove();

Wyświetl plik

@ -2,14 +2,14 @@
<div class="form-group row">
<div class="col-md-2 control-label" for="input">Locator 1</div>
<div class="col-md-4">
<input class="form-control input-group-sm" id="locator1" type="text" name="locator1" placeholder="" value="<?php if ($station_locator != "0") echo $station_locator; ?>" aria-label="locator1">
<input class="form-control input-group-sm" id="qrbcalc_locator1" type="text" name="locator1" placeholder="" value="<?php if ($station_locator != "0") echo $station_locator; ?>" aria-label="locator1">
</div>
</div>
<div class="form-group row">
<div class="col-md-2 control-label" for="input">Locator 2</div>
<div class="col-md-4">
<input class="form-control input-group-sm" id="locator2" type="text" name="locator2" placeholder="" aria-label="locator2">
<input class="form-control input-group-sm" id="qrbcalc_locator2" type="text" name="locator2" placeholder="" aria-label="locator2">
</div>
</div>
@ -17,7 +17,7 @@
<label class="col-md-2 control-label" for="button1id"></label>
<div class="col-md-4">
<button id="button2id" type="reset" name="button2id" class="btn-sm btn-warning">Reset</button>
<button id="button1id" type="button" onclick="calculateQrb(this.form);" name="button1id" class="btn-sm btn-primary">Calculate</button>
<button id="button1id" type="button" onclick="calculateQrb();" name="button1id" class="btn-sm btn-primary">Calculate</button>
</div>
</div>
</form>

Wyświetl plik

@ -23,12 +23,20 @@ function echo_table_col($row, $name) {
case 'Country': echo '<td>' . ucwords(strtolower(($row->COL_COUNTRY))) . '</td>'; break;
case 'IOTA': echo '<td>' . ($row->COL_IOTA) . '</td>'; break;
case 'SOTA': echo '<td>' . ($row->COL_SOTA_REF) . '</td>'; break;
case 'Grid': echo '<td>'; echo strlen($row->COL_GRIDSQUARE)==0?$row->COL_VUCC_GRIDS:$row->COL_GRIDSQUARE . '</td>'; break;
case 'Grid': echo '<td>'; echoQrbCalcLink($row->COL_VUCC_GRIDS, $row->COL_GRIDSQUARE); echo '</td>'; break;
case 'Band': echo '<td>'; if($row->COL_SAT_NAME != null) { echo $row->COL_SAT_NAME; } else { echo strtolower($row->COL_BAND); } echo '</td>'; break;
case 'State': echo '<td>' . ($row->COL_STATE) . '</td>'; break;
case 'Operator':echo '<td>' . ($row->COL_OPERATOR) . '</td>'; break;
}
}
function echoQrbCalcLink($grid, $vucc) {
if (strlen($grid) != 0) {
echo $grid . ' <a id="edit_qso" href="javascript:spawnQrbCalculator(\'' . $grid . '\')"><i class="fas fa-globe"></i></a>';
} else if (strlen($vucc) != 0) {
echo $vucc .' <a id="edit_qso" href="javascript:spawnQrbCalculator(\'' . $vucc . '\')"><i class="fas fa-globe"></i></a>';
}
}
?>

Wyświetl plik

@ -97,7 +97,7 @@
<?php if($row->COL_GRIDSQUARE != null) { ?>
<tr>
<td>Gridsquare:</td>
<td><?php echo $row->COL_GRIDSQUARE; ?></td>
<td><?php echo $row->COL_GRIDSQUARE; ?> <a id="edit_qso" href="javascript:spawnQrbCalculator('<?php echo $row->COL_GRIDSQUARE; ?>')"><i class="fas fa-globe"></i></a></td>
</tr>
<?php } ?>
@ -133,7 +133,7 @@
<?php if($row->COL_VUCC_GRIDS != null) { ?>
<tr>
<td>Gridsquare (Multi):</td>
<td><?php echo $row->COL_VUCC_GRIDS; ?></td>
<td><?php echo $row->COL_VUCC_GRIDS; ?> <a id="edit_qso" href="javascript:spawnQrbCalculator('<?php echo $row->COL_VUCC_GRIDS; ?>')"><i class="fas fa-globe"></i></a></td>
</tr>
<?php } ?>