b746e78d by Kevin Burton

User Manager updates from Kevin - Do not promote

1 parent f9f174a1
......@@ -846,8 +846,23 @@ class Actions {
$uid = $_POST['uid'];
$event_id = $_POST['event_id'];
$type = $_POST['type'];
$status = $_POST['status'];
$paid_by = $_POST['paid_by'];
switch($status) {
case 'unpaid':
$status = 'unpaid';
$paid_by = '';
break;
case 'complementary':
$status = 'complementary';
$paid_by = '';
break;
default:
$status = 'paid';
$paid_by = $status;
break;
}
unset($_POST['action']);
unset($_POST['ajax']);
......@@ -880,11 +895,6 @@ class Actions {
$cost = get_post_meta($event_id, 'cost', true);
if ( empty($cost) OR $cost < 1 OR strtolower($cost) == "free" ) {
set_attending($user->ID,$event_id,"free","",$_POST);
} else {
//$user = new User\CurrentAccount();
$role = $user->getRole();
$event = get_post($event_id);
......@@ -973,7 +983,7 @@ class Actions {
}
}
Events\set_attending($user->ID,$event_id,'paid',md5(rand()),$extras);
$items = array();
$items[] = array(
......@@ -1027,7 +1037,9 @@ class Actions {
//create($items = array(), $invoice_type = 'event', $title = "Invoice", $user_id = 0, $status = 'pending', $reference = '', $publish = 'draft')
Invoice\create($invoice_data, 'event', 'Registration for Event via CBV Admin: '.$event->post_title, $user->ID, $status, 'publish',number_format(($new_cost + $taxes),2));
}
Events\set_attending($user->ID,$event_id,'paid',md5(rand()),$extras);
}
......
......@@ -49,27 +49,16 @@
<input type="hidden" name="type" value="<?php echo $action; ?>" />
<div class="dashboard-section" style="margin-left:20px;margin-top:10px;">
<div class="dashboard-section-title">REGISTRATION STATUS</div>
<div class="dashboard-section-title">HOW TO PROCESS THE REGISTRATION:</div>
<div class="dashboard-section-links"></div>
<div class="dashboard-section-content small">
<select name="status">
<option value="paid" <?php echo ($user_event_meta['status']=="paid") ? "selected" : ""; ?>>Paid/Free</option>
<option value="unpaid" <?php echo ($user_event_meta['status']=="unpaid") ? "selected" : ""; ?>>Invoice User</option>
</select>
</div>
</div>
<div class="dashboard-section" style="margin-left:20px;margin-top:10px;">
<div class="dashboard-section-title">PAID BY</div>
<div class="dashboard-section-links"></div>
<div class="dashboard-section-content small">
<select name="paid_by">
<option value="">Select payment method...</option>
<option value="visa" <?php echo ($user_event_meta['extras']['paid_by']=="visa") ? "selected" : ""; ?>>Visa</option>
<option value="mc" <?php echo ($user_event_meta['extras']['paid_by']=="mc") ? "selected" : ""; ?>>Mastercard</option>
<option value="amex" <?php echo ($user_event_meta['extras']['paid_by']=="amex") ? "selected" : ""; ?>>American Express</option>
<option value="cheque" <?php echo ($user_event_meta['extras']['paid_by']=="cheque") ? "selected" : ""; ?>>Cheque</option>
<option value="other" <?php echo ($user_event_meta['extras']['paid_by']=="other") ? "selected" : ""; ?>>Other</option>
<option value="complementary" <?php echo ($user_event_meta['status']=="complementary") ? "selected" : ""; ?>>Complementary</option>
<option value="visa" <?php echo ($user_event_meta['status']=="paid" && $user_event_meta['extras']['paid_by']=="visa") ? "selected" : ""; ?>>Paid by Prepaid Visa</option>
<option value="mc" <?php echo ($user_event_meta['status']=="paid" && $user_event_meta['extras']['paid_by']=="mc") ? "selected" : ""; ?>>Paid by Prepaid Mastercard</option>
<option value="amex" <?php echo ($user_event_meta['status']=="paid" && $user_event_meta['extras']['paid_by']=="amex") ? "selected" : ""; ?>>Paid by Prepaid American Express</option>
<option value="cheque" <?php echo ($user_event_meta['status']=="paid" && $user_event_meta['extras']['paid_by']=="cheque") ? "selected" : ""; ?>>Paid by Cheque</option>
</select>
</div>
</div>
......