Long"; } if ($sub_id == 2) { $s_header = "Flat"; } if ($sub_id == 3) { $s_header = "Other"; } $sSql1 = "select * from prod_mst2 where cat_id=$iCat and sub_id=$sub_id order by cat_id, sub_id, sub_sub_id, prod_desc_sort"; $status = msqlQuery ($sock1, $sSql1); $res1 = msqlStoreResult(); $iTotal = (int) msqlNumRows ($res1); $iTotal = $iTotal - 1; $iTotReal = (real) $iTotal / 3; $iTotInt = (int) $iTotal / 3; $iMaxRows[0] = (int) 0; $iMaxRows[1] = (int) 0; $iMaxRows[2] = (int) 0; if ($iTotReal > (real) $iTotInt) { $iMaxRows[0] = $iTotInt + 1; } else { $iMaxRows[0] = $iTotInt; } if (($iCat == 100 && $sub_id == 1 && $sub_sub_id == 1) || ($iCat == 200 && $sub_id == 1 && $sub_sub_id == 1)) { $iMaxRows[0] = $iMaxRows[0] + 1; } $iMaxRows[1] = $iMaxRows[0]; $iMaxRows[2] = $iMaxRows[0]; $count1=1; $ii = (int) 0; $iRows = (int) 0; $s_str1[0] = ""; $s_str1[1] = ""; $s_str1[2] = ""; $s_str1[0] = ""; $s_str1[1] = "
"; $s_str1[2] = "
"; if ($sub_id == 2) { $sSql2 = "select * from prod_mst2 where cat_id=$iCat and sub_id=$sub_id and sub_sub_id=1"; $status2 = msqlQuery ($sock1, $sSql2); $res2 = msqlStoreResult(); $iMaxRows[0] = (int) msqlNumRows ($res2); $sSql2 = "select * from prod_mst2 where cat_id=$iCat and sub_id=$sub_id and sub_sub_id=2"; $status2 = msqlQuery ($sock1, $sSql2); $res2 = msqlStoreResult(); $iMaxRows[1] = (int) msqlNumRows ($res2); $sSql2 = "select * from prod_mst2 where cat_id=$iCat and sub_id=$sub_id and sub_sub_id=3"; $status2 = msqlQuery ($sock1, $sSql2); $res2 = msqlStoreResult(); $iMaxRows[2] = (int) msqlNumRows ($res2); } /*echo ("total=$iTotal
real=$iTotReal
int=$iTotInt
Maxrows=$iMaxRows
");*/ while ( $count1 == 1) { $row1 = msqlFetchRow ($res1); if (# $row1 == 0) { $count1 = 0; break; } $cat_name = $row1[4]; $s_str1[$ii] = $s_str1[$ii] + ""; $iRows = $iRows + 1; if ($iRows == (int) $iMaxRows[$ii]) { $iRows = 0; $ii = $ii + 1; } } $s_str1[0] = $s_str1[0] + "
.$cat_name
"; $s_str1[1] = $s_str1[1] + ""; $s_str1[2] = $s_str1[2] + ""; echo (""); if ($iCat == 100 || $iCat == 200) { echo (" "); } echo ("
$s_header
"); if ($sub_id == 2) { echo ("Coils"); } echo (" $s_str1[0] "); if ($sub_id == 2) { echo ("Sheets"); } echo (" $s_str1[1] $s_str1[2]
"); } echo (""); echo (""); $sock = msqlConnect(); if ($sock < 0) { echo("ERROR : $ERRMSG\n"); exit (0); } else { $db = msqlSelectDB($sock, "mesteel"); if ($db < 0) { echo("
SORRY! DATABASE CURRENTLY NOT AVAILABLE.
PLEASE CHECK BACK LATER.. .






















\n"); } else { if ($buy_sell == "1") { $sStr = "Who Buys"; } else { $sStr = "Who Sells"; } echo (" M E   S T E E L

Steel Product List - $sStr

Choose the product you want to search on
"); echo ("
CARBON STEEL
"); processProd (100, 1, 1, (int) $sock, 1); processProd (100, 2, 1, (int) $sock, 1); processProd (100, 3, 1, (int) $sock, 1); echo ("
STAINLESS STEEL
"); processProd (200, 1, 1, (int) $sock, 1); processProd (200, 2, 1, (int) $sock, 1); processProd (200, 3, 1, (int) $sock, 1); echo ("
SPECIAL STEEL
"); processProd (300, 1, 1, (int) $sock, 0); echo ("
BASE MATERIALS
"); processProd (400, 1, 1, (int) $sock, 0); echo ("
ACCESSORIES
"); processProd (500, 1, 1, (int) $sock, 0); } } echo ("


"); msqlClose ($sock); >