mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
create function qso_is_confirmed() with user options about qsl
This commit is contained in:
@@ -391,6 +391,7 @@ class Logbookadvanced extends CI_Controller {
|
||||
|
||||
public function calculate($qso, $locator1, $locator2, $measurement_base, $var_dist, $custom_date_format) {
|
||||
$this->load->library('Qra');
|
||||
$this->load->model('logbook_model');
|
||||
|
||||
$data['distance'] = $this->qra->distance($locator1, $locator2, $measurement_base) . $var_dist;
|
||||
$data['bearing'] = $this->qra->get_bearing($locator1, $locator2) . "º";
|
||||
@@ -412,14 +413,15 @@ class Logbookadvanced extends CI_Controller {
|
||||
$data['mycallsign'] = $qso['station_callsign'];
|
||||
$data['datetime'] = date($custom_date_format, strtotime($qso['COL_TIME_ON'])). date(' H:i',strtotime($qso['COL_TIME_ON']));
|
||||
$data['satname'] = $qso['COL_SAT_NAME'];
|
||||
$data['confirmed'] = ((($qso['COL_EQSL_QSL_RCVD'] == 'Y') || ($qso['COL_LOTW_QSL_RCVD'] == 'Y') || ($qso['COL_QSL_RCVD'] == 'Y') || ($qso['COL_QRZCOM_QSO_DOWNLOAD_STATUS'] == 'Y')) == true ? true : false);
|
||||
|
||||
$data['confirmed'] = ($this->logbook_model->qso_is_confirmed($qso)==true) ? true : false;
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function calculateCoordinates($qso, $lat, $long, $mygrid, $measurement_base, $var_dist, $custom_date_format) {
|
||||
$this->load->library('Qra');
|
||||
|
||||
$this->load->model('logbook_model');
|
||||
|
||||
$latlng1 = $this->qra->qra2latlong($mygrid);
|
||||
$latlng2[0] = $lat;
|
||||
$latlng2[1] = $long;
|
||||
@@ -437,7 +439,7 @@ class Logbookadvanced extends CI_Controller {
|
||||
$data['mycallsign'] = $qso['station_callsign'];
|
||||
$data['datetime'] = date($custom_date_format, strtotime($qso['COL_TIME_ON'])). date(' H:i',strtotime($qso['COL_TIME_ON']));
|
||||
$data['satname'] = $qso['COL_SAT_NAME'];
|
||||
$data['confirmed'] = ((($qso['COL_EQSL_QSL_RCVD'] == 'Y') || ($qso['COL_LOTW_QSL_RCVD'] == 'Y') || ($qso['COL_QSL_RCVD'] == 'Y') || ($qso['COL_QRZCOM_QSO_DOWNLOAD_STATUS'] == 'Y')) == true ? true : false);
|
||||
$data['confirmed'] = ($this->logbook_model->qso_is_confirmed($qso)==true) ? true : false;
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
@@ -4708,9 +4708,7 @@ function lotw_last_qsl_date($user_id) {
|
||||
|
||||
// check if qso is confirmed //
|
||||
if (!$isVisitor) {
|
||||
if (($row->COL_EQSL_QSL_RCVD=='Y') || ($row->COL_LOTW_QSL_RCVD=='Y') || ($row->COL_QSL_RCVD=='Y') || ($row->COL_QRZCOM_QSO_DOWNLOAD_STATUS=='Y')) {
|
||||
$plot['confirmed'] = "Y";
|
||||
}
|
||||
$plot['confirmed'] = ($this->qso_is_confirmed($row)==true)?"Y":"N";
|
||||
}
|
||||
// check lat / lng (depend info source) //
|
||||
if ($row->COL_GRIDSQUARE != null) {
|
||||
@@ -4758,6 +4756,29 @@ function lotw_last_qsl_date($user_id) {
|
||||
$this->db->where('adif', $dxcc);
|
||||
return $this->db->get('primary_subdivisions');
|
||||
}
|
||||
|
||||
// return if qso is confirmed (depend user option "qsl method") //
|
||||
public function qso_is_confirmed($qso) {
|
||||
$confirmed = false;
|
||||
$this->load->model('user_model');
|
||||
$user_default_confirmation = $this->session->userdata('user_default_confirmation');
|
||||
if (isset($user_default_confirmation)) {
|
||||
$qso = (array) $qso;
|
||||
if (strpos($user_default_confirmation, 'Q') !== false) { // QSL
|
||||
if ($qso['COL_QSL_RCVD']=='Y') { $confirmed = true; }
|
||||
}
|
||||
if (strpos($user_default_confirmation, 'L') !== false) { // LoTW
|
||||
if ($qso['COL_LOTW_QSL_RCVD']=='Y') { $confirmed = true; }
|
||||
}
|
||||
if (strpos($user_default_confirmation, 'E') !== false) { // eQsl
|
||||
if ($qso['COL_EQSL_QSL_RCVD']=='Y') { $confirmed = true; }
|
||||
}
|
||||
if (strpos($user_default_confirmation, 'Z') !== false) { // QRZ
|
||||
if ($qso['COL_QRZCOM_QSO_DOWNLOAD_STATUS']=='Y') { $confirmed = true; }
|
||||
}
|
||||
}
|
||||
return $confirmed;
|
||||
}
|
||||
}
|
||||
|
||||
function validateADIFDate($date, $format = 'Ymd')
|
||||
|
||||
Reference in New Issue
Block a user