Merge pull request #1610 from AndreasK79/bands_added_wwff

Bands added wwff
这个提交包含在:
Andreas Kristiansen 2022-09-20 17:37:39 +02:00 提交者 GitHub
当前提交 de310b2362
找不到此签名对应的密钥
GPG 密钥 ID: 4AEE18F83AFDEB23
共有 8 个文件被更改,包括 42 次插入6 次删除

查看文件

@ -21,7 +21,7 @@ $config['migration_enabled'] = TRUE;
| 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['uscounties'] = $this->security->xss_clean($this->input->post('uscounties'));
$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'));
$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',
'uscounties' => $band['uscounties'] == "true" ? '1' : '0',
'was' => $band['was'] == "true" ? '1' : '0',
'wwff' => $band['wwff'] == "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->query("insert into bandxuser (bandid, userid, active, cq, dok, dxcc, iota, sig, sota, uscounties, was, 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);");
$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, 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) {

查看文件

@ -152,7 +152,7 @@ class User_Model extends CI_Model {
// Add user and insert bandsettings for user
$this->db->insert($this->config->item('auth_table'), $data);
$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;
} else {
return EUSERNAMEEXISTS;

查看文件

@ -11,7 +11,12 @@ class Wwff extends CI_Model {
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("col_band", $bandslots);
$this->db->order_by("COL_WWFF_REF", "ASC");
$this->db->where('COL_WWFF_REF !=', '');

查看文件

@ -35,8 +35,9 @@
<th>SIG</th>
<th>SOTA</th>
<th>US Counties</th>
<th>WAS</th>
<th>VUCC</th>
<th>WAS</th>
<th>WWFF</th>
<th>Bandgroup</th>
<th>SSB 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='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='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='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->ssb;?></td>
<td><?php echo $band->data;?></td>

查看文件

@ -190,6 +190,7 @@ function saveBand(id) {
'sota': $(".sota_"+id+" input[type='checkbox']").is(":checked"),
'uscounties': $(".uscounties_"+id+" input[type='checkbox']").is(":checked"),
'was': $(".was_"+id+" input[type='checkbox']").is(":checked"),
'wwff': $(".wwff_"+id+" input[type='checkbox']").is(":checked"),
'vucc': $(".vucc_"+id+" input[type='checkbox']").is(":checked")
},
success: function (html) {