[Bands] Added WWFF support to bands

这个提交包含在:
Andreas 2022-09-20 17:25:50 +02:00
父节点 e98f6b5627
当前提交 9e110039f3
共有 7 个文件被更改,包括 41 次插入6 次删除

查看文件

@ -21,7 +21,7 @@ $config['migration_enabled'] = TRUE;
| be upgraded / downgraded to. | be upgraded / downgraded to.
| |
*/ */
$config['migration_version'] = 98; $config['migration_version'] = 99;
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------

查看文件

@ -127,6 +127,7 @@ class Band extends CI_Controller {
$band['sota'] = $this->security->xss_clean($this->input->post('sota')); $band['sota'] = $this->security->xss_clean($this->input->post('sota'));
$band['uscounties'] = $this->security->xss_clean($this->input->post('uscounties')); $band['uscounties'] = $this->security->xss_clean($this->input->post('uscounties'));
$band['was'] = $this->security->xss_clean($this->input->post('was')); $band['was'] = $this->security->xss_clean($this->input->post('was'));
$band['wwff'] = $this->security->xss_clean($this->input->post('wwff'));
$band['vucc'] = $this->security->xss_clean($this->input->post('vucc')); $band['vucc'] = $this->security->xss_clean($this->input->post('vucc'));
$this->load->model('bands'); $this->load->model('bands');

查看文件

@ -0,0 +1,26 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Migration_add_wwff_to_bandxuser extends CI_Migration {
public function up()
{
if (!$this->db->field_exists('wwff', 'bandxuser')) {
$fields = array(
'wwff' => array(
'type' => 'INT',
'constraint' => 20,
'unsigned' => TRUE,
),
);
$this->dbforge->add_column('bandxuser', $fields);
$this->db->query("update bandxuser set wwff = 1");
}
}
public function down()
{
$this->dbforge->drop_column('bandxuser', 'wwff');
}
}

查看文件

@ -251,6 +251,7 @@ class Bands extends CI_Model {
'sota' => $band['sota'] == "true" ? '1' : '0', 'sota' => $band['sota'] == "true" ? '1' : '0',
'uscounties' => $band['uscounties'] == "true" ? '1' : '0', 'uscounties' => $band['uscounties'] == "true" ? '1' : '0',
'was' => $band['was'] == "true" ? '1' : '0', 'was' => $band['was'] == "true" ? '1' : '0',
'wwff' => $band['wwff'] == "true" ? '1' : '0',
'vucc' => $band['vucc'] == "true" ? '1' : '0' 'vucc' => $band['vucc'] == "true" ? '1' : '0'
); );
@ -278,8 +279,8 @@ class Bands extends CI_Model {
$this->db->insert('bands', $data); $this->db->insert('bands', $data);
} }
$this->db->query("insert into bandxuser (bandid, userid, active, cq, dok, dxcc, iota, sig, sota, uscounties, was, vucc) $this->db->query("insert into bandxuser (bandid, userid, active, cq, dok, dxcc, iota, sig, sota, uscounties, was, wwff, vucc)
select bands.id, " . $this->session->userdata('user_id') . ", 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 from bands where band ='".$data['band']."' and not exists (select 1 from bandxuser where userid = " . $this->session->userdata('user_id') . " and bandid = bands.id);"); select bands.id, " . $this->session->userdata('user_id') . ", 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 from bands where band ='".$data['band']."' and not exists (select 1 from bandxuser where userid = " . $this->session->userdata('user_id') . " and bandid = bands.id);");
} }
function getband($id) { function getband($id) {

查看文件

@ -152,7 +152,7 @@ class User_Model extends CI_Model {
// Add user and insert bandsettings for user // Add user and insert bandsettings for user
$this->db->insert($this->config->item('auth_table'), $data); $this->db->insert($this->config->item('auth_table'), $data);
$insert_id = $this->db->insert_id(); $insert_id = $this->db->insert_id();
$this->db->query("insert into bandxuser (bandid, userid, active, cq, dok, dxcc, iota, sig, sota, uscounties, was, vucc) select bands.id, " . $insert_id . ", 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 from bands;"); $this->db->query("insert into bandxuser (bandid, userid, active, cq, dok, dxcc, iota, sig, sota, uscounties, was, wwff, vucc) select bands.id, " . $insert_id . ", 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 from bands;");
return OK; return OK;
} else { } else {
return EUSERNAMEEXISTS; return EUSERNAMEEXISTS;

查看文件

@ -11,7 +11,12 @@ class Wwff extends CI_Model {
return null; return null;
} }
$this->load->model('bands');
$bandslots = $this->bands->get_worked_bands('wwff');
$this->db->where_in("station_id", $logbooks_locations_array); $this->db->where_in("station_id", $logbooks_locations_array);
$this->db->where_in("col_band", $bandslots);
$this->db->order_by("COL_WWFF_REF", "ASC"); $this->db->order_by("COL_WWFF_REF", "ASC");
$this->db->where('COL_WWFF_REF !=', ''); $this->db->where('COL_WWFF_REF !=', '');

查看文件

@ -35,8 +35,9 @@
<th>SIG</th> <th>SIG</th>
<th>SOTA</th> <th>SOTA</th>
<th>US Counties</th> <th>US Counties</th>
<th>WAS</th>
<th>VUCC</th> <th>VUCC</th>
<th>WAS</th>
<th>WWFF</th>
<th>Bandgroup</th> <th>Bandgroup</th>
<th>SSB QRG</th> <th>SSB QRG</th>
<th>DATA QRG</th> <th>DATA QRG</th>
@ -57,8 +58,9 @@
<td class='sig_<?php echo $band->id ?>'><input type="checkbox" <?php if ($band->sig == 1) {echo 'checked';}?>></td> <td class='sig_<?php echo $band->id ?>'><input type="checkbox" <?php if ($band->sig == 1) {echo 'checked';}?>></td>
<td class='sota_<?php echo $band->id ?>'><input type="checkbox" <?php if ($band->sota == 1) {echo 'checked';}?>></td> <td class='sota_<?php echo $band->id ?>'><input type="checkbox" <?php if ($band->sota == 1) {echo 'checked';}?>></td>
<td class='uscounties_<?php echo $band->id ?>'><input type="checkbox" <?php if ($band->uscounties == 1) {echo 'checked';}?>></td> <td class='uscounties_<?php echo $band->id ?>'><input type="checkbox" <?php if ($band->uscounties == 1) {echo 'checked';}?>></td>
<td class='was_<?php echo $band->id ?>'><input type="checkbox" <?php if ($band->was == 1) {echo 'checked';}?>></td>
<td class='vucc_<?php echo $band->id ?>'><input type="checkbox" <?php if ($band->vucc == 1) {echo 'checked';}?>></td> <td class='vucc_<?php echo $band->id ?>'><input type="checkbox" <?php if ($band->vucc == 1) {echo 'checked';}?>></td>
<td class='was_<?php echo $band->id ?>'><input type="checkbox" <?php if ($band->was == 1) {echo 'checked';}?>></td>
<td class='wwff_<?php echo $band->id ?>'><input type="checkbox" <?php if ($band->wwff == 1) {echo 'checked';}?>></td>
<td><?php echo $band->bandgroup;?></td> <td><?php echo $band->bandgroup;?></td>
<td><?php echo $band->ssb;?></td> <td><?php echo $band->ssb;?></td>
<td><?php echo $band->data;?></td> <td><?php echo $band->data;?></td>