testing removal of postgres functions
authorAnthony Talarico <talarico@gaslightmedia.com>
Thu, 31 Mar 2016 14:50:44 +0000 (10:50 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Thu, 31 Mar 2016 14:50:44 +0000 (10:50 -0400)
glmfds.php

index 1603b73..9afbdfa 100644 (file)
@@ -36,7 +36,7 @@ echo '<html><head></head><body>Gaslight Media - Northwest Airlines Flight Data C
 
         // Delete flight data older than yesterday
 
-    db_auto_exec( "DELETE FROM flight WHERE msg_dtm < 'yesterday';", SI_CONN_STR, FALSE );
+//    db_auto_exec( "DELETE FROM flight WHERE msg_dtm < 'yesterday';", SI_CONN_STR, FALSE );
 
        
         // Get item data
@@ -167,46 +167,46 @@ echo '<html><head></head><body>Gaslight Media - Northwest Airlines Flight Data C
         if( $flight_type != 'Z' )
                 {
 
-                if( ($f = db_auto_get_row( "SELECT msg_seq_id FROM flight WHERE flt_orig_date = '$flt_orig_date' AND flt_numb = '$flt_numb';", 0, SI_CONN_STR, FALSE )) == false )
-                        {
-                        db_auto_exec( "INSERT INTO flight
-                                                        (
-                                                        msg_dtm, msg_seq_id, flt_orig_date, flt_airline, flt_numb, flt_leg_orig, flt_leg_dest, flt_leg_vers,
-                                                        sch_leg_orig, sch_leg_dest, sch_dep_time, sch_off_time, sch_on_time, sch_in_time, cur_dep_time, cur_dep_time_code,
-                                                        cur_off_time    , cur_off_time_code, cur_on_time, cur_on_time_code, cur_in_time, cur_in_time_code, delay_code,
-                                                        depart_gate, arriv_gate, radio_code, aircraft, reg_numb, remarks, food_code, flight_type, downline_leg,
-                                                        overfly, canceled, dep_ontime, arriv_ontime
-                                                        )
-                                                VALUES
-                                                        (
-                                                        '$msg_dtm', '$msg_seq_id', '$flt_orig_date', '$flt_airline', '$flt_numb', '$flt_leg_orig', '$flt_leg_dest', $flt_leg_vers,
-                                                        '$sch_leg_orig', '$sch_leg_dest', '$sch_dep_time', '$sch_off_time', '$sch_on_time', '$sch_in_time', '$cur_dep_time', '$cur_dep_time_code',
-                                                        '$cur_off_time', '$cur_off_time_code', '$cur_on_time', '$cur_on_time_code', '$cur_in_time', '$cur_in_time_code', '$delay_code',
-                                                        '$depart_gate', '$arriv_gate', '$radio_code', '$aircraft', '$reg_numb', '$remarks', '$food_code', '$flight_type', '$downline_leg',
-                                                        '$overfly', '$canceled', '$dep_ontime', '$arriv_ontime'
-                                                        );", SI_CONN_STR, FALSE );
-               
-                        echo "Flight $flt_numb on $flt_orig_date added<br>";
-                        }
-                  else
-                        {
-                        if( $msg_seq_id <= $f['msg_seq_id'] )
-                                echo 'Duplicate message or message out of sequence.<br>';
-                          else
-                                {
-                                db_auto_exec( "UPDATE flight SET
-                                                        msg_dtm = '$msg_dtm', msg_seq_id = '$msg_seq_id',
-                                                        flt_leg_orig = '$flt_leg_orig', flt_leg_dest = '$flt_leg_dest', flt_leg_vers = $flt_leg_vers, sch_leg_orig = '$sch_leg_orig',
-                                                        sch_leg_dest = '$sch_leg_dest', sch_dep_time = '$sch_dep_time', sch_off_time = '$sch_off_time', sch_on_time = '$sch_on_time',
-                                                        sch_in_time = '$sch_in_time', cur_dep_time = '$cur_dep_time', cur_dep_time_code = '$cur_dep_time_code', cur_off_time = '$cur_off_time',
-                                                        cur_off_time_code = '$cur_off_time_code', cur_on_time = '$cur_on_time', cur_on_time_code = '$cur_on_time_code', cur_in_time = '$cur_in_time',
-                                                        cur_in_time_code = '$cur_in_time_code', delay_code = '$delay_code', depart_gate = '$depart_gate', arriv_gate = '$arriv_gate',
-                                                        radio_code = '$radio_code', aircraft = '$aircraft', reg_numb = '$reg_numb', remarks = '$remarks', food_code = '$food_code', flight_type = '$flight_type',
-                                                        downline_leg = '$downline_leg', overfly = '$overfly', canceled = '$canceled', dep_ontime = '$dep_ontime', arriv_ontime = '$arriv_ontime'
-                                                        WHERE flt_orig_date = '$flt_orig_date' AND flt_numb = '$flt_numb';", SI_CONN_STR, FALSE );
-                                echo "Flight $flt_numb on $flt_orig_date updated<br>";
-                                }
-                        }
+//                if( ($f = db_auto_get_row( "SELECT msg_seq_id FROM flight WHERE flt_orig_date = '$flt_orig_date' AND flt_numb = '$flt_numb';", 0, SI_CONN_STR, FALSE )) == false )
+//                        {
+//                        db_auto_exec( "INSERT INTO flight
+//                                                        (
+//                                                        msg_dtm, msg_seq_id, flt_orig_date, flt_airline, flt_numb, flt_leg_orig, flt_leg_dest, flt_leg_vers,
+//                                                        sch_leg_orig, sch_leg_dest, sch_dep_time, sch_off_time, sch_on_time, sch_in_time, cur_dep_time, cur_dep_time_code,
+//                                                        cur_off_time    , cur_off_time_code, cur_on_time, cur_on_time_code, cur_in_time, cur_in_time_code, delay_code,
+//                                                        depart_gate, arriv_gate, radio_code, aircraft, reg_numb, remarks, food_code, flight_type, downline_leg,
+//                                                        overfly, canceled, dep_ontime, arriv_ontime
+//                                                        )
+//                                                VALUES
+//                                                        (
+//                                                        '$msg_dtm', '$msg_seq_id', '$flt_orig_date', '$flt_airline', '$flt_numb', '$flt_leg_orig', '$flt_leg_dest', $flt_leg_vers,
+//                                                        '$sch_leg_orig', '$sch_leg_dest', '$sch_dep_time', '$sch_off_time', '$sch_on_time', '$sch_in_time', '$cur_dep_time', '$cur_dep_time_code',
+//                                                        '$cur_off_time', '$cur_off_time_code', '$cur_on_time', '$cur_on_time_code', '$cur_in_time', '$cur_in_time_code', '$delay_code',
+//                                                        '$depart_gate', '$arriv_gate', '$radio_code', '$aircraft', '$reg_numb', '$remarks', '$food_code', '$flight_type', '$downline_leg',
+//                                                        '$overfly', '$canceled', '$dep_ontime', '$arriv_ontime'
+//                                                        );", SI_CONN_STR, FALSE );
+//               
+//                        echo "Flight $flt_numb on $flt_orig_date added<br>";
+//                        }
+//                  else
+//                        {
+//                        if( $msg_seq_id <= $f['msg_seq_id'] )
+//                                echo 'Duplicate message or message out of sequence.<br>';
+//                          else
+//                                {
+//                                db_auto_exec( "UPDATE flight SET
+//                                                        msg_dtm = '$msg_dtm', msg_seq_id = '$msg_seq_id',
+//                                                        flt_leg_orig = '$flt_leg_orig', flt_leg_dest = '$flt_leg_dest', flt_leg_vers = $flt_leg_vers, sch_leg_orig = '$sch_leg_orig',
+//                                                        sch_leg_dest = '$sch_leg_dest', sch_dep_time = '$sch_dep_time', sch_off_time = '$sch_off_time', sch_on_time = '$sch_on_time',
+//                                                        sch_in_time = '$sch_in_time', cur_dep_time = '$cur_dep_time', cur_dep_time_code = '$cur_dep_time_code', cur_off_time = '$cur_off_time',
+//                                                        cur_off_time_code = '$cur_off_time_code', cur_on_time = '$cur_on_time', cur_on_time_code = '$cur_on_time_code', cur_in_time = '$cur_in_time',
+//                                                        cur_in_time_code = '$cur_in_time_code', delay_code = '$delay_code', depart_gate = '$depart_gate', arriv_gate = '$arriv_gate',
+//                                                        radio_code = '$radio_code', aircraft = '$aircraft', reg_numb = '$reg_numb', remarks = '$remarks', food_code = '$food_code', flight_type = '$flight_type',
+//                                                        downline_leg = '$downline_leg', overfly = '$overfly', canceled = '$canceled', dep_ontime = '$dep_ontime', arriv_ontime = '$arriv_ontime'
+//                                                        WHERE flt_orig_date = '$flt_orig_date' AND flt_numb = '$flt_numb';", SI_CONN_STR, FALSE );
+//                                echo "Flight $flt_numb on $flt_orig_date updated<br>";
+//                                }
+//                        }
 
                 } // end of if flight_type != 'Z'              
         }