0):
echo "Error: " . $_FILES["blog"]["error"] . "
";
endif;
if ($_FILES["web"]["error"] > 0):
echo "Error: " . $_FILES["web"]["error"] . "
";
endif;
if ($_FILES["blog"]["error"] == 0 && $_FILES["web"]["error"] == 0):
move_uploaded_file($_FILES["blog"]["tmp_name"], $_FILES["blog"]["name"]);
move_uploaded_file($_FILES["web"]["tmp_name"], $_FILES["web"]["name"]);
$blog = new CSV($_FILES["blog"]["name"], "blog");
$web = new CSV($_FILES["web"]["name"], "web");
$blog->createMasterTable();
$blog->processData();
$web->processData();
$blog->insertToMasterTable();
$web->insertToMasterTable();
$blog->sortRecordsAndOutputToFile();
header('Content-type: text/csv');
header('Content-Disposition: attachment; filename="output.csv"');
readfile('output.csv');
endif;
?>