kopia lustrzana https://github.com/magicbug/Cloudlog
Fixed bug where exceptions were not being checked when typing in a live qso sometimes
rodzic
0739790943
commit
6cc0dea243
|
@ -8,6 +8,10 @@ Website: [http://www.cloudlog.co.uk](http://www.cloudlog.co.uk)
|
|||
|
||||
* PHP (Version 7 or higher is recommended) & MySQL
|
||||
|
||||
You will also needthe following PHP modules installed
|
||||
|
||||
php-curl, php-mbstrings, php-xml
|
||||
|
||||
## Versions
|
||||
|
||||
* Master - Current working copy
|
||||
|
|
|
@ -1215,26 +1215,39 @@ class Logbook_model extends CI_Model {
|
|||
public function dxcc_lookup($call, $date){
|
||||
$len = strlen($call);
|
||||
|
||||
// query the table, removing a character from the right until a match
|
||||
for ($i = $len; $i > 0; $i--){
|
||||
//printf("searching for %s\n", substr($call, 0, $i));
|
||||
$dxcc_result = $this->db->select('*')
|
||||
->where('call', substr($call, 0, $i))
|
||||
->where('(start <= ', $date)
|
||||
->or_where("start = '0000-00-00'", NULL, false)
|
||||
->or_where("start is null)", NULL, false)
|
||||
->where('(end >= ', $date)
|
||||
->or_where("end = '0000-00-00'", NULL, false)
|
||||
->or_where("end is null)", NULL, false)
|
||||
->get('dxcc_prefixes');
|
||||
$this->db->where('call', $call);
|
||||
$this->db->where('CURDATE() between start and end');
|
||||
|
||||
//$dxcc_result = $this->db->query("select `call`, `entity`, `adif` from dxcc_prefixes where `call` = '".substr($call, 0, $i) ."'");
|
||||
//print $this->db->last_query();
|
||||
$query = $this->db->get('dxcc_exceptions');
|
||||
|
||||
|
||||
if ($query->num_rows() > 0){
|
||||
|
||||
$row = $query->row_array();
|
||||
|
||||
if ($dxcc_result->num_rows() > 0){
|
||||
$row = $dxcc_result->row_array();
|
||||
return $row;
|
||||
}
|
||||
} else {
|
||||
// query the table, removing a character from the right until a match
|
||||
for ($i = $len; $i > 0; $i--){
|
||||
//printf("searching for %s\n", substr($call, 0, $i));
|
||||
$dxcc_result = $this->db->select('*')
|
||||
->where('call', substr($call, 0, $i))
|
||||
->where('(start <= ', $date)
|
||||
->or_where("start = '0000-00-00'", NULL, false)
|
||||
->or_where("start is null)", NULL, false)
|
||||
->where('(end >= ', $date)
|
||||
->or_where("end = '0000-00-00'", NULL, false)
|
||||
->or_where("end is null)", NULL, false)
|
||||
->get('dxcc_prefixes');
|
||||
|
||||
//$dxcc_result = $this->db->query("select `call`, `entity`, `adif` from dxcc_prefixes where `call` = '".substr($call, 0, $i) ."'");
|
||||
//print $this->db->last_query();
|
||||
|
||||
if ($dxcc_result->num_rows() > 0){
|
||||
$row = $dxcc_result->row_array();
|
||||
return $row;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return array("Not Found", "Not Found");
|
||||
|
|
Ładowanie…
Reference in New Issue