Inventory Status
|
Part
| Warehouse
| Stock
| Units
| Delay
|
if(!empty($prob)){
echo("Problems adding:");
foreach($prob as $value){
echo("
$value");
}
exit();
}else{
$ShipZip = array();
$wait = array();
$Ecount = array();
$Edtup = array();
mysql_select_db('ecosmar_products', $dbcnx);
foreach($ookey as $value){
$getstock = mysql_query("SELECT ShipZip,wait,count,unit,dtup FROM entory_inv WHERE part_name='$value'");
if(!$getstock){
echo("
Could not retrieve Product Information
".mysql_error()."
");
}else{
$locount = mysql_num_rows($getstock);
if($locount == 0 or $locount == ""){
$nostock = "on";
}elseif($locount == 1){
$rot = mysql_fetch_array($getstock);
$ShipZip = $rot['ShipZip'];
$wait = $rot['wait'];
$Ecount = $rot['count'];
$Eunit = $rot['unit'];
$Edtup = $rot['dtup'];
$nostock = "off";
}elseif($locount > 1){
$ShipZips = array();
$waits = array();
$Ecounts = array();
$Eunits = array();
$Edtups = array();
while($rot = mysql_fetch_array($getstock)){
$ShipZips[] = $rot['ShipZip'];
$waits[] = $rot['wait'];
$Ecounts[] = $rot['count'];
$Eunits[] = $rot['unit'];
$Edtups[] = $rot['dtup'];
}
$muchstock = "on";
$ShipZip = implode(':', $ShipZips);
$wait = implode(':', $waits);
$Ecount = array_sum($Ecounts);
$Eunit = $Eunits[0];
$Edtup = implode(':', $Edtups);
}//if locount is greater than one
}//if getstock
if($nostock == "on"){
$getmfg = mysql_query("SELECT MID FROM ecosmar_products WHERE item_number='$value'");
if(!$getmfg){
echo("Could not retrieve vendor for $value. Contact Eco-\$mart Administration for availability. |
");
}else{
$rowse = mysql_fetch_array($getmfg);
$mid = $rowse[0];
$getmfgi = mysql_query("SELECT co_name,email,phone FROM mfg WHERE ID='$mid'");
if(!$getmfgi){
echo("Could not retrieve vendor information for $value. Contact Eco-\$mart Administration for availability. |
");
}else{
$rowb = mysql_fetch_array($getmfgi);
$mname = $rowb['co_name'];
$mmail = $rowb['email'];
$mphon = $rowb['phone'];
if($mname != ""){
echo("$value Not In Eco-\$mart Stock. Enquire: $mname, $mmail, $mphon |
");
}else{
echo("$value Not In Eco-\$mart Stock. Contact Eco-$mart Administration for Information |
");
}
}
}
}
if($nostock == "off"){
if($Ecount < 1){
$col = "red";
$messo = "*Out of Stock - Contact Eco-\$mart Administration for Availability.";
$warn = "On";
}elseif($Ecount < 2){
$col = "maroon";
$messo = "*Low Stock - Contact Eco-\$mart Administration for Availability.";
$warn = "On";
}else{
$col = "green";
$messo = "";
}
echo("$value | $ShipZip | $Ecount | $Eunit | $wait |
");
if($messo != ""){
echo("".$messo." |
");
}
}//nostockisoff
if($muchstock == "on"){
echo("$value | $ShipZip | $Ecount | $Eunit | $wait |
" .
"*More than one stock location |
");
}
}//foreach
}//ifprobisempty
?>