Tidy up imports
[contractdashboard.git] / admin / updateUNSPSC.php
blob:a/admin/updateUNSPSC.php -> blob:b/admin/updateUNSPSC.php
--- a/admin/updateUNSPSC.php
+++ b/admin/updateUNSPSC.php
@@ -6,6 +6,22 @@
 $unspscresult = mysql_query ("select * from UNSPSCcategories;");

 while ($row = mysql_fetch_assoc($unspscresult)) {

 	$unspsc[$row['Title']] = $row['UNSPSC'];

+	// some Australian spellings

+	$isiz = str_replace("iz","is",$row['Title']);

+	$unspsc[$isiz] = $row['UNSPSC'];

+	$defence = str_replace("efense","efence",$row['Title']);

+	$unspsc[$defence] = $row['UNSPSC'];

+	$center = str_replace("enter","entre",$row['Title']);

+	$unspsc[$center] = $row['UNSPSC'];

+	// some divergence from standard

+	$tobacco = str_replace("Food Beverage and Tobacco Products","Food and Beverage Products",$row['Title']);

+	$unspsc[$tobacco] = $row['UNSPSC'];

+	$architect = str_replace("Building and Construction and Maintenance Services","Architectural services",$row['Title']);

+	$unspsc[$architect] = $row['UNSPSC'];

+	// some just plain wrong

+	$noOilRigs = str_replace("Building and Construction and Maintenance Services","Management and provision of all facilities engineering modification and maintenance services for a site or platform",$row['Title']);

+	$unspsc[$noOilRigs] = $row['UNSPSC'];

+	

 }

 

 $query = "SELECT CNID,category,value

@@ -28,7 +44,7 @@
 	}

 	} 

 } else echo "error".mysql_error();

-asort($missing);

+asort($missing,SORT_NUMERIC);

 print_r($missing);

 ?>