formatted code better
这个提交包含在:
父节点
7a4c2f5bf8
当前提交
d9d1b428fa
共有 2 个文件被更改,包括 184 次插入 和 181 次删除
|
|
@ -165,7 +165,7 @@ class Logbook_model extends CI_Model
|
|||
$qso_rx_power = null;
|
||||
|
||||
if ($this->input->post('copyexchangeto')) {
|
||||
switch($this->input->post('copyexchangeto')) {
|
||||
switch ($this->input->post('copyexchangeto')) {
|
||||
case 'dok':
|
||||
$darc_dok = $srx_string;
|
||||
break;
|
||||
|
|
@ -184,13 +184,13 @@ class Logbook_model extends CI_Model
|
|||
case 'power':
|
||||
$qso_rx_power = $srx_string;
|
||||
break;
|
||||
// Example for more sophisticated exchanges and their split into the db:
|
||||
//case 'name/power':
|
||||
// if (strlen($srx_string) == 0) break;
|
||||
// $exch_pt = explode(" ",$srx_string);
|
||||
// $qso_name = $exch_pt[0];
|
||||
// if (count($exch_pt)>1) $qso_power = $exch_pt[1];
|
||||
// break;
|
||||
// Example for more sophisticated exchanges and their split into the db:
|
||||
//case 'name/power':
|
||||
// if (strlen($srx_string) == 0) break;
|
||||
// $exch_pt = explode(" ",$srx_string);
|
||||
// $qso_name = $exch_pt[0];
|
||||
// if (count($exch_pt)>1) $qso_power = $exch_pt[1];
|
||||
// break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
|
|
@ -2059,32 +2059,32 @@ class Logbook_model extends CI_Model
|
|||
|
||||
function check_if_grid_4char_worked_in_logbook($grid, $StationLocationsArray = null, $band = null)
|
||||
{
|
||||
if ($StationLocationsArray == null) {
|
||||
$CI = &get_instance();
|
||||
$CI->load->model('logbooks_model');
|
||||
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
|
||||
} else {
|
||||
$logbooks_locations_array = $StationLocationsArray;
|
||||
}
|
||||
|
||||
$this->db->select('COL_GRIDSQUARE');
|
||||
$this->db->where_in('station_id', $logbooks_locations_array);
|
||||
$this->db->group_start();
|
||||
$this->db->like('SUBSTRING(COL_GRIDSQUARE, 1, 4)', substr($grid, 0, 4));
|
||||
$this->db->or_like('SUBSTRING(COL_VUCC_GRIDS, 1, 4)', substr($grid, 0, 4));
|
||||
$this->db->group_end();
|
||||
|
||||
if ($band != null && $band != 'SAT') {
|
||||
$this->db->where('COL_BAND', $band);
|
||||
} else if ($band == 'SAT') {
|
||||
// Where col_sat_name is not empty
|
||||
$this->db->where('COL_SAT_NAME !=', '');
|
||||
}
|
||||
$this->db->limit('2');
|
||||
|
||||
$query = $this->db->get($this->config->item('table_name'));
|
||||
|
||||
return $query->num_rows();
|
||||
if ($StationLocationsArray == null) {
|
||||
$CI = &get_instance();
|
||||
$CI->load->model('logbooks_model');
|
||||
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
|
||||
} else {
|
||||
$logbooks_locations_array = $StationLocationsArray;
|
||||
}
|
||||
|
||||
$this->db->select('COL_GRIDSQUARE');
|
||||
$this->db->where_in('station_id', $logbooks_locations_array);
|
||||
$this->db->group_start();
|
||||
$this->db->like('SUBSTRING(COL_GRIDSQUARE, 1, 4)', substr($grid, 0, 4));
|
||||
$this->db->or_like('SUBSTRING(COL_VUCC_GRIDS, 1, 4)', substr($grid, 0, 4));
|
||||
$this->db->group_end();
|
||||
|
||||
if ($band != null && $band != 'SAT') {
|
||||
$this->db->where('COL_BAND', $band);
|
||||
} else if ($band == 'SAT') {
|
||||
// Where col_sat_name is not empty
|
||||
$this->db->where('COL_SAT_NAME !=', '');
|
||||
}
|
||||
$this->db->limit('2');
|
||||
|
||||
$query = $this->db->get($this->config->item('table_name'));
|
||||
|
||||
return $query->num_rows();
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -3489,7 +3489,7 @@ class Logbook_model extends CI_Model
|
|||
$rx_pwr = $record['rx_pwr'];
|
||||
} else {
|
||||
$rx_pwr = null;
|
||||
$my_error .= "Error QSO: Date: " . $time_on . " Callsign: " . $record['call'] . " RX_PWR (".$record['rx_pwr'].") is not a number<br>";
|
||||
$my_error .= "Error QSO: Date: " . $time_on . " Callsign: " . $record['call'] . " RX_PWR (" . $record['rx_pwr'] . ") is not a number<br>";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -2,153 +2,156 @@
|
|||
<br>
|
||||
<h2>Hamsat - Satellite Rovers</h2>
|
||||
<p>This data is from <a target="_blank" href="https://hams.at/">https://hams.at/</a>.
|
||||
<?php if ($user_hamsat_workable_only) {
|
||||
echo " Only workable passes shown.";
|
||||
} else {
|
||||
echo " All passes shown.";
|
||||
}?>
|
||||
<?php if ($user_hamsat_workable_only) {
|
||||
echo " Only workable passes shown.";
|
||||
} else {
|
||||
echo " All passes shown.";
|
||||
} ?>
|
||||
</p>
|
||||
<?php if ($user_hamsat_workable_only && $user_hamsat_key == '') { ?>
|
||||
<div class="alert alert-warning" role="warning">
|
||||
Private feed key empty. Please set the feed key in your profile.
|
||||
</div>
|
||||
<div class="alert alert-warning" role="warning">
|
||||
Private feed key empty. Please set the feed key in your profile.
|
||||
</div>
|
||||
<?php } else { ?>
|
||||
<?php if ($rovedata['data'] == []) { ?>
|
||||
<div class="alert alert-warning" role="warning">
|
||||
<?php echo lang('hams_at_no_activations_found');?>
|
||||
</div>
|
||||
<?php } else { ?>
|
||||
<table class="table table-striped table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Date</th>
|
||||
<th>Time</th>
|
||||
<th>Callsign</th>
|
||||
<th>Comment</th>
|
||||
<th>Satellite</th>
|
||||
<th>Mode</th>
|
||||
<th>Gridsquare(s)</th>
|
||||
<th>Workable</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($rovedata['data'] as $rove) :
|
||||
if ($user_hamsat_workable_only) {
|
||||
if (!$rove['is_workable']) {
|
||||
continue;
|
||||
}
|
||||
} ?>
|
||||
<tr>
|
||||
<td>
|
||||
<?php
|
||||
|
||||
// Get Date format
|
||||
if ($this->session->userdata('user_date_format')) {
|
||||
// If Logged in and session exists
|
||||
$custom_date_format = $this->session->userdata('user_date_format');
|
||||
} else {
|
||||
// Get Default date format from /config/wavelog.php
|
||||
$custom_date_format = $this->config->item('qso_date_format');
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<?php $timestamp = strtotime($rove['aos_at']);
|
||||
echo date($custom_date_format, $timestamp); ?>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
<?php echo date("H:i:s", $timestamp)." - ".date("H:i:s", strtotime($rove['los_at'])); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
$CI = &get_instance();
|
||||
$CI->load->model('logbooks_model');
|
||||
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
|
||||
$CI->load->model('logbook_model');
|
||||
$call_worked = $CI->logbook_model->check_if_callsign_worked_in_logbook($rove['callsign'], $logbooks_locations_array, "SAT");
|
||||
if ($call_worked != 0) {
|
||||
echo "<span class=\"text-success\">".$rove['callsign']."</span>";
|
||||
} else {
|
||||
echo $rove['callsign'];
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
echo xss_clean($rove['comment'] ?? '-');
|
||||
?>
|
||||
</td>
|
||||
<?php
|
||||
$direction = '';
|
||||
if ($rove['mhz_direction'] == 'up') {
|
||||
$direction = '↑';
|
||||
} else if ($rove['mhz_direction'] == 'down') {
|
||||
$direction = '↓';
|
||||
}
|
||||
$modeclass = '';
|
||||
if ($rove['mode'] == 'SSB' || $rove['mode'] == 'CW') {
|
||||
$modeclass = 'hamsatBgLin';
|
||||
} else if ($rove['mode'] == 'Data') {
|
||||
$modeclass = 'hamsatBgData';
|
||||
} else if ($rove['mode'] == 'FM') {
|
||||
$modeclass = 'hamsatBgFm';
|
||||
}
|
||||
|
||||
?>
|
||||
<td><span data-bs-toggle="tooltip" title="<?php if ($rove['mhz'] != '') { printf("%.3f", $rove['mhz']); echo " ".$direction ?? ''; } ?>"><?= $rove['satellite']['name'] ?></span></td>
|
||||
<td><span title="<?php echo $rove['mode']; ?>" class="badge <?php echo $modeclass; ?>"><?php echo $rove['mode']; ?></span></td>
|
||||
<td>
|
||||
|
||||
|
||||
<?php
|
||||
// Load the logbook model and call check_if_grid_worked_in_logbook
|
||||
foreach ($rove['grids'] as $grid) {
|
||||
$worked = $CI->logbook_model->check_if_grid_4char_worked_in_logbook($grid, null, "SAT");
|
||||
if ($worked != 0) {
|
||||
echo " <span data-bs-toggle=\"tooltip\" title=\"Worked\" class=\"badge bg-success\">" . $grid . "</span>";
|
||||
} else {
|
||||
echo " <span data-bs-toggle=\"tooltip\" title=\"Not Worked\" class=\"badge bg-danger\">" . $grid . "</span>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
if ($user_hamsat_key != '') {
|
||||
if ($rove['is_workable']) {
|
||||
echo date("H:i", strtotime($rove['workable_start_at']))." - ".date("H:i", strtotime($rove['workable_end_at']));
|
||||
} else {
|
||||
echo "<span data-bs-toggle=\"tooltip\" title=\"No\" class=\"badge bg-danger\">No</span>";
|
||||
}
|
||||
} else {
|
||||
echo "<span data-bs-toggle=\"tooltip\" title=\"Unkown\" class=\"badge bg-warning\">Unknown</span>";
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td><a href="<?php echo $rove['url']; ?>" target="_blank">Track</a></td>
|
||||
<?php
|
||||
$sat = $rove['satellite']['name'];
|
||||
switch (strtoupper($rove['satellite']['name'])) {
|
||||
case "GREENCUBE":
|
||||
$sat = 'IO-117';
|
||||
break;
|
||||
}
|
||||
?>
|
||||
<td>
|
||||
<?php
|
||||
if ($rove['is_workable'] || $user_hamsat_key == '') { ?>
|
||||
<a href="https://sat.fg8oj.com/sked.php?s%5B%5D=<?php echo $sat; ?>&l=<?php echo strtoupper($gridsquare); ?>&el1=0&l2=<?php echo $rove['grids'][0]; ?>&el2=0&duration=1&start=0&OK=Search" target="_blank">Sked</a>
|
||||
<?php } ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php } ?>
|
||||
<?php if ($rovedata['data'] == []) { ?>
|
||||
<div class="alert alert-warning" role="warning">
|
||||
<?php echo lang('hams_at_no_activations_found'); ?>
|
||||
</div>
|
||||
<?php } else { ?>
|
||||
<table class="table table-striped table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Date</th>
|
||||
<th>Time</th>
|
||||
<th>Callsign</th>
|
||||
<th>Comment</th>
|
||||
<th>Satellite</th>
|
||||
<th>Mode</th>
|
||||
<th>Gridsquare(s)</th>
|
||||
<th>Workable</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($rovedata['data'] as $rove) :
|
||||
if ($user_hamsat_workable_only) {
|
||||
if (!$rove['is_workable']) {
|
||||
continue;
|
||||
}
|
||||
} ?>
|
||||
<tr>
|
||||
<td>
|
||||
<?php
|
||||
|
||||
// Get Date format
|
||||
if ($this->session->userdata('user_date_format')) {
|
||||
// If Logged in and session exists
|
||||
$custom_date_format = $this->session->userdata('user_date_format');
|
||||
} else {
|
||||
// Get Default date format from /config/wavelog.php
|
||||
$custom_date_format = $this->config->item('qso_date_format');
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<?php $timestamp = strtotime($rove['aos_at']);
|
||||
echo date($custom_date_format, $timestamp); ?>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
<?php echo date("H:i:s", $timestamp) . " - " . date("H:i:s", strtotime($rove['los_at'])); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
$CI = &get_instance();
|
||||
$CI->load->model('logbooks_model');
|
||||
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
|
||||
$CI->load->model('logbook_model');
|
||||
$call_worked = $CI->logbook_model->check_if_callsign_worked_in_logbook($rove['callsign'], $logbooks_locations_array, "SAT");
|
||||
if ($call_worked != 0) {
|
||||
echo "<span class=\"text-success\">" . $rove['callsign'] . "</span>";
|
||||
} else {
|
||||
echo $rove['callsign'];
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
echo xss_clean($rove['comment'] ?? '-');
|
||||
?>
|
||||
</td>
|
||||
<?php
|
||||
$direction = '';
|
||||
if ($rove['mhz_direction'] == 'up') {
|
||||
$direction = '↑';
|
||||
} else if ($rove['mhz_direction'] == 'down') {
|
||||
$direction = '↓';
|
||||
}
|
||||
$modeclass = '';
|
||||
if ($rove['mode'] == 'SSB' || $rove['mode'] == 'CW') {
|
||||
$modeclass = 'hamsatBgLin';
|
||||
} else if ($rove['mode'] == 'Data') {
|
||||
$modeclass = 'hamsatBgData';
|
||||
} else if ($rove['mode'] == 'FM') {
|
||||
$modeclass = 'hamsatBgFm';
|
||||
}
|
||||
|
||||
?>
|
||||
<td><span data-bs-toggle="tooltip" title="<?php if ($rove['mhz'] != '') {
|
||||
printf("%.3f", $rove['mhz']);
|
||||
echo " " . $direction ?? '';
|
||||
} ?>"><?= $rove['satellite']['name'] ?></span></td>
|
||||
<td><span title="<?php echo $rove['mode']; ?>" class="badge <?php echo $modeclass; ?>"><?php echo $rove['mode']; ?></span></td>
|
||||
<td>
|
||||
|
||||
|
||||
<?php
|
||||
// Load the logbook model and call check_if_grid_worked_in_logbook
|
||||
foreach ($rove['grids'] as $grid) {
|
||||
$worked = $CI->logbook_model->check_if_grid_4char_worked_in_logbook($grid, null, "SAT");
|
||||
if ($worked != 0) {
|
||||
echo " <span data-bs-toggle=\"tooltip\" title=\"Worked\" class=\"badge bg-success\">" . $grid . "</span>";
|
||||
} else {
|
||||
echo " <span data-bs-toggle=\"tooltip\" title=\"Not Worked\" class=\"badge bg-danger\">" . $grid . "</span>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
if ($user_hamsat_key != '') {
|
||||
if ($rove['is_workable']) {
|
||||
echo date("H:i", strtotime($rove['workable_start_at'])) . " - " . date("H:i", strtotime($rove['workable_end_at']));
|
||||
} else {
|
||||
echo "<span data-bs-toggle=\"tooltip\" title=\"No\" class=\"badge bg-danger\">No</span>";
|
||||
}
|
||||
} else {
|
||||
echo "<span data-bs-toggle=\"tooltip\" title=\"Unkown\" class=\"badge bg-warning\">Unknown</span>";
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td><a href="<?php echo $rove['url']; ?>" target="_blank">Track</a></td>
|
||||
<?php
|
||||
$sat = $rove['satellite']['name'];
|
||||
switch (strtoupper($rove['satellite']['name'])) {
|
||||
case "GREENCUBE":
|
||||
$sat = 'IO-117';
|
||||
break;
|
||||
}
|
||||
?>
|
||||
<td>
|
||||
<?php
|
||||
if ($rove['is_workable'] || $user_hamsat_key == '') { ?>
|
||||
<a href="https://sat.fg8oj.com/sked.php?s%5B%5D=<?php echo $sat; ?>&l=<?php echo strtoupper($gridsquare); ?>&el1=0&l2=<?php echo $rove['grids'][0]; ?>&el2=0&duration=1&start=0&OK=Search" target="_blank">Sked</a>
|
||||
<?php } ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
正在加载…
在新工单中引用