mirror of
https://github.com/magicbug/Cloudlog
synced 2024-11-23 10:08:38 +00:00
Automated importing of LoTW users
This commit is contained in:
parent
06f74f3ed7
commit
008471a19d
@ -4,7 +4,8 @@ class Update extends CI_Controller {
|
||||
/*
|
||||
Controls Updating Elements of Cloudlog
|
||||
Functions:
|
||||
dxcc
|
||||
dxcc - imports the latest clublog cty.xml data
|
||||
lotw_users - imports lotw users
|
||||
*/
|
||||
|
||||
public function index()
|
||||
@ -160,5 +161,26 @@ class Update extends CI_Controller {
|
||||
echo "<table>";
|
||||
|
||||
}
|
||||
|
||||
public function lotw_users() {
|
||||
// Load Database connectors
|
||||
$this->load->model('lotw');
|
||||
|
||||
$this->lotw->empty_table("lotw_list");
|
||||
|
||||
$lines = file('http://www.hb9bza.net/lotw/lotw1.txt');
|
||||
|
||||
// Loop through our array, show HTML source as HTML source; and line numbers too.
|
||||
foreach ($lines as $line_num => $line) {
|
||||
echo "Line #<b>{$line_num}</b> : " . htmlspecialchars($line) . "<br />\n";
|
||||
|
||||
$data = array(
|
||||
'Callsign' => $line,
|
||||
);
|
||||
|
||||
$this->db->insert('lotw_list', $data);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
16
application/models/lotw.php
Normal file
16
application/models/lotw.php
Normal file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
class LOTW extends CI_Model {
|
||||
|
||||
function __construct()
|
||||
{
|
||||
// Call the Model constructor
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
|
||||
function empty_table($table) {
|
||||
$this->db->empty_table($table);
|
||||
}
|
||||
}
|
||||
?>
|
Loading…
Reference in New Issue
Block a user