function list_payments_action($uid) { // needed to set the tab active $extras_active = true; $payments_active = true; if (user_is_admin($uid)) { // dealing with payment add form if (isset($_POST['uid']) && isset($_POST['amount'])) { $error_message_active = add_payment($_POST['uid'], $_POST['amount']); } // list all the payments $payments = get_all_payments(); // Fetch all the users UIDs $uids = get_all_uids(); require 'templates/payments.php'; } else { require 'templates/login.php'; } }
function new_transfer($receiver, $transfers, $values) { $user = get_user_by_uid($values['client']); $values['reader'] = intval($values['reader']); $amount = 0.0; $amount = intval($transfers) * 0.5; if ($user) { $swipe = add_swipe(0, $user['uid'], 3, 1); debit_account($user['uid'], $amount); add_payment($receiver, $amount); new_order($values); } }
if ($order['pickupType'] == 'D') { $order['shippingStreet'] = $_POST['shippingStreet']; $order['shippingCity'] = $_POST['shippingCity']; $order['shippingState'] = $_POST['shippingState']; $order['shippingZipCode'] = $_POST['shippingZipCode']; } if ($formValidation) { $orderID = add_order($order, $_SESSION['orderLines']); $payment = array(); $payment['orderID'] = $orderID; $payment['amount'] = $_SESSION['totalPrice']; $payment['cardTypeID'] = $_POST['cardTypeID']; $payment['cardNumber'] = $_POST['cardNumber']; $payment['cardExpMonth'] = $_POST['cardExpMonth']; $payment['cardExpYear'] = $_POST['cardExpYear']; add_payment($payment); } $customer['billingStreet'] = $_POST['billingStreet']; $customer['billingCity'] = $_POST['billingCity']; $customer['billingState'] = $_POST['billingState']; $customer['billingZipCode'] = $_POST['billingZipCode']; if ($order['pickupType'] == 'D') { $customer['shippingStreet'] = $_POST['shippingStreet']; $customer['shippingCity'] = $_POST['shippingCity']; $customer['shippingState'] = $_POST['shippingState']; $customer['shippingZipCode'] = $_POST['shippingZipCode']; } $customer['cardTypeID'] = $_POST['cardTypeID']; $customer['cardNumber'] = $_POST['cardNumber']; $customer['cardExpMonth'] = $_POST['cardExpMonth']; $customer['cardExpYear'] = $_POST['cardExpYear'];