diff --git a/application/controllers/Map.php b/application/controllers/Map.php
index 4abd750c9..82bf8acb9 100644
--- a/application/controllers/Map.php
+++ b/application/controllers/Map.php
@@ -13,7 +13,7 @@ class Map extends CI_Controller {
$qra_position = $this->qra->qra2latlong($this->session->userdata('user_locator'));
$data['qra'] = "set";
$data['qra_lat'] = $qra_position[0];
- $data['qra_lng'] = $qra_position[1];
+ $data['qra_lng'] = $qra_position[1];
} else {
$data['qra'] = "none";
}
@@ -35,10 +35,10 @@ class Map extends CI_Controller {
{
$this->load->model('dxcc');
- $this->load->model('modes');
+ //$this->load->model('modes');
$data['worked_bands'] = $this->dxcc->get_worked_bands(); // Used in the view for band select
- $data['modes'] = $this->modes->active(); // Used in the view for mode select
+ //$data['modes'] = $this->modes->active(); // Used in the view for mode select
if ($this->input->post('band') != NULL) { // Band is not set when page first loads.
if ($this->input->post('band') == 'All') { // Did the user specify a band? If not, use all bands
@@ -55,23 +55,23 @@ class Map extends CI_Controller {
$data['bands'] = $bands; // Used for displaying selected band(s) in the table in the view
// Calculate Lat/Lng from Locator to use on Maps
- if($this->session->userdata('user_locator')) {
+ /*if($this->session->userdata('user_locator')) {
$this->load->library('qra');
$qra_position = $this->qra->qra2latlong($this->session->userdata('user_locator'));
$data['qra'] = "set";
$data['qra_lat'] = $qra_position[0];
- $data['qra_lng'] = $qra_position[1];
+ $data['qra_lng'] = $qra_position[1];
} else {
$data['qra'] = "none";
- }
+ }*/
- $this->load->model('Stations');
+ /*$this->load->model('Stations');
$station_id = $this->Stations->find_active();
$station_data = $this->Stations->profile_clean($station_id);
// load the view
- $data['station_profile'] = $station_data;
+ $data['station_profile'] = $station_data;*/
$data['page_title'] = "Map QSOs";
@@ -105,7 +105,7 @@ class Map extends CI_Controller {
$end_date = $this->uri->segment(4);
$band = $this->uri->segment(5);
$this->load->model('logbook_model');
-
+
$this->load->library('qra');
$qsos = $this->logbook_model->map_custom_qsos(rawurldecode($start_date), rawurldecode($end_date), $band);
@@ -120,7 +120,7 @@ class Map extends CI_Controller {
echo ",";
}
- if($row->COL_SAT_NAME != null) {
+ if($row->COL_SAT_NAME != null) {
echo "{\"lat\":\"".$stn_loc[0]."\",\"lng\":\"".$stn_loc[1]."\", \"html\":\"Callsign: ".$row->COL_CALL."
Date/Time: ".$row->COL_TIME_ON."
SAT: ".$row->COL_SAT_NAME."
Mode: ".$row->COL_MODE."\",\"label\":\"".$row->COL_CALL."\"}";
} else {
echo "{\"lat\":\"".$stn_loc[0]."\",\"lng\":\"".$stn_loc[1]."\", \"html\":\"Callsign: ".$row->COL_CALL."
Date/Time: ".$row->COL_TIME_ON."
Band: ".$row->COL_BAND."
Mode: ".$row->COL_MODE."\",\"label\":\"".$row->COL_CALL."\"}";
@@ -134,7 +134,7 @@ class Map extends CI_Controller {
FROM dxcc_entities
WHERE prefix = SUBSTRING( \''.$row->COL_CALL.'\', 1, LENGTH( prefix ) )
ORDER BY LENGTH( prefix ) DESC
- LIMIT 1
+ LIMIT 1
');
foreach ($query->result() as $dxcc) {
@@ -154,12 +154,12 @@ class Map extends CI_Controller {
function map_data() {
$this->load->model('logbook_model');
-
+
$this->load->library('qra');
//echo date('Y-m-d')
$raw = strtotime('Monday last week');
-
+
$mon = date('Y-m-d', $raw);
$sun = date('Y-m-d', strtotime('Monday next week'));
@@ -175,7 +175,7 @@ class Map extends CI_Controller {
echo ",";
}
- if($row->COL_SAT_NAME != null) {
+ if($row->COL_SAT_NAME != null) {
echo "{\"lat\":\"".$stn_loc[0]."\",\"lng\":\"".$stn_loc[1]."\", \"html\":\"Callsign: ".$row->COL_CALL."
Date/Time: ".$row->COL_TIME_ON."
SAT: ".$row->COL_SAT_NAME."
Mode: ".$row->COL_MODE."\",\"label\":\"".$row->COL_CALL."\"}";
} else {
echo "{\"lat\":\"".$stn_loc[0]."\",\"lng\":\"".$stn_loc[1]."\", \"html\":\"Callsign: ".$row->COL_CALL."
Date/Time: ".$row->COL_TIME_ON."
Band: ".$row->COL_BAND."
Mode: ".$row->COL_MODE."\",\"label\":\"".$row->COL_CALL."\"}";
@@ -189,7 +189,7 @@ class Map extends CI_Controller {
FROM dxcc_entities
WHERE prefix = SUBSTRING( \''.$row->COL_CALL.'\', 1, LENGTH( prefix ) )
ORDER BY LENGTH( prefix ) DESC
- LIMIT 1
+ LIMIT 1
');
foreach ($query->result() as $dxcc) {
@@ -206,4 +206,4 @@ class Map extends CI_Controller {
echo "}";
}
-}
\ No newline at end of file
+}
diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php
index 56b1d1608..e7d126c8d 100755
--- a/application/models/Logbook_model.php
+++ b/application/models/Logbook_model.php
@@ -1038,13 +1038,12 @@ class Logbook_model extends CI_Model {
/* used to return custom qsos requires start, end date plus a band */
function map_custom_qsos($start, $end, $band) {
- $CI =& get_instance();
- $CI->load->model('Stations');
- $station_id = $CI->Stations->find_active();
+ $CI =& get_instance();
+ $CI->load->model('logbooks_model');
+ $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
$this->db->where("COL_TIME_ON BETWEEN '".$start."' AND '".$end."'");
- $this->db->where("station_id", $station_id);
-
+ $this->db->where_in("station_id", $logbooks_locations_array);
if($band != "All" && $band != "SAT") {
$this->db->where("COL_BAND", $band);
diff --git a/application/views/map/custom_date.php b/application/views/map/custom_date.php
index e7e7f4e5d..bcc915a41 100644
--- a/application/views/map/custom_date.php
+++ b/application/views/map/custom_date.php
@@ -1,6 +1,6 @@