Please enter a quantity."; $send = "no"; } else { $qty_err[$i]=''; } if ($part_num[$i] == '') { $part_err[$i]="
Please enter a valid part number."; $send = "no"; } else { $part_err[$i]=''; } if ($reason[$i] == '') { $reason_err[$i]="
Please select a reason for return."; $send = "no"; } else { $reason_err[$i]=''; } } if (!$order_number) { $order_err = "
Please enter your order number."; $send = "no"; } if (!$first_name) { $first_err = "
Please enter your first name."; $send = "no"; } if (!$last_name) { $last_err = "
Please enter your last name."; $send = "no"; } if (!trim($email)) { $email_err='
Please supply your email address.'; $send = "no"; } elseif (!is_valid_email($email)) { $email_err='
You must supply a complete, valid email address, i.e. joe@aol.com'; $send = "no"; } if ($send != "no") { $db->query(sprintf("INSERT INTO e2u_rga_returns (order_number, issue_date, first_name, last_name, company, email, comments) VALUES ('%s', date_trunc('day', timestamp 'now'), '%s', '%s', '%s', '%s', '%s')",$order_number, pg_escape_string($first_name), pg_escape_string($last_name), pg_escape_string($company), $email, pg_escape_string($comments))); foreach ($qty as $row => $qtynum) { if ($qtynum != '') { $rga_id = $db->query_fetch_array("select last_value from e2u_rga_returns_id_seq", 'last_value'); foreach ($rga_id as $id => $menu) { $db->query(sprintf("insert into e2u_rga_return_items (rga_id, qty, part_num, description, price, reason) values ('%d','%d','%s','%s','%d','%s')", $id, trim($qty[$row]), pg_escape_string($part_num[$row]), pg_escape_string($description[$row]), $price[$row], pg_escape_string($reason[$row]))); } } } $subject = "FE RGA Form"; $msg = "Order #: $order_number\n"; $msg .= "Issue Date: $issue_date\n"; $msg .= "Name: $first_name $last_name\n"; $msg .= "Company: $company\n"; $msg .= "Email: $email\n\n"; foreach ($qty as $row => $qtynum) { if ($qtynum != '') { $msg .= "Qty: $qty[$row]\n"; $msg .= "Item to be Returned: $part_num[$row]\n"; $msg .= "Description: $description[$row]\n"; $msg .= "Price: $price[$row]\n"; $msg .= "Reason: $reason[$row]\n\n"; } } $msg .= "\nComments: $comments\n"; $to = "customerservice@fineentertaining.com"; $to .= ", $email"; $mailheaders = "From: customerservice@fineentertaining.com\n"; mail($to, $subject, $msg, $mailheaders); $msg = nl2br($msg); print "
Your RGA has been processed.
Click Here to print this for records.
Return Goods Authorization
Order Number: | $order_number | |
Customer Information: | $first_name $last_name | |
Comany: | $company | |
Email: |
List the items you are returning.
Qty | Part # | Description | Price | Reason for Return |
$qty[$i] | $part_num[$i] | $description[$i] | $price[$i] | $reason[$i] |
Comments: $comments |