mirror of
https://github.com/magicbug/Cloudlog
synced 2024-11-22 00:07:14 +00:00
[Dashboard] QSO Today Notice now updates every 30 seconds
This addresses #3116
This commit is contained in:
parent
1a3f4c90cb
commit
3ad075d3d6
@ -188,6 +188,23 @@ class Dashboard extends CI_Controller
|
||||
}
|
||||
}
|
||||
|
||||
public function todays_qso_component() {
|
||||
$this->load->model('user_model');
|
||||
|
||||
if ($this->user_model->validate_session() == 0) {
|
||||
// User is not logged in
|
||||
} else {
|
||||
$this->load->model('logbook_model');
|
||||
$this->load->model('logbooks_model');
|
||||
}
|
||||
|
||||
$logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
|
||||
|
||||
$data['todays_qsos'] = $this->logbook_model->todays_qsos($logbooks_locations_array);
|
||||
$this->load->view('components/dashboard_todays_qsos', $data);
|
||||
|
||||
}
|
||||
|
||||
public function logbook_display_component() {
|
||||
$this->load->model('user_model');
|
||||
|
||||
|
11
application/views/components/dashboard_todays_qsos.php
Normal file
11
application/views/components/dashboard_todays_qsos.php
Normal file
@ -0,0 +1,11 @@
|
||||
<div hx-get="<?php echo site_url('dashboard/todays_qso_component'); ?>" hx-trigger="every 30s">
|
||||
<?php if ($todays_qsos >= 1) { ?>
|
||||
<div class="alert alert-success" role="alert">
|
||||
<?php echo lang('dashboard_you_have_had'); ?> <strong><?php echo $todays_qsos; ?></strong> <?php echo $todays_qsos != 1 ? lang('dashboard_qsos_today') : str_replace('QSOs', 'QSO', lang('dashboard_qsos_today')); ?>
|
||||
</div>
|
||||
<?php } else { ?>
|
||||
<div class="alert alert-warning" role="alert">
|
||||
<span class="badge text-bg-info"><?php echo lang('general_word_important'); ?></span> <i class="fas fa-broadcast-tower"></i> <?php echo lang('notice_turn_the_radio_on'); ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
Loading…
Reference in New Issue
Block a user