Merge branch 'dev' of https://github.com/magicbug/Cloudlog into dev
这个提交包含在:
		
						当前提交
						338492aefe
					
				
					共有  17 个文件被更改,包括 848 次插入 和 129 次删除
				
			
		
							
								
								
									
										
											二进制
										
									
								
								CloudLog_logo.png
									
									
									
									
									
										普通文件
									
								
							
							
						
						
									
										
											二进制
										
									
								
								CloudLog_logo.png
									
									
									
									
									
										普通文件
									
								
							
										
											二进制文件未显示。
										
									
								
							| 
		 之后 宽度: | 高度: | 大小: 31 KiB  | 
| 
						 | 
				
			
			@ -0,0 +1,491 @@
 | 
			
		|||
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
 | 
			
		||||
 | 
			
		||||
class Calltester extends CI_Controller {
 | 
			
		||||
	public function db() {
 | 
			
		||||
        set_time_limit(3600);
 | 
			
		||||
 | 
			
		||||
        // Starting clock time in seconds
 | 
			
		||||
        $start_time = microtime(true);
 | 
			
		||||
        
 | 
			
		||||
		$this->load->model('logbook_model');
 | 
			
		||||
 | 
			
		||||
        $sql = 'select distinct col_country, col_call, col_dxcc, date(col_time_on) date from ' . $this->config->item('table_name');
 | 
			
		||||
        $query = $this->db->query($sql);
 | 
			
		||||
 | 
			
		||||
        $callarray = $query->result();
 | 
			
		||||
 | 
			
		||||
        $result = array();
 | 
			
		||||
        
 | 
			
		||||
        $i = 0;
 | 
			
		||||
 | 
			
		||||
        foreach ($callarray as $call) {
 | 
			
		||||
            $i++;
 | 
			
		||||
            $dxcc = $this->logbook_model->dxcc_lookup($call->col_call, $call->date);
 | 
			
		||||
 | 
			
		||||
            $dxcc['adif'] = (isset($dxcc['adif'])) ? $dxcc['adif'] : 0;
 | 
			
		||||
            $dxcc['entity'] = (isset($dxcc['entity'])) ? $dxcc['entity'] : 0;
 | 
			
		||||
            
 | 
			
		||||
            if ($call->col_dxcc != $dxcc['adif']) {
 | 
			
		||||
                $result[] = array(
 | 
			
		||||
                                'Callsign'          => $call->col_call, 
 | 
			
		||||
                                'Expected country'  => $call->col_country, 
 | 
			
		||||
                                'Expected adif'     => $call->col_dxcc, 
 | 
			
		||||
                                'Result country'    => ucwords(strtolower($dxcc['entity']), "- (/"),
 | 
			
		||||
                                'Result adif'       => $dxcc['adif'],
 | 
			
		||||
                            );
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        
 | 
			
		||||
        // End clock time in seconds
 | 
			
		||||
        $end_time = microtime(true);
 | 
			
		||||
 | 
			
		||||
        // Calculate script execution time
 | 
			
		||||
        $execution_time = ($end_time - $start_time);
 | 
			
		||||
        
 | 
			
		||||
        echo " Execution time of script = ".$execution_time." sec <br/>";
 | 
			
		||||
        echo $i . " calls tested. <br/>";
 | 
			
		||||
        $count = 0;
 | 
			
		||||
 | 
			
		||||
        if ($result) {
 | 
			
		||||
            $this->array_to_table($result);
 | 
			
		||||
        }
 | 
			
		||||
        
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
    function array_to_table($table) {  
 | 
			
		||||
        echo '<style>
 | 
			
		||||
        table {
 | 
			
		||||
            font-family: Arial, Helvetica, sans-serif;
 | 
			
		||||
            border-collapse: collapse;
 | 
			
		||||
            width: 100%;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        table td, table th {
 | 
			
		||||
            border: 1px solid #ddd;
 | 
			
		||||
            padding: 4px;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        table tr:nth-child(even){background-color: #f2f2f2;}
 | 
			
		||||
 | 
			
		||||
        table tr:hover {background-color: #ddd;}
 | 
			
		||||
 | 
			
		||||
        table th {
 | 
			
		||||
            padding-top: 4px;
 | 
			
		||||
            padding-bottom: 4px;
 | 
			
		||||
            text-align: left;
 | 
			
		||||
            background-color: #04AA6D;
 | 
			
		||||
            color: white;
 | 
			
		||||
        }
 | 
			
		||||
        </style> ';
 | 
			
		||||
 | 
			
		||||
       echo '<table>';
 | 
			
		||||
    
 | 
			
		||||
       // Table header
 | 
			
		||||
        foreach ($table[0] as $key=>$value) {
 | 
			
		||||
            echo "<th>".$key."</th>";
 | 
			
		||||
        }
 | 
			
		||||
    
 | 
			
		||||
        // Table body
 | 
			
		||||
        foreach ($table as $value) {
 | 
			
		||||
            echo "<tr>";
 | 
			
		||||
            foreach ($value as $val) {
 | 
			
		||||
                    echo "<td>".$val."</td>";
 | 
			
		||||
            } 
 | 
			
		||||
            echo "</tr>";
 | 
			
		||||
        } 
 | 
			
		||||
       echo "</table>";
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    function csv() {
 | 
			
		||||
        set_time_limit(3600);
 | 
			
		||||
 | 
			
		||||
        // Starting clock time in seconds
 | 
			
		||||
        $start_time = microtime(true);
 | 
			
		||||
        
 | 
			
		||||
		$this->load->model('logbook_model');
 | 
			
		||||
 | 
			
		||||
        $file = 'uploads/calls.csv';
 | 
			
		||||
        $handle = fopen($file,"r");
 | 
			
		||||
    
 | 
			
		||||
        $data = fgetcsv($handle,1000,","); // Skips firsts line, usually that is the header
 | 
			
		||||
        $data = fgetcsv($handle,1000,",");
 | 
			
		||||
    
 | 
			
		||||
        $result = array();
 | 
			
		||||
        
 | 
			
		||||
        $i = 0;
 | 
			
		||||
 | 
			
		||||
        do {
 | 
			
		||||
            if ($data[0]) {
 | 
			
		||||
                // COL_CALL,COL_DXCC,COL_TIME_ON
 | 
			
		||||
                $i++;
 | 
			
		||||
 | 
			
		||||
                $dxcc = $this->logbook_model->dxcc_lookup($data[0], $data[2]);
 | 
			
		||||
 | 
			
		||||
                $dxcc['adif'] = (isset($dxcc['adif'])) ? $dxcc['adif'] : 0;
 | 
			
		||||
                $dxcc['entity'] = (isset($dxcc['entity'])) ? $dxcc['entity'] : 0;
 | 
			
		||||
 | 
			
		||||
                $data[1] = $data[1] == "NULL" ? 0 : $data[1];
 | 
			
		||||
                
 | 
			
		||||
                if ($data[1] != $dxcc['adif']) {
 | 
			
		||||
                    $result[] = array(
 | 
			
		||||
                                    'Callsign'          => $data[0], 
 | 
			
		||||
                                    'Expected country'  => '', 
 | 
			
		||||
                                    'Expected adif'     => $data[1], 
 | 
			
		||||
                                    'Result country'    => ucwords(strtolower($dxcc['entity']), "- (/"),
 | 
			
		||||
                                    'Result adif'       => $dxcc['adif'],
 | 
			
		||||
                                );
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        } while ($data = fgetcsv($handle,1000,","));
 | 
			
		||||
 | 
			
		||||
        // End clock time in seconds
 | 
			
		||||
        $end_time = microtime(true);
 | 
			
		||||
 | 
			
		||||
        // Calculate script execution time
 | 
			
		||||
        $execution_time = ($end_time - $start_time);
 | 
			
		||||
        
 | 
			
		||||
        echo " Execution time of script = ".$execution_time." sec <br/>";
 | 
			
		||||
        echo $i . " calls tested. <br/>";
 | 
			
		||||
        $count = 0;
 | 
			
		||||
 | 
			
		||||
        if ($result) {
 | 
			
		||||
            $this->array_to_table($result);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /*
 | 
			
		||||
     * Uses check_dxcc_table - written to check if that function works
 | 
			
		||||
     */
 | 
			
		||||
    function csv2() {
 | 
			
		||||
        set_time_limit(3600);
 | 
			
		||||
 | 
			
		||||
        // Starting clock time in seconds
 | 
			
		||||
        $start_time = microtime(true);
 | 
			
		||||
        
 | 
			
		||||
		$this->load->model('logbook_model');
 | 
			
		||||
 | 
			
		||||
        $file = 'uploads/calls.csv';
 | 
			
		||||
        $handle = fopen($file,"r");
 | 
			
		||||
    
 | 
			
		||||
        $data = fgetcsv($handle,1000,","); // Skips firsts line, usually that is the header
 | 
			
		||||
        $data = fgetcsv($handle,1000,",");
 | 
			
		||||
    
 | 
			
		||||
        $result = array();
 | 
			
		||||
        
 | 
			
		||||
        $i = 0;
 | 
			
		||||
 | 
			
		||||
        do {
 | 
			
		||||
            if ($data[0]) {
 | 
			
		||||
                // COL_CALL,COL_DXCC,COL_TIME_ON
 | 
			
		||||
                $i++;
 | 
			
		||||
 | 
			
		||||
                $dxcc = $this->logbook_model->check_dxcc_table($data[0], $data[2]);
 | 
			
		||||
 | 
			
		||||
                $data[1] = $data[1] == "NULL" ? 0 : $data[1];
 | 
			
		||||
                
 | 
			
		||||
                if ($data[1] != $dxcc[0]) {
 | 
			
		||||
                    $result[] = array(
 | 
			
		||||
                                    'Callsign'          => $data[0], 
 | 
			
		||||
                                    'Expected country'  => '', 
 | 
			
		||||
                                    'Expected adif'     => $data[1], 
 | 
			
		||||
                                    'Result country'    => ucwords(strtolower($dxcc[1]), "- (/"),
 | 
			
		||||
                                    'Result adif'       => $dxcc[0],
 | 
			
		||||
                                );
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        } while ($data = fgetcsv($handle,1000,","));
 | 
			
		||||
 | 
			
		||||
        // End clock time in seconds
 | 
			
		||||
        $end_time = microtime(true);
 | 
			
		||||
 | 
			
		||||
        // Calculate script execution time
 | 
			
		||||
        $execution_time = ($end_time - $start_time);
 | 
			
		||||
        
 | 
			
		||||
        echo " Execution time of script = ".$execution_time." sec <br/>";
 | 
			
		||||
        echo $i . " calls tested. <br/>";
 | 
			
		||||
        $count = 0;
 | 
			
		||||
 | 
			
		||||
        if ($result) {
 | 
			
		||||
            $this->array_to_table($result);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    function call() {
 | 
			
		||||
        $testarray = array();
 | 
			
		||||
 | 
			
		||||
        $testarray[] = array(
 | 
			
		||||
            'Callsign'  => 'VE3EY/VP9',
 | 
			
		||||
            'Country'   => 'Bermuda', 
 | 
			
		||||
            'Adif'      => 64, 
 | 
			
		||||
            'Date'      => $date = date('Ymd', time())
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
        $testarray[] = array(
 | 
			
		||||
            'Callsign'  => 'VP2MDG',
 | 
			
		||||
            'Country'   => 'Montserrat', 
 | 
			
		||||
            'Adif'      => 96, 
 | 
			
		||||
            'Date'      => $date = date('Ymd', time())
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
        $testarray[] = array(
 | 
			
		||||
            'Callsign'  => 'VP2EY',
 | 
			
		||||
            'Country'   => 'Anguilla', 
 | 
			
		||||
            'Adif'      => 12, 
 | 
			
		||||
            'Date'      => $date = date('Ymd', time())
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
        $testarray[] = array(
 | 
			
		||||
            'Callsign'  => 'VP2VI',
 | 
			
		||||
            'Country'   => 'British Virgin Islands.', 
 | 
			
		||||
            'Adif'      => 65, 
 | 
			
		||||
            'Date'      => $date = date('Ymd', time())
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
        $testarray[] = array(
 | 
			
		||||
            'Callsign'  => 'VP2V/AA7V',
 | 
			
		||||
            'Country'   => 'British Virgin Islands', 
 | 
			
		||||
            'Adif'      => 65, 
 | 
			
		||||
            'Date'      => $date = date('Ymd', time())
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
        $testarray[] = array(
 | 
			
		||||
            'Callsign'  => 'W8LR/R',
 | 
			
		||||
            'Country'   => 'United States Of America', 
 | 
			
		||||
            'Adif'      => 291, 
 | 
			
		||||
            'Date'      => $date = date('Ymd', time())
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
        $testarray[] = array(
 | 
			
		||||
            'Callsign'  => 'SO1FH',
 | 
			
		||||
            'Country'   => 'Poland', 
 | 
			
		||||
            'Adif'      => 269, 
 | 
			
		||||
            'Date'      => $date = date('Ymd', time())
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
        $testarray[] = array(
 | 
			
		||||
            'Callsign'  => 'KZ1H/PP',
 | 
			
		||||
            'Country'   => 'Brazil', 
 | 
			
		||||
            'Adif'      => 108, 
 | 
			
		||||
            'Date'      => $date = date('Ymd', time())
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
        $testarray[] = array(
 | 
			
		||||
            'Callsign'  => 'K1KW/AM',
 | 
			
		||||
            'Country'   => 'None', 
 | 
			
		||||
            'Adif'      => 0, 
 | 
			
		||||
            'Date'      => $date = date('Ymd', time())
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
        $testarray[] = array(
 | 
			
		||||
            'Callsign'  => 'K1KW/MM',
 | 
			
		||||
            'Country'   => 'None', 
 | 
			
		||||
            'Adif'      => 0, 
 | 
			
		||||
            'Date'      => $date = date('Ymd', time())
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
        $testarray[] = array(
 | 
			
		||||
            'Callsign'  => 'TF/DL2NWK/P',
 | 
			
		||||
            'Country'   => 'Iceland', 
 | 
			
		||||
            'Adif'      => 242, 
 | 
			
		||||
            'Date'      => $date = date('Ymd', time())
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
        $testarray[] = array(
 | 
			
		||||
            'Callsign'  => 'OZ1ALS/A',
 | 
			
		||||
            'Country'   => 'Denmark', 
 | 
			
		||||
            'Adif'      => 221, 
 | 
			
		||||
            'Date'      => $date = date('Ymd', time())
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
        $testarray[] = array(
 | 
			
		||||
            'Callsign'  => 'LA1K',
 | 
			
		||||
            'Country'   => 'Norway', 
 | 
			
		||||
            'Adif'      => 266, 
 | 
			
		||||
            'Date'      => $date = date('Ymd', time())
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
        $testarray[] = array(
 | 
			
		||||
            'Callsign'  => 'K1KW/M',
 | 
			
		||||
            'Country'   => 'United States Of America', 
 | 
			
		||||
            'Adif'      => 291, 
 | 
			
		||||
            'Date'      => $date = date('Ymd', time())
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
        $testarray[] = array(
 | 
			
		||||
            'Callsign'  => 'TF/DL2NWK/M',
 | 
			
		||||
            'Country'   => 'Iceland', 
 | 
			
		||||
            'Adif'      => 242, 
 | 
			
		||||
            'Date'      => $date = date('Ymd', time())
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
        $testarray[] = array(
 | 
			
		||||
            'Callsign'  => 'TF/DL2NWK/MM',
 | 
			
		||||
            'Country'   => 'None', 
 | 
			
		||||
            'Adif'      => 0, 
 | 
			
		||||
            'Date'      => $date = date('Ymd', time())
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
        $testarray[] = array(
 | 
			
		||||
            'Callsign'  => 'TF/DL2NWK/P',
 | 
			
		||||
            'Country'   => 'Iceland', 
 | 
			
		||||
            'Adif'      => 242, 
 | 
			
		||||
            'Date'      => $date = date('Ymd', time())
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
        $testarray[] = array(
 | 
			
		||||
            'Callsign'  => '2M0SQL/P',
 | 
			
		||||
            'Country'   => 'Scotland', 
 | 
			
		||||
            'Adif'      => 279, 
 | 
			
		||||
            'Date'      => $date = date('Ymd', time())
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
        $testarray[] = array(
 | 
			
		||||
            'Callsign'  => 'FT8WW',
 | 
			
		||||
            'Country'   => 'Crozet Island', 
 | 
			
		||||
            'Adif'      => 41, 
 | 
			
		||||
            'Date'      => $date = date('Ymd', time())
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
        $testarray[] = array(
 | 
			
		||||
            'Callsign'  => 'RV0AL/0/P',
 | 
			
		||||
            'Country'   => 'Asiatic Russia', 
 | 
			
		||||
            'Adif'      => 15, 
 | 
			
		||||
            'Date'      => $date = date('Ymd', time())
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
        $testarray[] = array(
 | 
			
		||||
            'Callsign'  => 'OH/DJ1YFK',
 | 
			
		||||
            'Country'   => 'Finland', 
 | 
			
		||||
            'Adif'      => 224, 
 | 
			
		||||
            'Date'      => $date = date('Ymd', time())
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
        $testarray[] = array(
 | 
			
		||||
            'Callsign'  => 'N6TR/7',
 | 
			
		||||
            'Country'   => 'United States Of America', 
 | 
			
		||||
            'Adif'      => 291, 
 | 
			
		||||
            'Date'      => $date = date('Ymd', time())
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
        $testarray[] = array(
 | 
			
		||||
            'Callsign'  => 'KH0CW',
 | 
			
		||||
            'Country'   => 'United States Of America', 
 | 
			
		||||
            'Adif'      => 291, 
 | 
			
		||||
            'Date'      => $date = date('Ymd', time())
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
        $testarray[] = array(
 | 
			
		||||
            'Callsign'  => 'R2FM/P',
 | 
			
		||||
            'Country'   => 'kaliningrad', 
 | 
			
		||||
            'Adif'      => 126, 
 | 
			
		||||
            'Date'      => $date = date('Ymd', time())
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
        $testarray[] = array(
 | 
			
		||||
            'Callsign'  => 'R2FM',
 | 
			
		||||
            'Country'   => 'kaliningrad', 
 | 
			
		||||
            'Adif'      => 126, 
 | 
			
		||||
            'Date'      => $date = date('Ymd', time())
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
        $testarray[] = array(
 | 
			
		||||
            'Callsign'  => 'FT5XO',
 | 
			
		||||
            'Country'   => 'Kerguelen Island', 
 | 
			
		||||
            'Adif'      => 131, 
 | 
			
		||||
            'Date'      => 20050320
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
        $testarray[] = array(
 | 
			
		||||
            'Callsign'  => 'VP8CTR',
 | 
			
		||||
            'Country'   => 'Antarctica', 
 | 
			
		||||
            'Adif'      => 13, 
 | 
			
		||||
            'Date'      => 19970207
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
        $testarray[] = array(
 | 
			
		||||
            'Callsign'  => 'FO0AAA',
 | 
			
		||||
            'Country'   => 'Clipperton', 
 | 
			
		||||
            'Adif'      => 36, 
 | 
			
		||||
            'Date'      => '20000302'
 | 
			
		||||
        );
 | 
			
		||||
        
 | 
			
		||||
        $testarray[] = array(
 | 
			
		||||
            'Callsign'  => 'CX/PR8KW',
 | 
			
		||||
            'Country'   => 'Uruguay', 
 | 
			
		||||
            'Adif'      => 144, 
 | 
			
		||||
            'Date'      => $date = date('Ymd', time())
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
        $testarray[] = array(
 | 
			
		||||
            'Callsign'  => 'IQ3MV/LH',
 | 
			
		||||
            'Country'   => 'Italy', 
 | 
			
		||||
            'Adif'      => 248, 
 | 
			
		||||
            'Date'      => $date = date('Ymd', time())
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
        $testarray[] = array(
 | 
			
		||||
            'Callsign'  => 'LA1K/QRP',
 | 
			
		||||
            'Country'   => 'Norway', 
 | 
			
		||||
            'Adif'      => 266, 
 | 
			
		||||
            'Date'      => $date = date('Ymd', time())
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
        $testarray[] = array(
 | 
			
		||||
            'Callsign'  => 'LA1K/LGT',
 | 
			
		||||
            'Country'   => 'Norway', 
 | 
			
		||||
            'Adif'      => 266, 
 | 
			
		||||
            'Date'      => $date = date('Ymd', time())
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
        $testarray[] = array(
 | 
			
		||||
            'Callsign'  => 'SM1K/LH',
 | 
			
		||||
            'Country'   => 'Sweden', 
 | 
			
		||||
            'Adif'      => 284, 
 | 
			
		||||
            'Date'      => $date = date('Ymd', time())
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
        set_time_limit(3600);
 | 
			
		||||
 | 
			
		||||
        // Starting clock time in seconds
 | 
			
		||||
        $start_time = microtime(true);
 | 
			
		||||
        
 | 
			
		||||
		$this->load->model('logbook_model');
 | 
			
		||||
 | 
			
		||||
        $result = array();
 | 
			
		||||
        
 | 
			
		||||
        $i = 0;
 | 
			
		||||
 | 
			
		||||
        foreach ($testarray as $call) {
 | 
			
		||||
            $i++;
 | 
			
		||||
            $dxcc = $this->logbook_model->dxcc_lookup($call['Callsign'], $call['Date']);
 | 
			
		||||
 | 
			
		||||
            $dxcc['adif'] = (isset($dxcc['adif'])) ? $dxcc['adif'] : 0;
 | 
			
		||||
            $dxcc['entity'] = (isset($dxcc['entity'])) ? $dxcc['entity'] : 0;
 | 
			
		||||
            
 | 
			
		||||
            if ($call['Adif'] != $dxcc['adif']) {
 | 
			
		||||
                $result[] = array(
 | 
			
		||||
                                'Callsign'          => $call['Callsign'], 
 | 
			
		||||
                                'Expected country'  => $call['Country'], 
 | 
			
		||||
                                'Expected adif'     => $call['Adif'], 
 | 
			
		||||
                                'Result country'    => ucwords(strtolower($dxcc['entity']), "- (/"),
 | 
			
		||||
                                'Result adif'       => $dxcc['adif'],
 | 
			
		||||
                            );
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        
 | 
			
		||||
        // End clock time in seconds
 | 
			
		||||
        $end_time = microtime(true);
 | 
			
		||||
 | 
			
		||||
        // Calculate script execution time
 | 
			
		||||
        $execution_time = ($end_time - $start_time);
 | 
			
		||||
        
 | 
			
		||||
        echo " Execution time of script = ".$execution_time." sec <br/>";
 | 
			
		||||
        echo $i . " calls tested. <br/>";
 | 
			
		||||
        $count = 0;
 | 
			
		||||
 | 
			
		||||
        if ($result) {
 | 
			
		||||
            $this->array_to_table($result);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -873,15 +873,15 @@ class Lotw extends CI_Controller {
 | 
			
		|||
		$contents = file_get_contents('https://lotw.arrl.org/lotw-user-activity.csv', true);
 | 
			
		||||
 | 
			
		||||
        if($contents === FALSE) {
 | 
			
		||||
            echo "something went wrong";
 | 
			
		||||
            echo "Something went wrong with fetching the LoTW users file.";
 | 
			
		||||
        } else {
 | 
			
		||||
            $file = './updates/lotw_users.csv';
 | 
			
		||||
 | 
			
		||||
            if(!is_file($file)){        // Some simple example content.
 | 
			
		||||
                file_put_contents($file, $contents);     // Save our content to the file.
 | 
			
		||||
            if (file_put_contents($file, $contents) !== FALSE) {     // Save our content to the file.
 | 
			
		||||
                echo "LoTW User Data Saved.";
 | 
			
		||||
            } else {
 | 
			
		||||
                echo "FAILED: Could not write to LoTW users file";
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            echo "LoTW User Data Saved.";
 | 
			
		||||
        }
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -165,7 +165,7 @@ class Update extends CI_Controller {
 | 
			
		|||
	public function dxcc() {
 | 
			
		||||
	    $this->update_status("Downloading file");
 | 
			
		||||
 | 
			
		||||
	    // give it 5 minutes...
 | 
			
		||||
	    // give it 10 minutes...
 | 
			
		||||
	    set_time_limit(600);
 | 
			
		||||
	
 | 
			
		||||
		// Load Migration data if any.
 | 
			
		||||
| 
						 | 
				
			
			@ -177,13 +177,21 @@ class Update extends CI_Controller {
 | 
			
		|||
		$url = "https://cdn.clublog.org/cty.php?api=a11c3235cd74b88212ce726857056939d52372bd";
 | 
			
		||||
		
 | 
			
		||||
		$gz = gzopen($url, 'r');
 | 
			
		||||
		if ($gz === FALSE) {
 | 
			
		||||
			$this->update_status("Something went wrong with fetching the cty.xml file.");
 | 
			
		||||
			return;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		$data = "";
 | 
			
		||||
		while (!gzeof($gz)) {
 | 
			
		||||
		  $data .= gzgetc($gz);
 | 
			
		||||
		}
 | 
			
		||||
		gzclose($gz);
 | 
			
		||||
 | 
			
		||||
		file_put_contents($this->make_update_path("cty.xml"), $data);
 | 
			
		||||
		if (file_put_contents($this->make_update_path("cty.xml"), $data) === FALSE) {
 | 
			
		||||
			$this->update_status("FAILED: Could not write to LoTW users file");
 | 
			
		||||
			return;
 | 
			
		||||
		}
 | 
			
		||||
	
 | 
			
		||||
	    // Clear the tables, ready for new data
 | 
			
		||||
		$this->db->empty_table("dxcc_entities");
 | 
			
		||||
| 
						 | 
				
			
			@ -238,6 +246,11 @@ class Update extends CI_Controller {
 | 
			
		|||
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	public function check_missing_continent() {
 | 
			
		||||
		$this->load->model('logbook_model');
 | 
			
		||||
		$this->logbook_model->check_missing_continent();
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	public function check_missing_grid($all = false){
 | 
			
		||||
	    $this->load->model('logbook_model');
 | 
			
		||||
        $this->logbook_model->check_missing_grid_id($all);
 | 
			
		||||
| 
						 | 
				
			
			@ -247,7 +260,7 @@ class Update extends CI_Controller {
 | 
			
		|||
        $strFile = $this->make_update_path("clublog_scp.txt");
 | 
			
		||||
        $url = "https://cdn.clublog.org/clublog.scp.gz";
 | 
			
		||||
        set_time_limit(300);
 | 
			
		||||
        $this->update_status("Downloading Club Log SCP file");
 | 
			
		||||
        echo "Downloading Club Log SCP file...<br>";
 | 
			
		||||
        $gz = gzopen($url, 'r');
 | 
			
		||||
        if ($gz)
 | 
			
		||||
        {
 | 
			
		||||
| 
						 | 
				
			
			@ -256,21 +269,20 @@ class Update extends CI_Controller {
 | 
			
		|||
                $data .= gzgetc($gz);
 | 
			
		||||
            }
 | 
			
		||||
            gzclose($gz);
 | 
			
		||||
            file_put_contents($strFile, $data);
 | 
			
		||||
            if (file_exists($strFile))
 | 
			
		||||
            if (file_put_contents($strFile, $data) !== FALSE)
 | 
			
		||||
            {
 | 
			
		||||
                $nCount = count(file($strFile));
 | 
			
		||||
                if ($nCount > 0)
 | 
			
		||||
                {
 | 
			
		||||
                    $this->update_status("DONE: " . number_format($nCount) . " callsigns loaded" );
 | 
			
		||||
                    echo "DONE: " . number_format($nCount) . " callsigns loaded";
 | 
			
		||||
                } else {
 | 
			
		||||
                    $this->update_status("FAILED: Empty file");
 | 
			
		||||
                    echo "FAILED: Empty file";
 | 
			
		||||
                }
 | 
			
		||||
            } else {
 | 
			
		||||
                $this->update_status("FAILED: Could not create Club Log SCP file locally");
 | 
			
		||||
                echo "FAILED: Could not write to Club Log SCP file";
 | 
			
		||||
            }
 | 
			
		||||
        } else {
 | 
			
		||||
            $this->update_status("FAILED: Could not connect to Club Log");
 | 
			
		||||
            echo "FAILED: Could not connect to Club Log";
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -281,15 +293,15 @@ class Update extends CI_Controller {
 | 
			
		|||
        $contents = file_get_contents('https://lotw.arrl.org/lotw-user-activity.csv', true);
 | 
			
		||||
 | 
			
		||||
        if($contents === FALSE) { 
 | 
			
		||||
            echo "something went wrong";
 | 
			
		||||
            echo "Something went wrong with fetching the LoTW users file.";
 | 
			
		||||
        } else {
 | 
			
		||||
            $file = './updates/lotw_users.csv';
 | 
			
		||||
 | 
			
		||||
            if(!is_file($file)){        // Some simple example content.
 | 
			
		||||
                file_put_contents($file, $contents);     // Save our content to the file.
 | 
			
		||||
            if (file_put_contents($file, $contents) !== FALSE) {     // Save our content to the file.
 | 
			
		||||
                echo "LoTW User Data Saved.";
 | 
			
		||||
            } else {
 | 
			
		||||
                echo "FAILED: Could not write to LoTW users file";
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            echo "LoTW User Data Saved.";
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			@ -318,10 +330,7 @@ class Update extends CI_Controller {
 | 
			
		|||
        } else {
 | 
			
		||||
            $file = './assets/json/dok.txt';
 | 
			
		||||
 | 
			
		||||
            file_put_contents($file, $contents);     // Save our content to the file.
 | 
			
		||||
 | 
			
		||||
            if (file_exists($file))
 | 
			
		||||
            {
 | 
			
		||||
            if (file_put_contents($file, $contents) !== FALSE) {     // Save our content to the file.
 | 
			
		||||
                $nCount = count(file($file));
 | 
			
		||||
                if ($nCount > 0)
 | 
			
		||||
                {
 | 
			
		||||
| 
						 | 
				
			
			@ -330,7 +339,7 @@ class Update extends CI_Controller {
 | 
			
		|||
                    echo"FAILED: Empty file";
 | 
			
		||||
                }
 | 
			
		||||
            } else {
 | 
			
		||||
                echo"FAILED: Could not create dok.txt file locally";
 | 
			
		||||
                echo"FAILED: Could not write to dok.txt file";
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			@ -343,36 +352,38 @@ class Update extends CI_Controller {
 | 
			
		|||
 | 
			
		||||
        $sotafile = './assets/json/sota.txt';
 | 
			
		||||
 | 
			
		||||
        if($csvfile === FALSE) {
 | 
			
		||||
        $csvhandle = fopen($csvfile,"r");
 | 
			
		||||
        if ($csvhandle === FALSE) {
 | 
			
		||||
            echo "Something went wrong with fetching the SOTA file";
 | 
			
		||||
        } else {
 | 
			
		||||
            $csvhandle = fopen($csvfile,"r");
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
            $data = fgetcsv($csvhandle,1000,","); // Skip line we are not interested in
 | 
			
		||||
            $data = fgetcsv($csvhandle,1000,","); // Skip line we are not interested in
 | 
			
		||||
            $data = fgetcsv($csvhandle,1000,",");
 | 
			
		||||
            $sotafilehandle = fopen($sotafile, 'w');
 | 
			
		||||
        $data = fgetcsv($csvhandle,1000,","); // Skip line we are not interested in
 | 
			
		||||
        $data = fgetcsv($csvhandle,1000,","); // Skip line we are not interested in
 | 
			
		||||
        $data = fgetcsv($csvhandle,1000,",");
 | 
			
		||||
        $sotafilehandle = fopen($sotafile, 'w');
 | 
			
		||||
 | 
			
		||||
            do {
 | 
			
		||||
                if ($data[0]) {
 | 
			
		||||
                    fwrite($sotafilehandle, $data[0].PHP_EOL);
 | 
			
		||||
                }
 | 
			
		||||
            } while ($data = fgetcsv($csvhandle,1000,","));
 | 
			
		||||
        if ($sotafilehandle === FALSE) {
 | 
			
		||||
            echo"FAILED: Could not write to sota.txt file";
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
            fclose($csvhandle);
 | 
			
		||||
            fclose($sotafilehandle);
 | 
			
		||||
            if (file_exists($sotafile))
 | 
			
		||||
            {
 | 
			
		||||
                $nCount = count(file($sotafile));
 | 
			
		||||
                if ($nCount > 0)
 | 
			
		||||
                {
 | 
			
		||||
                    echo "DONE: " . number_format($nCount) . " SOTA's saved";
 | 
			
		||||
                } else {
 | 
			
		||||
                    echo"FAILED: Empty file";
 | 
			
		||||
                }
 | 
			
		||||
            } else {
 | 
			
		||||
                echo"FAILED: Could not create sota.txt file locally";
 | 
			
		||||
        $$nCount = 0;
 | 
			
		||||
        do {
 | 
			
		||||
            if ($data[0]) {
 | 
			
		||||
                fwrite($sotafilehandle, $data[0].PHP_EOL);
 | 
			
		||||
                $nCount++;
 | 
			
		||||
            }
 | 
			
		||||
        } while ($data = fgetcsv($csvhandle,1000,","));
 | 
			
		||||
 | 
			
		||||
        fclose($csvhandle);
 | 
			
		||||
        fclose($sotafilehandle);
 | 
			
		||||
 | 
			
		||||
        if ($nCount > 0)
 | 
			
		||||
        {
 | 
			
		||||
            echo "DONE: " . number_format($nCount) . " SOTA's saved";
 | 
			
		||||
        } else {
 | 
			
		||||
            echo"FAILED: Empty file";
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -391,29 +402,35 @@ class Update extends CI_Controller {
 | 
			
		|||
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
 | 
			
		||||
        $csv = curl_exec($ch);
 | 
			
		||||
        curl_close($ch);
 | 
			
		||||
        if ($csv === FALSE) {
 | 
			
		||||
            echo "Something went wrong with fetching the WWFF file";
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $wwfffilehandle = fopen($wwfffile, 'w');
 | 
			
		||||
        if ($wwfffilehandle === FALSE) {
 | 
			
		||||
            echo"FAILED: Could not write to wwff.txt file";
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $data = str_getcsv($csv,"\n");
 | 
			
		||||
        $nCount = 0;
 | 
			
		||||
        foreach ($data as $idx => $row) {
 | 
			
		||||
           if ($idx == 0) continue; // Skip line we are not interested in
 | 
			
		||||
           $row = str_getcsv($row, ',');
 | 
			
		||||
           if ($row[0]) {
 | 
			
		||||
              fwrite($wwfffilehandle, $row[0].PHP_EOL);
 | 
			
		||||
              $nCount++;
 | 
			
		||||
           }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        fclose($wwfffilehandle);
 | 
			
		||||
        if (file_exists($wwfffile))
 | 
			
		||||
 | 
			
		||||
        if ($nCount > 0)
 | 
			
		||||
        {
 | 
			
		||||
            $nCount = count(file($wwfffile));
 | 
			
		||||
            if ($nCount > 0)
 | 
			
		||||
            {
 | 
			
		||||
                echo "DONE: " . number_format($nCount) . " WWFF's saved";
 | 
			
		||||
            } else {
 | 
			
		||||
                echo"FAILED: Empty file";
 | 
			
		||||
            }
 | 
			
		||||
            echo "DONE: " . number_format($nCount) . " WWFF's saved";
 | 
			
		||||
        } else {
 | 
			
		||||
            echo"FAILED: Could not create wwff.txt file locally";
 | 
			
		||||
            echo"FAILED: Empty file";
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -429,29 +446,34 @@ class Update extends CI_Controller {
 | 
			
		|||
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
 | 
			
		||||
        $csv = curl_exec($ch);
 | 
			
		||||
        curl_close($ch);
 | 
			
		||||
        if ($csv === FALSE) {
 | 
			
		||||
            echo "Something went wrong with fetching the POTA file";
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $potafilehandle = fopen($potafile, 'w');
 | 
			
		||||
        if ($potafilehandle === FALSE) {
 | 
			
		||||
            echo"FAILED: Could not write to pota.txt file";
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
        $data = str_getcsv($csv,"\n");
 | 
			
		||||
        $nCount = 0;
 | 
			
		||||
        foreach ($data as $idx => $row) {
 | 
			
		||||
           if ($idx == 0) continue; // Skip line we are not interested in
 | 
			
		||||
           $row = str_getcsv($row, ',');
 | 
			
		||||
           if ($row[0]) {
 | 
			
		||||
              fwrite($potafilehandle, $row[0].PHP_EOL);
 | 
			
		||||
              $nCount++;
 | 
			
		||||
           }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        fclose($potafilehandle);
 | 
			
		||||
        if (file_exists($potafile))
 | 
			
		||||
 | 
			
		||||
        if ($nCount > 0)
 | 
			
		||||
        {
 | 
			
		||||
            $nCount = count(file($potafile));
 | 
			
		||||
            if ($nCount > 0)
 | 
			
		||||
            {
 | 
			
		||||
                echo "DONE: " . number_format($nCount) . " POTA's saved";
 | 
			
		||||
            } else {
 | 
			
		||||
                echo"FAILED: Empty file";
 | 
			
		||||
            }
 | 
			
		||||
            echo "DONE: " . number_format($nCount) . " POTA's saved";
 | 
			
		||||
        } else {
 | 
			
		||||
            echo"FAILED: Could not create pota.txt file locally";
 | 
			
		||||
            echo"FAILED: Empty file";
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -94,6 +94,7 @@ $lang['gen_hamradio_logbook'] = 'Logbook';
 | 
			
		|||
 | 
			
		||||
$lang['gen_hamradio_cq_zone'] = 'CQ Zone';
 | 
			
		||||
$lang['gen_hamradio_dxcc'] = 'DXCC';
 | 
			
		||||
$lang['gen_hamradio_continent'] = 'Continent';
 | 
			
		||||
$lang['gen_hamradio_usa_state'] = 'USA State';
 | 
			
		||||
$lang['gen_hamradio_county_reference'] = 'USA County';
 | 
			
		||||
$lang['gen_hamradio_iota_reference'] = 'IOTA Reference';
 | 
			
		||||
| 
						 | 
				
			
			@ -125,3 +126,11 @@ $lang['gen_this_qso_was_confirmed_on'] = 'This QSO was confirmed on';
 | 
			
		|||
$lang['error_no_logbook_found'] = 'No logbooks were found. You need to define a logbook under Station Logbooks! Do it here:';
 | 
			
		||||
 | 
			
		||||
$lang['copy_to_clipboard'] = 'Copy to clipboard';
 | 
			
		||||
 | 
			
		||||
$lang['africa'] = 'Africa';
 | 
			
		||||
$lang['antarctica'] = 'Antarctica';
 | 
			
		||||
$lang['asia'] = 'Asia';
 | 
			
		||||
$lang['europe'] = 'Europe';
 | 
			
		||||
$lang['northamerica'] = 'North America';
 | 
			
		||||
$lang['oceania'] = 'Oceania';
 | 
			
		||||
$lang['southamerica'] = 'South America';
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -94,6 +94,7 @@ $lang['gen_hamradio_logbook'] = 'Logbuch';
 | 
			
		|||
 | 
			
		||||
$lang['gen_hamradio_cq_zone'] = 'CQ Zone';
 | 
			
		||||
$lang['gen_hamradio_dxcc'] = 'DXCC';
 | 
			
		||||
$lang['gen_hamradio_continent'] = 'Kontinent';
 | 
			
		||||
$lang['gen_hamradio_usa_state'] = 'USA-Staat';
 | 
			
		||||
$lang['gen_hamradio_county_reference'] = 'USA County';
 | 
			
		||||
$lang['gen_hamradio_iota_reference'] = 'IOTA Referenznummer';
 | 
			
		||||
| 
						 | 
				
			
			@ -124,3 +125,11 @@ $lang['gen_from_date'] = 'Ab Datum';
 | 
			
		|||
$lang['gen_this_qso_was_confirmed_on'] = 'Dieses QSO wurde bestätigt am';
 | 
			
		||||
 | 
			
		||||
$lang['copy_to_clipboard'] = 'In die Zwischenablage kopieren';
 | 
			
		||||
 | 
			
		||||
$lang['africa'] = 'Afrika';
 | 
			
		||||
$lang['antarctica'] = 'Antarktis';
 | 
			
		||||
$lang['asia'] = 'Asien';
 | 
			
		||||
$lang['europe'] = 'Europa';
 | 
			
		||||
$lang['northamerica'] = 'Nord-Amerika';
 | 
			
		||||
$lang['oceania'] = 'Ozeanien';
 | 
			
		||||
$lang['southamerica'] = 'Süd-Amerika';
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -78,6 +78,19 @@ class Logbook_model extends CI_Model {
 | 
			
		|||
        $dxcc_id = $this->input->post('dxcc_id');
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if($this->input->post('continent') == "") {
 | 
			
		||||
 | 
			
		||||
      $dxcc = $this->check_dxcc_table(strtoupper(trim($this->input->post('callsign'))), $datetime);
 | 
			
		||||
      if (empty($dxcc[3])) {
 | 
			
		||||
        $continent = null;
 | 
			
		||||
      } else {
 | 
			
		||||
       $continent = $dxcc[3];
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
    } else {
 | 
			
		||||
        $continent = $this->input->post('continent');
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    $mode = $this->get_main_mode_if_submode($this->input->post('mode'));
 | 
			
		||||
    if ($mode == null) {
 | 
			
		||||
        $mode = $this->input->post('mode');
 | 
			
		||||
| 
						 | 
				
			
			@ -139,6 +152,7 @@ class Logbook_model extends CI_Model {
 | 
			
		|||
            'COL_SAT_NAME' => strtoupper($this->input->post('sat_name')),
 | 
			
		||||
            'COL_SAT_MODE' => strtoupper($this->input->post('sat_mode')),
 | 
			
		||||
            'COL_COUNTRY' => $country,
 | 
			
		||||
            'COL_CONT' => $continent,
 | 
			
		||||
            'COL_QSLSDATE' => $qslsdate,
 | 
			
		||||
            'COL_QSLRDATE' => $qslrdate,
 | 
			
		||||
            'COL_QSL_SENT' => $qsl_sent,
 | 
			
		||||
| 
						 | 
				
			
			@ -161,8 +175,8 @@ class Logbook_model extends CI_Model {
 | 
			
		|||
            'COL_TX_PWR' => $tx_power,
 | 
			
		||||
            'COL_STX' => $stx,
 | 
			
		||||
            'COL_SRX' => $srx,
 | 
			
		||||
            'COL_STX_STRING' => $stx_string,
 | 
			
		||||
            'COL_SRX_STRING' => $srx_string,
 | 
			
		||||
            'COL_STX_STRING' => strtoupper(trim($stx_string)),
 | 
			
		||||
            'COL_SRX_STRING' => strtoupper(trim($srx_string)),
 | 
			
		||||
            'COL_CONTEST_ID' => $contestid,
 | 
			
		||||
            'COL_NR_BURSTS' => null,
 | 
			
		||||
            'COL_NR_PINGS' => null,
 | 
			
		||||
| 
						 | 
				
			
			@ -621,7 +635,7 @@ class Logbook_model extends CI_Model {
 | 
			
		|||
         } else if ($data['COL_BAND'] == '15m') {
 | 
			
		||||
            $sat_name = 'FO-118[H/u]';
 | 
			
		||||
         }
 | 
			
		||||
      } else if ($data['COL_SAT_NAME'] == 'ARISS') {
 | 
			
		||||
      } else if ($data['COL_SAT_NAME'] == 'ARISS' || $data['COL_SAT_NAME'] == 'ISS') {
 | 
			
		||||
         if ($data['COL_MODE'] == 'FM') {
 | 
			
		||||
            $sat_name = 'ISS-FM';
 | 
			
		||||
         } else if ($data['COL_MODE'] == 'PKT') {
 | 
			
		||||
| 
						 | 
				
			
			@ -785,6 +799,7 @@ class Logbook_model extends CI_Model {
 | 
			
		|||
       'COL_COMMENT' => $this->input->post('comment'),
 | 
			
		||||
       'COL_NAME' => $this->input->post('name'),
 | 
			
		||||
       'COL_COUNTRY' => $country,
 | 
			
		||||
       'COL_CONT' => $this->input->post('continent'),
 | 
			
		||||
       'COL_DXCC'=> $this->input->post('dxcc_id'),
 | 
			
		||||
       'COL_CQZ' => $this->input->post('cqz'),
 | 
			
		||||
       'COL_SAT_NAME' => $this->input->post('sat_name'),
 | 
			
		||||
| 
						 | 
				
			
			@ -816,8 +831,8 @@ class Logbook_model extends CI_Model {
 | 
			
		|||
       'COL_QTH' => $this->input->post('qth'),
 | 
			
		||||
       'COL_PROP_MODE' => $this->input->post('prop_mode'),
 | 
			
		||||
       'COL_FREQ_RX' => $this->parse_frequency($this->input->post('freq_display_rx')),
 | 
			
		||||
       'COL_STX_STRING' => $this->input->post('stx_string'),
 | 
			
		||||
       'COL_SRX_STRING' => $this->input->post('srx_string'),
 | 
			
		||||
       'COL_STX_STRING' => strtoupper(trim($this->input->post('stx_string'))),
 | 
			
		||||
       'COL_SRX_STRING' => strtoupper(trim($this->input->post('srx_string'))),
 | 
			
		||||
       'COL_STX' => $stx_string,
 | 
			
		||||
       'COL_SRX' => $srx_string,
 | 
			
		||||
       'COL_CONTEST_ID' => $this->input->post('contest_name'),
 | 
			
		||||
| 
						 | 
				
			
			@ -2907,7 +2922,9 @@ class Logbook_model extends CI_Model {
 | 
			
		|||
     */
 | 
			
		||||
    public function check_dxcc_table($call, $date){
 | 
			
		||||
 | 
			
		||||
		$dxcc_exceptions = $this->db->select('`entity`, `adif`, `cqz`')
 | 
			
		||||
    $csadditions = '/^P$|^R$|^A$|^M$/';
 | 
			
		||||
 | 
			
		||||
		$dxcc_exceptions = $this->db->select('`entity`, `adif`, `cqz`, `cont`')
 | 
			
		||||
             ->where('call', $call)
 | 
			
		||||
             ->where('(start <= ', $date)
 | 
			
		||||
             ->or_where('start is null)', NULL, false)
 | 
			
		||||
| 
						 | 
				
			
			@ -2917,12 +2934,14 @@ class Logbook_model extends CI_Model {
 | 
			
		|||
 | 
			
		||||
		if ($dxcc_exceptions->num_rows() > 0){
 | 
			
		||||
			$row = $dxcc_exceptions->row_array();
 | 
			
		||||
			return array($row['adif'], $row['entity'], $row['cqz']);
 | 
			
		||||
			return array($row['adif'], $row['entity'], $row['cqz'], $row['cont']);
 | 
			
		||||
		}
 | 
			
		||||
    if (preg_match('/(^KG4)[A-Z09]{3}/', $call)) {      // KG4/ and KG4 5 char calls are Guantanamo Bay. If 4 or 6 char, it is USA
 | 
			
		||||
      $call = "K";
 | 
			
		||||
    } elseif (preg_match('/(^OH\/)|(\/OH[1-9]?$)/', $call)) {   # non-Aland prefix!
 | 
			
		||||
      $call = "OH";                                             # make callsign OH = finland
 | 
			
		||||
    } elseif (preg_match('/(^CX\/)|(\/CX[1-9]?$)/', $call)) {   # non-Antarctica prefix!
 | 
			
		||||
      $call = "CX";                                             # make callsign CX = Uruguay
 | 
			
		||||
    } elseif (preg_match('/(^3D2R)|(^3D2.+\/R)/', $call)) {     # seems to be from Rotuma
 | 
			
		||||
      $call = "3D2/R";                                          # will match with Rotuma
 | 
			
		||||
    } elseif (preg_match('/^3D2C/', $call)) {                   # seems to be from Conway Reef
 | 
			
		||||
| 
						 | 
				
			
			@ -2934,23 +2953,43 @@ class Logbook_model extends CI_Model {
 | 
			
		|||
    } elseif (preg_match('/(^KG4)[A-Z09]{1}/', $call)) {
 | 
			
		||||
      $call = "K";
 | 
			
		||||
		} elseif (preg_match('/\w\/\w/', $call)) {
 | 
			
		||||
      if (preg_match_all('/^((\d|[A-Z])+\/)?((\d|[A-Z]){3,})(\/(\d|[A-Z])+)?(\/(\d|[A-Z])+)?$/', $call, $matches)) {
 | 
			
		||||
        $prefix = $matches[1][0];
 | 
			
		||||
        $callsign = $matches[3][0];
 | 
			
		||||
        $suffix = $matches[5][0];
 | 
			
		||||
      if ($prefix) {
 | 
			
		||||
          $prefix = substr($prefix, 0, -1); # Remove the / at the end 
 | 
			
		||||
      }
 | 
			
		||||
      if ($suffix) {
 | 
			
		||||
          $suffix = substr($suffix, 1); # Remove the / at the beginning
 | 
			
		||||
      };
 | 
			
		||||
      if (preg_match($csadditions, $suffix)) {
 | 
			
		||||
        if ($prefix) {
 | 
			
		||||
          $call = $prefix;  
 | 
			
		||||
        } else {
 | 
			
		||||
          $call = $callsign;
 | 
			
		||||
        }
 | 
			
		||||
      } else {
 | 
			
		||||
        $result = $this->wpx($call, 1);                       # use the wpx prefix instead
 | 
			
		||||
        if ($result == '') {
 | 
			
		||||
          $row['adif'] = 0;
 | 
			
		||||
          $row['entity'] = 'None';
 | 
			
		||||
          $row['cqz'] = 0;
 | 
			
		||||
          return array($row['adif'], $row['entity'], $row['cqz']);
 | 
			
		||||
          $row['cont'] = '';
 | 
			
		||||
          return array($row['adif'], $row['entity'], $row['cqz'], $row['cont']);
 | 
			
		||||
        } else {
 | 
			
		||||
          $call = $result . "AA";
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
		$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('`call`, `entity`, `adif`, `cqz`')
 | 
			
		||||
            $dxcc_result = $this->db->select('`call`, `entity`, `adif`, `cqz`, `cont`')
 | 
			
		||||
                                    ->where('call', substr($call, 0, $i))
 | 
			
		||||
                                    ->where('(start <= ', $date)
 | 
			
		||||
                                    ->or_where("start is null)", NULL, false)
 | 
			
		||||
| 
						 | 
				
			
			@ -2963,24 +3002,26 @@ class Logbook_model extends CI_Model {
 | 
			
		|||
 | 
			
		||||
            if ($dxcc_result->num_rows() > 0){
 | 
			
		||||
                $row = $dxcc_result->row_array();
 | 
			
		||||
                return array($row['adif'], $row['entity'], $row['cqz']);
 | 
			
		||||
                return array($row['adif'], $row['entity'], $row['cqz'], $row['cont']);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return array("Not Found", "Not Found");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
    public function dxcc_lookup($call, $date){
 | 
			
		||||
 | 
			
		||||
    $csadditions = '/^P$|^R$|^A$|^M$/';
 | 
			
		||||
 | 
			
		||||
		$dxcc_exceptions = $this->db->select('`entity`, `adif`, `cqz`')
 | 
			
		||||
				->where('call', $call)
 | 
			
		||||
				->where('(start <= CURDATE()')
 | 
			
		||||
				->where('(start <= ', $date)
 | 
			
		||||
				->or_where('start is null)', NULL, false)
 | 
			
		||||
				->where('(end >= CURDATE()')
 | 
			
		||||
				->where('(end >= ', $date)
 | 
			
		||||
				->or_where('end is null)', NULL, false)
 | 
			
		||||
				->get('dxcc_exceptions');
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
			if ($dxcc_exceptions->num_rows() > 0){
 | 
			
		||||
				$row = $dxcc_exceptions->row_array();
 | 
			
		||||
				return $row;
 | 
			
		||||
| 
						 | 
				
			
			@ -2990,6 +3031,8 @@ class Logbook_model extends CI_Model {
 | 
			
		|||
          $call = "K";
 | 
			
		||||
        } elseif (preg_match('/(^OH\/)|(\/OH[1-9]?$)/', $call)) {   # non-Aland prefix!
 | 
			
		||||
          $call = "OH";                                             # make callsign OH = finland
 | 
			
		||||
        } elseif (preg_match('/(^CX\/)|(\/CX[1-9]?$)/', $call)) {   # non-Antarctica prefix!
 | 
			
		||||
          $call = "CX";                                             # make callsign CX = Uruguay
 | 
			
		||||
        } elseif (preg_match('/(^3D2R)|(^3D2.+\/R)/', $call)) {     # seems to be from Rotuma
 | 
			
		||||
          $call = "3D2/R";                                          # will match with Rotuma
 | 
			
		||||
        } elseif (preg_match('/^3D2C/', $call)) {                   # seems to be from Conway Reef
 | 
			
		||||
| 
						 | 
				
			
			@ -3001,18 +3044,37 @@ class Logbook_model extends CI_Model {
 | 
			
		|||
        } elseif (preg_match('/(^KG4)[A-Z09]{1}/', $call)) {
 | 
			
		||||
          $call = "K";
 | 
			
		||||
        } elseif (preg_match('/\w\/\w/', $call)) {
 | 
			
		||||
            $result = $this->wpx($call, 1);                       # use the wpx prefix instead
 | 
			
		||||
            if ($result == '') {
 | 
			
		||||
              $row['adif'] = 0;
 | 
			
		||||
              $row['entity'] = 'None';
 | 
			
		||||
              $row['cqz'] = 0;
 | 
			
		||||
              $row['long'] = '0';
 | 
			
		||||
              $row['lat'] = '0';
 | 
			
		||||
              return $row;
 | 
			
		||||
            } else {
 | 
			
		||||
              $call = $result . "AA";
 | 
			
		||||
          if (preg_match_all('/^((\d|[A-Z])+\/)?((\d|[A-Z]){3,})(\/(\d|[A-Z])+)?(\/(\d|[A-Z])+)?$/', $call, $matches)) {
 | 
			
		||||
              $prefix = $matches[1][0];
 | 
			
		||||
              $callsign = $matches[3][0];
 | 
			
		||||
              $suffix = $matches[5][0];
 | 
			
		||||
            if ($prefix) {
 | 
			
		||||
                $prefix = substr($prefix, 0, -1); # Remove the / at the end 
 | 
			
		||||
            }
 | 
			
		||||
            if ($suffix) {
 | 
			
		||||
                $suffix = substr($suffix, 1); # Remove the / at the beginning
 | 
			
		||||
            };
 | 
			
		||||
            if (preg_match($csadditions, $suffix)) {
 | 
			
		||||
              if ($prefix) {
 | 
			
		||||
                $call = $prefix;  
 | 
			
		||||
              } else {
 | 
			
		||||
                $call = $callsign;
 | 
			
		||||
              }
 | 
			
		||||
            } else {
 | 
			
		||||
              $result = $this->wpx($call, 1);                       # use the wpx prefix instead
 | 
			
		||||
              if ($result == '') {
 | 
			
		||||
                $row['adif'] = 0;
 | 
			
		||||
                $row['entity'] = 'None';
 | 
			
		||||
                $row['cqz'] = 0;
 | 
			
		||||
                $row['long'] = '0';
 | 
			
		||||
                $row['lat'] = '0';
 | 
			
		||||
                return $row;
 | 
			
		||||
              } else {
 | 
			
		||||
                $call = $result . "AA";
 | 
			
		||||
              }
 | 
			
		||||
          }
 | 
			
		||||
    		}
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
				$len = strlen($call);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -3046,8 +3108,8 @@ class Logbook_model extends CI_Model {
 | 
			
		|||
      $b = '';
 | 
			
		||||
      $c = '';
 | 
			
		||||
  
 | 
			
		||||
      $lidadditions = '/^QRP|^LGT/';
 | 
			
		||||
      $csadditions = '/^P$|^R$|^A$|^M$/';
 | 
			
		||||
      $lidadditions = '/^QRP$|^LGT$/';
 | 
			
		||||
      $csadditions = '/^P$|^R$|^A$|^M$|^LH$/';
 | 
			
		||||
      $noneadditions = '/^MM$|^AM$/';
 | 
			
		||||
  
 | 
			
		||||
      # First check if the call is in the proper format, A/B/C where A and C
 | 
			
		||||
| 
						 | 
				
			
			@ -3242,6 +3304,16 @@ class Logbook_model extends CI_Model {
 | 
			
		|||
        print("$count updated\n");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function check_missing_continent(){
 | 
			
		||||
       // get all records with no COL_CONT
 | 
			
		||||
       $this->db->trans_start();
 | 
			
		||||
       $sql = "UPDATE ".$this->config->item('table_name')." JOIN dxcc_entities ON ".$this->config->item('table_name').".col_dxcc = dxcc_entities.adif SET col_cont = dxcc_entities.cont WHERE COALESCE(".$this->config->item('table_name').".col_cont, '') = ''";
 | 
			
		||||
 | 
			
		||||
        $query = $this->db->query($sql);
 | 
			
		||||
        print($this->db->affected_rows()." updated\n");
 | 
			
		||||
        $this->db->trans_complete();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	public function check_missing_grid_id($all){
 | 
			
		||||
        // get all records with no COL_GRIDSQUARE
 | 
			
		||||
        $this->db->select("COL_PRIMARY_KEY, COL_CALL, COL_TIME_ON, COL_TIME_OFF");
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -161,19 +161,23 @@
 | 
			
		|||
        <?php if (file_exists('.git')) { ?>
 | 
			
		||||
        <?php
 | 
			
		||||
            $commitHash = trim(exec('git log --pretty="%H" -n1 HEAD'));
 | 
			
		||||
            $branch = '';
 | 
			
		||||
            $remote = '';
 | 
			
		||||
            $owner = '';
 | 
			
		||||
            // only proceed here if git can actually be executed
 | 
			
		||||
            if ($commitHash != "") {
 | 
			
		||||
               $commitDate = trim(exec('git log --pretty="%ci" -n1 HEAD'));
 | 
			
		||||
               $line = trim(exec('git log -n 1 --pretty=%D HEAD'));
 | 
			
		||||
               $pieces = explode(', ', $line);
 | 
			
		||||
               $remote = substr($pieces[1], 0, strpos($pieces[1], '/'));
 | 
			
		||||
               $branch = substr($pieces[1], strpos($pieces[1], '/')+1);
 | 
			
		||||
               $url = trim(exec('git remote get-url '.$remote));
 | 
			
		||||
               $owner = '';
 | 
			
		||||
               if (strpos($url, 'https://github.com') !== false) {
 | 
			
		||||
                  $owner = preg_replace('/https:\/\/github\.com\/(\w+)\/Cloudlog\.git/', '$1', $url);
 | 
			
		||||
               } else if (strpos($url, 'git@github.com') !== false) {
 | 
			
		||||
                  $owner = preg_replace('/git@github\.com:(\w+)\/Cloudlog\.git/', '$1', $url);
 | 
			
		||||
               if (isset($pieces[1])) {
 | 
			
		||||
                  $remote = substr($pieces[1], 0, strpos($pieces[1], '/'));
 | 
			
		||||
                  $branch = substr($pieces[1], strpos($pieces[1], '/')+1);
 | 
			
		||||
                  $url = trim(exec('git remote get-url '.$remote));
 | 
			
		||||
                  if (strpos($url, 'https://github.com') !== false) {
 | 
			
		||||
                     $owner = preg_replace('/https:\/\/github\.com\/(\w+)\/Cloudlog\.git/', '$1', $url);
 | 
			
		||||
                  } else if (strpos($url, 'git@github.com') !== false) {
 | 
			
		||||
                     $owner = preg_replace('/git@github\.com:(\w+)\/Cloudlog\.git/', '$1', $url);
 | 
			
		||||
                  }
 | 
			
		||||
               }
 | 
			
		||||
               $tag = trim(exec('git describe --tags '.$commitHash));
 | 
			
		||||
            }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -215,6 +215,8 @@
 | 
			
		|||
 | 
			
		||||
                                    <input type="hidden" class="form-control" id="country" name="country" value="<?php echo $qso->COL_COUNTRY; ?>">
 | 
			
		||||
 | 
			
		||||
                                </div>
 | 
			
		||||
                                <div class="form-row">
 | 
			
		||||
                                    <div class="form-group col-sm-6">
 | 
			
		||||
                                        <label for="dxcc_id">DXCC</label>
 | 
			
		||||
                                        <select class="custom-select" id="dxcc_id" name="dxcc_id" required>
 | 
			
		||||
| 
						 | 
				
			
			@ -231,6 +233,19 @@
 | 
			
		|||
 | 
			
		||||
                                        </select>
 | 
			
		||||
                                    </div>
 | 
			
		||||
                                    <div class="form-group col-sm-6">
 | 
			
		||||
                                        <label for="continent"><?php echo $this->lang->line('gen_hamradio_continent'); ?></label>
 | 
			
		||||
                                        <select class="custom-select" id="continent" name="continent">
 | 
			
		||||
                                            <option value=""></option>
 | 
			
		||||
                                            <option value="AF" <?php if($qso->COL_CONT == "AF") { echo "selected=\"selected\""; } ?>><?php echo $this->lang->line('africa'); ?></option>
 | 
			
		||||
                                            <option value="AN" <?php if($qso->COL_CONT == "AN") { echo "selected=\"selected\""; } ?>><?php echo $this->lang->line('antarctica'); ?></option>
 | 
			
		||||
                                            <option value="AS" <?php if($qso->COL_CONT == "AS") { echo "selected=\"selected\""; } ?>><?php echo $this->lang->line('asia'); ?></option>
 | 
			
		||||
                                            <option value="EU" <?php if($qso->COL_CONT == "EU") { echo "selected=\"selected\""; } ?>><?php echo $this->lang->line('europe'); ?></option>
 | 
			
		||||
                                            <option value="NA" <?php if($qso->COL_CONT == "NA") { echo "selected=\"selected\""; } ?>><?php echo $this->lang->line('northamerica'); ?></option>
 | 
			
		||||
                                            <option value="OC" <?php if($qso->COL_CONT == "OC") { echo "selected=\"selected\""; } ?>><?php echo $this->lang->line('oceania'); ?></option>
 | 
			
		||||
                                            <option value="SA" <?php if($qso->COL_CONT == "SA") { echo "selected=\"selected\""; } ?>><?php echo $this->lang->line('southamerica'); ?></option>
 | 
			
		||||
                                        </select>
 | 
			
		||||
                                    </div>
 | 
			
		||||
                                </div>
 | 
			
		||||
 | 
			
		||||
                            </div>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -222,6 +222,19 @@
 | 
			
		|||
 | 
			
		||||
                  </select>
 | 
			
		||||
              </div>
 | 
			
		||||
              <div class="form-group">
 | 
			
		||||
                  <label for="continent"><?php echo $this->lang->line('gen_hamradio_continent'); ?></label>
 | 
			
		||||
                  <select class="custom-select" id="continent" name="continent">
 | 
			
		||||
                      <option value=""></option>
 | 
			
		||||
                      <option value="AF"><?php echo $this->lang->line('africa'); ?></option>
 | 
			
		||||
                      <option value="AN"><?php echo $this->lang->line('antarctica'); ?></option>
 | 
			
		||||
                      <option value="AS"><?php echo $this->lang->line('asia'); ?></option>
 | 
			
		||||
                      <option value="EU"><?php echo $this->lang->line('europe'); ?></option>
 | 
			
		||||
                      <option value="NA"><?php echo $this->lang->line('northamerica'); ?></option>
 | 
			
		||||
                      <option value="OC"><?php echo $this->lang->line('oceania'); ?></option>
 | 
			
		||||
                      <option value="SA"><?php echo $this->lang->line('southamerica'); ?></option>
 | 
			
		||||
                  </select>
 | 
			
		||||
              </div>
 | 
			
		||||
              <div class="form-group">
 | 
			
		||||
                  <label for="cqz"><?php echo $this->lang->line('gen_hamradio_cq_zone'); ?></label>
 | 
			
		||||
                  <select class="custom-select" id="cqz" name="cqz" required>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -30,6 +30,11 @@
 | 
			
		|||
				<p><a class="btn btn-primary" href="<?php echo site_url('update/check_missing_dxcc');?>">Check QSOs missing DXCC data</a></p>
 | 
			
		||||
				<p><a class="btn btn-primary" href="<?php echo site_url('update/check_missing_dxcc/all');?>">Re-check all QSOs in logbook</a></p>
 | 
			
		||||
 | 
			
		||||
				<h5>Apply Continent Data to Logbook</h5>
 | 
			
		||||
				<p class="card-text">
 | 
			
		||||
					This function can be used to update QSO continent information for all QSOs in Cloudlog missing that information.
 | 
			
		||||
				</p>
 | 
			
		||||
				<p><a class="btn btn-primary" href="<?php echo site_url('update/check_missing_continent');?>">Check QSOs missing continent data</a></p>
 | 
			
		||||
				<style>
 | 
			
		||||
					#dxcc_update_status{
 | 
			
		||||
					display: None;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,23 +1,59 @@
 | 
			
		|||
<div id="container" class="container mx-auto pt-5" style="max-width:400px">
 | 
			
		||||
<style>
 | 
			
		||||
html,
 | 
			
		||||
body {
 | 
			
		||||
    height: 100%;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
<h1>Login</h1>
 | 
			
		||||
<?php $this->load->view('layout/messages'); ?>
 | 
			
		||||
body {
 | 
			
		||||
    display: flex;
 | 
			
		||||
    align-items: center;
 | 
			
		||||
    padding-top: 40px;
 | 
			
		||||
    padding-bottom: 40px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
<form method="post" action="<?php echo site_url('user/login'); ?>" name="users">
 | 
			
		||||
	<input type="hidden" name="id" value="<?php echo $this->uri->segment(3); ?>" />
 | 
			
		||||
	<div class="form-group">
 | 
			
		||||
		<label for="user_name">Username</label>
 | 
			
		||||
		<input id="user_name" type="text" name="user_name" class="form-control" value="<?php echo $this->input->post('user_name'); ?>">
 | 
			
		||||
	</div>
 | 
			
		||||
	<div class="form-group">
 | 
			
		||||
		<label for="password">Password</label>
 | 
			
		||||
		<input id="password" type="password" name="user_password" class="form-control">
 | 
			
		||||
	</div>
 | 
			
		||||
	<div class="form-group">
 | 
			
		||||
		<input class="btn-info p-2 col" type="submit" value="Log in" />
 | 
			
		||||
	</div>
 | 
			
		||||
</form>
 | 
			
		||||
.form-signin {
 | 
			
		||||
    width: 100%;
 | 
			
		||||
    max-width: 430px;
 | 
			
		||||
    padding: 15px;
 | 
			
		||||
    margin: auto;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
<p><a href="<?php echo site_url('user/forgot_password'); ?>">Forgot your password?</a></p>
 | 
			
		||||
.form-signin input[type="email"] {
 | 
			
		||||
    margin-bottom: -1px;
 | 
			
		||||
    border-bottom-right-radius: 0;
 | 
			
		||||
    border-bottom-left-radius: 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
</div>
 | 
			
		||||
.form-signin input[type="password"] {
 | 
			
		||||
    border-top-left-radius: 0;
 | 
			
		||||
    border-top-right-radius: 0;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
<main class="form-signin">
 | 
			
		||||
    <img src="<?php echo base_url()?>/CloudLog_logo.png" class="mx-auto d-block" alt="" style="width:100px;height:100px;">
 | 
			
		||||
    <div class="my-2 bg-body rounded-0 shadow-sm card mb-2 shadow-sm">
 | 
			
		||||
        <div class="card-body">
 | 
			
		||||
            <h3>Login to Cloudlog</h3>
 | 
			
		||||
            <form method="post" action="<?php echo site_url('user/login'); ?>" name="users">
 | 
			
		||||
			<?php $this->form_validation->set_error_delimiters('', ''); ?>
 | 
			
		||||
                <input type="hidden" name="id" value="<?php echo $this->uri->segment(3); ?>" />
 | 
			
		||||
                <div>
 | 
			
		||||
                    <label for="floatingInput"><strong>Username<strong></label>
 | 
			
		||||
                    <input type="text" name="user_name" class="form-control" id="floatingInput" placeholder="Username"
 | 
			
		||||
                        value="<?php echo $this->input->post('user_name'); ?>">
 | 
			
		||||
                </div>
 | 
			
		||||
                <div>
 | 
			
		||||
                    <label for="floatingPassword"><strong>Password</strong></label>
 | 
			
		||||
                    <input type="password" name="user_password" class="form-control" id="floatingPassword"
 | 
			
		||||
                        placeholder="Password">
 | 
			
		||||
                </div>
 | 
			
		||||
 | 
			
		||||
                <div>
 | 
			
		||||
                    <p><small><a class="" href="<?php echo site_url('user/forgot_password'); ?>">Forgot your password?</a></small></p>
 | 
			
		||||
                </div>
 | 
			
		||||
					<?php $this->load->view('layout/messages'); ?>
 | 
			
		||||
                <button class="w-100 btn btn-info" type="submit">Login →</button>
 | 
			
		||||
            </form>
 | 
			
		||||
        </div>
 | 
			
		||||
    </div>
 | 
			
		||||
</main>
 | 
			
		||||
| 
						 | 
				
			
			@ -188,6 +188,39 @@
 | 
			
		|||
                    </tr>
 | 
			
		||||
                    <?php } ?>
 | 
			
		||||
 | 
			
		||||
                    <?php if($row->COL_CONT != null) { ?>
 | 
			
		||||
                    <tr>
 | 
			
		||||
                        <td><?php echo $this->lang->line('gen_hamradio_continent'); ?></td>
 | 
			
		||||
                        <td>
 | 
			
		||||
                        <?php
 | 
			
		||||
                           switch($row->COL_CONT) {
 | 
			
		||||
                             case "AF":
 | 
			
		||||
                               echo $this->lang->line('africa');
 | 
			
		||||
                               break;
 | 
			
		||||
                             case "AN":
 | 
			
		||||
                               echo $this->lang->line('antarctica');
 | 
			
		||||
                               break;
 | 
			
		||||
                             case "AS":
 | 
			
		||||
                               echo $this->lang->line('asia');
 | 
			
		||||
                               break;
 | 
			
		||||
                             case "EU":
 | 
			
		||||
                               echo $this->lang->line('europe');
 | 
			
		||||
                               break;
 | 
			
		||||
                             case "NA":
 | 
			
		||||
                               echo $this->lang->line('northamerica');
 | 
			
		||||
                               break;
 | 
			
		||||
                             case "OC":
 | 
			
		||||
                               echo $this->lang->line('oceania');
 | 
			
		||||
                               break;
 | 
			
		||||
                             case "SA":
 | 
			
		||||
                               echo $this->lang->line('southamerica');
 | 
			
		||||
                               break;
 | 
			
		||||
                           }
 | 
			
		||||
                        ?>
 | 
			
		||||
                        </td>
 | 
			
		||||
                    </tr>
 | 
			
		||||
                    <?php } ?>
 | 
			
		||||
 | 
			
		||||
                    <?php if($row->COL_CONTEST_ID != null) { ?>
 | 
			
		||||
                    <tr>
 | 
			
		||||
                        <td><?php echo $this->lang->line('contesting_contest_name'); ?></td>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -412,3 +412,7 @@ div#station_logbooks_linked_table_paginate {
 | 
			
		|||
.dropdown-menu {
 | 
			
		||||
    z-index: 2000;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.qso_panel .dxccsummary {
 | 
			
		||||
    margin-bottom: 10px;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -146,7 +146,7 @@ function qso_edit(id) {
 | 
			
		|||
                        labelField: 'name',
 | 
			
		||||
                        searchField: 'name',
 | 
			
		||||
                        options: [],
 | 
			
		||||
                        create: false,
 | 
			
		||||
                        create: true,
 | 
			
		||||
                        load: function(query, callback) {
 | 
			
		||||
                            if (!query || query.length < 3) return callback();  // Only trigger if 3 or more characters are entered
 | 
			
		||||
                            $.ajax({
 | 
			
		||||
| 
						 | 
				
			
			@ -174,7 +174,7 @@ function qso_edit(id) {
 | 
			
		|||
                        labelField: 'name',
 | 
			
		||||
                        searchField: 'name',
 | 
			
		||||
                        options: [],
 | 
			
		||||
                        create: false,
 | 
			
		||||
                        create: true,
 | 
			
		||||
                        load: function(query, callback) {
 | 
			
		||||
                            if (!query || query.length < 3) return callback();  // Only trigger if 3 or more characters are entered
 | 
			
		||||
                            $.ajax({
 | 
			
		||||
| 
						 | 
				
			
			@ -202,7 +202,7 @@ function qso_edit(id) {
 | 
			
		|||
                        labelField: 'name',
 | 
			
		||||
                        searchField: 'name',
 | 
			
		||||
                        options: [],
 | 
			
		||||
                        create: false,
 | 
			
		||||
                        create: true,
 | 
			
		||||
                        load: function(query, callback) {
 | 
			
		||||
                            if (!query || query.length < 3) return callback();  // Only trigger if 3 or more characters are entered
 | 
			
		||||
                            $.ajax({
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -394,8 +394,8 @@ function logQso() {
 | 
			
		|||
				// Store contest session
 | 
			
		||||
				localStorage.setItem("contestid", $("#contestname").val());
 | 
			
		||||
				localStorage.setItem("exchangetype", $("#exchangetype").val());
 | 
			
		||||
				localStorage.setItem("exchangereceived", $("#exch_rcvd").val());
 | 
			
		||||
				localStorage.setItem("exchangesent", $("#exch_sent").val());
 | 
			
		||||
				localStorage.setItem("exchangereceived", $("#exch_rcvd").val().toUpperCase());
 | 
			
		||||
				localStorage.setItem("exchangesent", $("#exch_sent").val().toUpperCase());
 | 
			
		||||
				localStorage.setItem("serialreceived", $("#exch_serial_r").val());
 | 
			
		||||
				localStorage.setItem("serialsent", $("#exch_serial_s").val());
 | 
			
		||||
				localStorage.setItem("gridsquarereceived", $("#exch_gridsquare_r").val());
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -68,7 +68,7 @@ $( document ).ready(function() {
 | 
			
		|||
		labelField: 'name',
 | 
			
		||||
		searchField: 'name',
 | 
			
		||||
		options: [],
 | 
			
		||||
		create: false,
 | 
			
		||||
		create: true,
 | 
			
		||||
		load: function(query, callback) {
 | 
			
		||||
			if (!query || query.length < 3) return callback();  // Only trigger if 3 or more characters are entered
 | 
			
		||||
			$.ajax({
 | 
			
		||||
| 
						 | 
				
			
			@ -101,7 +101,7 @@ $( document ).ready(function() {
 | 
			
		|||
		labelField: 'name',
 | 
			
		||||
		searchField: 'name',
 | 
			
		||||
		options: [],
 | 
			
		||||
		create: false,
 | 
			
		||||
		create: true,
 | 
			
		||||
		load: function(query, callback) {
 | 
			
		||||
			if (!query || query.length < 3) return callback();  // Only trigger if 3 or more characters are entered
 | 
			
		||||
			$.ajax({
 | 
			
		||||
| 
						 | 
				
			
			@ -134,7 +134,7 @@ $( document ).ready(function() {
 | 
			
		|||
		labelField: 'name',
 | 
			
		||||
		searchField: 'name',
 | 
			
		||||
		options: [],
 | 
			
		||||
		create: false,
 | 
			
		||||
		create: true,
 | 
			
		||||
		load: function(query, callback) {
 | 
			
		||||
			if (!query || query.length < 3) return callback();  // Only trigger if 3 or more characters are entered
 | 
			
		||||
			$.ajax({
 | 
			
		||||
| 
						 | 
				
			
			@ -327,6 +327,7 @@ function reset_fields() {
 | 
			
		|||
 | 
			
		||||
	$('#locator_info').text("");
 | 
			
		||||
	$('#country').val("");
 | 
			
		||||
	$('#continent').val("");
 | 
			
		||||
	$('#lotw_info').text("");
 | 
			
		||||
	$('#qrz_info').text("");
 | 
			
		||||
	$('#hamqth_info').text("");
 | 
			
		||||
| 
						 | 
				
			
			@ -536,6 +537,10 @@ $("#callsign").focusout(function() {
 | 
			
		|||
					$('#name').val(result.callsign_name);
 | 
			
		||||
				}
 | 
			
		||||
 | 
			
		||||
				if($('#continent').val() == "") {
 | 
			
		||||
					$('#continent').val(result.dxcc.cont);
 | 
			
		||||
				}
 | 
			
		||||
 | 
			
		||||
				if($('#qth').val() == "") {
 | 
			
		||||
					$('#qth').val(result.callsign_qth);
 | 
			
		||||
				}
 | 
			
		||||
| 
						 | 
				
			
			@ -772,6 +777,7 @@ function resetDefaultQSOFields() {
 | 
			
		|||
	$('#callsign_info').text("");
 | 
			
		||||
	$('#locator_info').text("");
 | 
			
		||||
	$('#country').val("");
 | 
			
		||||
	$('#continent').val("");
 | 
			
		||||
	$('#dxcc_id').val("");
 | 
			
		||||
	$('#cqz').val("");
 | 
			
		||||
	$('#name').val("");
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		正在加载…
	
		在新工单中引用