Problem getting invoice data.
Error: ".mysql_error()."

"); }else{ $row = mysql_fetch_array($newinv); $ID = $row['ID']; $invnum = $row['invnum']; $CID = $row['CID']; $RID = $row['RID']; $rep = $row['rep']; $rep_email = $row['rep_email']; $rec_co = $row['rec_co']; $rec_name = $row['rec_name']; $rec_address = $row['rec_address']; $rec_city = $row['rec_city']; $rec_state = $row['rec_state']; $rec_zip = $row['rec_zip']; $rec_phone = $row['rec_phone']; $ponum = $row['ponum']; $terms = $row['terms']; $due = $row['due']; $chunk_due = chunk_split($due, 2, ':'); $chunk_arrd = explode(":", $chunk_due); $doit = $chunk_arrd[2].'/'.$chunk_arrd[3].'/'.$chunk_arrd[0].$chunk_arrd[1]; $project = $row['project']; $taxtotal = $row['taxtotal']; $tax = $row['tax']; $subtotal = $row['subtotal']; $shiptotal = $row['shiptotal']; $balance = $row['balance']; $payments = $row['payments']; $special = $row['special']; $status = $row['status']; } $getprod = mysql_query("SELECT prod_name,prod_desc,prod_qty,prod_price,prod_unit FROM inv_prod WHERE invnum='$invnum' ORDER BY prod_name"); if(!$getprod){ echo("Could not retrieve Product Information
".mysql_error()." "); }else{ while($rop = mysql_fetch_array($getprod)){ $prod_name[] = $rop['prod_name']; $prod_desc[] = $rop['prod_desc']; $prod_q = $rop['prod_qty']; $prod_qty[] = $prod_q; $prod_pr = $rop['prod_price']; $prod_unit = $rop['prod_unit']; $prod_price[] = $prod_pr; $prod_amount[] = $prod_pr * $prod_q; } } $getship = mysql_query("SELECT prod_name,carrier,charge FROM inv_ship WHERE invnum='$invnum' ORDER BY prod_name"); if(!$getship){ echo("Could not retrieve Shipping Information
".mysql_error()." "); }else{ while($ros = mysql_fetch_array($getship)){ $ship_name[] = $ros['prod_name']; $carrier[] = $ros['carrier']; $charge[] = $ros['charge']; } $carrs = array_unique($carrier); $shiptot = array_sum($charge); $shiptotal = sprintf("%01.2f", $shiptot); } mysql_select_db('ecosmar_contacts', $dbcnx); $contact = mysql_query("SELECT first_Name,Name,Company,Address,City,State,ZipCode from con_main WHERE ID='$CID'"); if(!$contact){ echo("

Problem getting contact data.
Error: ".mysql_error()."

"); }else{ $rowc = mysql_fetch_array($contact); $first_Name = $rowc['first_Name']; $Name = $rowc['Name']; $Company = $rowc['Company']; $Address = $rowc['Address']; $City = $rowc['City']; $State = $rowc['State']; $ZipCode = $rowc['ZipCode']; $customer = "$Company
$first_Name $Name
$Address
$City, $State $ZipCode
$email
$Phone
$FAX"; $c_ship = "$Company
$first_Name $Name
$Address
$City, $State $ZipCode
$Phone"; $shipto = "$rec_co
$rec_name
$rec_address
$rec_city, $rec_state $rec_zip
$rec_phone"; } } $right = "So"; ?>

Eco-$mart, Inc.
4411 Bee Ridge Road #344
Sarasota, FL 34233
PH. 888-329-2705   FX: 941-377-9460
www.ecosmartinc.com

Quote
Date Invoice #
   
Representative
 
Bill To: Ship To:
P.O. Number Terms Est. Delivery Project
       
" . "" . "" . ""); $i++; } ?>
Item Code Description QTY Price Unit Total
$prod_name[$i]$prod_desc[$i]" . "$prod_qty[$i]" . "$prod_price[$i]$prod_unit[$i]$$formamount" . "
Edit this Quote Subtotal $" . $subtotal . "

"); ?>

" . "" . "" . "" . "" . ""); $i = $i + 1; } ?>

" . "" . "" . "" . "" . "" . "
" . "
" . "" . "" . "" . "" . "" . "
"); }else{ echo("

Invoices cannot be deleted at this level. If there is a problem concerning an Invoice, please contact Eco-\$mart Administration.

"); } ?>
Sales Tax $" . $tax . "

"); ?>
Shipping $" . $shiptotal . "

"); ?>
Total $" . $total . "

"); ?>
Payments/Credits

0){ mysql_select_db('ecosmar_inv', $dbcnx); $paycheck = mysql_query("SELECT amount,dtnum FROM inv_pay WHERE invnum='$invnum'"); if(!$paycheck){ echo("Could not get Payment Data"); }else{ while($rod = mysql_fetch_array($paycheck)){ $pamount[] = $rod['amount']; $pdtnum[] = $rod['dtnum']; } $ptot = array_sum($pamount); $ptotal = sprintf("%01.2f", $ptot); echo ("

$" . $ptotal . "

" . "

"); $paycount = count($pamount); $i = 0; while($i < $paycount){ $pdtnum = $pdtnum[$i]; $chunk_pdtnum = chunk_split($pdtnum, 2, ':'); $chunk_arrp = explode(":", $chunk_pdtnum); $paidit = $chunk_arrp[2].'/'.$chunk_arrp[3].'/'.$chunk_arrp[0].$chunk_arrp[1]; echo(":$paidit - $pamount[$i]:"); $i = $i + 1; } echo("

"); } }else{ echo ("

0.00

"); } ?>

Balance Due

$