mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
@@ -431,6 +431,9 @@ class Satellite extends CI_Controller {
|
||||
|
||||
$filtered=[];
|
||||
foreach ($sat_tles as $sat_tle) {
|
||||
if ($sat_tle->tle == null) {
|
||||
continue;
|
||||
}
|
||||
try {
|
||||
$temp = preg_split('/\n/', $sat_tle->tle);
|
||||
|
||||
|
||||
@@ -100,7 +100,6 @@ class Curl {
|
||||
// Add the filepath
|
||||
$url .= $file_path;
|
||||
|
||||
$this->option(CURLOPT_BINARYTRANSFER, TRUE);
|
||||
$this->option(CURLOPT_VERBOSE, TRUE);
|
||||
|
||||
return $this->execute();
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
class Satellite_model extends CI_Model {
|
||||
|
||||
function get_all_satellites() {
|
||||
$sql = "select satellite.id, satellite.name as satname, group_concat(distinct satellitemode.name separator ', ') as modename, satellite.displayname, satellite.orbit, satellite.lotw as lotw, tle.updated
|
||||
$sql = "select satellite.id, satellite.name as satname, group_concat(distinct satellitemode.name separator ', ') as modename, satellite.displayname, satellite.orbit, satellite.lotw as lotw, tle.updated, tle.tle
|
||||
from satellite
|
||||
left outer join satellitemode on satellite.id = satellitemode.satelliteid
|
||||
left outer join tle on satellite.id = tle.satelliteid
|
||||
@@ -31,6 +31,7 @@ class Satellite_model extends CI_Model {
|
||||
$sql = "select satellite.id, satellite.name as satname, satellite.displayname as displayname, tle.tle
|
||||
from satellite
|
||||
join tle on satellite.id = tle.satelliteid
|
||||
where tle is not NULL
|
||||
order by satellite.name
|
||||
";
|
||||
|
||||
|
||||
@@ -370,6 +370,11 @@ class Update_model extends CI_Model {
|
||||
$starttime = $mtime;
|
||||
|
||||
$this->update_norad_ids();
|
||||
|
||||
// Clear all TLE so that reentered birds disappear from planner and path prediction
|
||||
$sql = "UPDATE `tle` SET `tle` = NULL WHERE 1;";
|
||||
$this->db->query($sql);
|
||||
|
||||
$url = 'https://www.amsat.org/tle/dailytle.txt';
|
||||
$curl = curl_init($url);
|
||||
|
||||
@@ -428,7 +433,6 @@ class Update_model extends CI_Model {
|
||||
curl_setopt($curl, CURLOPT_FAILONERROR, true);
|
||||
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
|
||||
curl_setopt($curl, CURLOPT_BINARYTRANSFER,true);
|
||||
curl_setopt($curl, CURLOPT_TIMEOUT, 10);
|
||||
|
||||
$response = curl_exec($curl);
|
||||
|
||||
@@ -97,7 +97,7 @@
|
||||
echo '</td>';
|
||||
?>
|
||||
<?php echo '<td style="text-align: center; vertical-align: middle;">';
|
||||
if ($sat->updated != null) {
|
||||
if ($sat->tle != null) {
|
||||
echo '<button class="btn btn-sm btn-success" onclick="editTle(' . $sat->id . ');" data-bs-toggle="tooltip" title="Last TLE updated was ' . date($custom_date_format . " H:i", strtotime($sat->updated)) . '">'.__("Yes").'</i></button>';
|
||||
} else {
|
||||
echo '<button class="btn btn-sm btn-danger" onclick="editTle(' . $sat->id . ');">'.__("No").'</button>';
|
||||
|
||||
Reference in New Issue
Block a user