Handle empty results

This commit is contained in:
phl0
2024-12-12 14:13:35 +01:00
parent 4c598f95a3
commit 791c71496f
3 changed files with 10 additions and 7 deletions

View File

@@ -402,7 +402,6 @@ class Update extends CI_Controller {
$this->load->view('interface_assets/header', $data);
$this->load->view('lotw/satupdate', $bodyData);
$this->load->view('interface_assets/footer');
//echo $result;
}
function version_check() {

View File

@@ -380,7 +380,7 @@ class Update_model extends CI_Model {
$response = curl_exec($curl);
if (curl_errno($curl)) {
echo __('cURL error:').' '.curl_error($curl).' ('.curl_errno($curl).')';
log_message('error', __('cURL error:').' '.curl_error($curl).' ('.curl_errno($curl).')');
return;
}
curl_close($curl);

View File

@@ -2,12 +2,16 @@
<h2><?php echo $page_title; ?></h2>
<?php
print '<table class="table table-striped table-hover">';
print '<tr><th>'.__('Name').'</th><th>'.__('Display Name').'</th><th>'.__('Start Date').'</th><th>'.__('End Date').'</th><th>'.__('Status').'</th></tr>';
foreach ($satupdates as $sat) {
print('<tr><td>'.$sat['name'].'</td><td>'.$sat['displayname'].'</td><td>'.$sat['startDate'].'</td><td>'.$sat['endDate'].'</td><td>'.$sat['status'].'</td></tr>');
if ($satupdates) {
echo '<table class="table table-striped table-hover">';
echo '<tr><th>'.__('Name').'</th><th>'.__('Display Name').'</th><th>'.__('Start Date').'</th><th>'.__('End Date').'</th><th>'.__('Status').'</th></tr>';
foreach ($satupdates as $sat) {
echo('<tr><td>'.$sat['name'].'</td><td>'.$sat['displayname'].'</td><td>'.$sat['startDate'].'</td><td>'.$sat['endDate'].'</td><td>'.$sat['status'].'</td></tr>');
}
echo '</table>';
} else {
echo 'No updates found or file could not be parsed.';
}
print '</table>';
?>
</div>