mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
Add LoTW accepted to edit/create functions
This commit is contained in:
@@ -77,10 +77,15 @@ class Satellite extends CI_Controller {
|
||||
$satellite['name'] = $this->security->xss_clean($this->input->post('name'));
|
||||
$satellite['exportname'] = $this->security->xss_clean($this->input->post('exportname'));
|
||||
$satellite['orbit'] = $this->security->xss_clean($this->input->post('orbit'));
|
||||
if ($this->security->xss_clean($this->input->post('lotw')) == 'Y') {
|
||||
$satellite['lotw'] = 'Y';
|
||||
} else {;
|
||||
$satellite['lotw'] = 'N';
|
||||
}
|
||||
|
||||
$this->satellite_model->saveupdatedsatellite($id, $satellite);
|
||||
$this->satellite_model->saveupdatedsatellite($id, $satellite);
|
||||
echo json_encode(array('message' => 'OK'));
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
public function delete() {
|
||||
|
||||
@@ -38,19 +38,15 @@ class Satellite_model extends CI_Model {
|
||||
}
|
||||
|
||||
function saveupdatedsatellite($id, $satellite) {
|
||||
$this->db->where('satellite.id', $id);
|
||||
|
||||
$this->db->update('satellite', $satellite);
|
||||
|
||||
return true;
|
||||
$this->db->where('satellite.id', $id);
|
||||
$this->db->update('satellite', $satellite);
|
||||
return true;
|
||||
}
|
||||
|
||||
function saveSatelliteMode($id, $satmode) {
|
||||
$this->db->where('satellitemode.id', $id);
|
||||
|
||||
$this->db->update('satellitemode', $satmode);
|
||||
|
||||
return true;
|
||||
$this->db->update('satellitemode', $satmode);
|
||||
return true;
|
||||
}
|
||||
|
||||
function add() {
|
||||
@@ -59,6 +55,11 @@ class Satellite_model extends CI_Model {
|
||||
'exportname' => xss_clean($this->input->post('exportname', true)),
|
||||
'orbit' => xss_clean($this->input->post('orbit', true)),
|
||||
);
|
||||
if (xss_clean($this->input->post('lotw', true)) == 'Y') {
|
||||
$data['lotw'] = 'Y';
|
||||
} else {
|
||||
$data['lotw'] = 'N';
|
||||
}
|
||||
|
||||
$this->db->where('name', xss_clean($this->input->post('name', true)));
|
||||
$result = $this->db->get('satellite');
|
||||
|
||||
@@ -65,6 +65,14 @@
|
||||
<input type="text" class="form-control" name="downlinkFrequency" id="downlinkFrequency" aria-describedby="downlinkFrequency" required>
|
||||
<small id="downlinkFrequencyHelp" class="form-text text-muted"><?= __("Enter frequency (in Hz) used for downlink"); ?></small>
|
||||
</div>
|
||||
<div class="mb-3 col-md-6">
|
||||
<label for="lotwAccepted"><?= __("Accepted by LoTW"); ?></label>
|
||||
<select id="lotwAccepted" class="form-select" name="lotwAccepted">
|
||||
<option value="Y"><?= __("Yes"); ?></option>
|
||||
<option value="N" selected="selected"><?= __("No"); ?></option>
|
||||
</select>
|
||||
<small id="exportNameInputHelp" class="form-text text-muted"><?= __("Set to yes only if satellite is accepted my LoTW"); ?></small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button type="button" onclick="createSatellite(this.form);" class="btn btn-sm btn-primary"><i class="fas fa-plus-square"></i> <?= __("Save"); ?></button>
|
||||
|
||||
@@ -20,6 +20,19 @@
|
||||
<input type="text" class="form-control" name="orbit" id="orbit" aria-describedby="orbitHelp" value="<?php if(set_value('band') != "") { echo set_value('band'); } else { echo $satellite->orbit; } ?>" required>
|
||||
<small id="sorbitHelp" class="form-text text-muted"><?= __("Enter which orbit the satellite has (LEO, MEO, GEO)"); ?></small>
|
||||
</div>
|
||||
<div class="mb-3 col-md-6">
|
||||
<label for="lotwAccepted"><?= __("Accepted by LoTW"); ?></label>
|
||||
<select id="lotwAccepted" class="form-select" name="lotwAccepted">
|
||||
<?php if ($satellite->lotw == 'Y') { ?>
|
||||
<option value="Y" selected="selected"><?= __("Yes"); ?></option>
|
||||
<option value="N"><?= __("No"); ?></option>
|
||||
<?php } else { ?>
|
||||
<option value="Y"><?= __("Yes"); ?></option>
|
||||
<option value="N" selected="selected"><?= __("No"); ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
<small id="exportNameInputHelp" class="form-text text-muted"><?= __("Set to yes only if satellite is accepted my LoTW"); ?></small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button type="button" onclick="saveUpdatedSatellite(this.form);" class="btn btn-sm btn-primary"><i class="fas fa-plus-square"></i> <?= __("Save satellite"); ?></button>
|
||||
|
||||
@@ -71,6 +71,7 @@ function createSatellite(form) {
|
||||
'uplinkfrequency': form.uplinkFrequency.value,
|
||||
'downlinkmode': form.downlinkMode.value,
|
||||
'downlinkfrequency': form.downlinkFrequency.value,
|
||||
'lotw': form.lotwAccepted.value,
|
||||
},
|
||||
success: function (html) {
|
||||
location.reload();
|
||||
@@ -117,6 +118,7 @@ function saveUpdatedSatellite(form) {
|
||||
data: {'id': form.id.value,
|
||||
'name': form.nameInput.value,
|
||||
'exportname': form.exportNameInput.value,
|
||||
'lotw': form.lotwAccepted.value,
|
||||
'orbit': form.orbit.value,
|
||||
},
|
||||
success: function (html) {
|
||||
|
||||
Reference in New Issue
Block a user