当前提交
3e2ab2fb45
共有 7 个文件被更改,包括 148 次插入 和 46 次删除
|
|
@ -21,7 +21,7 @@ $config['migration_enabled'] = TRUE;
|
||||||
| be upgraded / downgraded to.
|
| be upgraded / downgraded to.
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
$config['migration_version'] = 52;
|
$config['migration_version'] = 53;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -164,7 +164,9 @@ class Awards extends CI_Controller {
|
||||||
public function vucc_band(){
|
public function vucc_band(){
|
||||||
$this->load->model('vucc');
|
$this->load->model('vucc');
|
||||||
$band = str_replace('"', "", $this->input->get("Band"));
|
$band = str_replace('"', "", $this->input->get("Band"));
|
||||||
$data['vucc_array'] = $this->vucc->vucc_details($band);
|
$type = str_replace('"', "", $this->input->get("Type"));
|
||||||
|
$data['vucc_array'] = $this->vucc->vucc_details($band, $type);
|
||||||
|
$data['type'] = $type;
|
||||||
|
|
||||||
// Render Page
|
// Render Page
|
||||||
$data['page_title'] = "VUCC - band";
|
$data['page_title'] = "VUCC - band";
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||||
|
|
||||||
|
class Migration_gridsquare_index extends CI_Migration {
|
||||||
|
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
$sql = "CREATE INDEX HRD_IDX_COL_GRIDSQUARE USING BTREE ON " . $this->config->item('table_name') . " (COL_GRIDSQUARE)";
|
||||||
|
$this->db->query($sql);
|
||||||
|
|
||||||
|
$sql = "CREATE INDEX HRD_IDX_COL_VUCC_GRIDS USING BTREE ON " . $this->config->item('table_name') ." (COL_VUCC_GRIDS)";
|
||||||
|
$this->db->query($sql);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
$sql = "ALTER TABLE " . $this->config->item('table_name') . " DROP INDEX HRD_IDX_COL_GRIDSQUARE";
|
||||||
|
$this->db->query($sql);
|
||||||
|
|
||||||
|
$sql = "ALTER TABLE " . $this->config->item('table_name') . " DROP INDEX HRD_IDX_COL_VUCC_GRIDS";
|
||||||
|
$this->db->query($sql);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -232,19 +232,10 @@ class Logbook_model extends CI_Model {
|
||||||
$CI =& get_instance();
|
$CI =& get_instance();
|
||||||
$CI->load->model('Stations');
|
$CI->load->model('Stations');
|
||||||
$station_id = $CI->Stations->find_active();
|
$station_id = $CI->Stations->find_active();
|
||||||
$sql = "select * from " . $this->config->item('table_name') . " where station_id =" . $station_id . " and col_gridsquare like '" . $gridsquare. "%'";
|
$sql = "select * from " . $this->config->item('table_name') .
|
||||||
|
" where station_id =" . $station_id .
|
||||||
if ($band != 'All') {
|
" and (col_gridsquare like '" . $gridsquare. "%'
|
||||||
if ($band == 'SAT') {
|
or col_vucc_grids like '%" . $gridsquare. "%')";
|
||||||
$sql .= " and col_prop_mode ='" . $band . "'";
|
|
||||||
} else {
|
|
||||||
$sql .= " and col_prop_mode !='SAT'";
|
|
||||||
$sql .= " and col_band ='" . $band . "'";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$sql .= " union ";
|
|
||||||
$sql .= "select * from " . $this->config->item('table_name') . " where station_id =" . $station_id . " and col_vucc_grids like '%" . $gridsquare. "%'";
|
|
||||||
|
|
||||||
if ($band != 'All') {
|
if ($band != 'All') {
|
||||||
if ($band == 'SAT') {
|
if ($band == 'SAT') {
|
||||||
|
|
|
||||||
|
|
@ -164,7 +164,7 @@ class VUCC extends CI_Model
|
||||||
$sql = "select col_vucc_grids
|
$sql = "select col_vucc_grids
|
||||||
from " . $this->config->item('table_name') .
|
from " . $this->config->item('table_name') .
|
||||||
" where station_id =" . $station_id .
|
" where station_id =" . $station_id .
|
||||||
" and (LENGTH(col_vucc_grids) > 0) ";
|
" and col_vucc_grids <> '' ";
|
||||||
|
|
||||||
if ($confirmationMethod == 'both') {
|
if ($confirmationMethod == 'both') {
|
||||||
$sql .= " and (col_qsl_rcvd='Y' or col_lotw_qsl_rcvd='Y')";
|
$sql .= " and (col_qsl_rcvd='Y' or col_lotw_qsl_rcvd='Y')";
|
||||||
|
|
@ -199,7 +199,7 @@ class VUCC extends CI_Model
|
||||||
$sql = "select distinct upper(substring(col_gridsquare, 1, 4)) gridsquare
|
$sql = "select distinct upper(substring(col_gridsquare, 1, 4)) gridsquare
|
||||||
from " . $this->config->item('table_name') .
|
from " . $this->config->item('table_name') .
|
||||||
" where station_id =" . $station_id .
|
" where station_id =" . $station_id .
|
||||||
" and (LENGTH(col_gridsquare) > 0)";
|
" and col_gridsquare <> ''";
|
||||||
|
|
||||||
if ($confirmationMethod == 'both') {
|
if ($confirmationMethod == 'both') {
|
||||||
$sql .= " and (col_qsl_rcvd='Y' or col_lotw_qsl_rcvd='Y')";
|
$sql .= " and (col_qsl_rcvd='Y' or col_lotw_qsl_rcvd='Y')";
|
||||||
|
|
@ -228,27 +228,81 @@ class VUCC extends CI_Model
|
||||||
/*
|
/*
|
||||||
* Makes a list of all gridsquares on chosen band with info about lotw and qsl
|
* Makes a list of all gridsquares on chosen band with info about lotw and qsl
|
||||||
*/
|
*/
|
||||||
function vucc_details($band) {
|
function vucc_details($band, $type) {
|
||||||
$col_gridsquare_worked = $this->get_vucc_summary($band, 'none');
|
|
||||||
|
|
||||||
$workedGridArray = array();
|
if ($type == 'worked') {
|
||||||
foreach ($col_gridsquare_worked as $workedgrid) {
|
$workedGridArray = $this->getWorkedGridsList($band, 'none');
|
||||||
array_push($workedGridArray, $workedgrid['gridsquare']);
|
$vuccBand = $this->removeConfirmedGrids($band, $workedGridArray);
|
||||||
|
} else if ($type == 'confirmed') {
|
||||||
|
$workedGridArray = $this->getWorkedGridsList($band, 'both');
|
||||||
|
$vuccBand = $this->markConfirmedGrids($band, $workedGridArray);
|
||||||
|
} else {
|
||||||
|
$workedGridArray = $this->getWorkedGridsList($band, 'none');
|
||||||
|
$vuccBand = $this->markConfirmedGrids($band, $workedGridArray);
|
||||||
}
|
}
|
||||||
|
|
||||||
$col_vucc_grids_worked = $this->get_vucc_summary_col_vucc($band, 'none');
|
if (count($vuccBand) == 0) {
|
||||||
|
return 0;
|
||||||
|
} else {
|
||||||
|
ksort($vuccBand);
|
||||||
|
return $vuccBand;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($col_vucc_grids_worked as $gridSplit) {
|
function removeConfirmedGrids($band, $workedGridArray) {
|
||||||
|
$vuccDataQsl = $this->get_vucc_summary($band, 'qsl');
|
||||||
|
|
||||||
|
foreach ($vuccDataQsl as $grid) {
|
||||||
|
if (($key = array_search($grid['gridsquare'], $workedGridArray)) !== false) {
|
||||||
|
unset($workedGridArray[$key]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$vuccDataLotw = $this->get_vucc_summary($band, 'lotw');
|
||||||
|
|
||||||
|
foreach ($vuccDataLotw as $grid) {
|
||||||
|
if (($key = array_search($grid['gridsquare'], $workedGridArray)) !== false) {
|
||||||
|
unset($workedGridArray[$key]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$col_vucc_grids_confirmed_qsl = $this->get_vucc_summary_col_vucc($band, 'lotw');
|
||||||
|
|
||||||
|
foreach ($col_vucc_grids_confirmed_qsl as $gridSplit) {
|
||||||
$grids = explode(",", $gridSplit['col_vucc_grids']);
|
$grids = explode(",", $gridSplit['col_vucc_grids']);
|
||||||
foreach($grids as $key) {
|
foreach($grids as $key) {
|
||||||
$grid_four = strtoupper(substr(trim($key),0,4));
|
$grid_four = strtoupper(substr(trim($key),0,4));
|
||||||
|
if (($key = array_search($grid_four, $workedGridArray)) !== false) {
|
||||||
if(!in_array($grid_four, $workedGridArray)){
|
unset($workedGridArray[$key]);
|
||||||
array_push($workedGridArray, $grid_four);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$col_vucc_grids_confirmed_lotw = $this->get_vucc_summary_col_vucc($band, 'qsl');
|
||||||
|
|
||||||
|
foreach ($col_vucc_grids_confirmed_lotw as $gridSplit) {
|
||||||
|
$grids = explode(",", $gridSplit['col_vucc_grids']);
|
||||||
|
foreach($grids as $key) {
|
||||||
|
$grid_four = strtoupper(substr(trim($key),0,4));
|
||||||
|
if (($key = array_search($grid_four, $workedGridArray)) !== false) {
|
||||||
|
unset($workedGridArray[$key]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
foreach ($workedGridArray as $grid) {
|
||||||
|
$this->load->model('logbook_model');
|
||||||
|
$result = $this->logbook_model->vucc_qso_details($grid, $band);
|
||||||
|
$callsignlist = '';
|
||||||
|
foreach($result->result() as $call) {
|
||||||
|
$callsignlist .= $call->COL_CALL . '<br/>';
|
||||||
|
}
|
||||||
|
$vuccBand[$grid]['call'] = $callsignlist;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $vuccBand;
|
||||||
|
}
|
||||||
|
|
||||||
|
function markConfirmedGrids($band, $workedGridArray) {
|
||||||
foreach ($workedGridArray as $grid) {
|
foreach ($workedGridArray as $grid) {
|
||||||
$vuccBand[$grid]['qsl'] = '';
|
$vuccBand[$grid]['qsl'] = '';
|
||||||
$vuccBand[$grid]['lotw'] = '';
|
$vuccBand[$grid]['lotw'] = '';
|
||||||
|
|
@ -286,12 +340,32 @@ class VUCC extends CI_Model
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count($vuccBand) == 0) {
|
return $vuccBand;
|
||||||
return 0;
|
}
|
||||||
} else {
|
|
||||||
ksort($vuccBand);
|
function getWorkedGridsList($band, $confirmationMethod) {
|
||||||
return $vuccBand;
|
|
||||||
|
$col_gridsquare_worked = $this->get_vucc_summary($band, $confirmationMethod);
|
||||||
|
|
||||||
|
$workedGridArray = array();
|
||||||
|
foreach ($col_gridsquare_worked as $workedgrid) {
|
||||||
|
array_push($workedGridArray, $workedgrid['gridsquare']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$col_vucc_grids_worked = $this->get_vucc_summary_col_vucc($band, $confirmationMethod);
|
||||||
|
|
||||||
|
foreach ($col_vucc_grids_worked as $gridSplit) {
|
||||||
|
$grids = explode(",", $gridSplit['col_vucc_grids']);
|
||||||
|
foreach($grids as $key) {
|
||||||
|
$grid_four = strtoupper(substr(trim($key),0,4));
|
||||||
|
|
||||||
|
if(!in_array($grid_four, $workedGridArray)){
|
||||||
|
array_push($workedGridArray, $grid_four);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $workedGridArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_station_id() {
|
function get_station_id() {
|
||||||
|
|
|
||||||
|
|
@ -9,24 +9,35 @@
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<td>#</td>
|
<td>#</td>
|
||||||
<td>Gridsquare</td>
|
<td>Gridsquare</td>';
|
||||||
<td>QSL</td>
|
|
||||||
<td>LoTW</td>
|
if ($type != 'worked') {
|
||||||
</tr>
|
echo '<td>QSL</td>
|
||||||
|
<td>LoTW</td>';
|
||||||
|
} else {
|
||||||
|
echo '<td>Call</td>';
|
||||||
|
}
|
||||||
|
echo '</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>';
|
<tbody>';
|
||||||
foreach ($vucc_array as $vucc => $value) { // Fills the table with the data
|
foreach ($vucc_array as $vucc => $value) { // Fills the table with the data
|
||||||
echo '<tr>
|
echo '<tr>
|
||||||
<td>'. $i++ .'</td>
|
<td>'. $i++ .'</td>
|
||||||
<td><a href=\'javascript:displayVuccContacts("'. $vucc .'","'. $band . '")\'>'. $vucc .'</td>
|
<td><a href=\'javascript:displayVuccContacts("'. $vucc .'","'. $band . '")\'>'. $vucc .'</td>';
|
||||||
<td>'. $value['qsl'] . '</td>
|
|
||||||
<td>'. $value['lotw'] .'</td>
|
if ($type != 'worked') {
|
||||||
</tr>';
|
echo '<td>'. $value['qsl'] . '</td>
|
||||||
|
<td>'. $value['lotw'] .'</td>';
|
||||||
|
} else {
|
||||||
|
echo '<td>'. $value['call'] .'</td>';
|
||||||
|
}
|
||||||
|
|
||||||
|
echo '</tr>';
|
||||||
}
|
}
|
||||||
echo '</tfoot></table></div>';
|
echo '</tbody></table></div>';
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
echo '<div class="alert alert-danger" role="alert"><a href="#" class="close" data-dismiss="alert" aria-label="close">×</a>Nothing found!</div>';
|
echo '<div class="alert alert-danger" role="alert"><a href="#" class="close" data-dismiss="alert" aria-label="close">×</a>Nothing found!</div>';
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
|
|
@ -13,8 +13,8 @@
|
||||||
<?php foreach($vucc_array as $band => $vucc) {
|
<?php foreach($vucc_array as $band => $vucc) {
|
||||||
echo '<tr>';
|
echo '<tr>';
|
||||||
echo '<td><a href=\'vucc_band?Band="'. $band . '"\'>'. $band .'</td>';
|
echo '<td><a href=\'vucc_band?Band="'. $band . '"\'>'. $band .'</td>';
|
||||||
echo '<td>' . $vucc['worked'] . '</td>';
|
echo '<td><a href=\'vucc_band?Band="'. $band . '"&Type="worked"\'>'. $vucc['worked'] .'</td>';
|
||||||
echo '<td>' . $vucc['confirmed'] . '</td>';
|
echo '<td><a href=\'vucc_band?Band="'. $band . '"&Type="confirmed"\'>'. $vucc['confirmed'] .'</td>';
|
||||||
echo '</tr>';
|
echo '</tr>';
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
正在加载…
在新工单中引用