}
}
//finish suppcode check
$sql = "SELECT prodgroup FROM hkmatrix WHERE uid = " . $i;
$results = $db->QuerySingleRowArray($sql);
$pgcode = $results[0];
if ($pgcode) {
$sql2 = "SELECT hkcategory, wwwcategory FROM categories WHERE code = '" . $pgcode . "'";
//print $sql2."<br>";
$subresults = $db->Query($sql2);
if (!empty($subresults)) {
$ns = $db->fetchRow($subresults);
//print_r($ns);
if ($ns[1]) {
$newsupp = $db->clean($ns[1]);
} else {
$newsupp = $db->clean($ns[0]);
}
$sql3 = "UPDATE hkmatrix SET prodgroup ='" . $newsupp . "' WHERE uid = " . $i;
//print "<br> $sql3";
$results = $db->Query($sql3);
}
}
// end pgcode check
}
if ($cli == 0) {
$sql = "SELECT * FROM hkmatrix";
$newresults = $db->Query($sql);
print $db->GetHTML(false, 'width:100%;', 'font-size:10px;color:#000;background:#cc0;', 'font-size:9px;color:#000;border-width:1px;border-style:solid;');
echo '<br>All imported. It is safe to close this tab and continue with import.<input type="button" value="Close" onclick="window.close()" /><br>';
}