Merge pull request #2401 from AndreasK79/logbook_advances_qsl_slideshow
Logbook advanced: QSL slideshow
这个提交包含在:
当前提交
843c5758ad
共有 6 个文件被更改,包括 176 次插入 和 9 次删除
|
|
@ -115,6 +115,7 @@ class Logbookadvanced extends CI_Controller {
|
|||
'sota' => xss_clean($this->input->post('sota')),
|
||||
'pota' => xss_clean($this->input->post('pota')),
|
||||
'wwff' => xss_clean($this->input->post('wwff')),
|
||||
'qslimages' => xss_clean($this->input->post('qslimages')),
|
||||
);
|
||||
|
||||
$qsos = [];
|
||||
|
|
@ -225,4 +226,11 @@ class Logbookadvanced extends CI_Controller {
|
|||
public function startAtLabel() {
|
||||
$this->load->view('logbookadvanced/startatform');
|
||||
}
|
||||
|
||||
public function qslSlideshow() {
|
||||
$cleanids = $this->security->xss_clean($this->input->post('ids'));
|
||||
$this->load->model('logbookadvanced_model');
|
||||
$data['qslimages'] = $this->logbookadvanced_model->getQslsForQsoIds($cleanids);
|
||||
$this->load->view('logbookadvanced/qslcarousel', $data);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -168,6 +168,18 @@ class Logbookadvanced_model extends CI_Model {
|
|||
|
||||
$limit = $searchCriteria['qsoresults'];
|
||||
|
||||
$where2 = '';
|
||||
|
||||
if ($searchCriteria['qslimages'] !== '') {
|
||||
if ($searchCriteria['qslimages'] == 'Y') {
|
||||
$where2 .= ' and x.qslcount > "0"';
|
||||
}
|
||||
if ($searchCriteria['qslimages'] == 'N') {
|
||||
$where2 .= ' and x.qslcount is null';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$sql = "
|
||||
SELECT *
|
||||
FROM " . $this->config->item('table_name') . " qsos
|
||||
|
|
@ -181,6 +193,7 @@ class Logbookadvanced_model extends CI_Model {
|
|||
) x on qsos.COL_PRIMARY_KEY = x.qsoid
|
||||
WHERE station_profile.user_id = ?
|
||||
$where
|
||||
$where2
|
||||
ORDER BY qsos.COL_TIME_ON desc, qsos.COL_PRIMARY_KEY desc
|
||||
LIMIT $limit
|
||||
";
|
||||
|
|
@ -391,4 +404,19 @@ class Logbookadvanced_model extends CI_Model {
|
|||
|
||||
return $modes;
|
||||
}
|
||||
|
||||
function getQslsForQsoIds($ids) {
|
||||
$CI =& get_instance();
|
||||
$CI->load->model('logbooks_model');
|
||||
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
|
||||
|
||||
$this->db->select('*');
|
||||
$this->db->from($this->config->item('table_name'));
|
||||
$this->db->join('qsl_images', 'qsl_images.qsoid = ' . $this->config->item('table_name') . '.col_primary_key');
|
||||
$this->db->where_in('qsoid', $ids);
|
||||
$this->db->where_in('station_id', $logbooks_locations_array);
|
||||
$this->db->order_by("id", "desc");
|
||||
|
||||
return $this->db->get()->result();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -247,6 +247,14 @@
|
|||
</datalist>
|
||||
<input type="search" list="qslvia" name="qslviainput" class="custom-select custom-select-sm">
|
||||
</div>
|
||||
<div class="form-group col-lg-2 col-md-2 col-sm-3 col-xl">
|
||||
<label for="qslimages">QSL Images</label>
|
||||
<select class="form-control form-control-sm" id="qslimages" name="qslimages">
|
||||
<option value="">-</option>
|
||||
<option value="Y">Yes</option>
|
||||
<option value="N">No</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
@ -266,6 +274,7 @@
|
|||
<button type="button" class="btn btn-sm btn-warning mr-1" id="receivedDirect">Received (direct)</button>
|
||||
<button type="button" class="btn btn-sm btn-info mr-1" id="exportAdif">Create ADIF</button>
|
||||
<button type="button" class="btn btn-sm btn-info mr-1" id="printLabel">Print Label</button>
|
||||
<button type="button" class="btn btn-sm btn-info mr-1" id="qslSlideshow">QSL Slideshow</button>
|
||||
<button type="button" class="btn btn-sm btn-danger mr-1" id="deleteQsos">Delete</button>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,74 @@
|
|||
<div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel">
|
||||
<?php if (count($qslimages) > 1) { ?>
|
||||
<ol class="carousel-indicators">
|
||||
<?php
|
||||
$i = 0;
|
||||
foreach ($qslimages as $image) {
|
||||
echo '<li data-target="#carouselExampleIndicators" data-slide-to="' . $i . '"';
|
||||
if ($i == 0) {
|
||||
echo 'class="active"';
|
||||
}
|
||||
$i++;
|
||||
echo '></li>';
|
||||
}
|
||||
?>
|
||||
</ol>
|
||||
<?php } ?>
|
||||
<div class="carousel-inner">
|
||||
|
||||
<?php
|
||||
$i = 1;
|
||||
foreach ($qslimages as $image) {
|
||||
echo '<div class="text-center carousel-item carouselimageid_' . $image->id;
|
||||
if ($i == 1) {
|
||||
echo ' active';
|
||||
}
|
||||
echo '">';?>
|
||||
<table style="width:100%" class="table-sm table table-bordered table-hover table-striped table-condensed text-center">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Callsign</th>
|
||||
<th>Date/Time</th>
|
||||
<th>Mode</th>
|
||||
<th>Band</th>
|
||||
<th>Name</th>
|
||||
<th>DXCC</th>
|
||||
<th>State</th>
|
||||
<th>CQ Zone</th>
|
||||
<th>IOTA</th>
|
||||
<th>Gridsquare</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
echo '<tr>';
|
||||
echo '<td>'.$image->COL_CALL.'</td>';
|
||||
echo '<td>'.$image->COL_TIME_ON.'</td>';
|
||||
echo '<td>'.$image->COL_MODE.'</td>';
|
||||
echo '<td>'.$image->COL_BAND.'</td>';
|
||||
echo '<td>'.$image->COL_NAME.'</td>';
|
||||
echo '<td>'.$image->COL_COUNTRY.'</td>';
|
||||
echo '<td>'.$image->COL_STATE.'</td>';
|
||||
echo '<td>'.$image->COL_CQZ.'</td>';
|
||||
echo '<td>'.$image->COL_IOTA.'</td>';
|
||||
echo '<td>'.$image->COL_GRIDSQUARE.'</td>';
|
||||
echo '</tr>';
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php echo '<img class="img-fluid w-qsl" src="' . base_url() . '/assets/qslcard/' . $image->filename .'" alt="QSL picture #'. $i++.'">';
|
||||
echo '</div>';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php if (count($qslimages) > 1) { ?>
|
||||
<a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev">
|
||||
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
|
||||
<span class="sr-only">Previous</span>
|
||||
</a>
|
||||
<a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next">
|
||||
<span class="carousel-control-next-icon" aria-hidden="true"></span>
|
||||
<span class="sr-only">Next</span>
|
||||
</a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
<div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel">
|
||||
<?php if (count($qslimages) > 1) { ?>
|
||||
<ol class="carousel-indicators">
|
||||
<?php
|
||||
$i = 0;
|
||||
|
|
@ -12,6 +13,7 @@
|
|||
}
|
||||
?>
|
||||
</ol>
|
||||
<?php } ?>
|
||||
<div class="carousel-inner">
|
||||
|
||||
<?php
|
||||
|
|
@ -27,6 +29,7 @@
|
|||
}
|
||||
?>
|
||||
</div>
|
||||
<?php if (count($qslimages) > 1) { ?>
|
||||
<a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev">
|
||||
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
|
||||
<span class="sr-only">Previous</span>
|
||||
|
|
@ -35,4 +38,5 @@
|
|||
<span class="carousel-control-next-icon" aria-hidden="true"></span>
|
||||
<span class="sr-only">Next</span>
|
||||
</a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
|
@ -197,6 +197,7 @@ $(document).ready(function () {
|
|||
sota: this.sota.value,
|
||||
pota: this.pota.value,
|
||||
wwff: this.wwff.value,
|
||||
qslimages: this.qslimages.value,
|
||||
},
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
|
|
@ -411,6 +412,49 @@ $(document).ready(function () {
|
|||
quickSearch('pota');
|
||||
});
|
||||
|
||||
$('#qslSlideshow').click(function (event) {
|
||||
var elements = $('#qsoList tbody input:checked');
|
||||
var nElements = elements.length;
|
||||
if (nElements == 0) {
|
||||
return;
|
||||
}
|
||||
$('#qslSlideshow').prop("disabled", true);
|
||||
var id_list=[];
|
||||
elements.each(function() {
|
||||
let id = $(this).first().closest('tr').data('qsoID')
|
||||
id_list.push(id);
|
||||
});
|
||||
$.ajax({
|
||||
url: base_url + 'index.php/logbookadvanced/qslSlideshow',
|
||||
type: 'post',
|
||||
data: {
|
||||
ids: id_list,
|
||||
},
|
||||
success: function (html) {
|
||||
BootstrapDialog.show({
|
||||
title: 'QSL Card',
|
||||
size: BootstrapDialog.SIZE_WIDE,
|
||||
cssClass: 'lookup-dialog',
|
||||
nl2br: false,
|
||||
message: html,
|
||||
onshown: function(dialog) {
|
||||
|
||||
},
|
||||
buttons: [{
|
||||
label: 'Close',
|
||||
action: function (dialogItself) {
|
||||
$('#qslSlideshow').prop("disabled", false);
|
||||
dialogItself.close();
|
||||
}
|
||||
}],
|
||||
onhide: function(dialogRef){
|
||||
$('#qslSlideshow').prop("disabled", false);
|
||||
},
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function quickSearch(type) {
|
||||
var elements = $('#qsoList tbody input:checked');
|
||||
var nElements = elements.length;
|
||||
|
|
|
|||
正在加载…
在新工单中引用