// Custom setup for specific database tables and fields $fields = array(`firstname`, `lastname`, `email`, `address1`, `address2`, `city`, `state`, `zip`, `phone` ); $table = "" . $tableprefix . "orders"; $queries = array(); // Custom Field Values Verification/Cleanup for($i = 0; $i < count($fields); $i++) { if($$fields[$i] == "") { array_push($input_errors,"Error: Valid ". $field[$i]. " is a required input value."); } } $email = trim($email); if (!valid_email($email)) { array_push($input_errors,"Error: Valid Email is a required input value."); } // Update Database with Verified Data if (count($input_errors) == 0) { $success_message = "Please continue to paypal to finish checkout process."; $failure_message = "Error: Error in shipping address, please re-enter address."; } // Add Database Entries if ((count($input_errors) == 0)) { $posted = now(); $fields.push("cart"); $cart = $_SESSION['visitor_cart']; include ("include/psuedo_functions/make_insert.php"); array_push($queries,$query); // Execute Database Statement(s) $dberror = run_queries($db,$queries,$DEBUG); } if((count($input_errors) == 0) && !$dberror) { $start_success = ""; $end_success = ""; $template->set_var("START_SUCCESS",$start_success); $template->set_var("END_SUCCESS",$end_success); } else { $start_success = ""; $template->set_var("START_SUCCESS",$start_success); $template->set_var("END_SUCCESS",$end_success); } $template->set_var("SHIPPING", $shipping); ?>