Could not reset product list.".mysql_error()."

"); } } $prodcount = count($additem); $i = 0; while($i < $prodcount){ $in = mysql_query("INSERT INTO inv_prod SET invnum='$invnum',prod_name='$additem[$i]',prod_desc='$adddesc[$i]',prod_qty='$addqty[$i]',prod_price='$addprice[$i]',dtnum='$dtnum',status='new'"); if(!in){ $prob[] = "$additem[$i]"; }else{ $ookey[] = "$additem[$i]"; } $i = $i + 1; } if(!empty($prob)){ echo("

Problems adding:"); foreach($prob as $value){ echo("
$value"); } exit(); }else{ 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){ 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[] = implode[':', $Ecounts]; $Eunit[] = implode[':', $Eunits]; $Edtup[] = implode[':', $Edtups]; }//if locount is greater than one }//if getstock }//foreach }//elseprobarrayisempty ?>

Eco-$mart Invoicing

Checking Inventory

$ebbit[$b]){ $nok[] = $zippit[$b]; $nebbit[] = $ebbit[$b]; } $b = $b + 1; } if(empty($sok)){ $addit = array_sum($nebbit); if($addit > $prod_qty[$i]){ $mess = "on"; }else{ $mess = "off"; } $Edtupped = explode(' : ', $Edtup[$i]); $sortit = rsort($Edtupped,SORT_NUMERIC); $chunk_it = chunk_split($sortit[0], 2, ':'); $chunk_arrs = explode(":", $chunk_it); $arrsof = $chunk_arrs[2].'/'.$chunk_arrs[3].'/'.$chunk_arrs[0].$chunk_arrs[1]; if($prod_qty[$i] > $ecounted and $mess == "off"){ $counted = "**".$prod_qty[$i]."**"; $countnote[$i] = "

" . ">> Order Amount is greater than Stock Inventory for ".$prod_name[$i]." <<." . "
Stock in ".$Eunit[$i]." as of ".$arrsof." :" . "  WhrHs: ".$ShipZip[$i]. "  Count: ".$Ecount[$i]. "  Delay: ".$wait[$i] . "
You may continue with this Quote. But you may need to adjust your delivery date." . "  View Inventory"; }elseif($prod_qty[$i] < $ecounted and $mess == "on"){ $counted = "¹".$prod_qty[$i].""; $countnote[$i] = "

" . "¹Total Available Inventory for ".$prod_name[$i]." is in more than one location.." . "
Stock in ".$Eunit[$i]." as of $arrsof :" . "  WhrHs: ".$ShipZip[$i] . "  Count: ".$Ecount[$i]." ".$Eunit[$i] . "  Delay: ".$wait[$i]." days." . "
You may continue with this Quote. But you may need to adjust your delivery date." . "  View Inventory"; } }//ifmuchstockison elseif($nostock == "off"){ $ecounted = $Ecount[$i]; if($prod_qty[$i] > $ecounted){ $counted = "¹".$prod_qty[$i].""; $countnote[$i] = "

" . ">> Order Amount is greater than Stock Inventory for ".$prod_name[$i]." <<." . "
Stock in ".$Eunit[$i]." as of ".$arrsof." :" . "  WhrHs: ".$ShipZip[$i]. "  Count: ".$Ecount[$i]. "  Delay: ".$wait[$i] . "
You may continue with this Quote. But you may need to adjust your delivery date." . "  View Inventory"; }else{ $counted = "¹".$prod_qty[$i].""; $countnote[$i] = "

" . " Order Amount in Stock for ".$prod_name[$i]."." . "
Stock in ".$Eunit[$i]." as of ".$arrsof." :" . "  WhrHs: ".$ShipZip[$i]. "  Count: ".$Ecount[$i]. "  Delay: ".$wait[$i]. "

"; }//ifprodqtyislessthanecounted }//ifnostockisoff elseif($nostock == "on"){ $counted = $prod_qty[$i]; mysql_select_db('ecosmar_products', $dbcnx); $stockcontact = mysql_query("SELECT co_name,phone,email FROM manufacturers WHERE prod_name='$prod_name[$i]'"); if(!$stockcontact){ $countnote[$i] = "Could not get inventory information for ".$prod_name[$i]; }else{ $row = mysql_fetch_array($stockcontact); $co_name = $row['co_name']; $phone = $row['phone']; $email = $row['email']; $countnote[$i] = "

".$prod_name[$i]. " is not kept in Eco-\$mart Inventory. Please contact vendor for availability." . "Company: ".$co_name."  Phone: ".$phone."  Email: ".$email. "

"; }//elsequerysuccess }//ifnostockison foreach($countnote as $value){ echo $value; } ?>