Results table headers now correctly only show when results are available. Also fixing issue where the first record downloaded from eqsl and lotw was not displayed in the results table. LoTW import now displays message if no results available.
这个提交包含在:
父节点
11c5d0d9c5
当前提交
efbc22e665
共有 3 个文件被更改,包括 89 次插入 和 100 次删除
|
|
@ -27,61 +27,59 @@ class eqsl extends CI_Controller {
|
|||
$this->adif_parser->load_from_file($filepath);
|
||||
|
||||
$this->adif_parser->initialize();
|
||||
|
||||
$records = $this->adif_parser->get_record();
|
||||
|
||||
if (count($records) > 0)
|
||||
$tableheaders = "<table>";
|
||||
$tableheaders .= "<tr class=\"titles\">";
|
||||
$tableheaders .= "<td>Date</td>";
|
||||
$tableheaders .= "<td>Call</td>";
|
||||
$tableheaders .= "<td>Mode</td>";
|
||||
$tableheaders .= "<td>Log Status</td>";
|
||||
$tableheaders .= "<td>eQSL Status</td>";
|
||||
$tableheaders .= "<tr>";
|
||||
$table = "";
|
||||
while ($record = $this->adif_parser->get_record())
|
||||
{
|
||||
$table = "<table>";
|
||||
$table .= "<tr class=\"titles\">";
|
||||
$table .= "<td>Date</td>";
|
||||
$table .= "<td>Call</td>";
|
||||
$table .= "<td>Mode</td>";
|
||||
$table .= "<td>Log Status</td>";
|
||||
$table .= "<td>eQSL Status</td>";
|
||||
$table .= "<tr>";
|
||||
while($record = $this->adif_parser->get_record())
|
||||
$time_on = date('Y-m-d', strtotime($record['qso_date'])) ." ".date('H:i', strtotime($record['time_on']));
|
||||
|
||||
// The report from eQSL should only contain entries that have been confirmed via eQSL
|
||||
// If there's a match for the QSO from the report in our log, it's confirmed via eQSL.
|
||||
|
||||
// If we have a positive match from LoTW, record it in the DB according to the user's preferences
|
||||
if ($record['qsl_sent'] == "Y")
|
||||
{
|
||||
$time_on = date('Y-m-d', strtotime($record['qso_date'])) ." ".date('H:i', strtotime($record['time_on']));
|
||||
|
||||
// The report from eQSL should only contain entries that have been confirmed via eQSL
|
||||
// If there's a match for the QSO from the report in our log, it's confirmed via eQSL.
|
||||
|
||||
// If we have a positive match from LoTW, record it in the DB according to the user's preferences
|
||||
if ($record['qsl_sent'] == "Y")
|
||||
$record['qsl_sent'] = $config['eqsl_rcvd_mark'];
|
||||
}
|
||||
|
||||
$status = $this->logbook_model->import_check($time_on, $record['call'], $record['band']);
|
||||
if ($status == "Found")
|
||||
{
|
||||
$dupe = $this->logbook_model->eqsl_dupe_check($time_on, $record['call'], $record['band'], $config['eqsl_rcvd_mark']);
|
||||
if ($dupe == false)
|
||||
{
|
||||
$record['qsl_sent'] = $config['eqsl_rcvd_mark'];
|
||||
}
|
||||
|
||||
$status = $this->logbook_model->import_check($time_on, $record['call'], $record['band']);
|
||||
if ($status == "Found")
|
||||
{
|
||||
$dupe = $this->logbook_model->eqsl_dupe_check($time_on, $record['call'], $record['band'], $config['eqsl_rcvd_mark']);
|
||||
if ($dupe == false)
|
||||
{
|
||||
$eqsl_status = $this->logbook_model->eqsl_update($time_on, $record['call'], $record['band'], $config['eqsl_rcvd_mark']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$eqsl_status = "Already received an eQSL for this QSO.";
|
||||
}
|
||||
$eqsl_status = $this->logbook_model->eqsl_update($time_on, $record['call'], $record['band'], $config['eqsl_rcvd_mark']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$eqsl_status = "QSO not found";
|
||||
$eqsl_status = "Already received an eQSL for this QSO.";
|
||||
}
|
||||
$table .= "<tr>";
|
||||
$table .= "<td>".$time_on."</td>";
|
||||
$table .= "<td>".$record['call']."</td>";
|
||||
$table .= "<td>".$record['mode']."</td>";
|
||||
$table .= "<td>QSO Record: ".$status."</td>";
|
||||
$table .= "<td>eQSL Record: ".$eqsl_status."</td>";
|
||||
$table .= "<tr>";
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$eqsl_status = "QSO not found";
|
||||
}
|
||||
$table .= "<tr>";
|
||||
$table .= "<td>".$time_on."</td>";
|
||||
$table .= "<td>".$record['call']."</td>";
|
||||
$table .= "<td>".$record['mode']."</td>";
|
||||
$table .= "<td>QSO Record: ".$status."</td>";
|
||||
$table .= "<td>eQSL Record: ".$eqsl_status."</td>";
|
||||
$table .= "<tr>";
|
||||
}
|
||||
if ($table != "")
|
||||
{
|
||||
$table .= "</table>";
|
||||
$data['eqsl_results_table_headers'] = $tableheaders;
|
||||
$data['eqsl_results_table'] = $table;
|
||||
|
||||
}
|
||||
|
||||
unlink($filepath);
|
||||
|
|
|
|||
|
|
@ -28,70 +28,60 @@ class Lotw extends CI_Controller {
|
|||
|
||||
$this->adif_parser->initialize();
|
||||
|
||||
$table = "<table>";
|
||||
$table .= "<tr class=\"titles\">";
|
||||
$table .= "<td>QSO Date</td>";
|
||||
$table .= "<td>Call</td>";
|
||||
$table .= "<td>Mode</td>";
|
||||
$table .= "<td>LoTW QSL Received</td>";
|
||||
$table .= "<td>Date LoTW Confirmed</td>";
|
||||
$table .= "<td>Log Status</td>";
|
||||
$table .= "<td>LoTW Status</td>";
|
||||
$table .= "<tr>";
|
||||
$tableheaders = "<table>";
|
||||
$tableheaders .= "<tr class=\"titles\">";
|
||||
$tableheaders .= "<td>QSO Date</td>";
|
||||
$tableheaders .= "<td>Call</td>";
|
||||
$tableheaders .= "<td>Mode</td>";
|
||||
$tableheaders .= "<td>LoTW QSL Received</td>";
|
||||
$tableheaders .= "<td>Date LoTW Confirmed</td>";
|
||||
$tableheaders .= "<td>Log Status</td>";
|
||||
$tableheaders .= "<td>LoTW Status</td>";
|
||||
$tableheaders .= "<tr>";
|
||||
|
||||
while($record = $this->adif_parser->get_record())
|
||||
{
|
||||
if(count($record) == 0)
|
||||
$table = "";
|
||||
while($record = $this->adif_parser->get_record())
|
||||
{
|
||||
break;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//echo date('Y-m-d', strtotime($record['qso_date']))."<br>";
|
||||
//echo date('H:m', strtotime($record['time_on']))."<br>";
|
||||
|
||||
//$this->logbook_model->import($record);
|
||||
|
||||
//echo $record["call"]."<br>";
|
||||
//print_r($record->);
|
||||
$time_on = date('Y-m-d', strtotime($record['qso_date'])) ." ".date('H:i', strtotime($record['time_on']));
|
||||
|
||||
$time_on = date('Y-m-d', strtotime($record['qso_date'])) ." ".date('H:i', strtotime($record['time_on']));
|
||||
|
||||
$qsl_date = date('Y-m-d', strtotime($record['qslrdate'])) ." ".date('H:i', strtotime($record['qslrdate']));
|
||||
$qsl_date = date('Y-m-d', strtotime($record['qslrdate'])) ." ".date('H:i', strtotime($record['qslrdate']));
|
||||
|
||||
if (isset($record['time_off'])) {
|
||||
$time_off = date('Y-m-d', strtotime($record['qso_date'])) ." ".date('H:i', strtotime($record['time_off']));
|
||||
} else {
|
||||
$time_off = date('Y-m-d', strtotime($record['qso_date'])) ." ".date('H:i', strtotime($record['time_on']));
|
||||
if (isset($record['time_off'])) {
|
||||
$time_off = date('Y-m-d', strtotime($record['qso_date'])) ." ".date('H:i', strtotime($record['time_off']));
|
||||
} else {
|
||||
$time_off = date('Y-m-d', strtotime($record['qso_date'])) ." ".date('H:i', strtotime($record['time_on']));
|
||||
}
|
||||
|
||||
// If we have a positive match from LoTW, record it in the DB according to the user's preferences
|
||||
if ($record['qsl_rcvd'] == "Y")
|
||||
{
|
||||
$record['qsl_rcvd'] = $config['lotw_rcvd_mark'];
|
||||
}
|
||||
|
||||
$status = $this->logbook_model->import_check($time_on, $record['call'], $record['band']);
|
||||
$lotw_status = $this->logbook_model->lotw_update($time_on, $record['call'], $record['band'], $qsl_date, $record['qsl_rcvd']);
|
||||
|
||||
$table .= "<tr>";
|
||||
$table .= "<td>".$time_on."</td>";
|
||||
$table .= "<td>".$record['call']."</td>";
|
||||
$table .= "<td>".$record['mode']."</td>";
|
||||
$table .= "<td>".$record['qsl_rcvd']."</td>";
|
||||
$table .= "<td>".$qsl_date."</td>";
|
||||
$table .= "<td>QSO Record: ".$status."</td>";
|
||||
$table .= "<td>LoTW Record: ".$lotw_status."</td>";
|
||||
$table .= "<tr>";
|
||||
}
|
||||
|
||||
// If we have a positive match from LoTW, record it in the DB according to the user's preferences
|
||||
if ($record['qsl_rcvd'] == "Y")
|
||||
if ($table != "")
|
||||
{
|
||||
$record['qsl_rcvd'] = $config['lotw_rcvd_mark'];
|
||||
}
|
||||
|
||||
$status = $this->logbook_model->import_check($time_on, $record['call'], $record['band']);
|
||||
$lotw_status = $this->logbook_model->lotw_update($time_on, $record['call'], $record['band'], $qsl_date, $record['qsl_rcvd']);
|
||||
|
||||
$table .= "<tr>";
|
||||
$table .= "<td>".$time_on."</td>";
|
||||
$table .= "<td>".$record['call']."</td>";
|
||||
$table .= "<td>".$record['mode']."</td>";
|
||||
$table .= "<td>".$record['qsl_rcvd']."</td>";
|
||||
$table .= "<td>".$qsl_date."</td>";
|
||||
$table .= "<td>QSO Record: ".$status."</td>";
|
||||
$table .= "<td>LoTW Record: ".$lotw_status."</td>";
|
||||
$table .= "<tr>";
|
||||
};
|
||||
|
||||
$table .= "</table>";
|
||||
|
||||
$table .= "</table>";
|
||||
$data['lotw_table_headers'] = $tableheaders;
|
||||
$data['lotw_table'] = $table;
|
||||
}
|
||||
|
||||
unlink($filepath);
|
||||
|
||||
$data['lotw_table'] = $table;
|
||||
|
||||
$data['page_title'] = "LoTW ADIF Information";
|
||||
$this->load->view('layout/header', $data);
|
||||
$this->load->view('lotw/analysis');
|
||||
|
|
|
|||
|
|
@ -4,9 +4,10 @@
|
|||
<?php $this->load->view('layout/messages'); ?>
|
||||
|
||||
<?php
|
||||
if (isset($eqsl_results_table))
|
||||
if (isset($eqsl_results_table_headers))
|
||||
{
|
||||
echo "<p>The following QSOs have been received from eQSL.cc</p>";
|
||||
echo "<p>The following QSLs have been received from eQSL.cc</p>";
|
||||
echo $eqsl_results_table_headers;
|
||||
echo $eqsl_results_table;
|
||||
}
|
||||
else
|
||||
|
|
|
|||
正在加载…
在新工单中引用