diff --git a/application/controllers/Eqsl.php b/application/controllers/Eqsl.php index 6a6f5b20..f64745b0 100644 --- a/application/controllers/Eqsl.php +++ b/application/controllers/Eqsl.php @@ -121,8 +121,7 @@ class eqsl extends CI_Controller { // perform an HTTP get on each one, and grab the status back $qslsnotsent = $this->eqslmethods_model->eqsl_not_yet_sent(); - $data['eqsl_table'] = $this->writeEqslNotSent($qslsnotsent->result_array(), $custom_date_format); - + $rows = ""; foreach ($qslsnotsent->result_array() as $qsl) { // eQSL username changes for linked account. @@ -132,7 +131,23 @@ class eqsl extends CI_Controller { $adif = $this->generateAdif($qsl, $data); $status = $this->uploadQso($adif); + + + $timestamp = strtotime($qsl['COL_TIME_ON']); + $rows .= "".date($custom_date_format, $timestamp).""; + $rows .= "".date('H:i', $timestamp).""; + $rows .= "".str_replace("0","Ø",$qsl['COL_CALL']).""; + $rows .= "".$qsl['COL_MODE'].""; + if(isset($qsl['COL_SUBMODE'])) { + $rows .= "".$qsl['COL_SUBMODE'].""; + } else { + $rows .= ""; + } + $rows .= "".$qsl['COL_BAND'].""; + $rows .= "".$status.""; } + $rows .= ""; + $data['eqsl_table'] = $this->generateResultTable($custom_date_format, $rows); } else { $qslsnotsent = $this->eqslmethods_model->eqsl_not_yet_sent(); if ($qslsnotsent->num_rows() > 0) { @@ -209,6 +224,24 @@ class eqsl extends CI_Controller { return $status; } + function generateResultTable($custom_date_format, $rows) { + $table = ''; + $table .= ""; + $table .= ""; + $table .= ""; + $table .= ""; + $table .= ""; + $table .= ""; + $table .= ""; + $table .= ""; + $table .= ""; + + $table .= $rows; + $table .= "
DateTimeCallModeSubmodeBandStatus
"; + + return $table; + } + // Build out the ADIF info string according to specs http://eqsl.cc/qslcard/ADIFContentSpecs.cfm function generateAdif($qsl, $data) { $COL_QSO_DATE = date('Ymd',strtotime($qsl['COL_TIME_ON']));