Show table of not yet downloaded QSLs

pull/2136/head
phl0 2023-05-10 22:14:29 +02:00
rodzic c317a63236
commit 9d77d199b4
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 48EA1E640798CA9A
3 zmienionych plików z 70 dodań i 12 usunięć

Wyświetl plik

@ -558,6 +558,7 @@ class eqsl extends CI_Controller {
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
$data['page_title'] = "eQSL Card Image Download";
$custom_date_format = $this->session->userdata('user_date_format');
$this->load->model('eqslmethods_model');
$rows = '';
@ -569,9 +570,10 @@ class eqsl extends CI_Controller {
// i.e. when operating /P it must be callsign/p
// the password, however, is always the same as the main account
$data['user_eqsl_name'] = $qsl['station_callsign'];
$adif = $this->generateAdif($qsl, $data);
//$adif = $this->generateAdif($qsl, $data);
$status = $this->uploadQso($adif, $qsl);
//$status = $this->uploadQso($adif, $qsl);
$status = "none";
$timestamp = strtotime($qsl['COL_TIME_ON']);
$rows .= "<td>".date($custom_date_format, $timestamp)."</td>";

Wyświetl plik

@ -81,21 +81,20 @@ class Eqslmethods_model extends CI_Model {
}
}
$this->db->select('station_profile.*, '.$this->config->item('table_name').'.COL_PRIMARY_KEY, '.$this->config->item('table_name').'.COL_TIME_ON, '.$this->config->item('table_name').'.COL_CALL, '.$this->config->item('table_name').'.COL_MODE, '.$this->config->item('table_name').'.COL_SUBMODE, '.$this->config->item('table_name').'.COL_BAND, '.$this->config->item('table_name').'.COL_COMMENT, '.$this->config->item('table_name').'.COL_RST_SENT, '.$this->config->item('table_name').'.COL_PROP_MODE, '.$this->config->item('table_name').'.COL_SAT_NAME, '.$this->config->item('table_name').'.COL_SAT_MODE, '.$this->config->item('table_name').'.COL_QSLMSG');
$this->db->select('station_profile.*, '.$this->config->item('table_name').'.COL_PRIMARY_KEY, '.$this->config->item('table_name').'.COL_TIME_ON, '.$this->config->item('table_name').'.COL_CALL, '.$this->config->item('table_name').'.COL_MODE, '.$this->config->item('table_name').'.COL_SUBMODE, '.$this->config->item('table_name').'.COL_BAND, '.$this->config->item('table_name').'.COL_COMMENT, '.$this->config->item('table_name').'.COL_RST_SENT, '.$this->config->item('table_name').'.COL_PROP_MODE, '.$this->config->item('table_name').'.COL_SAT_NAME, '.$this->config->item('table_name').'.COL_SAT_MODE, '.$this->config->item('table_name').'.COL_QSLMSG, eQSL_images.*');
$this->db->from('station_profile');
$this->db->join($this->config->item('table_name'),'station_profile.station_id = '.$this->config->item('table_name').'.station_id');
$this->db->where("coalesce(station_profile.eqslqthnickname, '') <> ''");
$this->db->join('eQSL_images','eQSL_images.qso_id = '.$this->config->item('table_name').'.COL_PRIMARY_KEY','left outer');
//$this->db->where("coalesce(station_profile.eqslqthnickname, '') <> ''");
$this->db->where($this->config->item('table_name').'.COL_CALL !=', '');
$this->db->group_start();
$this->db->where($this->config->item('table_name').'.COL_EQSL_QSL_SENT is null');
$this->db->or_where($this->config->item('table_name').'.COL_EQSL_QSL_SENT', '');
$this->db->or_where($this->config->item('table_name').'.COL_EQSL_QSL_SENT', 'R');
$this->db->or_where($this->config->item('table_name').'.COL_EQSL_QSL_SENT', 'Q');
$this->db->or_where($this->config->item('table_name').'.COL_EQSL_QSL_SENT', 'N');
$this->db->group_end();
$this->db->where($this->config->item('table_name').'.COL_EQSL_QSL_RCVD', 'Y');
$this->db->where('qso_id', NULL);
$this->db->where_in('station_profile.station_id', $logbooks_locations_array);
return $this->db->get();
$result = $this->db->get();
log_message('info','SQL: '.$this->db->last_query());
return $result;
//return $this->db->get();
}
// Mark the QSO as sent to eQSL

Wyświetl plik

@ -0,0 +1,57 @@
<div class="container eqsl">
<h2><?php echo $page_title; ?></h2>
<div class="card">
<div class="card-header">
<div class="card-title">eQSL Card Image Download</div>
<ul class="nav nav-tabs card-header-tabs">
<li class="nav-item">
<a class="nav-link" href="<?php echo site_url('eqsl/import');?>">Download QSOs</a>
</li>
<li class="nav-item">
<a class="nav-link" href="<?php echo site_url('eqsl/Export');?>">Upload QSOs</a>
</li>
<li class="nav-item">
<a class="nav-link" href="<?php echo site_url('eqsl/tools');?>">Tools</a>
</li>
<li class="nav-item">
<a class="nav-link active" href="<?php echo site_url('eqsl/download');?>">Download eQSL Images</a>
</li>
</ul>
</div>
<div class="card-body">
<?php $this->load->view('layout/messages'); ?>
<?php
if (isset($eqsl_table))
{
?>
<p>Below is a table of QSOs that have been confirmed on eQSL but QSL images have not been downloaded yet.</p>
<!--<p><span class="badge badge-info">Info</span> Please make sure the "eQSL QTH Nickname" field is set in your station profile and that the value matches the QTH Nickname you set within eQSL.</p>-->
<?php
echo $eqsl_table;
echo "<p>Clicking \"Upload QSOs\" will send QSO information to eQSL.cc.</p>";
echo form_open('eqsl/export');
echo "<input type=\"hidden\" name=\"eqslexport\" id=\"eqslexport\" value=\"export\" />";
echo "<input class=\"btn btn-primary\" type=\"submit\" value=\"Upload QSOs\" /></form>";
}
else
{
if (isset($eqsl_results_table))
{
echo "<p>The following QSOs were sent to eQSL.</p>";
echo $eqsl_results_table;
}
else
{
echo "<p>There are no QSOs whose eQSL card images have not yet been downloaded. Go log some more QSOs!</p>";
}
}
?>
</div>
</div>
</div>