User Manager updates from Kevin - Do not promote
Showing
2 changed files
with
26 additions
and
25 deletions
| ... | @@ -846,8 +846,23 @@ class Actions { | ... | @@ -846,8 +846,23 @@ class Actions { |
| 846 | $uid = $_POST['uid']; | 846 | $uid = $_POST['uid']; |
| 847 | $event_id = $_POST['event_id']; | 847 | $event_id = $_POST['event_id']; |
| 848 | $type = $_POST['type']; | 848 | $type = $_POST['type']; |
| 849 | |||
| 849 | $status = $_POST['status']; | 850 | $status = $_POST['status']; |
| 850 | $paid_by = $_POST['paid_by']; | 851 | |
| 852 | switch($status) { | ||
| 853 | case 'unpaid': | ||
| 854 | $status = 'unpaid'; | ||
| 855 | $paid_by = ''; | ||
| 856 | break; | ||
| 857 | case 'complementary': | ||
| 858 | $status = 'complementary'; | ||
| 859 | $paid_by = ''; | ||
| 860 | break; | ||
| 861 | default: | ||
| 862 | $status = 'paid'; | ||
| 863 | $paid_by = $status; | ||
| 864 | break; | ||
| 865 | } | ||
| 851 | 866 | ||
| 852 | unset($_POST['action']); | 867 | unset($_POST['action']); |
| 853 | unset($_POST['ajax']); | 868 | unset($_POST['ajax']); |
| ... | @@ -880,11 +895,6 @@ class Actions { | ... | @@ -880,11 +895,6 @@ class Actions { |
| 880 | 895 | ||
| 881 | $cost = get_post_meta($event_id, 'cost', true); | 896 | $cost = get_post_meta($event_id, 'cost', true); |
| 882 | 897 | ||
| 883 | if ( empty($cost) OR $cost < 1 OR strtolower($cost) == "free" ) { | ||
| 884 | set_attending($user->ID,$event_id,"free","",$_POST); | ||
| 885 | } else { | ||
| 886 | |||
| 887 | //$user = new User\CurrentAccount(); | ||
| 888 | $role = $user->getRole(); | 898 | $role = $user->getRole(); |
| 889 | 899 | ||
| 890 | $event = get_post($event_id); | 900 | $event = get_post($event_id); |
| ... | @@ -973,7 +983,7 @@ class Actions { | ... | @@ -973,7 +983,7 @@ class Actions { |
| 973 | } | 983 | } |
| 974 | } | 984 | } |
| 975 | 985 | ||
| 976 | Events\set_attending($user->ID,$event_id,'paid',md5(rand()),$extras); | 986 | |
| 977 | $items = array(); | 987 | $items = array(); |
| 978 | 988 | ||
| 979 | $items[] = array( | 989 | $items[] = array( |
| ... | @@ -1027,7 +1037,9 @@ class Actions { | ... | @@ -1027,7 +1037,9 @@ class Actions { |
| 1027 | //create($items = array(), $invoice_type = 'event', $title = "Invoice", $user_id = 0, $status = 'pending', $reference = '', $publish = 'draft') | 1037 | //create($items = array(), $invoice_type = 'event', $title = "Invoice", $user_id = 0, $status = 'pending', $reference = '', $publish = 'draft') |
| 1028 | Invoice\create($invoice_data, 'event', 'Registration for Event via CBV Admin: '.$event->post_title, $user->ID, $status, 'publish',number_format(($new_cost + $taxes),2)); | 1038 | Invoice\create($invoice_data, 'event', 'Registration for Event via CBV Admin: '.$event->post_title, $user->ID, $status, 'publish',number_format(($new_cost + $taxes),2)); |
| 1029 | 1039 | ||
| 1030 | } | 1040 | Events\set_attending($user->ID,$event_id,'paid',md5(rand()),$extras); |
| 1041 | |||
| 1042 | |||
| 1031 | 1043 | ||
| 1032 | 1044 | ||
| 1033 | } | 1045 | } | ... | ... |
| ... | @@ -49,27 +49,16 @@ | ... | @@ -49,27 +49,16 @@ |
| 49 | <input type="hidden" name="type" value="<?php echo $action; ?>" /> | 49 | <input type="hidden" name="type" value="<?php echo $action; ?>" /> |
| 50 | 50 | ||
| 51 | <div class="dashboard-section" style="margin-left:20px;margin-top:10px;"> | 51 | <div class="dashboard-section" style="margin-left:20px;margin-top:10px;"> |
| 52 | <div class="dashboard-section-title">REGISTRATION STATUS</div> | 52 | <div class="dashboard-section-title">HOW TO PROCESS THE REGISTRATION:</div> |
| 53 | <div class="dashboard-section-links"></div> | 53 | <div class="dashboard-section-links"></div> |
| 54 | <div class="dashboard-section-content small"> | 54 | <div class="dashboard-section-content small"> |
| 55 | <select name="status"> | 55 | <select name="status"> |
| 56 | <option value="paid" <?php echo ($user_event_meta['status']=="paid") ? "selected" : ""; ?>>Paid/Free</option> | ||
| 57 | <option value="unpaid" <?php echo ($user_event_meta['status']=="unpaid") ? "selected" : ""; ?>>Invoice User</option> | 56 | <option value="unpaid" <?php echo ($user_event_meta['status']=="unpaid") ? "selected" : ""; ?>>Invoice User</option> |
| 58 | </select> | 57 | <option value="complementary" <?php echo ($user_event_meta['status']=="complementary") ? "selected" : ""; ?>>Complementary</option> |
| 59 | </div> | 58 | <option value="visa" <?php echo ($user_event_meta['status']=="paid" && $user_event_meta['extras']['paid_by']=="visa") ? "selected" : ""; ?>>Paid by Prepaid Visa</option> |
| 60 | </div> | 59 | <option value="mc" <?php echo ($user_event_meta['status']=="paid" && $user_event_meta['extras']['paid_by']=="mc") ? "selected" : ""; ?>>Paid by Prepaid Mastercard</option> |
| 61 | 60 | <option value="amex" <?php echo ($user_event_meta['status']=="paid" && $user_event_meta['extras']['paid_by']=="amex") ? "selected" : ""; ?>>Paid by Prepaid American Express</option> | |
| 62 | <div class="dashboard-section" style="margin-left:20px;margin-top:10px;"> | 61 | <option value="cheque" <?php echo ($user_event_meta['status']=="paid" && $user_event_meta['extras']['paid_by']=="cheque") ? "selected" : ""; ?>>Paid by Cheque</option> |
| 63 | <div class="dashboard-section-title">PAID BY</div> | ||
| 64 | <div class="dashboard-section-links"></div> | ||
| 65 | <div class="dashboard-section-content small"> | ||
| 66 | <select name="paid_by"> | ||
| 67 | <option value="">Select payment method...</option> | ||
| 68 | <option value="visa" <?php echo ($user_event_meta['extras']['paid_by']=="visa") ? "selected" : ""; ?>>Visa</option> | ||
| 69 | <option value="mc" <?php echo ($user_event_meta['extras']['paid_by']=="mc") ? "selected" : ""; ?>>Mastercard</option> | ||
| 70 | <option value="amex" <?php echo ($user_event_meta['extras']['paid_by']=="amex") ? "selected" : ""; ?>>American Express</option> | ||
| 71 | <option value="cheque" <?php echo ($user_event_meta['extras']['paid_by']=="cheque") ? "selected" : ""; ?>>Cheque</option> | ||
| 72 | <option value="other" <?php echo ($user_event_meta['extras']['paid_by']=="other") ? "selected" : ""; ?>>Other</option> | ||
| 73 | </select> | 62 | </select> |
| 74 | </div> | 63 | </div> |
| 75 | </div> | 64 | </div> | ... | ... |
-
Please register or sign in to post a comment