Merge branch 'dev' of https://github.com/magicbug/Cloudlog into dev
这个提交包含在:
		
						当前提交
						84511beba9
					
				
					共有  6 个文件被更改,包括 176 次插入 和 9 次删除
				
			
		| 
						 | 
					@ -115,6 +115,7 @@ class Logbookadvanced extends CI_Controller {
 | 
				
			||||||
			'sota' => xss_clean($this->input->post('sota')),
 | 
								'sota' => xss_clean($this->input->post('sota')),
 | 
				
			||||||
			'pota' => xss_clean($this->input->post('pota')),
 | 
								'pota' => xss_clean($this->input->post('pota')),
 | 
				
			||||||
			'wwff' => xss_clean($this->input->post('wwff')),
 | 
								'wwff' => xss_clean($this->input->post('wwff')),
 | 
				
			||||||
 | 
								'qslimages' => xss_clean($this->input->post('qslimages')),
 | 
				
			||||||
		);
 | 
							);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		$qsos = [];
 | 
							$qsos = [];
 | 
				
			||||||
| 
						 | 
					@ -225,4 +226,11 @@ class Logbookadvanced extends CI_Controller {
 | 
				
			||||||
	public function startAtLabel() {
 | 
						public function startAtLabel() {
 | 
				
			||||||
		$this->load->view('logbookadvanced/startatform');
 | 
							$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'];
 | 
							$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 = "
 | 
							$sql = "
 | 
				
			||||||
			SELECT *
 | 
								SELECT *
 | 
				
			||||||
			FROM " . $this->config->item('table_name') . " qsos
 | 
								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
 | 
								) x on qsos.COL_PRIMARY_KEY = x.qsoid
 | 
				
			||||||
			WHERE station_profile.user_id =  ?
 | 
								WHERE station_profile.user_id =  ?
 | 
				
			||||||
			$where
 | 
								$where
 | 
				
			||||||
 | 
								$where2
 | 
				
			||||||
			ORDER BY qsos.COL_TIME_ON desc, qsos.COL_PRIMARY_KEY desc
 | 
								ORDER BY qsos.COL_TIME_ON desc, qsos.COL_PRIMARY_KEY desc
 | 
				
			||||||
			LIMIT $limit
 | 
								LIMIT $limit
 | 
				
			||||||
		";
 | 
							";
 | 
				
			||||||
| 
						 | 
					@ -391,4 +404,19 @@ class Logbookadvanced_model extends CI_Model {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		return $modes;
 | 
							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>
 | 
									</datalist>
 | 
				
			||||||
				<input type="search" list="qslvia" name="qslviainput" class="custom-select custom-select-sm">
 | 
									<input type="search" list="qslvia" name="qslviainput" class="custom-select custom-select-sm">
 | 
				
			||||||
			</div>
 | 
								</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>
 | 
				
			||||||
	</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-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="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="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>
 | 
								<button type="button" class="btn btn-sm btn-danger mr-1" id="deleteQsos">Delete</button>
 | 
				
			||||||
		</div>
 | 
							</div>
 | 
				
			||||||
	</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">
 | 
					<div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel">
 | 
				
			||||||
 | 
					<?php if (count($qslimages) > 1) { ?>
 | 
				
			||||||
<ol class="carousel-indicators">
 | 
					<ol class="carousel-indicators">
 | 
				
			||||||
    <?php
 | 
					    <?php
 | 
				
			||||||
    $i = 0;
 | 
					    $i = 0;
 | 
				
			||||||
| 
						 | 
					@ -12,6 +13,7 @@
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    ?>
 | 
					    ?>
 | 
				
			||||||
</ol>
 | 
					</ol>
 | 
				
			||||||
 | 
					<?php } ?>
 | 
				
			||||||
<div class="carousel-inner">
 | 
					<div class="carousel-inner">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    <?php
 | 
					    <?php
 | 
				
			||||||
| 
						 | 
					@ -27,12 +29,14 @@
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    ?>
 | 
					    ?>
 | 
				
			||||||
</div>
 | 
					</div>
 | 
				
			||||||
<a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev">
 | 
					<?php if (count($qslimages) > 1) { ?>
 | 
				
			||||||
    <span class="carousel-control-prev-icon" aria-hidden="true"></span>
 | 
						<a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev">
 | 
				
			||||||
    <span class="sr-only">Previous</span>
 | 
							<span class="carousel-control-prev-icon" aria-hidden="true"></span>
 | 
				
			||||||
</a>
 | 
							<span class="sr-only">Previous</span>
 | 
				
			||||||
<a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next">
 | 
						</a>
 | 
				
			||||||
    <span class="carousel-control-next-icon" aria-hidden="true"></span>
 | 
						<a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next">
 | 
				
			||||||
    <span class="sr-only">Next</span>
 | 
							<span class="carousel-control-next-icon" aria-hidden="true"></span>
 | 
				
			||||||
</a>
 | 
							<span class="sr-only">Next</span>
 | 
				
			||||||
 | 
						</a>
 | 
				
			||||||
 | 
					<?php } ?>
 | 
				
			||||||
</div>
 | 
					</div>
 | 
				
			||||||
| 
						 | 
					@ -197,6 +197,7 @@ $(document).ready(function () {
 | 
				
			||||||
				sota: this.sota.value,
 | 
									sota: this.sota.value,
 | 
				
			||||||
				pota: this.pota.value,
 | 
									pota: this.pota.value,
 | 
				
			||||||
				wwff: this.wwff.value,
 | 
									wwff: this.wwff.value,
 | 
				
			||||||
 | 
									qslimages: this.qslimages.value,
 | 
				
			||||||
			},
 | 
								},
 | 
				
			||||||
			dataType: 'json',
 | 
								dataType: 'json',
 | 
				
			||||||
			success: function (data) {
 | 
								success: function (data) {
 | 
				
			||||||
| 
						 | 
					@ -411,6 +412,49 @@ $(document).ready(function () {
 | 
				
			||||||
		quickSearch('pota');
 | 
							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) {
 | 
						function quickSearch(type) {
 | 
				
			||||||
		var elements = $('#qsoList tbody input:checked');
 | 
							var elements = $('#qsoList tbody input:checked');
 | 
				
			||||||
		var nElements = elements.length;
 | 
							var nElements = elements.length;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		正在加载…
	
		在新工单中引用