Works now if QSLs are not waiting to be downloaded

这个提交包含在:
Corby Krick 2013-11-03 13:15:25 -06:00
父节点 0e348f4bb7
当前提交 e9fdc07b93
共有 2 个文件被更改,包括 63 次插入44 次删除

查看文件

@ -28,15 +28,20 @@ class eqsl extends CI_Controller {
$this->adif_parser->initialize(); $this->adif_parser->initialize();
$table = "<table>"; $records = $this->adif_parser->get_record();
if (count($records) > 0)
{
$table = "<table>";
$table .= "<tr>";
$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()) while($record = $this->adif_parser->get_record())
{ {
/*if(count($record) == 0)
{
break;
};
*/
$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']));
// The report from eQSL should only contain entries that have been confirmed via eQSL // The report from eQSL should only contain entries that have been confirmed via eQSL
@ -72,13 +77,14 @@ class eqsl extends CI_Controller {
$table .= "<td>QSO Record: ".$status."</td>"; $table .= "<td>QSO Record: ".$status."</td>";
$table .= "<td>eQSL Record: ".$eqsl_status."</td>"; $table .= "<td>eQSL Record: ".$eqsl_status."</td>";
$table .= "<tr>"; $table .= "<tr>";
}; }
$table .= "</table>"; $table .= "</table>";
$data['eqsl_results_table'] = $table;
//unlink($filepath); }
$data['eqsl_table'] = $table; unlink($filepath);
$data['page_title'] = "eQSL Import Information"; $data['page_title'] = "eQSL Import Information";
$this->load->view('layout/header', $data); $this->load->view('layout/header', $data);
@ -163,7 +169,7 @@ class eqsl extends CI_Controller {
} }
else else
{ {
if (stristr($result, "Your ADIF log file has been built")) if (stristr($input, "Your ADIF log file has been built"))
{ {
// Get all the links on the page and grab the URL for the ADI file. // Get all the links on the page and grab the URL for the ADI file.
$regexp = "<a\s[^>]*href=(\"??)([^\" >]*?)\\1[^>]*>(.*)<\/a>"; $regexp = "<a\s[^>]*href=(\"??)([^\" >]*?)\\1[^>]*>(.*)<\/a>";
@ -173,6 +179,7 @@ class eqsl extends CI_Controller {
// Look for the link that has the .adi file, and download it to $file // Look for the link that has the .adi file, and download it to $file
if (substr($match, -4, 4) == ".adi") if (substr($match, -4, 4) == ".adi")
{ {
file_put_contents($file, file_get_contents("http://eqsl.cc/qslcard/" . $match)); file_put_contents($file, file_get_contents("http://eqsl.cc/qslcard/" . $match));
ini_set('memory_limit', '-1'); ini_set('memory_limit', '-1');
$this->loadFromFile($file); $this->loadFromFile($file);

查看文件

@ -1,6 +1,18 @@
<div id="container"> <div id="container">
<h2><?php echo $page_title; ?></h2> <h2><?php echo $page_title; ?></h2>
<?php echo $eqsl_table; ?> <?php $this->load->view('layout/messages'); ?>
<?php
if (isset($eqsl_results_table))
{
echo "<p>The following QSOs have been received from eQSL.cc</p>";
echo $eqsl_results_table;
}
else
{
echo "<p>There are no QSO confirmations waiting for you at eQSL.cc</p>";
}
?>
</div> </div>