mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
Fix my_call replacement
This commit is contained in:
@@ -647,7 +647,9 @@ class QSO extends CI_Controller {
|
||||
$this->load->model('stations');
|
||||
$this->load->library('qra');
|
||||
$stationProfile = $this->input->post('stationProfile', TRUE);
|
||||
$data = array('station_power' => $this->stations->get_station_power($stationProfile));
|
||||
$result = $this->stations->get_station_power($stationProfile);
|
||||
$data['station_power'] = $result['station_power'];
|
||||
$data['station_callsign'] = $result['station_callsign'];
|
||||
[$data['lat'], $data['lng']] = $this->qra->qra2latlong($this->stations->gridsquare_from_station($stationProfile));
|
||||
|
||||
header('Content-Type: application/json');
|
||||
|
||||
@@ -578,15 +578,16 @@ class Stations extends CI_Model {
|
||||
}
|
||||
|
||||
public function get_station_power($id) {
|
||||
$this->db->select('station_power');
|
||||
$this->db->select('station_power, station_callsign');
|
||||
$this->db->where('user_id', $this->session->userdata('user_id'));
|
||||
$this->db->where('station_id', $id);
|
||||
$query = $this->db->get('station_profile');
|
||||
if($query->num_rows() >= 1) {
|
||||
foreach ($query->result() as $row)
|
||||
{
|
||||
return $row->station_power;
|
||||
}
|
||||
$row = $query->row(); // only one result expected
|
||||
return [
|
||||
'station_power' => $row->station_power,
|
||||
'station_callsign' => $row->station_callsign
|
||||
];
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -341,7 +341,7 @@ switch ($date_format) {
|
||||
$power = '';
|
||||
foreach ($stations->result() as $stationrow) {
|
||||
?>
|
||||
<option value="<?php echo $stationrow->station_id; ?>" <?php if($active_station_profile == $stationrow->station_id) { echo "selected=\"selected\""; $power = $stationrow->station_power; } ?>><?php echo $stationrow->station_profile_name; ?></option>
|
||||
<option value="<?php echo $stationrow->station_id; ?>" <?php if($active_station_profile == $stationrow->station_id) { echo "selected=\"selected\""; $power = $stationrow->station_power; $station_callsign = $stationrow->station_callsign; } ?>><?php echo $stationrow->station_profile_name; ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
@@ -832,3 +832,6 @@ switch ($date_format) {
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<script>
|
||||
var station_callsign = "<?php echo $station_callsign; ?>";
|
||||
</script>
|
||||
|
||||
@@ -373,7 +373,7 @@ function UpdateMacros(macrotext) {
|
||||
|
||||
let newString;
|
||||
my_call = my_call.replaceAll('Ø', '0');
|
||||
newString = macrotext.replace(/\[MYCALL\]/g, my_call);
|
||||
newString = macrotext.replace(/\[MYCALL\]/g, station_callsign);
|
||||
newString = newString.replace(/\[CALL\]/g, CALL);
|
||||
newString = newString.replace(/\[RSTS\]/g, RSTS);
|
||||
return newString;
|
||||
|
||||
Reference in New Issue
Block a user