From: Anthony Talarico Date: Mon, 18 Apr 2016 20:09:38 +0000 (-0400) Subject: changing flight class time retrieval method X-Git-Tag: v1.0.0~10^2~2 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=ce800e2f5c936abc84a8ce7a96ba319d1b3e135b;p=WP-Themes%2Fairciu.git changing flight class time retrieval method --- diff --git a/class_flight.php b/class_flight.php index bd2371c..db1ec66 100644 --- a/class_flight.php +++ b/class_flight.php @@ -97,24 +97,24 @@ include_once($_SERVER['DOCUMENT_ROOT'].'/wp-config.php' ); if ($row['name'] == "EXPRESS AIRLINES 1, INC.") $this->arr_data[$key]['name'] = 'Delta Airlines'; if ($row['airline'] == "EXPRESS AIRLINES 1, INC.") $this->arr_data[$key]['airline'] = 'Delta Airlines'; } - foreach( $this->dep_data as $key) + foreach( $this->dep_data as $key=>$value) { - $update_times[] = strtotime($row['msg_dtm']); + $update_times[] = strtotime($value['msg_dtm']); if ($row['name'] == "EXPRESS AIRLINES 1, INC.") $this->dep_data[$key]['name'] = 'Delta Airlines'; if ($row['airline'] == "EXPRESS AIRLINES 1, INC.") $this->dep_data[$key]['airline'] = 'Delta Airlines'; } rsort($update_times); // get UTC offset for current date/time $TimeDiff = 4+date("I"); -// $this->last_updated = '

 

Last updated: '.date("n/j/Y g:i a",$update_times[0]-($TimeDiff*60*60)).'

'; - $query = "SELECT msg_dtm FROM glm_flight - ORDER BY msg_dtm DESC - LIMIT 1;"; - $results = $wpdb->get_results($query, ARRAY_A); - foreach($results as $key=>$value){ - $lastUpdated = date("n/j/Y g:i a", strtotime($value['msg_dtm']) - ($TimeDiff*60*60)); - } - $this->last_updated = '

 

Last updated: '. $lastUpdated . '

'; + $this->last_updated = '

 

Last updated: '.date("n/j/Y g:i a",$update_times[0]-($TimeDiff*60*60)).'

'; + // $query = "SELECT msg_dtm FROM glm_flight + // ORDER BY msg_dtm DESC + // LIMIT 1;"; + // $results = $wpdb->get_results($query, ARRAY_A); + // foreach($results as $key=>$value){ + // $lastUpdated = date("n/j/Y g:i a", strtotime($value['msg_dtm']) - ($TimeDiff*60*60)); + // } + // $this->last_updated = '

 

Last updated: '. $lastUpdated . '

'; //echo '';