mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 02:14:13 +00:00
Update TLE in case they are null
This commit is contained in:
@@ -82,13 +82,22 @@ class Satellite_model extends CI_Model {
|
||||
$tleline2 = trim($tlelines[1]);
|
||||
}
|
||||
|
||||
$data = array(
|
||||
'satelliteid' => $id,
|
||||
'tle' => $tleline1 . "\n" . $tleline2,
|
||||
);
|
||||
$this->db->insert('tle', $data);
|
||||
$insert_id = $this->db->insert_id();
|
||||
return $insert_id;
|
||||
$this->db->where('satelliteid', $id);
|
||||
if ($this->db->get('tle')->num_rows() > 0) {
|
||||
$data = array(
|
||||
'tle' => $tleline1 . "\n" . $tleline2,
|
||||
);
|
||||
$this->db->where('satelliteid', $id);
|
||||
$this->db->update('tle', $data);
|
||||
} else {
|
||||
$data = array(
|
||||
'satelliteid' => $id,
|
||||
'tle' => $tleline1 . "\n" . $tleline2,
|
||||
);
|
||||
$this->db->insert('tle', $data);
|
||||
$insert_id = $this->db->insert_id();
|
||||
return $insert_id;
|
||||
}
|
||||
}
|
||||
|
||||
function deleteSatMode($id) {
|
||||
|
||||
Reference in New Issue
Block a user