kopia lustrzana https://github.com/magicbug/Cloudlog
Brush up WWFF awards table with some candy
rodzic
8f76dba633
commit
afa4c0932d
|
@ -4,39 +4,50 @@
|
|||
|
||||
<?php
|
||||
if ($wwff_all) {
|
||||
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/cloudlog.php
|
||||
$custom_date_format = $this->config->item('qso_date_format');
|
||||
}
|
||||
?>
|
||||
|
||||
<table class="table table-sm table-striped table-hover">
|
||||
<table style="width: 100%" id="wwfftable" class="wwfftable table table-sm table-striped table-hover">
|
||||
<thead>
|
||||
|
||||
<tr>
|
||||
<td>Reference</td>
|
||||
<td>Date/Time</td>
|
||||
<td>Callsign</td>
|
||||
<td>Band</td>
|
||||
<td>RST Sent</td>
|
||||
<td>RST Received</td>
|
||||
<th style="text-align: center"><?php echo $this->lang->line('gen_hamradio_wwff_reference') ?></th>
|
||||
<th style="text-align: center"><?php echo $this->lang->line('general_word_date') ?></th>
|
||||
<th style="text-align: center"><?php echo $this->lang->line('general_word_time') ?></th>
|
||||
<th style="text-align: center"><?php echo $this->lang->line('gen_hamradio_callsign') ?></th>
|
||||
<th style="text-align: center"><?php echo $this->lang->line('gen_hamradio_band') ?></th>
|
||||
<th style="text-align: center"><?php echo $this->lang->line('gen_hamradio_rsts') ?></th>
|
||||
<th style="text-align: center"><?php echo $this->lang->line('gen_hamradio_rstr') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<?php
|
||||
if ($wwff_all->num_rows() > 0) {
|
||||
foreach ($wwff_all->result() as $row) {
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<?php echo $row->COL_WWFF_REF; ?>
|
||||
</td>
|
||||
<td><?php $timestamp = strtotime($row->COL_TIME_ON); echo date('d/m/y', $timestamp); ?> - <?php $timestamp = strtotime($row->COL_TIME_ON); echo date('H:i', $timestamp); ?></td>
|
||||
<td><?php echo $row->COL_CALL; ?></td>
|
||||
<td><?php echo $row->COL_BAND; ?></td>
|
||||
<td><?php echo $row->COL_RST_SENT; ?></td>
|
||||
<td><?php echo $row->COL_RST_RCVD; ?></td>
|
||||
<td style="text-align: center"><?php echo $row->COL_WWFF_REF; ?></td>
|
||||
<td style="text-align: center"><?php $timestamp = strtotime($row->COL_TIME_ON); echo date($custom_date_format, $timestamp); ?></td>
|
||||
<td style="text-align: center"><?php $timestamp = strtotime($row->COL_TIME_ON); echo date('H:i', $timestamp); ?></td>
|
||||
<td style="text-align: center"><?php echo $row->COL_CALL; ?></td>
|
||||
<td style="text-align: center"><?php if($row->COL_SAT_NAME != null) { echo $row->COL_SAT_NAME; } else { echo $row->COL_BAND; } ?></td>
|
||||
<td style="text-align: center"><?php echo $row->COL_RST_SENT; ?></td>
|
||||
<td style="text-align: center"><?php echo $row->COL_RST_RCVD; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<?php } else {
|
||||
echo '<div class="alert alert-danger" role="alert"><a href="#" class="close" data-dismiss="alert" aria-label="close">×</a>Nothing found!</div>';
|
||||
|
|
|
@ -2987,5 +2987,65 @@ function deleteQsl(id) {
|
|||
</script>
|
||||
<?php } ?>
|
||||
|
||||
<?php if ($this->uri->segment(1) == "awards" && ($this->uri->segment(2) == "wwff") ) {
|
||||
// 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/cloudlog.php
|
||||
$custom_date_format = $this->config->item('qso_date_format');
|
||||
}
|
||||
|
||||
switch ($custom_date_format) {
|
||||
case 'd/m/y': $usethisformat = 'D/MM/YY';break;
|
||||
case 'd/m/Y': $usethisformat = 'D/MM/YYYY';break;
|
||||
case 'm/d/y': $usethisformat = 'MM/D/YY';break;
|
||||
case 'm/d/Y': $usethisformat = 'MM/D/YYYY';break;
|
||||
case 'd.m.Y': $usethisformat = 'D.MM.YYYY';break;
|
||||
case 'y/m/d': $usethisformat = 'YY/MM/D';break;
|
||||
case 'Y-m-d': $usethisformat = 'YYYY-MM-D';break;
|
||||
case 'M d, Y': $usethisformat = 'MMM D, YYYY';break;
|
||||
case 'M d, y': $usethisformat = 'MMM D, YY';break;
|
||||
}
|
||||
|
||||
?>
|
||||
<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/moment.min.js"></script>
|
||||
<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/datetime-moment.js"></script>
|
||||
<script>
|
||||
$.fn.dataTable.moment('<?php echo $usethisformat ?>');
|
||||
$.fn.dataTable.ext.buttons.clear = {
|
||||
className: 'buttons-clear',
|
||||
action: function ( e, dt, node, config ) {
|
||||
dt.search('').draw();
|
||||
}
|
||||
};
|
||||
$('#wwfftable').DataTable({
|
||||
"pageLength": 25,
|
||||
responsive: false,
|
||||
ordering: true,
|
||||
"scrollY": "500px",
|
||||
"scrollCollapse": true,
|
||||
"paging": false,
|
||||
"scrollX": true,
|
||||
"order": [ 0, 'asc' ],
|
||||
dom: 'Bfrtip',
|
||||
buttons: [
|
||||
{
|
||||
extend: 'csv'
|
||||
},
|
||||
{
|
||||
extend: 'clear',
|
||||
text: 'Clear'
|
||||
}
|
||||
]
|
||||
});
|
||||
// change color of csv-button if dark mode is chosen
|
||||
if (isDarkModeTheme()) {
|
||||
$('[class*="buttons"]').css("color", "white");
|
||||
}
|
||||
</script>
|
||||
<?php } ?>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
Ładowanie…
Reference in New Issue