[QSL Print Queue] Expanded the view with a table to see which QSOs are ready for print.
这个提交包含在:
父节点
9692adc75a
当前提交
cfd6253dfc
共有 3 个文件被更改,包括 100 次插入 和 40 次删除
|
|
@ -15,13 +15,19 @@ class QSLPrint extends CI_Controller {
|
|||
{
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize(99)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
|
||||
|
||||
$this->load->model('stations');
|
||||
$data['station_profile'] = $this->stations->all();
|
||||
|
||||
$this->load->model('qslprint_model');
|
||||
$data['qsos'] = $this->qslprint_model->get_qsos_for_print();
|
||||
|
||||
$data['page_title'] = "Print Requested QSLs";
|
||||
|
||||
$this->load->view('interface_assets/header', $data);
|
||||
$this->load->view('qslprint/index');
|
||||
$this->load->view('interface_assets/footer');
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function exportadif()
|
||||
|
|
@ -34,8 +40,8 @@ class QSLPrint extends CI_Controller {
|
|||
$data['qsos'] = $this->adif_data->export_printrequested();
|
||||
|
||||
$this->load->view('adif/data/exportall', $data);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function exportcsv()
|
||||
{
|
||||
// Set memory limit to unlimited to allow heavy usage
|
||||
|
|
@ -50,51 +56,51 @@ class QSLPrint extends CI_Controller {
|
|||
header("Content-Description: File Transfer");
|
||||
header("Content-Disposition: attachment; filename=$filename");
|
||||
header("Content-Type: application/csv;charset=iso-8859-1");
|
||||
|
||||
|
||||
// file creation
|
||||
$file = fopen('php://output', 'w');
|
||||
|
||||
|
||||
$header = array("STATION_CALLSIGN",
|
||||
"COL_CALL",
|
||||
"COL_QSL_VIA",
|
||||
"COL_TIME_ON",
|
||||
"COL_MODE",
|
||||
"COL_FREQ",
|
||||
"COL_BAND",
|
||||
"COL_RST_SENT",
|
||||
"COL_SAT_NAME",
|
||||
"COL_SAT_MODE",
|
||||
"COL_QSL_RCVD",
|
||||
"COL_CALL",
|
||||
"COL_QSL_VIA",
|
||||
"COL_TIME_ON",
|
||||
"COL_MODE",
|
||||
"COL_FREQ",
|
||||
"COL_BAND",
|
||||
"COL_RST_SENT",
|
||||
"COL_SAT_NAME",
|
||||
"COL_SAT_MODE",
|
||||
"COL_QSL_RCVD",
|
||||
"COL_COMMENT",
|
||||
"COL_ROUTING",
|
||||
"ADIF",
|
||||
"COL_ROUTING",
|
||||
"ADIF",
|
||||
"ENTITY");
|
||||
|
||||
fputcsv($file, $header);
|
||||
|
||||
|
||||
foreach ($myData->result() as $qso) {
|
||||
fputcsv($file,
|
||||
fputcsv($file,
|
||||
array($qso->STATION_CALLSIGN,
|
||||
str_replace("0", "Ø", $qso->COL_CALL),
|
||||
$qso->COL_QSL_VIA!=""?"Via ".str_replace("0", "Ø", $qso->COL_QSL_VIA):"",
|
||||
$qso->COL_TIME_ON,
|
||||
$qso->COL_MODE,
|
||||
$qso->COL_FREQ,
|
||||
$qso->COL_BAND,
|
||||
$qso->COL_RST_SENT,
|
||||
$qso->COL_SAT_NAME,
|
||||
$qso->COL_SAT_MODE,
|
||||
$qso->COL_QSL_RCVD =='Y'?'TNX QSL':'PSE QSL',
|
||||
$qso->COL_COMMENT,
|
||||
str_replace("0", "Ø", $qso->COL_CALL),
|
||||
$qso->COL_QSL_VIA!=""?"Via ".str_replace("0", "Ø", $qso->COL_QSL_VIA):"",
|
||||
$qso->COL_TIME_ON,
|
||||
$qso->COL_MODE,
|
||||
$qso->COL_FREQ,
|
||||
$qso->COL_BAND,
|
||||
$qso->COL_RST_SENT,
|
||||
$qso->COL_SAT_NAME,
|
||||
$qso->COL_SAT_MODE,
|
||||
$qso->COL_QSL_RCVD =='Y'?'TNX QSL':'PSE QSL',
|
||||
$qso->COL_COMMENT,
|
||||
$qso->COL_ROUTING,
|
||||
$qso->ADIF,
|
||||
$qso->ADIF,
|
||||
$qso->ENTITY));
|
||||
}
|
||||
|
||||
fclose($file);
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
function qsl_printed() {
|
||||
$this->load->model('qslprint_model');
|
||||
$this->load->model('user_model');
|
||||
|
|
@ -111,4 +117,4 @@ class QSLPrint extends CI_Controller {
|
|||
}
|
||||
|
||||
/* End of file Qslprint.php */
|
||||
/* Location: ./application/controllers/Qslprint.php */
|
||||
/* Location: ./application/controllers/Qslprint.php */
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ class Qslprint_model extends CI_Model {
|
|||
$CI =& get_instance();
|
||||
$CI->load->model('Stations');
|
||||
$station_id = $CI->Stations->find_active();
|
||||
|
||||
|
||||
$data = array(
|
||||
'COL_QSLSDATE' => date('Y-m-d'),
|
||||
'COL_QSL_SENT' => "Y",
|
||||
|
|
@ -22,6 +22,21 @@ class Qslprint_model extends CI_Model {
|
|||
$this->db->where("station_id", $station_id);
|
||||
$this->db->update($this->config->item('table_name'), $data);
|
||||
}
|
||||
|
||||
function get_qsos_for_print() {
|
||||
$CI =& get_instance();
|
||||
$CI->load->model('Stations');
|
||||
|
||||
$active_station_id = $this->stations->find_active();
|
||||
|
||||
$this->db->where($this->config->item('table_name').'.station_id', $active_station_id);
|
||||
$this->db->join('station_profile', 'station_profile.station_id = '.$this->config->item('table_name').'.station_id');
|
||||
$this->db->where_in('COL_QSL_SENT', array('R', 'Q'));
|
||||
$this->db->order_by("COL_TIME_ON", "ASC");
|
||||
$query = $this->db->get($this->config->item('table_name'));
|
||||
|
||||
return $query;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -16,15 +16,54 @@
|
|||
Export Requested QSLs for Printing
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<select name="station_profile" class="custom-select mb-2 mr-sm-2" style="width: 20%;">
|
||||
<option value="0">Select Station Profile</option>
|
||||
<?php foreach ($station_profile->result() as $station) { ?>
|
||||
<option value="<?php echo $station->station_id; ?>">Callsign: <?php echo $station->station_callsign; ?> (<?php echo $station->station_profile_name; ?>)</option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
|
||||
<p class="card-text">Here you can export requested QSLs as CSV or ADIF files for printing and, optionally, mark them as sent via bureau.</p>
|
||||
<p class="card-text">Requested QSLs are any QSOs with a value of "Requested" or "Queued" in their "QSL Sent" field.</p>
|
||||
<p class="card-text">Only QSOs under the active station profile will be exported.</p>
|
||||
|
||||
<p><a href="<?php echo site_url('qslprint/exportcsv'); ?>" title="Export CSV-file" target="_blank" class="btn btn-primary">Export requested QSLs to CSV-file</a></p>
|
||||
|
||||
<p><a href="<?php echo site_url('qslprint/exportadif'); ?>" title="Export ADIF" target="_blank" class="btn btn-primary">Export requested QSLs to ADIF-file</a></p>
|
||||
|
||||
<p><a href="<?php echo site_url('qslprint/qsl_printed'); ?>" title="Mark QSLs as printed" target="_blank" class="btn btn-primary">Mark requested QSLs as sent</a></p>
|
||||
<?php
|
||||
if (is_array($qsos->result())) {
|
||||
echo '<table style="width:100%" class="table table-sm table-bordered table-hover table-striped table-condensed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style=\'text-align: center\'>'.$this->lang->line('gen_hamradio_callsign').'</th>
|
||||
<th style=\'text-align: center\'>Date</th>
|
||||
<th style=\'text-align: center\'>Time</th>
|
||||
<th style=\'text-align: center\'>Mode</th>
|
||||
<th style=\'text-align: center\'>Band</th>
|
||||
<th style=\'text-align: center\'>Station</th>
|
||||
<th style=\'text-align: center\'></th>
|
||||
</tr>
|
||||
</thead><tbody>';
|
||||
|
||||
foreach ($qsos->result() as $qsl) {
|
||||
echo '<tr>';
|
||||
echo '<td style=\'text-align: center\'>' . $qsl->COL_CALL . '</td>';
|
||||
echo '<td style=\'text-align: center\'>' . $qsl->COL_TIME_ON . '</td>';
|
||||
echo '<td style=\'text-align: center\'>' . $qsl->COL_TIME_ON . '</td>';
|
||||
echo '<td style=\'text-align: center\'>'; if($qsl->COL_SAT_NAME != null) { echo $qsl->COL_SAT_NAME; } else { echo strtolower($qsl->COL_BAND); }; echo '</td>';
|
||||
echo '<td style=\'text-align: center\'>'; echo $qsl->COL_SUBMODE==null?$qsl->COL_MODE:$qsl->COL_SUBMODE; echo '</td>';
|
||||
echo '<td style=\'text-align: center\'><span class="badge badge-light">' . $qsl->station_callsign . '</span></td>';
|
||||
echo '<td id="'.$qsl->COL_PRIMARY_KEY.'" style=\'text-align: center\'><button onclick="deleteFromQslQueue(\''.$qsl->COL_PRIMARY_KEY.'\')" class="btn btn-sm btn-danger">Delete from queue</button></td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
echo '</tbody></table>';
|
||||
}
|
||||
?>
|
||||
|
||||
<p><a href="<?php echo site_url('qslprint/exportcsv'); ?>" title="Export CSV-file" target="_blank" class="btn btn-primary">Export requested QSLs to CSV-file</a></p>
|
||||
|
||||
<p><a href="<?php echo site_url('qslprint/exportadif'); ?>" title="Export ADIF" target="_blank" class="btn btn-primary">Export requested QSLs to ADIF-file</a></p>
|
||||
|
||||
<p><a href="<?php echo site_url('qslprint/qsl_printed'); ?>" title="Mark QSLs as printed" target="_blank" class="btn btn-primary">Mark requested QSLs as sent</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
正在加载…
在新工单中引用