Automated importing of LoTW users
这个提交包含在:
父节点
06f74f3ed7
当前提交
008471a19d
共有 2 个文件被更改,包括 39 次插入 和 1 次删除
|
|
@ -4,7 +4,8 @@ class Update extends CI_Controller {
|
||||||
/*
|
/*
|
||||||
Controls Updating Elements of Cloudlog
|
Controls Updating Elements of Cloudlog
|
||||||
Functions:
|
Functions:
|
||||||
dxcc
|
dxcc - imports the latest clublog cty.xml data
|
||||||
|
lotw_users - imports lotw users
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public function index()
|
public function index()
|
||||||
|
|
@ -160,5 +161,26 @@ class Update extends CI_Controller {
|
||||||
echo "<table>";
|
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
普通文件
16
application/models/lotw.php
普通文件
|
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
正在加载…
在新工单中引用