示例#1
0
         if ($year === 2006) {
             continue;
         }
         $con = new ODBCWrapper("Driver={Microsoft Access Driver (*.mdb, *.accdb)};Dbq=D:/dwork/bs_trafik_data/Trafikstatistik {$year}.mdb", "", "");
         echo "{$year}: ";
         echo $con->get_single_value("\tSELECT count(*)\n\t\t\t\t\t\t\t\t\t\t\t\t\tFROM PersonOplysninger\n\t\t\t\t\t\t\t\t\t\t\t\t\t");
         echo "<br>";
     }
 } elseif ($_GET['action'] === "export_personer") {
     for ($year = 2000; $year <= 2016; $year++) {
         if ($year === 2006) {
             continue;
         }
         $con = new ODBCWrapper("Driver={Microsoft Access Driver (*.mdb, *.accdb)};Dbq=D:/dwork/bs_trafik_data/Trafikstatistik {$year}.mdb", "", "");
         $dbf = new DatabaseFunctions($con);
         $dbf->sql_to_csv_file("\tSELECT *\n\t\t\t\t\t\t\t\t\t\t\t\tFROM PersonOplysninger\n\t\t\t\t\t\t\t\t\t\t\t\tORDER BY navn\n\t\t\t\t\t\t\t\t\t\t\t\t", "export_files/personoplysniner{$year}.csv");
         echo "personoplysniner {$year} exported<br>";
     }
 } elseif ($_GET['action'] === "export_trafik") {
     for ($year = 2000; $year <= 2016; $year++) {
         if ($year === 2006) {
             continue;
         }
         $con = new ODBCWrapper("Driver={Microsoft Access Driver (*.mdb, *.accdb)};Dbq=D:/dwork/bs_trafik_data/Trafikstatistik {$year}.mdb", "", "");
         foreach (array_keys($month_map) as $month_idx) {
             $itr = new TrafikIterator($con, $year, $month_idx);
             itr_to_csv_file($itr, "export_files/trafik{$year}.csv", $month_idx === "01", $month_idx !== "01");
         }
         echo "trafik {$year} exported<br>";
     }
 }