Merge pull request #2233 from AndreasK79/advanced_logbook_filters_lookups
[Advanced logbook] Added more filters and lookup
这个提交包含在:
		
						当前提交
						27643c662e
					
				
					共有  6 个文件被更改,包括 127 次插入 和 38 次删除
				
			
		|  | @ -106,6 +106,10 @@ class Logbookadvanced extends CI_Controller { | ||||||
| 			'state' => xss_clean($this->input->post('state')), | 			'state' => xss_clean($this->input->post('state')), | ||||||
| 			'qsoresults' => xss_clean($this->input->post('qsoresults')), | 			'qsoresults' => xss_clean($this->input->post('qsoresults')), | ||||||
| 			'sats' => xss_clean($this->input->post('sats')), | 			'sats' => xss_clean($this->input->post('sats')), | ||||||
|  | 			'lotwSent' => xss_clean($this->input->post('lotwSent')), | ||||||
|  | 			'lotwReceived' => xss_clean($this->input->post('lotwReceived')), | ||||||
|  | 			'eqslSent' => xss_clean($this->input->post('eqslSent')), | ||||||
|  | 			'eqslReceived' => xss_clean($this->input->post('eqslReceived')), | ||||||
| 		); | 		); | ||||||
| 
 | 
 | ||||||
| 		$qsos = []; | 		$qsos = []; | ||||||
|  |  | ||||||
|  | @ -56,6 +56,24 @@ class Logbookadvanced_model extends CI_Model { | ||||||
| 			$binding[] = $searchCriteria['qslReceived']; | 			$binding[] = $searchCriteria['qslReceived']; | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
|  | 		if ($searchCriteria['lotwSent'] !== '') { | ||||||
|  | 			$conditions[] = "COL_LOTW_QSL_SENT = ?"; | ||||||
|  | 			$binding[] = $searchCriteria['lotwSent']; | ||||||
|  | 		} | ||||||
|  | 		if ($searchCriteria['lotwReceived'] !== '') { | ||||||
|  | 			$conditions[] = "COL_LOTW_QSL_RCVD = ?"; | ||||||
|  | 			$binding[] = $searchCriteria['lotwReceived']; | ||||||
|  | 		} | ||||||
|  | 
 | ||||||
|  | 		if ($searchCriteria['eqslSent'] !== '') { | ||||||
|  | 			$conditions[] = "COL_EQSL_QSL_SENT = ?"; | ||||||
|  | 			$binding[] = $searchCriteria['eqslSent']; | ||||||
|  | 		} | ||||||
|  | 		if ($searchCriteria['eqslReceived'] !== '') { | ||||||
|  | 			$conditions[] = "COL_EQSL_QSL_RCVD = ?"; | ||||||
|  | 			$binding[] = $searchCriteria['eqslReceived']; | ||||||
|  | 		} | ||||||
|  | 
 | ||||||
|         if ($searchCriteria['iota'] !== '') { |         if ($searchCriteria['iota'] !== '') { | ||||||
| 			$conditions[] = "COL_IOTA = ?"; | 			$conditions[] = "COL_IOTA = ?"; | ||||||
| 			$binding[] = $searchCriteria['iota']; | 			$binding[] = $searchCriteria['iota']; | ||||||
|  |  | ||||||
|  | @ -144,6 +144,8 @@ | ||||||
| 						<option value="TR">Tropospheric ducting</option> | 						<option value="TR">Tropospheric ducting</option> | ||||||
| 				</select> | 				</select> | ||||||
| 			</div> | 			</div> | ||||||
|  | 		</div> | ||||||
|  | 		<div class="form-row"> | ||||||
| 		<div class="form-group col-lg-2 col-md-2 col-sm-3 col-xl"> | 		<div class="form-group col-lg-2 col-md-2 col-sm-3 col-xl"> | ||||||
| 				<label for="qslSent">QSL Sent</label> | 				<label for="qslSent">QSL Sent</label> | ||||||
| 				<select id="qslSent" name="qslSent" class="form-control form-control-sm"> | 				<select id="qslSent" name="qslSent" class="form-control form-control-sm"> | ||||||
|  | @ -166,7 +168,50 @@ | ||||||
| 					<option value="V">Verified</option> | 					<option value="V">Verified</option> | ||||||
| 				</select> | 				</select> | ||||||
| 			</div> | 			</div> | ||||||
| 
 | 			<div class="form-group col-lg-2 col-md-2 col-sm-3 col-xl"> | ||||||
|  | 				<label for="lotwSent">LoTW Sent</label> | ||||||
|  | 				<select id="lotwSent" name="lotwSent" class="form-control form-control-sm"> | ||||||
|  | 					<option value="">All</option> | ||||||
|  | 					<option value="Y">Yes</option> | ||||||
|  | 					<option value="N">No</option> | ||||||
|  | 					<option value="R">Requested</option> | ||||||
|  | 					<option value="Q">Queued</option> | ||||||
|  | 					<option value="I">Ignore/Invalid</option> | ||||||
|  | 				</select> | ||||||
|  | 			</div> | ||||||
|  | 			<div class="form-group col-lg-2 col-md-2 col-sm-3 col-xl"> | ||||||
|  | 				<label for="lotwReceived">LoTW Received</label> | ||||||
|  | 				<select id="lotwReceived" name="lotwReceived" class="form-control form-control-sm"> | ||||||
|  | 					<option value="">All</option> | ||||||
|  | 					<option value="Y">Yes</option> | ||||||
|  | 					<option value="N">No</option> | ||||||
|  | 					<option value="R">Requested</option> | ||||||
|  | 					<option value="I">Ignore/Invalid</option> | ||||||
|  | 					<option value="V">Verified</option> | ||||||
|  | 				</select> | ||||||
|  | 			</div> | ||||||
|  | 			<div class="form-group col-lg-2 col-md-2 col-sm-3 col-xl"> | ||||||
|  | 				<label for="eqslSent">eQSL Sent</label> | ||||||
|  | 				<select id="eqslSent" name="eqslSent" class="form-control form-control-sm"> | ||||||
|  | 					<option value="">All</option> | ||||||
|  | 					<option value="Y">Yes</option> | ||||||
|  | 					<option value="N">No</option> | ||||||
|  | 					<option value="R">Requested</option> | ||||||
|  | 					<option value="Q">Queued</option> | ||||||
|  | 					<option value="I">Ignore/Invalid</option> | ||||||
|  | 				</select> | ||||||
|  | 			</div> | ||||||
|  | 			<div class="form-group col-lg-2 col-md-2 col-sm-3 col-xl"> | ||||||
|  | 				<label for="eqslReceived">eQSL Received</label> | ||||||
|  | 				<select id="eqslReceived" name="eqslReceived" class="form-control form-control-sm"> | ||||||
|  | 					<option value="">All</option> | ||||||
|  | 					<option value="Y">Yes</option> | ||||||
|  | 					<option value="N">No</option> | ||||||
|  | 					<option value="R">Requested</option> | ||||||
|  | 					<option value="I">Ignore/Invalid</option> | ||||||
|  | 					<option value="V">Verified</option> | ||||||
|  | 				</select> | ||||||
|  | 			</div> | ||||||
| 		</div> | 		</div> | ||||||
| 	</div> | 	</div> | ||||||
| 	 | 	 | ||||||
|  |  | ||||||
|  | @ -370,7 +370,7 @@ function validateLocator(locator) { | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| // This displays the dialog with the form and it's where the resulttable is displayed
 | // This displays the dialog with the form and it's where the resulttable is displayed
 | ||||||
| function spawnLookupModal() { | function spawnLookupModal(searchphrase, searchtype) { | ||||||
| 	$.ajax({ | 	$.ajax({ | ||||||
| 		url: base_url + 'index.php/lookup', | 		url: base_url + 'index.php/lookup', | ||||||
| 		type: 'post', | 		type: 'post', | ||||||
|  | @ -384,6 +384,35 @@ function spawnLookupModal() { | ||||||
| 				onshown: function(dialog) { | 				onshown: function(dialog) { | ||||||
| 					$('#quicklookuptype').change(function(){ | 					$('#quicklookuptype').change(function(){ | ||||||
| 						var type = $('#quicklookuptype').val(); | 						var type = $('#quicklookuptype').val(); | ||||||
|  |                         changeLookupType(type); | ||||||
|  | 					}); | ||||||
|  |                     if (searchtype !== undefined) { | ||||||
|  |                         $('#quicklookuptype').val(searchtype); | ||||||
|  |                         if (searchtype == 'dxcc') { | ||||||
|  |                             $("#quicklookupdxcc").val(searchphrase); | ||||||
|  |                         } else if (searchtype == 'iota') { | ||||||
|  |                             $("#quicklookupiota").val(searchphrase); | ||||||
|  |                         } else if (searchtype == 'cq') { | ||||||
|  |                             $("#quicklookupcqz").val(searchphrase); | ||||||
|  |                         } else { | ||||||
|  |                             $("#quicklookuptext").val(searchphrase); | ||||||
|  |                         } | ||||||
|  |                         changeLookupType(searchtype); | ||||||
|  |                         getLookupResult(this.form); | ||||||
|  |                     } | ||||||
|  | 				}, | ||||||
|  | 				buttons: [{ | ||||||
|  | 					label: 'Close', | ||||||
|  | 					action: function (dialogItself) { | ||||||
|  | 						dialogItself.close(); | ||||||
|  | 					} | ||||||
|  | 				}] | ||||||
|  | 			}); | ||||||
|  | 		} | ||||||
|  | 	}); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | function changeLookupType(type) { | ||||||
|     if (type == "dxcc") { |     if (type == "dxcc") { | ||||||
|         $('#quicklookupdxcc').show(); |         $('#quicklookupdxcc').show(); | ||||||
|         $('#quicklookupiota').hide(); |         $('#quicklookupiota').hide(); | ||||||
|  | @ -415,17 +444,6 @@ function spawnLookupModal() { | ||||||
|         $('#quicklookupdxcc').hide(); |         $('#quicklookupdxcc').hide(); | ||||||
|         $('#quicklookuptext').hide(); |         $('#quicklookuptext').hide(); | ||||||
|     } |     } | ||||||
| 					}); |  | ||||||
| 				}, |  | ||||||
| 				buttons: [{ |  | ||||||
| 					label: 'Close', |  | ||||||
| 					action: function (dialogItself) { |  | ||||||
| 						dialogItself.close(); |  | ||||||
| 					} |  | ||||||
| 				}] |  | ||||||
| 			}); |  | ||||||
| 		} |  | ||||||
| 	}); |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| // This function executes the call to the backend for fetching queryresult and displays the table in the dialog
 | // This function executes the call to the backend for fetching queryresult and displays the table in the dialog
 | ||||||
|  |  | ||||||
|  | @ -187,7 +187,11 @@ $(document).ready(function () { | ||||||
| 				gridsquare: this.gridsquare.value, | 				gridsquare: this.gridsquare.value, | ||||||
| 				state: this.state.value, | 				state: this.state.value, | ||||||
| 				qsoresults: this.qsoResults.value, | 				qsoresults: this.qsoResults.value, | ||||||
| 				sats: this.sats.value | 				sats: this.sats.value, | ||||||
|  | 				lotwSent: this.lotwSent.value, | ||||||
|  | 				lotwReceived: this.lotwReceived.value, | ||||||
|  | 				eqslSent: this.eqslSent.value, | ||||||
|  | 				eqslReceived: this.eqslReceived.value, | ||||||
| 			}, | 			}, | ||||||
| 			dataType: 'json', | 			dataType: 'json', | ||||||
| 			success: function (data) { | 			success: function (data) { | ||||||
|  |  | ||||||
|  | @ -188,9 +188,9 @@ class QSO | ||||||
| 		$this->lotw = $this->getLotwString($data, $custom_date_format); | 		$this->lotw = $this->getLotwString($data, $custom_date_format); | ||||||
| 		$this->eqsl = $this->getEqslString($data, $custom_date_format); | 		$this->eqsl = $this->getEqslString($data, $custom_date_format); | ||||||
| 		 | 		 | ||||||
| 		$this->cqzone = ($data['COL_CQZ'] === null) ? '' : $data['COL_CQZ']; | 		$this->cqzone = ($data['COL_CQZ'] === null) ? '' : '<a href="javascript:spawnLookupModal('.$data['COL_CQZ'].',\'cq\');">'.$data['COL_CQZ'].'</a>'; | ||||||
| 		$this->state = ($data['COL_STATE'] === null) ? '' :$data['COL_STATE']; | 		$this->state = ($data['COL_STATE'] === null) ? '' :$data['COL_STATE']; | ||||||
| 		$this->dxcc = ($data['name'] === null) ? '- NONE -' : ucwords(strtolower($data['name']), "- (/"); | 		$this->dxcc = ($data['name'] === null) ? '- NONE -' : '<a href="javascript:spawnLookupModal('.$data['COL_DXCC'].',\'dxcc\');">'.ucwords(strtolower($data['name']), "- (/").'</a>'; | ||||||
| 		$this->iota = ($data['COL_IOTA'] === null) ? '' : $this->getIotaLink($data['COL_IOTA']); | 		$this->iota = ($data['COL_IOTA'] === null) ? '' : $this->getIotaLink($data['COL_IOTA']); | ||||||
| 		if (array_key_exists('end', $data)) { | 		if (array_key_exists('end', $data)) { | ||||||
| 			$this->end = ($data['end'] === null) ? null : DateTime::createFromFormat("Y-m-d", $data['end'], new DateTimeZone('UTC')); | 			$this->end = ($data['end'] === null) ? null : DateTime::createFromFormat("Y-m-d", $data['end'], new DateTimeZone('UTC')); | ||||||
|  | @ -961,7 +961,7 @@ class QSO | ||||||
| 	private function getIotaLink($iota) : string | 	private function getIotaLink($iota) : string | ||||||
| 	{ | 	{ | ||||||
| 		if ($iota !== '') { | 		if ($iota !== '') { | ||||||
| 			return '<a href="https://www.iota-world.org/iotamaps/?grpref=' .$iota . '" target="_blank">' . $iota . '</a>'; | 			return '<a href="javascript:spawnLookupModal(\''.$iota.'\',\'iota\');">'.$iota.'</a> <a href="https://www.iota-world.org/iotamaps/?grpref=' .$iota . '" target="_blank"><i class="fas fa-globe"></i></a>'; | ||||||
| 		} | 		} | ||||||
| 		return ''; | 		return ''; | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
		正在加载…
	
		在新工单中引用