diff --git a/application/controllers/Satellite.php b/application/controllers/Satellite.php index 194aa4249..3e6b52dae 100644 --- a/application/controllers/Satellite.php +++ b/application/controllers/Satellite.php @@ -527,4 +527,13 @@ class Satellite extends CI_Controller { // Calculate the day number return Predict_Time::unix2daynum($timestamp, 0); } + + public function getSatelliteInfo() { + $satname = $this->security->xss_clean($this->input->post('sat', true)); + $this->load->model('satellite_model'); + + $data['satinfo'] = $this->satellite_model->get_satellite_information($satname); + + $this->load->view('satellite/satinfo', $data); + } } diff --git a/application/models/Satellite_model.php b/application/models/Satellite_model.php index fe025001d..9d5c552d6 100644 --- a/application/models/Satellite_model.php +++ b/application/models/Satellite_model.php @@ -12,6 +12,21 @@ class Satellite_model extends CI_Model { return $this->db->query($sql)->result(); } + function get_satellite_information($satname = null) { + $bindings = []; + $sql = "select satellite.id, satellite.name as satname, satellitemode.name as modename, satellite.displayname, satellite.orbit, satellite.lotw as lotw, tle.updated, satellitemode.uplink_mode, satellitemode.downlink_mode, satellitemode. uplink_freq, satellitemode.downlink_freq + from satellite + left outer join satellitemode on satellite.id = satellitemode.satelliteid + left outer join tle on satellite.id = tle.satelliteid "; + + if ($satname != null) { + $sql .= " where satellite.name = ? "; + $bindings[] = $satname; + } + + return $this->db->query($sql, $bindings)->result(); + } + function get_all_satellites_with_tle() { $sql = "select satellite.id, satellite.name as satname, tle.tle from satellite diff --git a/application/views/satellite/passtable.php b/application/views/satellite/passtable.php index 3899f0613..07c0aa9c0 100644 --- a/application/views/satellite/passtable.php +++ b/application/views/satellite/passtable.php @@ -28,7 +28,7 @@ if (isset($filtered)) { $tca=sat2pol($max_el_az,$max_el,$scale); $control = array(2 * $tca[0] - ($aos[0] + $los[0]) / 2, 2 * $tca[1] - ($aos[1] + $los[1]) / 2); // Calc Controlpoints for Bezier-Curve echo ''; - echo '' . $pass->satname . ''; + echo '' . $pass->satname . ' '; echo '' . Predict_Time::daynum2readable($pass->aos, $zone, $format) . ''; echo '' . Predict_Time::daynum2readable($pass->los, $zone, $format) . ''; echo '' . returntimediff(Predict_Time::daynum2readable($pass->aos, $zone, $format), Predict_Time::daynum2readable($pass->los, $zone, $format), $format) . ''; diff --git a/application/views/satellite/satinfo.php b/application/views/satellite/satinfo.php new file mode 100644 index 000000000..e1b0be5a9 --- /dev/null +++ b/application/views/satellite/satinfo.php @@ -0,0 +1,33 @@ + + + + ' . __("Name") . ' + ' . __("Mode") . ' + ' . __("Uplink mode") . ' + ' . __("Uplink frequency") . ' + ' . __("Downlink mode") . ' + ' . __("Downlink frequency") . ' + ' . __("Orbit") . ' + ' . __("LoTW") . ' + ' . __("TLE date") . ' + + + '; + foreach($satinfo as $sat) { + echo ''; + echo '' . $sat->satname . ''; + echo '' . $sat->modename . ''; + echo '' . $sat->uplink_mode . ''; + echo '' . $sat->uplink_freq . ''; + echo '' . $sat->downlink_mode . ''; + echo '' . $sat->downlink_freq . ''; + echo '' . $sat->orbit . ''; + echo '' . $sat->lotw . ''; + echo '' . $sat->updated . ''; + echo ''; + } + echo ' + '; +?> diff --git a/assets/js/sections/satpasses.js b/assets/js/sections/satpasses.js index b2211557b..1e0c3e42c 100644 --- a/assets/js/sections/satpasses.js +++ b/assets/js/sections/satpasses.js @@ -36,6 +36,9 @@ function loadPasses() { $(".ld-ext-right-plot").removeClass('running'); $(".ld-ext-right-plot").prop('disabled', false); $('#searchpass').prop("disabled", false); + $('.satelliteinfo').click(function (event) { + getSatelliteInfo(this); + }); }, error: function(e) { modalloading=false; @@ -43,6 +46,34 @@ function loadPasses() { }); } +function getSatelliteInfo(element) { + var satname = $(element).closest('td').contents().first().text().trim(); + $.ajax({ + url: base_url + 'index.php/satellite/getSatelliteInfo', + type: 'post', + data: {'sat': satname, + }, + success: function (html) { + BootstrapDialog.show({ + title: 'Satellite information', + size: BootstrapDialog.SIZE_WIDE, + cssClass: 'information-dialog', + nl2br: false, + message: html, + buttons: [{ + label: lang_admin_close, + action: function (dialogItself) { + dialogItself.close(); + } + }] + }); + }, + error: function(e) { + + } + }); +} + function loadSkedPasses() { $.ajax({ url: base_url + 'index.php/satellite/searchSkedPasses',