<<<<Restricted Area>>>>" . "
Sorry, you must Log In to view this Page

"); exit(); } $usrn = $_GET['usrn']; $ID = $_GET['ID']; $today = date("F j, Y"); $year1 = date(Y); $year2 = $year + 1; $year3 = $year2 +1; $dbcnx = @mysql_connect('mysql.plainhost.com', 'ecosmar_ecosmart', 'ecoman1'); mysql_select_db('ecosmar_inv', $dbcnx); $getem = @mysql_query("SELECT ID,invnum,CID,rep,rec_name,rec_address,rec_city,rec_state,rec_zip,ponum,terms,due,dueup,project,balance,payments,dtup,dtnum,special,prgrss FROM ecoinvoice WHERE ID='$ID'"); if (!$getem) { echo('

Error retrieving Invoice Data.
' . 'Error: '. mysql_error(). '

'); } $row = mysql_fetch_array($getem); $ID = $row['ID']; $invnum = $row['invnum']; $CID = $row['CID']; $rep = $row['rep']; $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']; $ponum = $row['ponum']; $terms = $row['terms']; $due = $row['due']; $dueup = $row['dueup']; if($dueup != 0){ $due = $dueup; $graph = "prggrd.gif"; }else{ $graph = "prggreen.gif"; } $chunk_due = chunk_split($due, 2, ':'); $chunk_arrd = explode(":", $chunk_due); $doodat = $chunk_arrd[2].'-'.$chunk_arrd[3].'-'.$chunk_arrd[0].$chunk_arrd[1]; $doodmonth = $chunk_arrd[2] + 0; $doodyear = $chunk_arrd[0].$chunk_arrd[1]; $project = $row['project']; $balance = $row['balance']; $payments = $row['payments']; $dtup = $row['dtup']; $chunk_dtup = chunk_split($dtup, 2, ':'); $chunk_arru = explode(":", $chunk_dtup); $datup = $chunk_arru[2].'-'.$chunk_arru[3].'-'.$chunk_arru[0].$chunk_arru[1]; if($dtup != 0){ $dtupmess = "Last Update: ".$datup; }else{ $dtupmess = ""; } $dtnum = $row['dtnum']; $chunk_dtnum = chunk_split($dtnum, 2, ':'); $chunk_arr = explode(":", $chunk_dtnum); $datus = $chunk_arr[2].'-'.$chunk_arr[3].'-'.$chunk_arr[0].$chunk_arr[1]; $special = $row['special']; if($special != 'None'){ $spec_notify = "Eco-\$mart Special Pricing Level: ".$special; } $prgrss = $row['prgrss']; $todaysdate = date(0,0,0,date("n"),date("d"),date("Y")); $duedate = date(0,0,0,$doodmonth,$chunk_arrd[3],$doodyear); $prgdiff = $duedate - $todaysdate; $daysto = $prgrss - $prgdiff; $prgper = $prgdiff  /  $prgrss; $formprg = sprintf("%01.2f", $prgper); $gbar = 200 * $formprg; mysql_select_db('ecosmar_contacts', $dbcnx); $listem = @mysql_query("SELECT ID,first_Name,Name,Company,Phone,Address,FAX,City,email,State,ZipCode FROM con_main WHERE ID='$CID'"); if (!$listem) { echo('

Error retrieving data from data base.
' . 'Error: '. mysql_error(). '

'); } $rowb = mysql_fetch_array($listem); $CID = $rowb['ID']; $first_Name = $rowb['first_Name']; $Name = $rowb['Name']; $Company = $rowb['Company']; $Phone = $rowb['Phone']; $Address = $rowb['Address']; $FAX = $rowb['FAX']; $City = $rowb['City']; $email = $rowb['email']; $State = $rowb['State']; $ZipCode = $rowb['ZipCode']; $customer = "$first_Name $Name
$Company
$Address
$City, $State $ZipCode
$email
$Phone
$FAX"; if($Address != $rec_address){ $shipto = "$rec_name
$rec_address
$rec_city, $rec_state $rec_zip"; $shipnote = " Same as Bill To."; }else{ $shipnote = ""; $shipto = "Same as Bill To"; } ?>

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

Invoice
Date Invoice #
   
Representative
 
Bill To: Ship To:      
P.O. Number Terms Due Date Project #
Error retrieving Product Data.
' . 'Error: '. mysql_error(). '

'); } while($rowp = mysql_fetch_array($prod_inv)){ $PID = $rowp['ID']; $prod_name = $rowp['prod_name']; $prod_name_arr[] = $prod_name; $prod_desc = $rowp['prod_desc']; $prod_qty = $rowp['prod_qty']; $prod_price = $rowp['prod_price']; $status = $rowp['status']; $amount = $prod_qty * $prod_price; echo(""); $full_amount[] = $amount; } ?>
Item Code Description Quantity Price Amount
$prod_name$prod_desc" . "$prod_qty" . "$prod_price$amount" . "
         
Edit Eco-$mart Invoice

Subtotal " . $subtotal . "

"); ?>

Adjust Delivery Date:

 New Date:   
 Notes: Notes must accompany any Delivery Date Adjustment.
Notify Customer by email message.
Notes will be included in the email message.
Sales Tax " . $tax . "

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

"); ?>
Payments/Credits

Balance Due