mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
Merge branch 'dev' into passwords
This commit is contained in:
@@ -27,30 +27,40 @@ class Lookup extends CI_Controller {
|
||||
}
|
||||
|
||||
public function search() {
|
||||
$CI =& get_instance();
|
||||
$CI->load->model('logbooks_model');
|
||||
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
|
||||
$this->load->model('logbooks_model');
|
||||
$logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
|
||||
|
||||
$location_list = "'".implode("','",$logbooks_locations_array)."'";
|
||||
|
||||
$this->load->model('lookup_model');
|
||||
$this->load->model('bands');
|
||||
|
||||
$data['bands'] = $this->bands->get_worked_bands(xss_clean($this->input->post('type')));
|
||||
|
||||
$data['type'] = xss_clean($this->input->post('type'));
|
||||
$data['dxcc'] = xss_clean($this->input->post('dxcc'));
|
||||
$data['was'] = xss_clean($this->input->post('was'));
|
||||
$data['sota'] = xss_clean($this->input->post('sota'));
|
||||
$data['grid'] = xss_clean($this->input->post('grid'));
|
||||
$data['iota'] = xss_clean($this->input->post('iota'));
|
||||
$data['cqz'] = xss_clean($this->input->post('cqz'));
|
||||
$data['wwff'] = xss_clean($this->input->post('wwff'));
|
||||
$data['location_list'] = $location_list;
|
||||
|
||||
$data['result'] = $this->lookup_model->getSearchResult($data);
|
||||
if ($data['type'] == "lotw") {
|
||||
$this->load->model('logbook_model');
|
||||
$data['callsign'] = xss_clean($this->input->post('lotw'));
|
||||
$data['lotw_lastupload'] = $this->logbook_model->check_last_lotw($data['callsign']);
|
||||
|
||||
$this->load->view('lookup/lotwuser', $data);
|
||||
} else {
|
||||
$this->load->model('bands');
|
||||
|
||||
$data['bands'] = $this->bands->get_worked_bands(xss_clean($this->input->post('type')));
|
||||
|
||||
|
||||
$data['dxcc'] = xss_clean($this->input->post('dxcc'));
|
||||
$data['was'] = xss_clean($this->input->post('was'));
|
||||
$data['sota'] = xss_clean($this->input->post('sota'));
|
||||
$data['grid'] = xss_clean($this->input->post('grid'));
|
||||
$data['iota'] = xss_clean($this->input->post('iota'));
|
||||
$data['cqz'] = xss_clean($this->input->post('cqz'));
|
||||
$data['wwff'] = xss_clean($this->input->post('wwff'));
|
||||
$data['location_list'] = $location_list;
|
||||
|
||||
$data['result'] = $this->lookup_model->getSearchResult($data);
|
||||
$this->load->view('lookup/result', $data);
|
||||
}
|
||||
|
||||
$this->load->view('lookup/result', $data);
|
||||
}
|
||||
|
||||
public function scp() {
|
||||
@@ -131,11 +141,11 @@ class Lookup extends CI_Controller {
|
||||
|
||||
public function get_state_list() {
|
||||
$this->load->library('subdivisions');
|
||||
|
||||
|
||||
$dxcc = xss_clean($this->input->post('dxcc'));
|
||||
$states_result = $this->subdivisions->get_state_list($dxcc);
|
||||
$subdivision_name = $this->subdivisions->get_primary_subdivision_name($dxcc);
|
||||
|
||||
|
||||
if ($states_result->num_rows() > 0) {
|
||||
$states_array = $states_result->result_array();
|
||||
$result = array(
|
||||
@@ -150,7 +160,7 @@ class Lookup extends CI_Controller {
|
||||
echo json_encode(array('status' => 'No States for this DXCC in Database'));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function get_county() {
|
||||
$json = [];
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
<option value="sota">SOTA</option>
|
||||
<option value="was">US State</option>
|
||||
<option value="wwff">WWFF</option>
|
||||
<option value="lotw">LoTW user</option>
|
||||
</select>
|
||||
<div> </div>
|
||||
<input style="display:none" class="form-control input-group-sm w-auto" id="quicklookuptext" type="text" name="searchfield" placeholder="" aria-label="Search">
|
||||
@@ -63,4 +64,4 @@
|
||||
</form>
|
||||
<br />
|
||||
<div class="table-responsive" id="lookupresulttable">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
16
application/views/lookup/lotwuser.php
Normal file
16
application/views/lookup/lotwuser.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
echo 'LoTW User: ';
|
||||
if (isset($lotw_lastupload) && $lotw_lastupload != '') {
|
||||
$lotw_hint = '';
|
||||
if ($lotw_lastupload > 365) {
|
||||
$lotw_hint = ' lotw_info_red';
|
||||
} elseif ($lotw_lastupload > 30) {
|
||||
$lotw_hint = ' lotw_info_orange';
|
||||
} elseif ($lotw_lastupload > 7) {
|
||||
$lotw_hint = ' lotw_info_yellow';
|
||||
}
|
||||
echo '<a id="lotw_badge" href="https://lotw.arrl.org/lotwuser/act?act='.$callsign.'" target="_blank"><small id="lotw_info" class="badge text-bg-success'.$lotw_hint.'" data-bs-toggle="tooltip" title="LoTW User">Yes</small></a> <a id="lotw_badge" href="https://lotw.arrl.org/lotwuser/act?act='.$callsign.'" target="_blank"> last upload</a> '.$lotw_lastupload.' days ago';
|
||||
} else {
|
||||
echo "<span data-bs-toggle=\"tooltip\" title=\"No LoTW User\" class=\"badge text-bg-danger\" style=\"padding-left: 0.2em; padding-right: 0.2em;\">No</span>";
|
||||
}
|
||||
?>
|
||||
@@ -661,7 +661,7 @@ function changeLookupType(type) {
|
||||
$('#quicklookupcqz').hide();
|
||||
$('#quicklookupwas').hide();
|
||||
$('#quicklookuptext').hide();
|
||||
} else if (type == "vucc" || type == "sota" || type == "wwff") {
|
||||
} else if (type == "vucc" || type == "sota" || type == "wwff" || type == "lotw") {
|
||||
$('#quicklookuptext').show();
|
||||
$('#quicklookupiota').hide();
|
||||
$('#quicklookupdxcc').hide();
|
||||
@@ -698,6 +698,7 @@ function getLookupResult() {
|
||||
iota: $('#quicklookupiota').val(),
|
||||
sota: $('#quicklookuptext').val(),
|
||||
wwff: $('#quicklookuptext').val(),
|
||||
lotw: $('#quicklookuptext').val(),
|
||||
},
|
||||
success: function (html) {
|
||||
$('#lookupresulttable').html(html);
|
||||
|
||||
Reference in New Issue
Block a user