symlink($sortFilename, $linkOfLink); link($realFilename, $hardFilename); echo "*** testing reading of links ***\n"; echo "soft link:"; readFile2($sortFilename); echo "hard link:"; readFile2($hardFilename); echo "link of link:"; readFile2($linkOfLink); echo "*** test appending to links ***\n"; echo "soft link:"; appendFile($sortFilename); echo "hard link:"; appendFile($hardFilename); echo "link of link:"; appendFile($linkOfLink); echo "*** test overwriting links ***\n"; echo "soft link:"; writeFile($sortFilename); echo "hard link:"; writeFile($hardFilename); echo "link of link:"; writeFile($linkOfLink); unlink($linkOfLink); unlink($sortFilename); unlink($hardFilename); unlink($realFilename); chdir(".."); rmdir($tmpDir); function readFile2($file) {
$key = $oldKey + $k; $allNewData["key_" . $key]["fultonPage"] = $fultonPage; $allNewData["key_" . $key]["fultonTaxes"] = array(); $allNewData["key_" . $key]["fultonWaste"] = array(); $allNewData["key_" . $key]["fultonPdf"] = ""; $allNewData["key_" . $key]["parselNumber"] = $v; } } else { $key = $data["key"]; $allNewData["key_" . $key]["fultonPage"] = $data["fultonPage"]; $allNewData["key_" . $key]["fultonTaxes"] = $data["fultonTaxes"]; $allNewData["key_" . $key]["fultonWaste"] = $data["fultonWaste"]; $allNewData["key_" . $key]["fultonPdf"] = $data["fultonPdf"]; $allNewData["key_" . $key]["parselNumber"] = $data["parselNumber"]; } appendFile(array("content" => $allNewData)); die(json_encode(array("error" => 0))); } if (!empty($_GET["download"])) { header("Content-type: application/vnd.ms-excel"); header("Content-Disposition: attachment;Filename=fulton_scraper.xls"); $download = ""; $script = ""; } else { $download = "<h3><a href='?download=true'>Download Excel!</a></h3>"; $script = "\n\t\t<link rel='stylesheet' type='text/css' href='//cdn.datatables.net/1.10.10/css/jquery.dataTables.min.css'>\n\t\t<script src='//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js'></script>\n\t\t<script src='//cdn.datatables.net/1.10.10/js/jquery.dataTables.min.js'></script>\n\t\t<style>\n\t\t\t#fulton{\n\t\t\t\twidth: 7000px;\n\t\t\t\tpadding: 0px !important;\n\t\t\t}\n\t\t\t#fulton, th, td{\n\t\t\t\tborder: 1px solid;\n\t\t\t\tpadding: 5px 10px;\n\t\t\t}\n\t\t\t#fulton td{\n\t\t\t\tvertical-align: top;\n\t\t\t}\n\t\t</style>\n\t\t<script>\n\t\t\t\$('#fulton thead th').each( function () {\n\t\t var title = \$('#fulton tfoot th').eq( \$(this).index() ).text();\n\t\t\t \$(this).append( '<br><input type=\"text\" placeholder=\"Search '+title+'\"/>' );\n\t\t\t} );\n\t\t\t \n\t\t // DataTable\n\t\t var table = \$('#fulton').DataTable();\n\t\t \n\t\t // Apply the search\n\t\t table.columns().eq( 0 ).each( function ( colIdx ) {\n\t\t \$( 'input', table.column( colIdx ).header() ).on( 'keyup change', function () {\n\t\t table\n\t\t .column( colIdx )\n\t\t .search( this.value )\n\t\t .draw();\n\t\t } );\n\t\t } );\n\t\t</script>"; } function readResultFile() { global $pdo; $query = $pdo->prepare('SELECT * FROM fultonfile GROUP BY parselNumber');