THEME MODE - added themes warning if no mode

This commit is contained in:
HB9HIL
2024-01-16 01:44:50 +01:00
parent 9bc32e7269
commit 3a0264ce27
3 changed files with 18 additions and 3 deletions

View File

@@ -58,6 +58,8 @@ class Dashboard extends CI_Controller {
$data['current_active'] = $this->stations->find_active();
$data['themesWithoutMode'] = $this->setup_model->checkThemesWithoutMode();
$setup_required = false;
if($setup_required) {

View File

@@ -3,7 +3,7 @@
class Setup_model extends CI_Model {
function getCountryCount() {
$sql = 'select count(*) as count from dxcc_entities';
$sql = 'SELECT count(*) as count FROM dxcc_entities';
$query = $this->db->query($sql);
return $query->row()->count;
@@ -11,7 +11,7 @@ class Setup_model extends CI_Model {
function getLogbookCount() {
$userid = xss_clean($this->session->userdata('user_id'));
$sql = 'select count(*) as count from station_logbooks where user_id =' . $userid;
$sql = 'SELECT count(*) as count FROM station_logbooks WHERE user_id =' . $userid;
$query = $this->db->query($sql);
return $query->row()->count;
@@ -19,7 +19,14 @@ class Setup_model extends CI_Model {
function getLocationCount() {
$userid = xss_clean($this->session->userdata('user_id'));
$sql = 'select count(*) as count from station_profile where user_id =' . $userid;
$sql = 'SELECT count(*) as count FROM station_profile WHERE user_id =' . $userid;
$query = $this->db->query($sql);
return $query->row()->count;
}
function checkThemesWithoutMode() {
$sql = "SELECT COUNT(*) AS count FROM themes WHERE theme_mode IS NULL OR theme_mode = ''";
$query = $this->db->query($sql);
return $query->row()->count;

View File

@@ -93,6 +93,12 @@ function echoQrbCalcLink($mygrid, $grid, $vucc) {
</div>
<?php } ?>
<?php if($themesWithoutMode != 0) { ?>
<div class="alert alert-danger" role="alert">
You have themes without defined theme mode. Please ask the admin to edit the themes.
</div>
<?php } ?>
<?php if ($this->session->userdata('user_id')) { ?>
<?php
$current_date = date('Y-m-d H:i:s');