Blue Ball Logo KieferArt
FINE ART PURCHASE PAGE

"; $_SESSION['edit'] = 'on'; //echo "SESSIONS edit is SET." . "
"; } else { //echo "Edit is NOT SET." . "
"; } /* SETS INPUT VARIABLES FOR USE IN INPUT CHECKS, LOADING TABLE OR RELOADING FORM VALUES FOR EDITING */ if (isset($_POST['fname'])) { $firstName = $_POST['fname']; } elseif (isset($_POST['edit'])) { $firstName = $_SESSION['fname']; } else { $firstName = "first name"; } //echo $firstName . ", "; if (isset($_POST['lname'])) { $lastName = $_POST['lname']; } elseif (isset($_POST['edit'])) { $lastName = $_SESSION['lname']; } else { $lastName = "last name"; } //echo $lastName . ", "; if (isset($_POST['street_apt_number'])) { $address = $_POST['street_apt_number']; } elseif (isset($_POST['edit'])) { $address = $_SESSION['address']; } else { $address = "address"; } //echo $address . ", "; if (isset($_POST['city'])) { $city = $_POST['city']; } elseif (isset($_POST['edit'])) { $city = $_SESSION['city']; } else { $city = "city"; } //echo $city . ", "; if (isset($_POST['state'])) { $state = $_POST['state']; } elseif (isset($_POST['edit'])) { $state = $_SESSION['state']; } else { $state = ''; } //echo $state . ", "; if (isset($_POST['zip_code'])) { $zip = $_POST['zip_code']; } elseif (isset($_POST['edit'])) { $zip = $_SESSION['zip']; } else { $zip = "zip code"; } //echo $zip . ", "; if (isset($_POST['email'])) { $email = $_POST['email']; } elseif (isset($_POST['edit'])) { $email = $_SESSION['email']; } else { $email = "email"; } //echo $email . " and "; if (isset($_POST['emailConfirm'])) { $emailConfirm = $_POST['emailConfirm']; $_SESSION['emailConfirm'] = $emailConfirm; } elseif (isset($_POST['edit'])) { $emailConfirm = $_SESSION['emailConfirm']; } else { $emailConfirm = "email confirm"; } //echo $emailConfirm . "." . "
"; if (isset($frame)) { $frame = $_POST['frame']; } else { $frame = ''; } if (isset($_SESSION['title']))//IF CUSTOMER HAS SELECTED A PAINTING { $title = $_SESSION['title']; if (isset($_POST['submitForm']))//IF CUSTOMER HAS FILLED OUT THIS FORM, PROCESS IT (on the same page) { echo "
"; /* DO INPUT CHECKS */ $validInput = true; if ((!isset($firstName)) || ($firstName == 'first name')) { $validInput = false; echo ""; "Please enter your first name. Thanks." . "
"; echo "
"; } if ((!isset($lastName)) || ($lastName == 'last name')) { $validInput = false; echo ""; echo "Please enter your last name. Thanks." . "
"; echo "
"; } if ((!isset($address)) || ($address == 'street address')) { $validInput = false; echo ""; echo "Please enter your street address. Thanks." . "
"; echo "
"; } if ((!isset($city)) || ($city == 'city')) { $validInput = false; echo ""; echo "Please enter your city. Thanks." . "
"; echo "
"; } if ((!isset($zip)) || ($zip == 'zip code')) { $validInput = false; echo ""; echo "Please enter your zip code. Thanks." . "
"; echo "
"; } if ((!isset($state)) || ($state == '')) { $validInput = false; echo ""; echo "Please select your state. Thanks." . "
"; echo "
"; } if ((!isset($email)) || ($email == 'email')) { $validInput = false; echo ""; echo "Please enter your email address. Thanks." . "
"; echo "
"; } elseif (!filter_input(INPUT_POST, "email", FILTER_VALIDATE_EMAIL)) { $validInput = false; echo "
"; echo "Please go back and re-enter your email address. Must've been a typo. Thanks." . "
"; echo "
"; } if ((!isset($emailConfirm)) || ($emailConfirm == 'email confirm')) { $validInput = false; echo ""; echo "Please confirm your email. Thanks." . "
"; echo "
"; } if ($email != $emailConfirm) { $validInput = false; echo ""; echo "Your email confirmation does not match." . "
" . "Please re-enter. Thanks." . "
"; echo "
"; } if (isset($_POST['frame'])) { $frame = $_POST['frame']; echo "
"; } else { $validInput = false; echo ""; echo "Please indicate whether or not you want a frame with the painting. Thanks." . "
"; echo "
"; } if ($validInput == true) { //echo $validInput . " is the value of validInput before form (true)." . "
"; } if (isset($_POST['submitForm'])) { //echo "continue button was clicked and post submit form is set." . "
"; } echo ""; }//END IF CUSTOMER HAS SUBMITTED FORM }//END IF CUSTOMER HAS SELECTED A PAINTING if (((isset($validInput)) && ($validInput == false)) || (!isset($_POST['submitForm']))) { ?>

' enctype='multipart/form-data' method='post' style='display:inline;'> Your personal information will be kept confidential
at KieferArt and will not be passed onto anyone else.
When you goto the PayPal site, you will need to re-enter your information.

    max 40 chars
    max 40 chars
    max 40 chars
    max 40 chars
    please select your state




Each fine art original for sale on this site has been framed. Some KieferArt customers prefer to buy their own frame for the painting. Please indicate here whether or not you would like to receive the painting FRAMED or UNFRAMED. (The sales price of the painting is not effected either way).
FRAMED              UNFRAMED




"; echo ""; echo ""; }//END IF validInput equals FALSE /* PRINT ORDER */ if ((isset($validInput)) && ($validInput == true)) { echo "

"; echo ""; echo "Please click the Paypal \"Pay Now\" button below to make your payment." . "
" . "(You may want to print this page for your records before leaving KieferArt.)" . "

"; echo ""; echo ""; echo "
"; echo ""; echo $date . "

"; echo "" . $firstName . " " . $lastName; echo "
"; echo $address . "
"; echo $city . ", " . $state . " " . $zip . "
"; echo "Email: " . $email . "
"; echo "Frame: " . $frame; if (($_SESSION['price'] == 'nfs') || ($_SESSION['price'] == 'NFS')) { echo "

" . "I'm sorry. this original is either not for sale or has already been sold." . "
"; echo "Please click " . "
" . "here" . "" . " for print availability. Thank you." . "

"; die(); } else { echo "

" . "Item price: " . "" . $_SESSION['price'] . "
"; } if ($state == 'MN') { $tax = $_SESSION['tax']; echo "MN State tax: " . "" . $tax . "
"; } else { $tax = 0; } $ship = 40.00; $ship = sprintf("%01.2f", $ship); echo "s/h: " . "" . "\$" . $ship . "

"; $priceF = substr($_SESSION['price'], 1); $taxF = substr($tax, 1); $total = $priceF + $taxF + $ship; $total = sprintf("%01.2f", $total); echo "" . "TOTAL PRICE: $" . $total . "

"; echo "
"; echo "
"; echo "" . $_SESSION[" . "
"; echo ""; echo $_SESSION['title']; echo "
"; /* EDIT BUTTON */ echo "
"; echo "
"; echo ""; echo "
"; echo "
"; /* LOAD SESSIONS WITH PRINTER FRIENDLY VARIABLES */ $_SESSION['date'] = $date; $_SESSION['fname'] = $firstName; $_SESSION['lname'] = $lastName; $_SESSION['address'] = $address; $_SESSION['city'] = $city; $_SESSION['state'] = $state; $_SESSION['zip'] = $zip; $_SESSION['email'] = $email; $_SESSION['frame'] = $frame; if ($tax) { $_SESSION['tax'] = $tax; } $_SESSION['ship'] = $ship; $_SESSION['total'] = $total; /* JUST FOR TESTING */ /*echo "
"; echo "
"; echo $_SESSION['fname'] . " (first name)" . "
"; echo $_SESSION['lname'] . " (last name)" . "
"; echo $_SESSION['address'] . " (address)" . "
"; echo $_SESSION['city'] . " (city)" . "
"; echo $_SESSION['state'] . " (state)" . "
"; echo $_SESSION['zip'] . " (zip)" . "
"; echo $_SESSION['email'] . " (email)" . "
"; echo $_SESSION['frame'] . " (frame)" . "
"; echo $_SESSION['price'] . " (price)" . "
"; if ($state == 'MN') { echo $_SESSION['tax'] . " (tax)" . "
"; } echo $_SESSION['ship'] . " (ship)" . "
"; echo $_SESSION['total'] . " (total)" . "
"; echo "
";*/ ?>

"; echo ""; echo ""; echo ""; $paypalTotalPrice = $priceF + $taxF + $ship; echo ""; ?>
"; /* LOAD ALL VALUES INTO fineArt TABLE */ // //CONNECT TO DB // // $con = mysql_connect("localhost","kieferar","otersauce"); if (!$con) { //echo "Mysql did not connect on " . $date . "." . "
"; die(); } else { //echo "Connected to mysql just fine, thank you." . "
"; } $selectDb = mysql_select_db("kieferar_greetingcard", $con); if (!$selectDb) { //echo "Did not select db." . "
"; } else { //echo "Selected greeting_card data base, too." . "
"; } /* INSERTS RECORD */ $idQuery = mysql_query("select faID from fineArt order by faID desc limit 1");//FINDS CURRENT RECORD FOR SELF EMAIL if (!$idQuery) { //echo "Did not query fineArt for last faID." . "
"; } else { while ($row = mysql_fetch_array($idQuery)) { global $id; $id = $row['faID']; //echo $id . " is the value of the id from the select last id while statement." . "
"; break; }//END WHILE }//END ELSE /* FILTERS INPUT */ $firstName = filter_var($_SESSION['fname'], FILTER_SANITIZE_SPECIAL_CHARS); $lastName = filter_var($_SESSION['lname'], FILTER_SANITIZE_SPECIAL_CHARS); $address = filter_var($_SESSION['address'], FILTER_SANITIZE_SPECIAL_CHARS); $city = filter_var($_SESSION['city'], FILTER_SANITIZE_SPECIAL_CHARS); $zip = filter_var($_SESSION['zip'], FILTER_SANITIZE_SPECIAL_CHARS); $title = filter_var($_SESSION['title'], FILTER_SANITIZE_SPECIAL_CHARS); if ((isset($_POST['edit'])) || (isset($_SESSION['edit']))) { $update = mysql_query("update fineArt set fname = '$firstName', lname = '$lastName', street_apt_number = '$address', city = '$city', state = '$state', zip_code = '$zip', email = '$email', frame = '$frame', tax = '$taxF', total = '$total' where faID = '$id'"); if (!$update) { //echo "Did not query record for updating." . mysql_error() . "
"; } else { //echo "Queried record for updating." . "
"; } } elseif ((!isset($_POST['edit'])) && ((isset($validInput)) && ($validInput == true))) { $sql = mysql_query("insert into fineArt (date, fname, lname, street_apt_number, city, state, zip_code, email, frame, title, price, tax, shipping, total) values ('$_SESSION[date]', '$firstName', '$lastName', '$address', '$city', '$_SESSION[state]', '$zip', '$_SESSION[email]', '$_SESSION[frame]', '$title', '$priceF', '$taxF', '$ship', '$total')"); if (!$sql) { //echo "Did not insert into fineArt table." . "
"; } else { //echo "Inserted record into fineArt table." . "
"; // // //SENDS NOTICE TO MY EMAIL THAT A CUSTOMER HAS SUBMITTED A FINE ART FORM ************* UNCOMMENT FOR PRODUCTION **************** // // $to = 'kiefer@kieferart.com'; $subject = 'New Fine Art Submission'; $message = "A fine art form was submitted on" . " " . $date . " from " . $firstName . " " . $lastName . ", record number: " . $id . ". Check paypal for payment."; $headers = 'From: kiefer@kieferart.com'; mail($to, $subject, $message, $headers); } }//END IF EDIT IS NOT SET echo "
";//CLOSES DIV FOR PRINTING MYSQL ERROR MESSAGES ?>