function updatePersonalInfo() { $id = $_POST['id']; $pass = $_POST['password']; $fname = $_POST['fname']; $mi = $_POST['mi']; $lname = $_POST['lname']; $phone = $_POST['phone']; $email = $_POST['email']; if (verifyAccount($id, $pass)) { _updatePersonalInfo($id, $fname, $mi, $lname, $phone, $email); } }
<!-- Account Verifcation Page: Last edited 22.09.15 --> <?php include "config.php"; include "functions.php"; websiteHeader(); ?> <body> <div id="verify-message"> <?php verifyAccount(); ?> </div> </body> </html>
function addCreditCardCheckout() { $id = isset($_POST['id']) ? $_POST['id'] : -1; $password = isset($_POST['password']) ? $_POST['password'] : '******'; $card_first_name = $_POST['card_first_name']; $card_middle_initial = $_POST['card_middle_initial']; $card_last_name = $_POST['card_last_name']; $card_type = $_POST['card_type']; $card_number = $_POST['card_number']; $card_expr_month = $_POST['card_expr_month']; $card_expr_year = $_POST['card_expr_year']; $card_sec_code = $_POST['card_sec_code']; if (verifyAccount($id, $password)) { // new address _addCreditCard($card_first_name, $card_middle_initial, $card_last_name, $card_type, $card_number, $card_expr_month, $card_expr_year, $card_sec_code); _addCustomerCard($id, $card_number); $card = _getCreditCard($card_number); echo json_encode($card); http_response(200); } else { http_response(200); _addCreditCard($card_first_name, $card_middle_initial, $card_last_name, $card_type, $card_number, $card_expr_month, $card_expr_year, $card_sec_code); $card = _getCreditCard($card_number); echo json_encode($card); } }
function addAddress() { $id = isset($_POST['id']) ? $_POST['id'] : -1; $password = isset($_POST['password']) ? $_POST['password'] : '******'; $street = $_POST['addr_street']; $city = $_POST['addr_city']; $state = $_POST['addr_state']; $country = $_POST['addr_country']; $zip = $_POST['addr_zip_code']; $addr_id = $_POST['addr_id']; if (verifyAccount($id, $password)) { // new address if ($addr_id == -1) { $addr_id = _addAddress($street, $city, $state, $country, $zip); //echo $addr_id; _addCustomerAddress($id, $addr_id); } else { _editAddress($addr_id, $street, $city, $state, $country, $zip); } $address = _getAddress($addr_id); if (is_array($address)) { $address["id"] = $addr_id; } echo json_encode($address); http_response(200); } else { http_response(200); $addr_id = _addAddress($street, $city, $state, $country, $zip); $address = _getAddress($addr_id); if (is_array($address)) { $address["id"] = $addr_id; } echo json_encode($address); } }