updating last updated flight data message if no data
authorAnthony Talarico <talarico@gaslightmedia.com>
Thu, 11 Jan 2018 16:05:47 +0000 (11:05 -0500)
committerAnthony Talarico <talarico@gaslightmedia.com>
Thu, 11 Jan 2018 16:05:47 +0000 (11:05 -0500)
currently displaying epoch date if no flight data, changing to use a message instead

class_flight.php
header.php
style.css

index 1c659b3..87a6af0 100644 (file)
@@ -107,10 +107,15 @@ include_once($_SERVER['DOCUMENT_ROOT'].'/wp-config.php' );
                                        if ($row['airline'] == "EXPRESS AIRLINES 1, INC.") $this->dep_data[$key]['airline'] = '<nobr>Delta Airlines</nobr>';
                                }
                        }
-                       rsort($update_times);
-                       // get UTC offset for current date/time
-                       $TimeDiff = 5+date("I");
-                       $this->last_updated = '<div id="last-update"><p>&nbsp;</p><p><b>Last updated:</b> '.date("n/j/Y g:i a",$update_times[0]-($TimeDiff*60*60)).'</p></div>';
+                       if( !empty( $update_times ) ){
+                               rsort($update_times);
+                               // get UTC offset for current date/time
+                               $TimeDiff = 5+date("I");
+                               $this->last_updated = '<div id="last-update"><p>&nbsp;</p><p><b>Last updated:</b> '.date("n/j/Y g:i a",$update_times[0]-($TimeDiff*60*60)).'</p></div>';
+                       } else {
+                               $this->last_updated = '<div id="last-update"><p>&nbsp;</p><p><b>Last updated:</b> No flight data available </p></div>';
+                       }
+
             // $query = "SELECT msg_dtm FROM glm_flight
             //             ORDER BY msg_dtm DESC
             //             LIMIT 1;";
index 5b735c9..63d5720 100644 (file)
@@ -4,7 +4,7 @@
     <meta charset="utf-8" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
     <title><?php wp_title(); ?></title>
-    <link rel="stylesheet" href="<?php echo get_stylesheet_directory_uri() ; ?>/css/app.css?v=1.0.6">
+    <link rel="stylesheet" href="<?php echo get_stylesheet_directory_uri() ; ?>/css/app.css?v=1.0.8">
       <link rel="shortcut icon" href="<?php echo esc_url( get_template_directory_uri() ) ;?>/favicon.ico">
     <link href='https://fonts.googleapis.com/css?family=Lato:400,400italic,700' rel='stylesheet' type='text/css'>
     <?php wp_head(); ?>
index b366a24..7912947 100644 (file)
--- a/style.css
+++ b/style.css
@@ -3,5 +3,5 @@ Theme Name: ChippewaCountyInternationAirport
 Author: Gaslight Media
 Author URI: http://www.gaslightmedia.com
 Description: A theme for ChippewaCountyInternationAirport
-Version: 1.0.0
+Version: 1.0.8
 */