2023-05-10 22:03:30 +08:00
< div class = " container " >
< br >
< h2 >< ? php echo $this -> lang -> line ( 'general_word_eqslcards' ); ?> </h2>
< div class = " alert alert-info " role = " alert " >
< ? php echo $this -> lang -> line ( 'qslcard_string_your_are_using' ); ?> <?php echo $storage_used; ?> <?php echo $this->lang->line('qslcard_string_disk_space'); ?>
</ div >
2025-08-10 20:36:33 +08:00
< br >
< div class = " tabs " >
< ul class = " nav nav-tabs " id = " myTab " role = " tablist " >
< li class = " nav-item " >
< a class = " nav-link active " id = " list-tab " data - bs - toggle = " tab " href = " #list " role = " tab " aria - controls = " list " aria - selected = " true " > List </ a >
</ li >
< li class = " nav-item " >
< a class = " nav-link " id = " gallery-tab " data - bs - toggle = " tab " href = " #gallery " role = " tab " aria - controls = " gallery " aria - selected = " false " > Gallery </ a >
</ li >
</ ul >
</ div >
< div class = " tab-content " id = " myTabContent " >
< div class = " tab-pane fade show active " id = " list " role = " tabpanel " aria - labelledby = " list-tab " >
< br />
2023-05-10 22:03:30 +08:00
< ? php
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' );
}
if ( is_array ( $qslarray -> result ())) {
echo ' < table style = " width:100% " class = " eqsltable table table-sm table-bordered table-hover table-striped table-condensed " >
< thead >
< tr >
< th style = \ 'text-align: center\'>' . $this -> lang -> line ( 'gen_hamradio_callsign' ) . ' </ th >
< th style = \ 'text-align: center\'>' . $this -> lang -> line ( 'gen_hamradio_mode' ) . ' </ th >
< th style = \ 'text-align: center\'>' . $this -> lang -> line ( 'general_word_date' ) . ' </ th >
< th style = \ 'text-align: center\'>' . $this -> lang -> line ( 'general_word_time' ) . ' </ th >
< th style = \ 'text-align: center\'>' . $this -> lang -> line ( 'gen_hamradio_band' ) . ' </ th >
< th style = \ 'text-align: center\'>' . $this -> lang -> line ( 'gen_hamradio_qsl' ) . ' </ th >
< th style = \ ' text - align : center\ ' ></ th >
</ tr >
</ thead >< tbody > ' ;
foreach ( $qslarray -> result () as $qsl ) {
echo '<tr>' ;
2023-10-27 14:53:58 +08:00
echo '<td style=\'text-align: center\'><a id="edit_qso" href="javascript:displayQso(' . $qsl -> COL_PRIMARY_KEY . ')">' . str_replace ( " 0 " , " Ø " , $qsl -> COL_CALL ) . '</a></td>' ;
2023-05-10 22:03:30 +08:00
echo '<td style=\'text-align: center\'>' ;
echo $qsl -> COL_SUBMODE == null ? $qsl -> COL_MODE : $qsl -> COL_SUBMODE ;
echo '</td>' ;
echo '<td style=\'text-align: center\'>' ;
$timestamp = strtotime ( $qsl -> COL_TIME_ON ); echo date ( $custom_date_format , $timestamp );
echo '</td>' ;
echo '<td style=\'text-align: center\'>' ;
$timestamp = strtotime ( $qsl -> COL_TIME_ON ); echo date ( 'H:i' , $timestamp );
echo '</td>' ;
echo '<td style=\'text-align: center\'>' ;
if ( $qsl -> COL_SAT_NAME != null ) { echo $qsl -> COL_SAT_NAME ; } else { echo strtolower ( $qsl -> COL_BAND ); };
echo '</td>' ;
echo '<td style=\'text-align: center\'>' . $qsl -> image_file . '</td>' ;
echo '<td style=\'text-align: center\'><button onclick="viewEqsl(\'' . $qsl -> image_file . '\', \'' . $qsl -> COL_CALL . '\')" class="btn btn-sm btn-success">View</button></td>' ;
echo '</tr>' ;
}
echo '</tbody></table>' ;
}
?>
2025-08-10 20:36:33 +08:00
</ div >
2025-08-10 23:19:08 +08:00
< div class = " tab-pane fade scrollable-div " id = " gallery " role = " tabpanel " aria - labelledby = " gallery-tab " >
2025-08-10 20:36:33 +08:00
< br />
< script src = " https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.8.3/modernizr.min.js " ></ script >
< script src = " https://cdnjs.cloudflare.com/ajax/libs/jquery/1.12.4/jquery.min.js " ></ script >
< script src = " https://cdnjs.cloudflare.com/ajax/libs/magnific-popup.js/1.1.0/jquery.magnific-popup.min.js " ></ script >
< link rel = " stylesheet " href = " https://cdnjs.cloudflare.com/ajax/libs/magnific-popup.js/1.1.0/magnific-popup.min.css " />
2025-08-10 22:06:43 +08:00
< script > $ ( document ) . ready ( function () { $ ( 'a.photo' ) . magnificPopup ( { type : 'image' } ); }); </ script >
2025-08-10 21:23:56 +08:00
< ? php
if ( function_exists ( " imagecreatefromstring " )) {
$folder_name = " images/eqsl_card_images " ;
$desired_width = 500 ;
2025-08-10 22:06:43 +08:00
$thumb_generations = 100 ;
2025-08-10 21:23:56 +08:00
if ( is_array ( $qslarray -> result ())) {
foreach ( $qslarray -> result () as $qsl ) {
2025-08-10 22:06:43 +08:00
if ( $thumb_generations >= 0 ) {
2025-08-10 21:23:56 +08:00
$src = $folder_name . '/' . $qsl -> image_file ;
$dest = $folder_name . '/_' . $qsl -> image_file ;
2025-08-10 22:06:43 +08:00
if ( ! file_exists ( $folder_name . '/_' . $qsl -> image_file )) {
$thumb_generations -- ;
/* read the source image */
2025-08-10 21:23:56 +08:00
$data = file_get_contents ( $src );
$source_image = imagecreatefromstring ( $data );
$width = imagesx ( $source_image );
$height = imagesy ( $source_image );
/* find the "desired height" of this thumbnail, relative to the desired width */
$desired_height = floor ( $height * ( $desired_width / $width ) );
/* create a new, "virtual" image */
$virtual_image = imagecreatetruecolor ( $desired_width , $desired_height );
/* copy source image at a resized size */
imagecopyresampled ( $virtual_image , $source_image , 0 , 0 , 0 , 0 , $desired_width , $desired_height , $width , $height );
/* create the physical thumbnail image to its destination */
imagejpeg ( $virtual_image , $dest , 60 );
}
echo '<a href="#" onclick="viewEqsl(\'' . $qsl -> image_file . '\', \'' . $qsl -> COL_CALL . '\')" class="photo" style="background-image: url(/' . $dest . ');"></a>' ;
2025-08-10 22:06:43 +08:00
}
2025-08-10 21:23:56 +08:00
}
}
2025-08-10 22:06:43 +08:00
} else {
echo 'Gallery requires GD libraries to be installed <a href="https://www.php.net/manual/en/image.installation.php">https://www.php.net/manual/en/image.installation.php</a>' ;
2025-08-10 21:23:56 +08:00
}
2025-08-10 20:36:33 +08:00
?>
</ div >
2023-05-10 22:03:30 +08:00
</ div >