<?php |
<?php |
include_once ("../lib/common.inc.php"); |
include_once ("../lib/common.inc.php"); |
function processFile($fpath, $tablename) |
function processFile($fpath, $tablename) |
{ |
{ |
global $conn; |
global $conn; |
$row = 1; |
$row = 1; |
$handle = fopen($fpath, "r"); |
$handle = fopen($fpath, "r"); |
//"t" mode string translates windows line breaks to unix |
//"t" mode string translates windows line breaks to unix |
$datamapping0711 = array( |
$datamapping0711 = array( |
"Agency" => "agencyName", |
"Agency" => "agencyName", |
"Parent CN ID" => "parentCN", |
"Parent CN ID" => "parentCN", |
"CN ID" => "CNID", |
"CN ID" => "CNID", |
"Publish Date" => "publishDate", |
"Publish Date" => "publishDate", |
"Amendment Date" => "amendDate", |
"Amendment Date" => "amendDate", |
"Status" => "", |
"Status" => "", |
"StartDate" => "contractStart", |
"StartDate" => "contractStart", |
"EndDate" => "contractEnd", |
"EndDate" => "contractEnd", |
"Value" => "value", |
"Value" => "value", |
"Description" => "description", |
"Description" => "description", |
"Agency Ref Id" => "agencyID", |
"Agency Ref Id" => "agencyID", |
"Category" => "category", |
"Category" => "category", |
"Procurement Method" => "procurementMethod", |
"Procurement Method" => "procurementMethod", |
"ATM ID" => "atmID", |
"ATM ID" => "atmID", |
"SON ID" => "SONID", |
"SON ID" => "SONID", |
"Confidentiality - Contract" => "confidentialityContract", |
"Confidentiality - Contract" => "confidentialityContract", |
"Confidentiality - Contract Reason(s)" => "confidentialityContractReason", |
"Confidentiality - Contract Reason(s)" => "confidentialityContractReason", |
"Confidentiality - Outputs" => "confidentialityOutputs", |
"Confidentiality - Outputs" => "confidentialityOutputs", |
"Confidentiality - Outputs Reason(s)" => "confidentialityOutputsReason", |
"Confidentiality - Outputs Reason(s)" => "confidentialityOutputsReason", |
"Consultancy" => "consultancy", |
"Consultancy" => "consultancy", |
"Consultancy Reason(s)" => "consultancyReason", |
"Consultancy Reason(s)" => "consultancyReason", |
"Amendment Reason" => "amendmentReason", |
"Amendment Reason" => "amendmentReason", |
"Supplier Name" => "supplierName", |
"Supplier Name" => "supplierName", |
"Supplier Address" => "supplierAddress", |
"Supplier Address" => "supplierAddress", |
"Supplier City" => "supplierCity", |
"Supplier City" => "supplierCity", |
"Supplier Postcode" => "supplierPostcode", |
"Supplier Postcode" => "supplierPostcode", |
"Supplier Country" => "supplierCountry", |
"Supplier Country" => "supplierCountry", |
"Supplier ABNExempt" => "supplierABNExempt", |
"Supplier ABNExempt" => "supplierABNExempt", |
"Supplier ABN" => "supplierABN", |
"Supplier ABN" => "supplierABN", |
"Agency Branch" => "contactBranch", |
"Agency Branch" => "contactBranch", |
"Agency Divison" => "contactDivision", |
"Agency Divison" => "contactDivision", |
"Agency Postcode" => "contactPostcode", |
"Agency Postcode" => "contactPostcode", |
"" => "" |
"" => "" |
); |
); |
$headers; |
$headers; |
$contractNoticeFields = array( |
$contractNoticeFields = array( |
"importFile", |
"importFile", |
"agencyName", |
"agencyName", |
"parentCN", |
"parentCN", |
"CNID", |
"CNID", |
"publishDate", |
"publishDate", |
"amendDate", |
"ame |