From: Ian Weller Date: Thu, 23 Mar 2017 12:56:27 +0000 (-0400) Subject: removing Pellston specific code. X-Git-Tag: v1.0.0^2~8 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=d9a36d3c1801b57b994b8df45de93e31a1a16ae0;p=WP-Themes%2Felklaketool.git removing Pellston specific code. I took out some things that related to Pellston and the airport theme. --- diff --git a/class_flight.php b/class_flight.php deleted file mode 100644 index a7d5dd5..0000000 --- a/class_flight.php +++ /dev/null @@ -1,259 +0,0 @@ -toolbox = &$toolbox; -// $this->DB =& $toolbox->DB; - $this->airports = array('DTW'=>'Detroit Metro','PLN'=>'Pellston'); - $this->time_codes = array('A'=>'Actual','E'=>'Estimated','D'=>'Descision','S'=>'Scheduled','R'=>'In-range'); - } - - function get_airports( $code ) - { global $wpdb; - $return = false; - $query = "select * from glm_airport where code = '$code'"; - if( $data = $wpdb->get_results( $query, ARRAY_A ) ) - { - $return = array( - 'city'=>$data[0]['city'], - 'state'=>$data[0]['state'], - 'name'=>$data[0]['name'] - ); - } - return( $return ); - } - /** - * get_flight_data - * - * @access public - * @return string - */ - function get_flight_data() - { - global $wpdb; - $this->get_arr_flight_data(); - $this->get_dep_flight_data(); - - if ( isset( $this->arr_data ) && is_array( $this->arr_data ) ) { - foreach( $this->arr_data as $key=>$value ) - { - $update_times[] = strtotime($value['msg_dtm']); - 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'; - } - } - if ( isset( $this->dep_data ) && is_array( $this->dep_data ) ) { - foreach( $this->dep_data as $key=>$value) - { - $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 . '

'; - //echo ''; - } - - /** - * get_arr_flight_data - * - * @access public - * @return string - */ - function get_arr_flight_data() - { - global $wpdb; - $query = "select *, name AS airline from glm_flight, glm_airlines where flt_orig_date = current_date and flt_leg_dest = 'PLN' and glm_airlines.code = flt_airline order by cur_in_time;"; - - if( $data = $wpdb->get_results( $query, ARRAY_A ) ) - { - $this->arr_data = $data; - } - } - - /** - * get_dep_flight_data - * - * @access public - * @return string - */ - function get_dep_flight_data() - { - global $wpdb; - $query = "select *, name AS airline from glm_flight, glm_airlines where flt_orig_date = current_date and flt_leg_orig = 'PLN' and glm_airlines.code = flt_airline order by cur_dep_time;"; - if( $data = $wpdb->get_results( $query, ARRAY_A ) ) - { - $this->dep_data = $data; - } - } - - /** - * format_time - * - * @param mixed $time - * @access public - * @return string - */ - function format_time( $time ) - { - $timestamp = strtotime( 'now '.$time ); - $newtime = date('g:i A',$timestamp); - return( $newtime ); - } - - /** - * build_arrivals - * - * @access public - * @return string - */ - function build_arrivals() - { - if( is_array( $this->arr_data ) ) - { - $out = ' - '; - $out .= ' - - - - - - - - - '; - foreach( $this->arr_data as $row ) - { - $airport = $this->get_airports( $row["flt_leg_orig"] ); - $airport_text = $airport["name"].' '.$airport["city"]; - $airport_text .= ( $airport["state"] ) ? ','.$airport["state"]:''; - $out .= ' - - - - - - - '; - } - $out .= '
FromFlightTimeStatus
'.$airport_text.''.$row["airline"].' '.$row["flt_numb"].''.$this->format_time( $row["cur_in_time"] ).' '.$this->time_codes[$row["cur_in_time_code"]].''.$row["remarks"].'
- '; - } - return( $out ); - } - - /** - * build_departures - * - * @access public - * @return string - */ - function build_departures() - { - - if( is_array( $this->dep_data ) ) - { - $out = ' - '; - $out .= ' - - - - - - - - - '; - foreach( $this->dep_data as $row ) - { - $airport = $this->get_airports( $row["flt_leg_dest"] ); - $airport_text = $airport["name"].' '.$airport["city"]; - $airport_text .= ( $airport["state"] ) ? ','.$airport["state"]:''; - $out .= ' - - - - - - - '; - } - $out .= '
DestinationFlightTimeStatus
'.$airport_text.''.$row["airline"].'
'.$row["flt_numb"].'
'.$this->format_time( $row["cur_dep_time"] ).' '.$this->time_codes[$row["cur_dep_time_code"]].''.$row["remarks"].'
- '; - } - return( $out ); - } - } -?> diff --git a/database.sql~ b/database.sql~ deleted file mode 100644 index 084a2ae..0000000 --- a/database.sql~ +++ /dev/null @@ -1,61 +0,0 @@ -CREATE TABLE glm_28_airport - ( - id SERIAL, - code text null, - name text null, - city text null, - state text null - ); -REVOKE ALL ON glm_airport FROM PUBLIC; -GRANT ALL ON glm_airport TO nobody; -REVOKE ALL ON airport_id_seq FROM PUBLIC; -GRANT ALL ON airport_id_seq TO nobody; -CREATE INDEX airport_code_index ON glm_airport(code); - -CREATE TABLE glm_28_flight - ( - id SERIAL, - msg_dtm timestamp null, - msg_seq_id text null, - flt_orig_date date null, - flt_airline text null, - flt_numb text null, - flt_leg_orig text null, - flt_leg_dest text null, - flt_leg_vers int null, - sch_leg_orig text null, - sch_leg_dest text null, - sch_dep_time time null, - sch_off_time time null, - sch_on_time time null, - sch_in_time time null, - cur_dep_time time null, - cur_dep_time_code text null, - cur_off_time time null, - cur_off_time_code text null, - cur_on_time time null, - cur_on_time_code text null, - cur_in_time time null, - cur_in_time_code text null, - delay_code text null, - depart_gate text null, - arriv_gate text null, - radio_code text null, - aircraft text null, - reg_numb text null, - remarks text null, - food_code text null, - flight_type text null, - downline_leg bool null, - overfly bool null, - canceled bool null, - dep_ontime bool null, - arriv_ontime bool null - ); - -REVOKE ALL ON glm_flight FROM PUBLIC; -GRANT ALL ON glm_flight TO nobody; -REVOKE ALL ON flight_id_seq FROM PUBLIC; -GRANT ALL ON flight_id_seq TO nobody; -CREATE INDEX flight_orig_date_index ON glm_flight(flt_orig_date); -CREATE INDEX flight_numb_index ON glm_flight(flt_numb); diff --git a/favicon.ico b/favicon.ico deleted file mode 100644 index 8f1b271..0000000 Binary files a/favicon.ico and /dev/null differ diff --git a/screenshot.png b/screenshot.png deleted file mode 100644 index f442d78..0000000 Binary files a/screenshot.png and /dev/null differ