Added Wked/cnfmd to call and DXCC including link to DXCC-Scoretable

This commit is contained in:
int2001
2024-02-17 17:49:17 +00:00
parent 0e6c6217a5
commit a66339f8b1
2 changed files with 54 additions and 15 deletions

View File

@@ -4,6 +4,7 @@ class Dxcalendar extends CI_Controller {
public function index() {
$this->load->model('user_model');
$this->load->model('logbook_model');
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
$data['page_title'] = "DX Calendar";
@@ -27,6 +28,7 @@ class Dxcalendar extends CI_Controller {
$dxped->dxcc = $tempinfo[0];
$date = $tempinfo[1] ?? '';
$dxped->dates = $this->extractDates($date, $custom_date_format);
$dxped->description = $item->description;
@@ -34,7 +36,21 @@ class Dxcalendar extends CI_Controller {
$descsplit = explode("\n", $item->description);
$call = (string) $descsplit[3];
$dxped->call = str_replace('--', '', $call);
$dxped->call = trim(str_replace('--', '', $call));
$chk_dxcc=$this->logbook_model->dxcc_lookup($dxped->call,$dxped->dates[2]->format('Y-m-d'));
if ($chk_dxcc['adif'] ?? '' != '') {
$chk_dxcc_val=$chk_dxcc['adif'];
$dxped->no_dxcc=false;
} else {
$chk_dxcc_val=-1;
$dxped->no_dxcc=true;
}
$dxped->call_wked =$this->logbook_model->check_if_callsign_worked_in_logbook($dxped->call);
$dxped->call_cnfmd =$this->logbook_model->check_if_callsign_cnfmd_in_logbook($dxped->call);
$dxped->dxcc_wked =$this->logbook_model->check_if_dxcc_worked_in_logbook($chk_dxcc_val);
$dxped->dxcc_cnfmd =$this->logbook_model->check_if_dxcc_cnfmd_in_logbook($chk_dxcc_val);
$dxped->dxcc_adif = $chk_dxcc_val;
$qslinfo = (string) $descsplit[4];
$qslinfo = str_replace('--', '', $qslinfo);
$dxped->qslinfo = str_replace('QSL: ', '', $qslinfo);
@@ -90,7 +106,7 @@ class Dxcalendar extends CI_Controller {
// Check if parsing was successful
if ($startDateTime !== false && $endDateTime !== false) {
return array($startDateTime->format($custom_date_format), $endDateTime->format($custom_date_format));
return array($startDateTime->format($custom_date_format), $endDateTime->format($custom_date_format), $startDateTime, $endDateTime);
} else {
return false; // Failed to parse dates
}

View File

@@ -16,20 +16,43 @@
</tr>
</thead>
<tbody>
<?php
foreach($rss as $item) {
echo '<tr>';
echo "<td>" . $item->dates[0] ?? '' . "</td>";
echo "<td>" . $item->dates[1] ?? '' . "</td>";
echo "<td>$item->dxcc</td>";
echo "<td>$item->call</td>";
echo "<td>$item->qslinfo</td>";
echo "<td>$item->source</td>";
echo "<td>$item->info</td>";
<?php
foreach($rss as $item) {
echo '<tr>';
echo "<td>" . $item->dates[0] ?? '' . "</td>";
echo "<td>" . $item->dates[1] ?? '' . "</td>";
echo "<td>";
if ($item->dxcc_adif >= 1) {
echo '<a href="javascript:spawnLookupModal(\''.$item->dxcc_adif.'\',\'dxcc\')">';
}
if ($item->dxcc_cnfmd) {
echo '<span class="text-success">';
} elseif ($item->dxcc_wked) {
echo '<span class="text-warning">';
} elseif ($item->no_dxcc) {
echo '<span>';
} else {
echo '<span class="text-danger">';
}
echo $item->dxcc."</span>";
if ($item->dxcc_adif >= 1) { echo "</a>"; }
echo "</td><td";
if ($item->call_cnfmd) {
echo ' class"text-success">';
} elseif ($item->call_wked) {
echo ' class="text-warning">';
} else {
echo ' class="text-danger">';
}
echo $item->call."</td>";
echo "<td>$item->qslinfo</td>";
echo "<td>$item->source</td>";
echo "<td>$item->info</td>";
echo '</tr>';
}
?>
echo '</tr>';
echo "\n";
}
?>
</tbody>
</table>