<?php

require_once 'UploadData.php';

// todo: to be cronned: http://serverfault.com/questions/54152/how-to-get-e-mail-from-failed-cron-jobs-in-ubuntu
// todo: get the correct muni value into the DB from the data file.  see example below
// todo: make sure license numbers are correctly entered into the DB

//"L30001596","12754","CPA","KAMP","TARA","MARIE","PAULY ROGERS AND COMPANY PC","6/1/2010","6/30/2016","ACTIVE","386","Home","E","","2016-6-30","NO","","12700 SW 72ND AVE","TIGARD","OR","97223","","7194 SW 156TH AVE","BEAVERTON","OR","97007","1485","11/4/2014 11:34:48","F0000378","11"
// in this record the 1485 is the muni value
$dataDir = "/home/oregon56/public_html/boasearch/data";
$env = "";
if (isset($_SERVER['LOGNAME']) && $_SERVER['LOGNAME'] == 'sarah' ) {
    $env = "dev";
    $dataDir = "/Users/sarah/Sites/NetForest/BOA/LicenseeSearch/uploads/data";
}
$ud = new UploadData($env);
$ud->setFirmsFilename($dataDir.'/websearchfirms.csv');
$ud->setIndividualsFilename($dataDir.'/websearchlicensees.csv');

//$ud->loadFirmsData();
//$ud->loadIndividualsData();


$ud->prepareDatabase();
$ud->loadData();
$ud->swapOldForNew();
exit(0);  // exit out normally