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