diff --git a/application/models/Cq.php b/application/models/Cq.php index 86c452a3..03915fa1 100644 --- a/application/models/Cq.php +++ b/application/models/Cq.php @@ -187,7 +187,14 @@ class CQ extends CI_Model{ if ($band == 'SAT') { $sql .= " and thcv.col_prop_mode ='" . $band . "'"; } else if ($band == 'All') { - $sql .= " and thcv.col_prop_mode !='SAT'"; + $this->load->model('bands'); + + $bandslots = $this->bands->get_worked_bands('cq'); + + $bandslots_list = "'".implode("','",$bandslots)."'"; + + $sql .= " and thcv.col_band in (" . $bandslots_list . ")" . + " and thcv.col_prop_mode !='SAT'"; } else { $sql .= " and thcv.col_prop_mode !='SAT'"; $sql .= " and thcv.col_band ='" . $band . "'"; @@ -210,7 +217,14 @@ class CQ extends CI_Model{ if ($band == 'SAT') { $sql .= " and thcv.col_prop_mode ='" . $band . "'"; } else if ($band == 'All') { - $sql .= " and thcv.col_prop_mode !='SAT'"; + $this->load->model('bands'); + + $bandslots = $this->bands->get_worked_bands('cq'); + + $bandslots_list = "'".implode("','",$bandslots)."'"; + + $sql .= " and thcv.col_band in (" . $bandslots_list . ")" . + " and thcv.col_prop_mode !='SAT'"; } else { $sql .= " and thcv.col_prop_mode !='SAT'"; $sql .= " and thcv.col_band ='" . $band . "'"; diff --git a/application/models/Dxcc.php b/application/models/Dxcc.php index 83263a02..c6d778ce 100644 --- a/application/models/Dxcc.php +++ b/application/models/Dxcc.php @@ -427,7 +427,14 @@ class DXCC extends CI_Model { if ($band == 'SAT') { $sql .= " and thcv.col_prop_mode ='" . $band . "'"; } else if ($band == 'All') { - $sql .= " and thcv.col_prop_mode !='SAT'"; + $this->load->model('bands'); + + $bandslots = $this->bands->get_worked_bands('dxcc'); + + $bandslots_list = "'".implode("','",$bandslots)."'"; + + $sql .= " and thcv.col_band in (" . $bandslots_list . ")" . + " and thcv.col_prop_mode !='SAT'"; } else { $sql .= " and thcv.col_prop_mode !='SAT'"; $sql .= " and thcv.col_band ='" . $band . "'"; @@ -458,7 +465,14 @@ class DXCC extends CI_Model { if ($band == 'SAT') { $sql .= " and thcv.col_prop_mode ='" . $band . "'"; } else if ($band == 'All') { - $sql .= " and thcv.col_prop_mode !='SAT'"; + $this->load->model('bands'); + + $bandslots = $this->bands->get_worked_bands('dxcc'); + + $bandslots_list = "'".implode("','",$bandslots)."'"; + + $sql .= " and thcv.col_band in (" . $bandslots_list . ")" . + " and thcv.col_prop_mode !='SAT'"; } else { $sql .= " and thcv.col_prop_mode !='SAT'"; $sql .= " and thcv.col_band ='" . $band . "'"; diff --git a/application/models/Iota.php b/application/models/Iota.php index 44998a0f..b578961f 100644 --- a/application/models/Iota.php +++ b/application/models/Iota.php @@ -325,7 +325,14 @@ class IOTA extends CI_Model { if ($band == 'SAT') { $sql .= " and thcv.col_prop_mode ='" . $band . "'"; } else if ($band == 'All') { - $sql .= " and thcv.col_prop_mode !='SAT'"; + $this->load->model('bands'); + + $bandslots = $this->bands->get_worked_bands('iota'); + + $bandslots_list = "'".implode("','",$bandslots)."'"; + + $sql .= " and thcv.col_band in (" . $bandslots_list . ")" . + " and thcv.col_prop_mode !='SAT'"; } else { $sql .= " and thcv.col_prop_mode !='SAT'"; $sql .= " and thcv.col_band ='" . $band . "'"; @@ -356,7 +363,14 @@ class IOTA extends CI_Model { if ($band == 'SAT') { $sql .= " and thcv.col_prop_mode ='" . $band . "'"; } else if ($band == 'All') { - $sql .= " and thcv.col_prop_mode !='SAT'"; + $this->load->model('bands'); + + $bandslots = $this->bands->get_worked_bands('iota'); + + $bandslots_list = "'".implode("','",$bandslots)."'"; + + $sql .= " and thcv.col_band in (" . $bandslots_list . ")" . + " and thcv.col_prop_mode !='SAT'"; } else { $sql .= " and thcv.col_prop_mode !='SAT'"; $sql .= " and thcv.col_band ='" . $band . "'"; diff --git a/application/models/Was.php b/application/models/Was.php index 05265eb2..fc3d9f28 100644 --- a/application/models/Was.php +++ b/application/models/Was.php @@ -117,7 +117,14 @@ class was extends CI_Model { if ($band == 'SAT') { $sql .= " and thcv.col_prop_mode ='" . $band . "'"; } else if ($band == 'All') { - $sql .= " and thcv.col_prop_mode !='SAT'"; + $this->load->model('bands'); + + $bandslots = $this->bands->get_worked_bands('was'); + + $bandslots_list = "'".implode("','",$bandslots)."'"; + + $sql .= " and thcv.col_band in (" . $bandslots_list . ")" . + " and thcv.col_prop_mode !='SAT'"; } else { $sql .= " and thcv.col_prop_mode !='SAT'"; $sql .= " and thcv.col_band ='" . $band . "'"; @@ -143,7 +150,14 @@ class was extends CI_Model { if ($band == 'SAT') { $sql .= " and thcv.col_prop_mode ='" . $band . "'"; } else if ($band == 'All') { - $sql .= " and thcv.col_prop_mode !='SAT'"; + $this->load->model('bands'); + + $bandslots = $this->bands->get_worked_bands('was'); + + $bandslots_list = "'".implode("','",$bandslots)."'"; + + $sql .= " and thcv.col_band in (" . $bandslots_list . ")" . + " and thcv.col_prop_mode !='SAT'"; } else { $sql .= " and thcv.col_prop_mode !='SAT'"; $sql .= " and thcv.col_band ='" . $band . "'"; @@ -247,6 +261,15 @@ class was extends CI_Model { $sql .= " and col_prop_mode !='SAT'"; $sql .= " and col_band ='" . $band . "'"; } + } else { + $this->load->model('bands'); + + $bandslots = $this->bands->get_worked_bands('was'); + + $bandslots_list = "'".implode("','",$bandslots)."'"; + + $sql .= " and col_band in (" . $bandslots_list . ")" . + " and col_prop_mode !='SAT'"; } return $sql; }