new function and remove old function
这个提交包含在:
父节点
5886ce2dc8
当前提交
81f9013e62
共有 4 个文件被更改,包括 36 次插入 和 403 次删除
|
|
@ -140,103 +140,5 @@ class Dashboard extends CI_Controller {
|
|||
$this->load->view('components/radio_display_table', $data);
|
||||
}
|
||||
|
||||
function map() {
|
||||
$this->load->model('logbook_model');
|
||||
|
||||
$this->load->library('qra');
|
||||
|
||||
$qsos = $this->logbook_model->get_last_qsos('18');
|
||||
|
||||
echo "{\"markers\": [";
|
||||
$count = 1;
|
||||
foreach ($qsos->result() as $row) {
|
||||
// check if qso is confirmed //
|
||||
if (($row->COL_EQSL_QSL_RCVD=='Y') || ($row->COL_LOTW_QSL_RCVD=='Y') || ($row->COL_QSL_RCVD=='Y')) { $row->_is_confirmed = 'Y'; } else { $row->_is_confirmed = 'N'; }
|
||||
//print_r($row);
|
||||
if($row->COL_GRIDSQUARE != null) {
|
||||
$stn_loc = $this->qra->qra2latlong($row->COL_GRIDSQUARE);
|
||||
if($count != 1) {
|
||||
echo ",";
|
||||
}
|
||||
|
||||
if($row->COL_SAT_NAME != null) {
|
||||
echo "{\"lat\":\"".$stn_loc[0]."\",\"lng\":\"".$stn_loc[1]."\", \"html\":\"Callsign: ".$row->COL_CALL."<br />Date/Time: ".$row->COL_TIME_ON."<br />SAT: ".$row->COL_SAT_NAME."<br />Mode: ";
|
||||
echo $row->COL_SUBMODE==null?$row->COL_MODE:$row->COL_SUBMODE;
|
||||
echo "\",\"label\":\"".$row->COL_CALL."\", \"confirmed\":\"".$row->_is_confirmed."\"}";
|
||||
} else {
|
||||
echo "{\"lat\":\"".$stn_loc[0]."\",\"lng\":\"".$stn_loc[1]."\", \"html\":\"Callsign: ".$row->COL_CALL."<br />Date/Time: ".$row->COL_TIME_ON."<br />Band: ".$row->COL_BAND."<br />Mode: ";
|
||||
echo $row->COL_SUBMODE==null?$row->COL_MODE:$row->COL_SUBMODE;
|
||||
echo "\",\"label\":\"".$row->COL_CALL."\", \"confirmed\":\"".$row->_is_confirmed."\"}";
|
||||
}
|
||||
|
||||
$count++;
|
||||
}elseif($row->COL_VUCC_GRIDS != null) {
|
||||
|
||||
$grids = explode(",", $row->COL_VUCC_GRIDS);
|
||||
if (count($grids) == 2) {
|
||||
$grid1 = $this->qra->qra2latlong(trim($grids[0]));
|
||||
$grid2 = $this->qra->qra2latlong(trim($grids[1]));
|
||||
|
||||
$coords[]=array('lat' => $grid1[0],'lng'=> $grid1[1]);
|
||||
$coords[]=array('lat' => $grid2[0],'lng'=> $grid2[1]);
|
||||
|
||||
$stn_loc = $this->qra->get_midpoint($coords);
|
||||
}
|
||||
if (count($grids) == 4) {
|
||||
$grid1 = $this->qra->qra2latlong(trim($grids[0]));
|
||||
$grid2 = $this->qra->qra2latlong(trim($grids[1]));
|
||||
$grid3 = $this->qra->qra2latlong(trim($grids[2]));
|
||||
$grid4 = $this->qra->qra2latlong(trim($grids[3]));
|
||||
|
||||
$coords[]=array('lat' => $grid1[0],'lng'=> $grid1[1]);
|
||||
$coords[]=array('lat' => $grid2[0],'lng'=> $grid2[1]);
|
||||
$coords[]=array('lat' => $grid3[0],'lng'=> $grid3[1]);
|
||||
$coords[]=array('lat' => $grid4[0],'lng'=> $grid4[1]);
|
||||
|
||||
$stn_loc = $this->qra->get_midpoint($coords);
|
||||
}
|
||||
|
||||
if($count != 1) {
|
||||
echo ",";
|
||||
}
|
||||
|
||||
if($row->COL_SAT_NAME != null) {
|
||||
echo "{\"lat\":\"".$stn_loc[0]."\",\"lng\":\"".$stn_loc[1]."\", \"html\":\"Callsign: ".$row->COL_CALL."<br />Date/Time: ".$row->COL_TIME_ON."<br />SAT: ".$row->COL_SAT_NAME."<br />Mode: ";
|
||||
echo $row->COL_SUBMODE==null?$row->COL_MODE:$row->COL_SUBMODE;
|
||||
echo "\",\"label\":\"".$row->COL_CALL."\", \"confirmed\":\"".$row->_is_confirmed."\"}";
|
||||
} else {
|
||||
echo "{\"lat\":\"".$stn_loc[0]."\",\"lng\":\"".$stn_loc[1]."\", \"html\":\"Callsign: ".$row->COL_CALL."<br />Date/Time: ".$row->COL_TIME_ON."<br />Band: ".$row->COL_BAND."<br />Mode: ";
|
||||
echo $row->COL_SUBMODE==null?$row->COL_MODE:$row->COL_SUBMODE;
|
||||
echo "\",\"label\":\"".$row->COL_CALL."\", \"confirmed\":\"".$row->_is_confirmed."\"}";
|
||||
}
|
||||
|
||||
$count++;
|
||||
} else {
|
||||
if($count != 1) {
|
||||
echo ",";
|
||||
}
|
||||
|
||||
if(isset($row->lat) && isset($row->long)) {
|
||||
$lat = $row->lat;
|
||||
$lng = $row->long;
|
||||
}
|
||||
echo "{\"lat\":\"".$lat."\",\"lng\":\"".$lng."\", \"html\":\"Callsign: ".$row->COL_CALL."<br />Date/Time: ".$row->COL_TIME_ON."<br />Band: ".$row->COL_BAND."<br />Mode: ";
|
||||
echo $row->COL_SUBMODE==null?$row->COL_MODE:$row->COL_SUBMODE;
|
||||
echo "\",\"label\":\"".$row->COL_CALL."\", \"confirmed\":\"".$row->_is_confirmed."\"}";
|
||||
$count++;
|
||||
}
|
||||
|
||||
}
|
||||
echo "]";
|
||||
|
||||
// [MAP Custom] ADD Station //
|
||||
$this->load->model('Stations');
|
||||
$station_json = $this->Stations->get_station_json_for_map();
|
||||
echo (!empty($station_json))?', '.$station_json:'';
|
||||
|
||||
echo "}";
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -594,109 +594,6 @@ class Logbook extends CI_Controller {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/* Used to generate maps for displaying on /logbook/ */
|
||||
function qso_map() {
|
||||
header('Content-Type: application/json; charset=utf-8');
|
||||
$this->load->model('logbook_model');
|
||||
|
||||
$this->load->library('qra');
|
||||
|
||||
$data['qsos'] = $this->logbook_model->get_qsos($this->uri->segment(3),$this->uri->segment(4));
|
||||
|
||||
echo "{\"markers\": [";
|
||||
$count = 1;
|
||||
foreach ($data['qsos']->result() as $row) {
|
||||
// check if qso is confirmed //
|
||||
if (($row->COL_EQSL_QSL_RCVD=='Y') || ($row->COL_LOTW_QSL_RCVD=='Y') || ($row->COL_QSL_RCVD=='Y')) { $row->_is_confirmed = 'Y'; } else { $row->_is_confirmed = 'N'; }
|
||||
|
||||
if($row->COL_GRIDSQUARE != null) {
|
||||
$stn_loc = $this->qra->qra2latlong($row->COL_GRIDSQUARE);
|
||||
if($count != 1) {
|
||||
echo ",";
|
||||
}
|
||||
|
||||
if($row->COL_SAT_NAME != null) {
|
||||
echo "{\"lat\":\"".$stn_loc[0]."\",\"lng\":\"".$stn_loc[1]."\", \"html\":\"Callsign: ".$row->COL_CALL."<br />Date/Time: ".$row->COL_TIME_ON."<br />SAT: ".$row->COL_SAT_NAME."<br />Mode: ";
|
||||
echo $row->COL_SUBMODE==null?$row->COL_MODE:$row->COL_SUBMODE;
|
||||
echo "\",\"label\":\"".$row->COL_CALL."\", \"confirmed\":\"".$row->_is_confirmed."\"}";
|
||||
} else {
|
||||
echo "{\"lat\":\"".$stn_loc[0]."\",\"lng\":\"".$stn_loc[1]."\", \"html\":\"Callsign: ".$row->COL_CALL."<br />Date/Time: ".$row->COL_TIME_ON."<br />Band: ".$row->COL_BAND."<br />Mode: ";
|
||||
echo $row->COL_SUBMODE==null?$row->COL_MODE:$row->COL_SUBMODE;
|
||||
echo "\",\"label\":\"".$row->COL_CALL."\", \"confirmed\":\"".$row->_is_confirmed."\"}";
|
||||
}
|
||||
|
||||
$count++;
|
||||
}elseif($row->COL_VUCC_GRIDS != null) {
|
||||
|
||||
$grids = explode(",", $row->COL_VUCC_GRIDS);
|
||||
if (count($grids) == 2) {
|
||||
$grid1 = $this->qra->qra2latlong(trim($grids[0]));
|
||||
$grid2 = $this->qra->qra2latlong(trim($grids[1]));
|
||||
|
||||
$coords[]=array('lat' => $grid1[0],'lng'=> $grid1[1]);
|
||||
$coords[]=array('lat' => $grid2[0],'lng'=> $grid2[1]);
|
||||
|
||||
$stn_loc = $this->qra->get_midpoint($coords);
|
||||
}
|
||||
if (count($grids) == 4) {
|
||||
$grid1 = $this->qra->qra2latlong(trim($grids[0]));
|
||||
$grid2 = $this->qra->qra2latlong(trim($grids[1]));
|
||||
$grid3 = $this->qra->qra2latlong(trim($grids[2]));
|
||||
$grid4 = $this->qra->qra2latlong(trim($grids[3]));
|
||||
|
||||
$coords[]=array('lat' => $grid1[0],'lng'=> $grid1[1]);
|
||||
$coords[]=array('lat' => $grid2[0],'lng'=> $grid2[1]);
|
||||
$coords[]=array('lat' => $grid3[0],'lng'=> $grid3[1]);
|
||||
$coords[]=array('lat' => $grid4[0],'lng'=> $grid4[1]);
|
||||
|
||||
$stn_loc = $this->qra->get_midpoint($coords);
|
||||
}
|
||||
|
||||
if($count != 1) {
|
||||
echo ",";
|
||||
}
|
||||
|
||||
if($row->COL_SAT_NAME != null) {
|
||||
echo "{\"lat\":\"".$stn_loc[0]."\",\"lng\":\"".$stn_loc[1]."\", \"html\":\"Callsign: ".$row->COL_CALL."<br />Date/Time: ".$row->COL_TIME_ON."<br />SAT: ".$row->COL_SAT_NAME."<br />Mode: ";
|
||||
echo $row->COL_SUBMODE==null?$row->COL_MODE:$row->COL_SUBMODE;
|
||||
echo "\",\"label\":\"".$row->COL_CALL."\", \"confirmed\":\"".$row->_is_confirmed."\"}";
|
||||
} else {
|
||||
echo "{\"lat\":\"".$stn_loc[0]."\",\"lng\":\"".$stn_loc[1]."\", \"html\":\"Callsign: ".$row->COL_CALL."<br />Date/Time: ".$row->COL_TIME_ON."<br />Band: ".$row->COL_BAND."<br />Mode: ";
|
||||
echo $row->COL_SUBMODE==null?$row->COL_MODE:$row->COL_SUBMODE;
|
||||
echo "\",\"label\":\"".$row->COL_CALL."\", \"confirmed\":\"".$row->_is_confirmed."\"}";
|
||||
}
|
||||
|
||||
$count++;
|
||||
|
||||
} else {
|
||||
if($count != 1) {
|
||||
echo ",";
|
||||
}
|
||||
|
||||
$result = $this->logbook_model->dxcc_lookup($row->COL_CALL, $row->COL_TIME_ON);
|
||||
|
||||
if(isset($result)) {
|
||||
$lat = $result['lat'];
|
||||
$lng = $result['long'];
|
||||
}
|
||||
echo "{\"lat\":\"".$lat."\",\"lng\":\"".$lng."\", \"html\":\"Callsign: ".$row->COL_CALL."<br />Date/Time: ".$row->COL_TIME_ON."<br />Band: ".$row->COL_BAND."<br />Mode: ";
|
||||
echo $row->COL_SUBMODE==null?$row->COL_MODE:$row->COL_SUBMODE;
|
||||
echo "\",\"label\":\"".$row->COL_CALL."\", \"confirmed\":\"".$row->_is_confirmed."\"}";
|
||||
$count++;
|
||||
}
|
||||
|
||||
}
|
||||
echo "]";
|
||||
|
||||
// [MAP Custom] ADD Station //
|
||||
$this->load->model('Stations');
|
||||
$station_json = $this->Stations->get_station_json_for_map();
|
||||
echo (!empty($station_json))?', '.$station_json:'';
|
||||
|
||||
echo "}";
|
||||
}
|
||||
|
||||
function view($id) {
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize($this->config->item('auth_mode'))) { return; }
|
||||
|
|
|
|||
|
|
@ -98,202 +98,33 @@ class Map extends CI_Controller {
|
|||
$this->load->view('interface_assets/footer',$footer_data);
|
||||
}
|
||||
|
||||
|
||||
function map_data_custom() {
|
||||
$start_date = $this->uri->segment(3);
|
||||
$end_date = $this->uri->segment(4);
|
||||
$band = $this->uri->segment(5);
|
||||
$mode = $this->uri->segment(6);
|
||||
$propagation = $this->uri->segment(7);
|
||||
// Generic fonction for return Json for MAP //
|
||||
function map_plot_json() {
|
||||
$this->load->model('Stations');
|
||||
$this->load->model('logbook_model');
|
||||
|
||||
$this->load->library('qra');
|
||||
|
||||
$qsos = $this->logbook_model->map_custom_qsos(rawurldecode($start_date), rawurldecode($end_date), $band, rawurldecode($mode), rawurldecode($propagation));
|
||||
|
||||
// set informations //
|
||||
if ($this->input->post('isCustom') == true) {
|
||||
$date_from = $this->input->post('date_from');
|
||||
$date_to = $this->input->post('date_to');
|
||||
$band = $this->input->post('band');
|
||||
$mode = $this->input->post('mode');
|
||||
$prop_mode = $this->input->post('prop_mode');
|
||||
$qsos = $this->logbook_model->map_custom_qsos($date_from, $date_to, $band, $mode, $prop_mode);
|
||||
} else if ($this->input->post('isFull') == true) {
|
||||
$qsos = $this->logbook_model->get_qsos(100000,0); // limited at 100000 (perhaps is too big for list of plot on map ?) //
|
||||
} else {
|
||||
$nb_qso = (intval($this->input->post('nb_qso'))>0)?$this->input->post('nb_qso'):25;
|
||||
$offset = (intval($this->input->post('offset'))>0)?$this->input->post('offset'):0;
|
||||
$qsos = $this->logbook_model->get_qsos($nb_qso, $offset);
|
||||
}
|
||||
// [PLOT] ADD plot //
|
||||
$plot_array = $this->logbook_model->get_plot_array_for_map($qsos->result());
|
||||
// [MAP Custom] ADD Station //
|
||||
$station_array = $this->Stations->get_station_array_for_map();
|
||||
|
||||
header('Content-Type: application/json; charset=utf-8');
|
||||
echo "{\"markers\": [";
|
||||
$count = 1;
|
||||
if ($qsos) {
|
||||
foreach ($qsos->result() as $row) {
|
||||
// check if qso is confirmed //
|
||||
if (($row->COL_EQSL_QSL_RCVD=='Y') || ($row->COL_LOTW_QSL_RCVD=='Y') || ($row->COL_QSL_RCVD=='Y')) { $row->_is_confirmed = 'Y'; } else { $row->_is_confirmed = 'N'; }
|
||||
|
||||
//print_r($row);
|
||||
if($row->COL_GRIDSQUARE != null) {
|
||||
$stn_loc = $this->qra->qra2latlong($row->COL_GRIDSQUARE);
|
||||
if($count != 1) {
|
||||
echo ",";
|
||||
}
|
||||
|
||||
if($row->COL_SAT_NAME != null) {
|
||||
echo "{\"lat\":\"".$stn_loc[0]."\",\"lng\":\"".$stn_loc[1]."\", \"html\":\"Callsign: ".$row->COL_CALL."<br />Date/Time: ".$row->COL_TIME_ON."<br />SAT: ".$row->COL_SAT_NAME."<br />Mode: ".$row->COL_MODE."\",\"label\":\"".$row->COL_CALL."\", \"confirmed\":\"".$row->_is_confirmed."\"}";
|
||||
} else {
|
||||
echo "{\"lat\":\"".$stn_loc[0]."\",\"lng\":\"".$stn_loc[1]."\", \"html\":\"Callsign: ".$row->COL_CALL."<br />Date/Time: ".$row->COL_TIME_ON."<br />Band: ".$row->COL_BAND."<br />Mode: ".$row->COL_MODE."\",\"label\":\"".$row->COL_CALL."\", \"confirmed\":\"".$row->_is_confirmed."\"}";
|
||||
}
|
||||
|
||||
$count++;
|
||||
}elseif($row->COL_VUCC_GRIDS != null) {
|
||||
|
||||
$grids = explode(",", $row->COL_VUCC_GRIDS);
|
||||
if (count($grids) == 2) {
|
||||
$grid1 = $this->qra->qra2latlong(trim($grids[0]));
|
||||
$grid2 = $this->qra->qra2latlong(trim($grids[1]));
|
||||
|
||||
$coords[]=array('lat' => $grid1[0],'lng'=> $grid1[1]);
|
||||
$coords[]=array('lat' => $grid2[0],'lng'=> $grid2[1]);
|
||||
|
||||
$stn_loc = $this->qra->get_midpoint($coords);
|
||||
}
|
||||
if (count($grids) == 4) {
|
||||
$grid1 = $this->qra->qra2latlong(trim($grids[0]));
|
||||
$grid2 = $this->qra->qra2latlong(trim($grids[1]));
|
||||
$grid3 = $this->qra->qra2latlong(trim($grids[2]));
|
||||
$grid4 = $this->qra->qra2latlong(trim($grids[3]));
|
||||
|
||||
$coords[]=array('lat' => $grid1[0],'lng'=> $grid1[1]);
|
||||
$coords[]=array('lat' => $grid2[0],'lng'=> $grid2[1]);
|
||||
$coords[]=array('lat' => $grid3[0],'lng'=> $grid3[1]);
|
||||
$coords[]=array('lat' => $grid4[0],'lng'=> $grid4[1]);
|
||||
|
||||
$stn_loc = $this->qra->get_midpoint($coords);
|
||||
}
|
||||
|
||||
if($count != 1) {
|
||||
echo ",";
|
||||
}
|
||||
|
||||
if($row->COL_SAT_NAME != null) {
|
||||
echo "{\"lat\":\"".$stn_loc[0]."\",\"lng\":\"".$stn_loc[1]."\", \"html\":\"Callsign: ".$row->COL_CALL."<br />Date/Time: ".$row->COL_TIME_ON."<br />SAT: ".$row->COL_SAT_NAME."<br />Mode: ".$row->COL_MODE."\",\"label\":\"".$row->COL_CALL."\", \"confirmed\":\"".$row->_is_confirmed."\"}";
|
||||
} else {
|
||||
echo "{\"lat\":\"".$stn_loc[0]."\",\"lng\":\"".$stn_loc[1]."\", \"html\":\"Callsign: ".$row->COL_CALL."<br />Date/Time: ".$row->COL_TIME_ON."<br />Band: ".$row->COL_BAND."<br />Mode: ".$row->COL_MODE."\",\"label\":\"".$row->COL_CALL."\", \"confirmed\":\"".$row->_is_confirmed."\"}";
|
||||
}
|
||||
|
||||
$count++;
|
||||
} else {
|
||||
if($count != 1) {
|
||||
echo ",";
|
||||
}
|
||||
|
||||
if(isset($row->lat) && isset($row->long)) {
|
||||
$lat = $row->lat;
|
||||
$lng = $row->long;
|
||||
}
|
||||
|
||||
echo "{\"lat\":\"".$lat."\",\"lng\":\"".$lng."\", \"html\":\"Callsign: ".$row->COL_CALL."<br />Date/Time: ".$row->COL_TIME_ON."<br />Band: ".$row->COL_BAND."<br />Mode: ".$row->COL_MODE."\",\"label\":\"".$row->COL_CALL."\", \"confirmed\":\"".$row->_is_confirmed."\"}";
|
||||
$count++;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
echo "]";
|
||||
|
||||
// [MAP Custom] ADD Station //
|
||||
$this->load->model('Stations');
|
||||
$station_json = $this->Stations->get_station_json_for_map();
|
||||
echo (!empty($station_json))?', '.$station_json:'';
|
||||
|
||||
echo "}";
|
||||
|
||||
echo json_encode(array_merge($plot_array, $station_array));
|
||||
}
|
||||
|
||||
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'));
|
||||
|
||||
$qsos = $this->logbook_model->map_all_qsos_for_active_station_profile();
|
||||
|
||||
echo "{\"markers\": [";
|
||||
$count = 1;
|
||||
foreach ($qsos->result() as $row) {
|
||||
// check if qso is confirmed //
|
||||
if (($row->COL_EQSL_QSL_RCVD=='Y') || ($row->COL_LOTW_QSL_RCVD=='Y') || ($row->COL_QSL_RCVD=='Y')) { $row->_is_confirmed = 'Y'; } else { $row->_is_confirmed = 'N'; }
|
||||
|
||||
//print_r($row);
|
||||
if($row->COL_GRIDSQUARE != null) {
|
||||
$stn_loc = $this->qra->qra2latlong($row->COL_GRIDSQUARE);
|
||||
if($count != 1) {
|
||||
echo ",";
|
||||
}
|
||||
|
||||
if($row->COL_SAT_NAME != null) {
|
||||
echo "{\"lat\":\"".$stn_loc[0]."\",\"lng\":\"".$stn_loc[1]."\", \"html\":\"Callsign: ".$row->COL_CALL."<br />Date/Time: ".$row->COL_TIME_ON."<br />SAT: ".$row->COL_SAT_NAME."<br />Mode: ".$row->COL_MODE."\",\"label\":\"".$row->COL_CALL."\", \"confirmed\":\"".$row->_is_confirmed."\"}";
|
||||
} else {
|
||||
echo "{\"lat\":\"".$stn_loc[0]."\",\"lng\":\"".$stn_loc[1]."\", \"html\":\"Callsign: ".$row->COL_CALL."<br />Date/Time: ".$row->COL_TIME_ON."<br />Band: ".$row->COL_BAND."<br />Mode: ".$row->COL_MODE."\",\"label\":\"".$row->COL_CALL."\", \"confirmed\":\"".$row->_is_confirmed."\"}";
|
||||
}
|
||||
|
||||
$count++;
|
||||
} elseif($row->COL_VUCC_GRIDS != null) {
|
||||
|
||||
$grids = explode(",", $row->COL_VUCC_GRIDS);
|
||||
if (count($grids) == 2) {
|
||||
$grid1 = $this->qra->qra2latlong(trim($grids[0]));
|
||||
$grid2 = $this->qra->qra2latlong(trim($grids[1]));
|
||||
|
||||
$coords[]=array('lat' => $grid1[0],'lng'=> $grid1[1]);
|
||||
$coords[]=array('lat' => $grid2[0],'lng'=> $grid2[1]);
|
||||
|
||||
$stn_loc = $this->qra->get_midpoint($coords);
|
||||
}
|
||||
if (count($grids) == 4) {
|
||||
$grid1 = $this->qra->qra2latlong(trim($grids[0]));
|
||||
$grid2 = $this->qra->qra2latlong(trim($grids[1]));
|
||||
$grid3 = $this->qra->qra2latlong(trim($grids[2]));
|
||||
$grid4 = $this->qra->qra2latlong(trim($grids[3]));
|
||||
|
||||
$coords[]=array('lat' => $grid1[0],'lng'=> $grid1[1]);
|
||||
$coords[]=array('lat' => $grid2[0],'lng'=> $grid2[1]);
|
||||
$coords[]=array('lat' => $grid3[0],'lng'=> $grid3[1]);
|
||||
$coords[]=array('lat' => $grid4[0],'lng'=> $grid4[1]);
|
||||
|
||||
$stn_loc = $this->qra->get_midpoint($coords);
|
||||
|
||||
}
|
||||
|
||||
if($count != 1) {
|
||||
echo ",";
|
||||
}
|
||||
|
||||
if($row->COL_SAT_NAME != null) {
|
||||
echo "{\"lat\":\"".$stn_loc[0]."\",\"lng\":\"".$stn_loc[1]."\", \"html\":\"Callsign: ".$row->COL_CALL."<br />Date/Time: ".$row->COL_TIME_ON."<br />SAT: ".$row->COL_SAT_NAME."<br />Mode: ".$row->COL_MODE."\",\"label\":\"".$row->COL_CALL."\", \"confirmed\":\"".$row->_is_confirmed."\"}";
|
||||
} else {
|
||||
echo "{\"lat\":\"".$stn_loc[0]."\",\"lng\":\"".$stn_loc[1]."\", \"html\":\"Callsign: ".$row->COL_CALL."<br />Date/Time: ".$row->COL_TIME_ON."<br />Band: ".$row->COL_BAND."<br />Mode: ".$row->COL_MODE."\",\"label\":\"".$row->COL_CALL."\", \"confirmed\":\"".$row->_is_confirmed."\"}";
|
||||
}
|
||||
|
||||
$count++;
|
||||
} else {
|
||||
$query = $this->db->query('
|
||||
SELECT *
|
||||
FROM dxcc_entities
|
||||
WHERE prefix = SUBSTRING( \''.$row->COL_CALL.'\', 1, LENGTH( prefix ) )
|
||||
ORDER BY LENGTH( prefix ) DESC
|
||||
LIMIT 1
|
||||
');
|
||||
|
||||
foreach ($query->result() as $dxcc) {
|
||||
if($count != 1) {
|
||||
echo ",";
|
||||
}
|
||||
echo "{\"lat\":\"".$dxcc->lat."\",\"lng\":\"".$dxcc->long."\", \"html\":\"Callsign: ".$row->COL_CALL."<br />Date/Time: ".$row->COL_TIME_ON."<br />Band: ".$row->COL_BAND."<br />Mode: ".$row->COL_MODE."\",\"label\":\"".$row->COL_CALL."\", \"confirmed\":\"".$row->_is_confirmed."\"}";
|
||||
$count++;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
echo "]";
|
||||
|
||||
// [MAP Custom] ADD Station //
|
||||
$this->load->model('Stations');
|
||||
$station_json = $this->Stations->get_station_json_for_map();
|
||||
echo (!empty($station_json))?', '.$station_json:'';
|
||||
|
||||
echo "}";
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -740,7 +740,7 @@ function showActivatorsMap(call, count, grids) {
|
|||
var q_lng = -32.695312;
|
||||
<?php } ?>
|
||||
|
||||
var qso_loc = '<?php echo site_url('map/map_data_custom/');?><?php echo rawurlencode($date_from); ?>/<?php echo rawurlencode($date_to); ?>/<?php echo rawurlencode($this->input->post('band')); ?>/<?php echo rawurlencode($this->input->post('mode')); ?>/<?php echo rawurlencode($this->input->post('prop_mode')); ?>';
|
||||
var qso_loc = '<?php echo site_url('map/map_plot_json/');?>';
|
||||
var q_zoom = 3;
|
||||
|
||||
$(document).ready(function(){
|
||||
|
|
@ -749,7 +749,10 @@ function showActivatorsMap(call, count, grids) {
|
|||
<?php } else { ?>
|
||||
var grid = "No";
|
||||
<?php } ?>
|
||||
initmap(grid, 'custommap');
|
||||
var customdata = {'dataPost':{'date_from':'<?php echo $date_from; ?>', 'date_to':'<?php echo $date_to; ?>',
|
||||
'band':'<?php echo $this->input->post('band'); ?>', 'mode':'<?php echo $this->input->post('mode'); ?>',
|
||||
'prop_mode':'<?php echo $this->input->post('prop_mode'); ?>', 'isCustom':true }}
|
||||
initmap(grid, 'custommap', customdata);
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -771,7 +774,7 @@ function showActivatorsMap(call, count, grids) {
|
|||
var q_lng = -32.695312;
|
||||
<?php } ?>
|
||||
|
||||
var qso_loc = '<?php echo site_url('map/map_data');?>';
|
||||
var qso_loc = '<?php echo site_url('map/map_plot_json');?>';
|
||||
var q_zoom = 2;
|
||||
|
||||
$(document).ready(function(){
|
||||
|
|
@ -780,7 +783,7 @@ function showActivatorsMap(call, count, grids) {
|
|||
<?php } else { ?>
|
||||
var grid = "No";
|
||||
<?php } ?>
|
||||
initmap(grid);
|
||||
initmap(grid,'map',{'dataPost':{'isFull':true}});
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -803,7 +806,7 @@ function showActivatorsMap(call, count, grids) {
|
|||
var q_lng = -32.695312;
|
||||
<?php } ?>
|
||||
|
||||
var qso_loc = '<?php echo site_url('dashboard/map');?>';
|
||||
var qso_loc = '<?php echo site_url('map/map_plot_json');?>';
|
||||
var q_zoom = 3;
|
||||
|
||||
$(document).ready(function(){
|
||||
|
|
@ -812,7 +815,7 @@ function showActivatorsMap(call, count, grids) {
|
|||
<?php } else { ?>
|
||||
var grid = "No";
|
||||
<?php } ?>
|
||||
initmap(grid);
|
||||
initmap(grid,'map',{'dataPost':{'nb_qso':'18'}});
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1002,7 +1005,7 @@ $(document).on('keypress',function(e) {
|
|||
var q_lng = -32.695312;
|
||||
<?php } ?>
|
||||
|
||||
var qso_loc = '<?php echo site_url('logbook/qso_map/25/'.$this->uri->segment(3)); ?>';
|
||||
var qso_loc = '<?php echo site_url('map/map_plot_json'); ?>';
|
||||
var q_zoom = 3;
|
||||
|
||||
<?php if ($this->config->item('map_gridsquares') != FALSE) { ?>
|
||||
|
|
@ -1010,7 +1013,7 @@ $(document).on('keypress',function(e) {
|
|||
<?php } else { ?>
|
||||
var grid = "No";
|
||||
<?php } ?>
|
||||
initmap(grid);
|
||||
initmap(grid,'map',{'dataPost':{'nb_qso':'25','offset':'<?php echo $this->uri->segment(3); ?>'}});
|
||||
|
||||
</script>
|
||||
<?php } ?>
|
||||
|
|
|
|||
正在加载…
在新工单中引用