当前提交
383602c482
共有 7 个文件被更改,包括 641 次插入 和 0 次删除
124
application/controllers/Cabrillo.php
普通文件
124
application/controllers/Cabrillo.php
普通文件
|
|
@ -0,0 +1,124 @@
|
|||
<?php
|
||||
|
||||
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
|
||||
/*
|
||||
This controller contains features for Cabrillo
|
||||
*/
|
||||
|
||||
class Cabrillo extends CI_Controller {
|
||||
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
}
|
||||
|
||||
public function index() {
|
||||
$data['page_title'] = "Export Cabrillo";
|
||||
|
||||
$this->load->model('Contesting_model');
|
||||
$this->load->model('stations');
|
||||
|
||||
$data['station_profile'] = $this->stations->all_of_user();
|
||||
$active_station_id = $this->stations->find_active();
|
||||
$station_profile = $this->stations->profile($active_station_id);
|
||||
|
||||
$data['active_station_info'] = $station_profile->row();
|
||||
|
||||
$footerData = [];
|
||||
$footerData['scripts'] = [
|
||||
'assets/js/sections/cabrillo.js'
|
||||
];
|
||||
|
||||
$this->load->view('interface_assets/header', $data);
|
||||
$this->load->view('cabrillo/index');
|
||||
$this->load->view('interface_assets/footer', $footerData);
|
||||
}
|
||||
|
||||
public function getContests() {
|
||||
$this->load->model('Contesting_model');
|
||||
|
||||
$station_id = $this->security->xss_clean($this->input->post('station_id'));
|
||||
$year = $this->security->xss_clean($this->input->post('year'));
|
||||
$result = $this->Contesting_model->get_logged_contests($station_id, $year);
|
||||
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode($result);
|
||||
}
|
||||
|
||||
public function getYears() {
|
||||
$this->load->model('Contesting_model');
|
||||
$station_id = $this->security->xss_clean($this->input->post('station_id'));
|
||||
|
||||
$result = $this->Contesting_model->get_logged_years($station_id);
|
||||
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode($result);
|
||||
}
|
||||
|
||||
public function getContestDates() {
|
||||
$this->load->model('Contesting_model');
|
||||
$station_id = $this->security->xss_clean($this->input->post('station_id'));
|
||||
$year = $this->security->xss_clean($this->input->post('year'));
|
||||
$contestid = $this->security->xss_clean($this->input->post('contestid'));
|
||||
|
||||
$result = $this->Contesting_model->get_contest_dates($station_id, $year, $contestid);
|
||||
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode($result);
|
||||
}
|
||||
|
||||
public function export() {
|
||||
// Set memory limit to unlimited to allow heavy usage
|
||||
ini_set('memory_limit', '-1');
|
||||
$this->load->model('Contesting_model');
|
||||
|
||||
$this->load->model('stations');
|
||||
|
||||
$this->load->model('user_model');
|
||||
|
||||
$station_id = $this->security->xss_clean($this->input->post('station_id'));
|
||||
$contest_id = $this->security->xss_clean($this->input->post('contestid'));
|
||||
|
||||
$from = $this->security->xss_clean($this->input->post('contestdatesfrom'));
|
||||
$to = $this->security->xss_clean($this->input->post('contestdatesto'));
|
||||
|
||||
$station = $this->stations->profile($station_id);
|
||||
|
||||
$station = $station->row();
|
||||
|
||||
$userinfo = $this->user_model->get_by_id($this->session->userdata('user_id'));
|
||||
|
||||
$userinfo = $userinfo->row();
|
||||
|
||||
$data['qsos'] = $this->Contesting_model->export_custom($from, $to, $contest_id, $station_id);
|
||||
|
||||
$data['contest_id'] = $contest_id;
|
||||
$data['callsign'] = $station->station_callsign;
|
||||
$data['claimed_score'] = '';
|
||||
$data['categoryoperator'] = $this->security->xss_clean($this->input->post('categoryoperator'));
|
||||
$data['categoryassisted'] = $this->security->xss_clean($this->input->post('categoryassisted'));
|
||||
$data['categoryband'] = $this->security->xss_clean($this->input->post('categoryband'));
|
||||
$data['categorymode'] = $this->security->xss_clean($this->input->post('categorymode'));
|
||||
$data['categorypower'] = $this->security->xss_clean($this->input->post('categorypower'));
|
||||
$data['categorystation'] = $this->security->xss_clean($this->input->post('categorystation'));
|
||||
$data['categorytransmitter'] = $this->security->xss_clean($this->input->post('categorytransmitter'));
|
||||
$data['categoryoverlay'] = $this->security->xss_clean($this->input->post('categoryoverlay'));
|
||||
$data['operators'] = $this->security->xss_clean($this->input->post('operators'));
|
||||
$data['club'] = $this->security->xss_clean($this->input->post('club'));
|
||||
$data['name'] = $userinfo->user_firstname . ' ' . $userinfo->user_lastname;
|
||||
$data['email'] = $userinfo->user_email;
|
||||
$data['address'] = $this->security->xss_clean($this->input->post('address'));
|
||||
$data['addresscity'] = $this->security->xss_clean($this->input->post('addresscity'));
|
||||
$data['addressstateprovince'] = $this->security->xss_clean($this->input->post('addressstateprovince'));
|
||||
$data['addresspostalcode'] = $this->security->xss_clean($this->input->post('addresspostalcode'));
|
||||
$data['addresscountry'] = $this->security->xss_clean($this->input->post('addresscountry'));
|
||||
$data['soapbox'] = $this->security->xss_clean($this->input->post('soapbox'));
|
||||
$data['gridlocator'] = $station->station_gridsquare;
|
||||
|
||||
$this->load->view('cabrillo/export', $data);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,142 @@
|
|||
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
// Format according to https://wwrof.org/cabrillo/cabrillo-qso-data/
|
||||
class Cabrilloformat {
|
||||
|
||||
public function header($contest_id, $callsign, $claimed_score,
|
||||
$operators, $club, $name, $address, $addresscity, $addressstateprovince, $addresspostalcode, $addresscountry, $soapbox, $gridlocator,
|
||||
$categoryoverlay, $categorytransmitter, $categorystation, $categorypower, $categorymode, $categoryband, $categoryassisted, $categoryoperator, $email) {
|
||||
$cab_header = "";
|
||||
$cab_header .= "START-OF-LOG: 3.0"."\r\n";
|
||||
$cab_header .= "CONTEST: ".$contest_id."\r\n";
|
||||
$cab_header .= "CALLSIGN: ".$callsign."\r\n";
|
||||
|
||||
if($claimed_score != null) {
|
||||
$cab_header .= "CLAIMED-SCORE: ".$claimed_score."\r\n";
|
||||
}
|
||||
|
||||
$cab_header .= "OPERATORS: ".$operators."\r\n";
|
||||
|
||||
if($club != null) {
|
||||
$cab_header .= "CLUB: ".$club."\r\n";
|
||||
}
|
||||
|
||||
$cab_header .= "CATEGORY-OPERATOR: ".$categoryoperator."\r\n";
|
||||
$cab_header .= "CATEGORY-BAND: ".$categoryband."\r\n";
|
||||
$cab_header .= "CATEGORY-ASSISTED: ".$categoryassisted."\r\n";
|
||||
$cab_header .= "CATEGORY-MODE: ".$categorymode."\r\n";
|
||||
$cab_header .= "CATEGORY-POWER: ".$categorypower."\r\n";
|
||||
$cab_header .= "CATEGORY-STATION: ".$categorystation."\r\n";
|
||||
$cab_header .= "CATEGORY-TRANSMITTER: ".$categorytransmitter."\r\n";
|
||||
$cab_header .= "CATEGORY-OVERLAY: ".$categoryoverlay."\r\n";
|
||||
|
||||
$cab_header .= "NAME: ".$name."\r\n";
|
||||
$cab_header .= "ADDRESS: ".$address."\r\n";
|
||||
$cab_header .= "ADDRESS-CITY: ".$addresscity."\r\n";
|
||||
$cab_header .= "ADDRESS-STATE-PROVINCE: ".$addressstateprovince."\r\n";
|
||||
$cab_header .= "ADDRESS-POSTALCODE: ".$addresspostalcode."\r\n";
|
||||
$cab_header .= "ADDRESS-COUNTRY: ".$addresscountry."\r\n";
|
||||
$cab_header .= "EMAIL: ".$email."\r\n";
|
||||
$cab_header .= "SOAPBOX: ".$soapbox."\r\n";
|
||||
|
||||
if($gridlocator != null) {
|
||||
$cab_header .= "GRID-LOCATOR: ".$gridlocator."\r\n";
|
||||
}
|
||||
|
||||
$cab_header .= "CREATED-BY: Cloudlog"."\r\n";
|
||||
|
||||
return $cab_header;
|
||||
|
||||
}
|
||||
|
||||
public function footer() {
|
||||
return "END-OF-LOG:";
|
||||
}
|
||||
|
||||
public function qso($qso) {
|
||||
$freq = substr($qso->COL_FREQ, 0, -3);
|
||||
if ($freq > 30000) {
|
||||
if ($freq > 250000000) {
|
||||
$freq = "LIGHT";
|
||||
}
|
||||
if ($freq >= 241000000 && $freq <= 250000000 ) {
|
||||
$freq = "241G";
|
||||
}
|
||||
if ($freq >= 134000000 && $freq <= 141000000 ) {
|
||||
$freq = "134G";
|
||||
}
|
||||
if ($freq >= 122250000 && $freq <= 123000000 ) {
|
||||
$freq = "122G";
|
||||
}
|
||||
if ($freq >= 75500000 && $freq <= 81500000 ) {
|
||||
$freq = "75G";
|
||||
}
|
||||
if ($freq >= 47000000 && $freq <= 47200000 ) {
|
||||
$freq = "47G";
|
||||
}
|
||||
if ($freq >= 24000000 && $freq <= 24250000 ) {
|
||||
$freq = "24G";
|
||||
}
|
||||
if ($freq >= 10000000 && $freq <= 10500000 ) {
|
||||
$freq = "10G";
|
||||
}
|
||||
if ($freq >= 5650000 && $freq <= 5850000 ) {
|
||||
$freq = "5.7G";
|
||||
}
|
||||
if ($freq >= 3400000 && $freq <= 3475000 ) {
|
||||
$freq = "3.4G";
|
||||
}
|
||||
if ($freq >= 2320000 && $freq <= 2450000 ) {
|
||||
$freq = "2.4G";
|
||||
}
|
||||
if ($freq >= 1240000 && $freq <= 1300000 ) {
|
||||
$freq = "1.2G";
|
||||
}
|
||||
if ($freq >= 902000 && $freq <= 928000 ) {
|
||||
$freq = "902";
|
||||
}
|
||||
if ($freq >= 430000 && $freq <= 440000 ) {
|
||||
$freq = "432";
|
||||
}
|
||||
if ($freq >= 222000 && $freq <= 225000 ) {
|
||||
$freq = "222";
|
||||
}
|
||||
if ($freq >= 144000 && $freq <= 146000 ) {
|
||||
$freq = "144";
|
||||
}
|
||||
if ($freq >= 70150 && $freq <= 70210 ) {
|
||||
$freq = "70";
|
||||
}
|
||||
if ($freq >= 50000 && $freq <= 52000 ) {
|
||||
$freq = "50";
|
||||
}
|
||||
}
|
||||
|
||||
if($qso->COL_MODE == "SSB") {
|
||||
$mode = "PH";
|
||||
} elseif($qso->COL_MODE == "RTTY") {
|
||||
$mode = "RY";
|
||||
} else {
|
||||
$mode = $qso->COL_MODE;
|
||||
}
|
||||
|
||||
$time = substr($qso->COL_TIME_ON, 0, -3);
|
||||
|
||||
$time = str_replace(":","",$time);
|
||||
|
||||
if ($qso->COL_STX_STRING != "") {
|
||||
|
||||
if($qso->COL_SRX_STRING != "") {
|
||||
$rx_string = $qso->COL_SRX_STRING;
|
||||
} else {
|
||||
$rx_string = "--";
|
||||
}
|
||||
|
||||
return "QSO: ".sprintf("%6s", $freq)." ".$mode." ".$time." ".sprintf("%-13s", $qso->station_callsign)." ".sprintf("%3s", $qso->COL_RST_SENT)." ".sprintf("%-6s", sprintf("%03d", $qso->COL_STX))." ".$qso->COL_STX_STRING . " " .sprintf("%-13s", $qso->COL_CALL)." ".sprintf("%3s", $qso->COL_RST_RCVD)." ".sprintf("%-6s", sprintf("%03d", $qso->COL_SRX))." " . $rx_string . " 0\n";
|
||||
} else {
|
||||
|
||||
return "QSO: ".sprintf("%6s", $freq)." ".$mode." ".$time." ".sprintf("%-13s", $qso->station_callsign)." ".sprintf("%3s", $qso->COL_RST_SENT)." ".sprintf("%-6s", sprintf("%03d", $qso->COL_STX))." ".sprintf("%-13s", $qso->COL_CALL)." ".sprintf("%3s", $qso->COL_RST_RCVD)." ".sprintf("%-6s", sprintf("%03d", $qso->COL_SRX))." 0\n";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -235,4 +235,87 @@ class Contesting_model extends CI_Model {
|
|||
}
|
||||
return;
|
||||
}
|
||||
|
||||
function export_custom($from, $to, $contest_id, $station_id) {
|
||||
$this->db->select(''.$this->config->item('table_name').'.*, station_profile.*');
|
||||
$this->db->from($this->config->item('table_name'));
|
||||
$this->db->where($this->config->item('table_name').'.station_id', $station_id);
|
||||
|
||||
// If date is set, we format the date and add it to the where-statement
|
||||
if ($from != 0) {
|
||||
$from = DateTime::createFromFormat('Y-m-d', $from);
|
||||
$from = $from->format('Y-m-d');
|
||||
$this->db->where("date(".$this->config->item('table_name').".COL_TIME_ON) >= '".$from."'");
|
||||
}
|
||||
if ($to != 0) {
|
||||
$to = DateTime::createFromFormat('Y-m-d', $to);
|
||||
$to = $to->format('Y-m-d');
|
||||
$this->db->where("date(".$this->config->item('table_name').".COL_TIME_ON) <= '".$to."'");
|
||||
}
|
||||
|
||||
$this->db->where($this->config->item('table_name').'.COL_CONTEST_ID', $contest_id);
|
||||
|
||||
$this->db->order_by($this->config->item('table_name').".COL_TIME_ON", "ASC");
|
||||
|
||||
$this->db->join('station_profile', 'station_profile.station_id = '.$this->config->item('table_name').'.station_id');
|
||||
|
||||
return $this->db->get();
|
||||
}
|
||||
|
||||
function get_logged_contests2() {
|
||||
$CI =& get_instance();
|
||||
$CI->load->model('Stations');
|
||||
$station_id = $CI->Stations->find_active();
|
||||
|
||||
$sql = "select col_contest_id, min(date(col_time_on)) mindate, max(date(col_time_on)) maxdate, year(col_time_on) year, month(col_time_on) month
|
||||
from " . $this->config->item('table_name') . "
|
||||
where coalesce(COL_CONTEST_ID, '') <> ''
|
||||
and station_id =" . $station_id;
|
||||
|
||||
$sql .= " group by COL_CONTEST_ID , year(col_time_on), month(col_time_on) order by year(col_time_on) desc";
|
||||
|
||||
$data = $this->db->query($sql);
|
||||
|
||||
return ($data->result());
|
||||
}
|
||||
|
||||
function get_logged_years($station_id) {
|
||||
|
||||
$sql = "select distinct year(col_time_on) year
|
||||
from " . $this->config->item('table_name') . "
|
||||
where coalesce(COL_CONTEST_ID, '') <> ''
|
||||
and station_id =" . $station_id;
|
||||
|
||||
$sql .= " order by year(col_time_on) desc";
|
||||
|
||||
$data = $this->db->query($sql);
|
||||
|
||||
return $data->result();
|
||||
}
|
||||
|
||||
function get_logged_contests($station_id, $year) {
|
||||
$sql = "select distinct col_contest_id
|
||||
from " . $this->config->item('table_name') . "
|
||||
where coalesce(COL_CONTEST_ID, '') <> ''
|
||||
and station_id =" . $station_id .
|
||||
" and year(col_time_on) ='" . $year . "'";
|
||||
|
||||
$sql .= " order by COL_CONTEST_ID asc";
|
||||
|
||||
$data = $this->db->query($sql);
|
||||
|
||||
return $data->result();
|
||||
}
|
||||
|
||||
function get_contest_dates($station_id, $year, $contestid) {
|
||||
$sql = "select distinct (date(col_time_on)) date
|
||||
from " . $this->config->item('table_name') . "
|
||||
where coalesce(COL_CONTEST_ID, '') <> ''
|
||||
and station_id =" . $station_id .
|
||||
" and year(col_time_on) ='" . $year . "' and col_contest_id ='" . $contestid . "'";
|
||||
|
||||
$data = $this->db->query($sql);
|
||||
|
||||
return $data->result();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,14 @@
|
|||
<?php
|
||||
header('Content-Type: text/plain; charset=utf-8');
|
||||
header('Content-Disposition: attachment; filename="'.$callsign.'-'.$contest_id.'-'.date('dmY-Hi').'.cbr"');
|
||||
|
||||
$CI =& get_instance();
|
||||
$CI->load->library('Cabrilloformat');
|
||||
|
||||
echo $CI->cabrilloformat->header($contest_id, $callsign, $claimed_score,
|
||||
$operators, $club, $name, $address, $addresscity, $addressstateprovince, $addresspostalcode, $addresscountry, $soapbox, $gridlocator,
|
||||
$categoryoverlay, $categorytransmitter, $categorystation, $categorypower, $categorymode, $categoryband, $categoryassisted, $categoryoperator, $email);
|
||||
foreach ($qsos->result() as $row) {
|
||||
echo $CI->cabrilloformat->qso($row);
|
||||
}
|
||||
echo $CI->cabrilloformat->footer();
|
||||
185
application/views/cabrillo/index.php
普通文件
185
application/views/cabrillo/index.php
普通文件
|
|
@ -0,0 +1,185 @@
|
|||
<div class="container">
|
||||
|
||||
<br>
|
||||
|
||||
<h2><?php echo $page_title; ?></h2>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
Export a contest to a Cabrillo log
|
||||
</div>
|
||||
<div class="card-body">
|
||||
|
||||
<?php
|
||||
echo '<div class="contests">';
|
||||
|
||||
|
||||
if ($station_profile) { ?>
|
||||
|
||||
<form class="form" action="<?php echo site_url('cabrillo/export'); ?>" method="post" enctype="multipart/form-data">
|
||||
<div class="form-group form-inline row">
|
||||
<div class="col-md-3 control-label" for="station_id">Select Station Location: </div>
|
||||
<select id="station_id" name="station_id" class="custom-select my-1 mr-sm-2 col-md-4">
|
||||
<?php foreach ($station_profile->result() as $station) { ?>
|
||||
<option value="<?php echo $station->station_id; ?>" <?php if ($station->station_id == $this->stations->find_active()) { echo " selected =\"selected\""; } ?>>Callsign: <?php echo $station->station_callsign; ?> (<?php echo $station->station_profile_name; ?>)</option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
<button id="button1id" type="button" onclick="loadYears();" name="button1id" class="btn btn-sm btn-primary"> Proceed</button>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-inline row contestyear">
|
||||
</div>
|
||||
<div class="form-group form-inline row contestname">
|
||||
</div>
|
||||
<div class="form-group form-inline row contestdates">
|
||||
</div>
|
||||
<div hidden="true" class="form-group form-inline row additionalinfo">
|
||||
<div class="col-md-3 control-label" for="soapbox">Club: </div>
|
||||
<input class="form-control my-1 mr-sm-2 col-md-4" id="soapbox" type="soapbox" name="soapbox" aria-label="soapbox">
|
||||
</div>
|
||||
<div hidden="true" class="form-group form-inline row additionalinfo">
|
||||
<div class="col-md-3 control-label" for="categoryoperator">Category-operator: </div>
|
||||
<select class="custom-select my-1 mr-sm-2 col-md-4" id="categoryoperator" name="categoryoperator">
|
||||
<option value="SINGLE-OP">Single-OP</option>
|
||||
<option value="MULTI-OP">Mulit-OP</option>
|
||||
<option value="CHECKLOG">Checklog</option>
|
||||
</select>
|
||||
</div>
|
||||
<div hidden="true" class="form-group form-inline row additionalinfo">
|
||||
<div class="col-md-3 control-label" for="categoryassisted">Category-assisted: </div>
|
||||
<select class="custom-select my-1 mr-sm-2 col-md-4" id="categoryassisted" name="categoryassisted">
|
||||
<option value="NON-ASSISTED">Non-assisted</option>
|
||||
<option value="ASSISTED">Assisted</option>
|
||||
</select>
|
||||
</div>
|
||||
<div hidden="true" class="form-group form-inline row additionalinfo">
|
||||
<div class="col-md-3 control-label" for="categoryband">Category-band: </div>
|
||||
<select class="custom-select my-1 mr-sm-2 col-md-4" id="categoryband" name="categoryband">
|
||||
<option value="ALL">ALL</option>
|
||||
<option value="160M">160M</option>
|
||||
<option value="80M">80M</option>
|
||||
<option value="40M">40M</option>
|
||||
<option value="20M">20M</option>
|
||||
<option value="15M">15M</option>
|
||||
<option value="10M">10M</option>
|
||||
<option value="6M">6M</option>
|
||||
<option value="4M">4M</option>
|
||||
<option value="2M">2M</option>
|
||||
<option value="222">222</option>
|
||||
<option value="432">432</option>
|
||||
<option value="902">902</option>
|
||||
<option value="1.2G">1.2G</option>
|
||||
<option value="2.3G">2.3G</option>
|
||||
<option value="3.4G">3.4G</option>
|
||||
<option value="5.7G">5.7G</option>
|
||||
<option value="10G">10G</option>
|
||||
<option value="24G">24G</option>
|
||||
<option value="47G">47G</option>
|
||||
<option value="75G">75G</option>
|
||||
<option value="122G">122G</option>
|
||||
<option value="134G">134G</option>
|
||||
<option value="241G">241G</option>
|
||||
<option value="Light">Light</option>
|
||||
<option value="VHF-3-BAND and VHF-FM-ONLY (ARRL VHF Contests only)">VHF-3-BAND and VHF-FM-ONLY (ARRL VHF Contests only)</option>
|
||||
</select>
|
||||
</div>
|
||||
<div hidden="true" class="form-group form-inline row additionalinfo">
|
||||
<div class="col-md-3 control-label" for="categorymode">Category-mode: </div>
|
||||
<select class="custom-select my-1 mr-sm-2 col-md-4" id="categorymode" name="categorymode">
|
||||
<option value="MIXED">MIXED</option>
|
||||
<option value="CW">CW</option>
|
||||
<option value="DIGI">DIGI</option>
|
||||
<option value="FM">FM</option>
|
||||
<option value="RTTY">RTTY</option>
|
||||
<option value="SSB">SSB</option>
|
||||
</select>
|
||||
</div>
|
||||
<div hidden="true" class="form-group form-inline row additionalinfo">
|
||||
<div class="col-md-3 control-label" for="categorypower">Category-power: </div>
|
||||
<select class="custom-select my-1 mr-sm-2 col-md-4" id="categorypower" name="categorypower">
|
||||
<option value="LOW">LOW</option>
|
||||
<option value="HIGH">HIGH</option>
|
||||
<option value="QRP">QRP</option>
|
||||
</select>
|
||||
</div>
|
||||
<div hidden="true" class="form-group form-inline row additionalinfo">
|
||||
<div class="col-md-3 control-label" for="categorystation">Category-station: </div>
|
||||
<select class="custom-select my-1 mr-sm-2 col-md-4" id="categorystation" name="categorystation">
|
||||
<option value="FIXED">FIXED</option>
|
||||
<option value="DISTRIBUTED">DISTRIBUTED</option>
|
||||
<option value="MOBILE">MOBILE</option>
|
||||
<option value="PORTABLE">PORTABLE</option>
|
||||
<option value="ROVER">ROVER</option>
|
||||
<option value="ROVER-LIMITED">ROVER-LIMITED</option>
|
||||
<option value="ROVER-UNLIMITED">ROVER-UNLIMITED</option>
|
||||
<option value="EXPEDITION">EXPEDITION</option>
|
||||
<option value="HQ">HQ</option>
|
||||
<option value="SCHOOL">SCHOOL</option>
|
||||
<option value="EXPLORER">EXPLORER</option>
|
||||
</select>
|
||||
</div>
|
||||
<div hidden="true" class="form-group form-inline row additionalinfo">
|
||||
<div class="col-md-3 control-label" for="categorytransmitter">Category-transmitter: </div>
|
||||
<select class="custom-select my-1 mr-sm-2 col-md-4" id="categorytransmitter" name="categorytransmitter">
|
||||
<option value="ONE">ONE</option>
|
||||
<option value="TWO">TWO</option>
|
||||
<option value="LIMITED">LIMITED</option>
|
||||
<option value="UNLIMITED">UNLIMITED</option>
|
||||
<option value="SWL">SWL</option>
|
||||
</select>
|
||||
</div>
|
||||
<div hidden="true" class="form-group form-inline row additionalinfo">
|
||||
<div class="col-md-3 control-label" for="categoryoverlay">Category-overlay: </div>
|
||||
<select class="custom-select my-1 mr-sm-2 col-md-4" id="categoryoverlay" name="categoryoverlay">
|
||||
<option value="CLASSIC">CLASSIC</option>
|
||||
<option value="ROOKIE">ROOKIE</option>
|
||||
<option value="TB-WIRES">TB-WIRES</option>
|
||||
<option value="YOUTH">YOUTH</option>
|
||||
<option value="NOVICE-TECH">NOVICE-TECH</option>
|
||||
<option value="YL">YL</option>
|
||||
</select>
|
||||
</div>
|
||||
<div hidden="true" class="form-group form-inline row additionalinfo">
|
||||
<div class="col-md-3 control-label" for="operators">Operators: </div>
|
||||
<input class="form-control my-1 mr-sm-2 col-md-4" id="operators" type="operators" name="operators" aria-label="operators">
|
||||
</select>
|
||||
</div>
|
||||
<div hidden="true" class="form-group form-inline row additionalinfo">
|
||||
<div class="col-md-3 control-label" for="soapbox">Soapbox: </div>
|
||||
<input class="form-control my-1 mr-sm-2 col-md-4" id="soapbox" type="text" name="soapbox" aria-label="soapbox">
|
||||
</div>
|
||||
<div hidden="true" class="form-group form-inline row additionalinfo">
|
||||
<div class="col-md-3 control-label" for="address">Address: </div>
|
||||
<input class="form-control my-1 mr-sm-2 col-md-4" id="address" type="text" name="address" aria-label="address">
|
||||
</div>
|
||||
<div hidden="true" class="form-group form-inline row additionalinfo">
|
||||
<div class="col-md-3 control-label" for="addresscity">Address-city: </div>
|
||||
<input class="form-control my-1 mr-sm-2 col-md-4" id="addresscity" type="text" name="addresscity" aria-label="addresscity">
|
||||
</div>
|
||||
<div hidden="true" class="form-group form-inline row additionalinfo">
|
||||
<div class="col-md-3 control-label" for="addressstateprovince">Address-state-province: </div>
|
||||
<input class="form-control my-1 mr-sm-2 col-md-4" id="addressstateprovince" type="text" name="addressstateprovince" aria-label="addressstateprovince">
|
||||
</div>
|
||||
<div hidden="true" class="form-group form-inline row additionalinfo">
|
||||
<div class="col-md-3 control-label" for="addresspostalcode">Address-postalcode: </div>
|
||||
<input class="form-control my-1 mr-sm-2 col-md-4" id="addresspostalcode" type="text" name="addresspostalcode" aria-label="addresspostalcode">
|
||||
</div>
|
||||
<div hidden="true" class="form-group form-inline row additionalinfo">
|
||||
<div class="col-md-3 control-label" for="addresscountry">Address-country: </div>
|
||||
<input class="form-control my-1 mr-sm-2 col-md-4" id="addresscountry" type="text" name="addresscountry" aria-label="addresscountry">
|
||||
</div>
|
||||
<div hidden="true" class="form-group form-inline row additionalinfo">
|
||||
<div class="col-md-3 control-label" for="button1id"></div>
|
||||
<button id="button1id" type="submit" name="button1id" class="btn btn-sm btn-primary"> Export</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<?php }
|
||||
else {
|
||||
echo 'No contests were found in your log.';
|
||||
}
|
||||
?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -230,6 +230,8 @@
|
|||
|
||||
<a class="dropdown-item" href="<?php echo site_url('csv');?>" title="SOTA CSV Export"><i class="fas fa-sync"></i> SOTA CSV Export</a>
|
||||
|
||||
<a class="dropdown-item" href="<?php echo site_url('cabrillo');?>" title="Cabrillo Export"><i class="fas fa-sync"></i> Cabrillo Export</a>
|
||||
|
||||
<div class="dropdown-divider"></div>
|
||||
|
||||
<?php
|
||||
|
|
|
|||
91
assets/js/sections/cabrillo.js
普通文件
91
assets/js/sections/cabrillo.js
普通文件
|
|
@ -0,0 +1,91 @@
|
|||
function loadYears() {
|
||||
$(".contestyear").empty();
|
||||
$(".contestname").empty();
|
||||
$(".contestdates").empty();
|
||||
$(".additionalinfo").attr("hidden", true);
|
||||
$.ajax({
|
||||
url: base_url+'index.php/cabrillo/getYears',
|
||||
type: 'post',
|
||||
data: {'station_id': $("#station_id").val()},
|
||||
success: function (data) {
|
||||
if (data.length > 0) {
|
||||
$(".contestyear").append('<div class="col-md-3 control-label" for="year">Select year: </div>' +
|
||||
'<select id="year" class="custom-select my-1 mr-sm-2 col-md-2" name="year">' +
|
||||
'</select>' +
|
||||
' <button onclick="loadContests();" class="btn btn-sm btn-primary" type="button">Proceed</button>');
|
||||
|
||||
$.each(data, function(key, value) {
|
||||
$('#year')
|
||||
.append($("<option></option>")
|
||||
.attr("value",value.year)
|
||||
.text(value.year));
|
||||
});
|
||||
} else {
|
||||
$(".contestyear").append("No contests were found for this station location!");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function loadContests() {
|
||||
$(".contestname").empty();
|
||||
$(".contestdates").empty();
|
||||
$.ajax({
|
||||
url: base_url+'index.php/cabrillo/getContests',
|
||||
type: 'post',
|
||||
data: {'year': $("#year").val(),
|
||||
'station_id': $("#station_id").val()
|
||||
},
|
||||
success: function (data) {
|
||||
$(".contestname").append('<div class="col-md-3 control-label" for="contestid">Select contest: </div>' +
|
||||
'<select class="custom-select my-1 mr-sm-2 col-md-4" id="contestid" name="contestid">' +
|
||||
'</select>' +
|
||||
' <button onclick="loadContestDates();" class="btn btn-sm btn-primary" type="button">Proceed</button>');
|
||||
|
||||
$.each(data, function(key, value) {
|
||||
$('#contestid')
|
||||
.append($("<option></option>")
|
||||
.attr("value",value.col_contest_id)
|
||||
.text(value.col_contest_id));
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function loadContestDates() {
|
||||
$(".contestdates").empty();
|
||||
$.ajax({
|
||||
url: base_url+'index.php/cabrillo/getContestDates',
|
||||
type: 'post',
|
||||
data: {'year': $("#year").val(),
|
||||
'contestid': $("#contestid").val(),
|
||||
'station_id': $("#station_id").val()},
|
||||
success: function (data) {
|
||||
$(".contestdates").append('<div class="col-md-3 control-label" for="contestdates">Select date range: </div>' +
|
||||
'<select class="custom-select my-1 mr-sm-2 col-md-2" id="contestdatesfrom" name="contestdatesfrom">' +
|
||||
'</select>' +
|
||||
'<select class="custom-select my-1 mr-sm-2 col-md-2" id="contestdatesto" name="contestdatesto">' +
|
||||
'</select>' +
|
||||
' <button class="btn btn-sm btn-primary" onclick="addAdditionalInfo();" type="button">Proceed</button>');
|
||||
|
||||
$.each(data, function(key, value) {
|
||||
$('#contestdatesfrom')
|
||||
.append($("<option></option>")
|
||||
.attr("value", value.date)
|
||||
.text(value.date));
|
||||
});
|
||||
|
||||
|
||||
$.each(data, function(key, value) {
|
||||
$('#contestdatesto')
|
||||
.append($("<option></option>")
|
||||
.attr("value", value.date)
|
||||
.text(value.date));
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function addAdditionalInfo() {
|
||||
$(".additionalinfo").removeAttr("hidden");
|
||||
}
|
||||
正在加载…
在新工单中引用