$last_name = COM_applyFilter($_POST['last_name']); $company = COM_applyFilter($_POST['company']); $address_line1 = COM_applyFilter($_POST['address_line1']); $address_line2 = COM_applyFilter($_POST['address_line2']); $city = COM_applyFilter($_POST['city']); $state = COM_applyFilter($_POST['state']); $zip = COM_applyFilter($_POST['zip']); $country = COM_applyFilter($_POST['country']); $card_number = COM_applyFilter($_POST['card_number']); $card_exp_month = COM_applyFilter($_POST['card_exp_month']); $card_exp_year = COM_applyFilter($_POST['card_exp_year']); $card_type = COM_applyFilter($_POST['card_type']); $issue_number = COM_applyFilter($_POST['issue_number']); $start_month = COM_applyFilter($_POST['start_month']); $start_year = COM_applyFilter($_POST['start_year']); $error = add_credit_card($_USER['uid'], $first_name, $middle_name, $last_name, $company, $address_line1, $address_line2, $city, $state, $zip, $country, $card_number, $card_exp_month, $card_exp_year, $card_type, $issue_number, $start_month, $start_year, isset($_POST['default']) ? true : false); } else { if (isset($_POST['delete_credit_card']) || isset($_GET['delete'])) { $error = delete_credit_card($_GET['id'], 'index.php?op=credit_cards'); } else { $error = ""; } } } draw_credit_card($error); echo "<SCRIPT type=\"text/javascript\">initCountry();</SCRIPT>"; //Needed for State/Country # #^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^DRAW_CREDIT_CARD^^^^^^^^^^^^ # Displays credit card information with error message #________________________________________________________________________________________________
function add_card() { global $_TABLES; require_once $_SESSION['path_html'] . "ecommerce/user_credit_card_functions.php"; //Get Payment Type $res = DB_query("SELECT ecom_payment_type FROM {$_TABLES['ecom_payment_type']} WHERE ecom_payment_type_id = " . $_SESSION['payment_type_id'] . ""); $row = DB_fetchArray($res); $billTo_firstName = COM_applyFilter($_POST['billTo_firstName']); $billTo_lastName = COM_applyFilter($_POST['billTo_lastName']); $billTo_street1 = COM_applyFilter($_POST['billTo_street1']); $billTo_city = COM_applyFilter($_POST['billTo_city']); $billTo_state = COM_applyFilter($_POST['billTo_state']); $billTo_postalCode = COM_applyFilter($_POST['billTo_postalCode']); $billTo_country = COM_applyFilter($_POST['billTo_country']); $card_accountNumber = COM_applyFilter($_POST['card_accountNumber']); $card_expirationMonth = COM_applyFilter($_POST['card_expirationMonth']); $card_expirationYear = COM_applyFilter($_POST['card_expirationYear']); $error = add_credit_card($_SESSION['uid'], $billTo_firstName, "", $billTo_lastName, "", $billTo_street1, "", $billTo_city, $billTo_state, $billTo_postalCode, $billTo_country, $card_accountNumber, $card_expirationMonth, $card_expirationYear, $row['ecom_payment_type'], "", "", "", false); echo $error; }