User Manager Event Registration, Refs#1070
Showing
3 changed files
with
22 additions
and
6 deletions
| ... | @@ -602,4 +602,7 @@ div.tablesorterPager input { | ... | @@ -602,4 +602,7 @@ div.tablesorterPager input { |
| 602 | 602 | ||
| 603 | div.dataTables_paginate span.paginate_active { | 603 | div.dataTables_paginate span.paginate_active { |
| 604 | color: #DF3224; | 604 | color: #DF3224; |
| 605 | } | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 605 | } | ||
| 606 | |||
| 607 | .small-table {} | ||
| 608 | .small-table td { font-size:11px; padding:3px; } | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -943,6 +943,8 @@ class Actions { | ... | @@ -943,6 +943,8 @@ class Actions { |
| 943 | $reg_deadline = get_post_meta($event_id,'reg_deadline',true); | 943 | $reg_deadline = get_post_meta($event_id,'reg_deadline',true); |
| 944 | $event_date = get_post_meta($event_id,'event_date',true); | 944 | $event_date = get_post_meta($event_id,'event_date',true); |
| 945 | 945 | ||
| 946 | $give_earlybird_discount = isset($_POST['discount_earlybird']) ? true : false; | ||
| 947 | $give_member_discount = isset($_POST['discount_member']) ? true : false; | ||
| 946 | 948 | ||
| 947 | $event_term_slugs = array(); | 949 | $event_term_slugs = array(); |
| 948 | $terms = get_the_terms($event_id,'event_type'); | 950 | $terms = get_the_terms($event_id,'event_type'); |
| ... | @@ -958,7 +960,7 @@ class Actions { | ... | @@ -958,7 +960,7 @@ class Actions { |
| 958 | $new_cost = $cost; | 960 | $new_cost = $cost; |
| 959 | $total_discount = 0; | 961 | $total_discount = 0; |
| 960 | 962 | ||
| 961 | if ( ($user->getRole()=="member" || $user->getRole()=="student") && !empty($member_discount) ) { | 963 | if ( $give_member_discount && !empty($member_discount) ) { |
| 962 | $show_member_discount = true; | 964 | $show_member_discount = true; |
| 963 | 965 | ||
| 964 | $discounts[] = Array( | 966 | $discounts[] = Array( |
| ... | @@ -970,7 +972,7 @@ class Actions { | ... | @@ -970,7 +972,7 @@ class Actions { |
| 970 | $total_discount = ($total_discount + $member_discount); | 972 | $total_discount = ($total_discount + $member_discount); |
| 971 | 973 | ||
| 972 | } | 974 | } |
| 973 | if (!empty($early_bird_deadline) && $early_bird_deadline > time()) { | 975 | if ( $give_earlybird_discount && !empty($early_bird_discount) ) { |
| 974 | $show_early_discount = true; | 976 | $show_early_discount = true; |
| 975 | 977 | ||
| 976 | $discounts[] = Array( | 978 | $discounts[] = Array( |
| ... | @@ -1009,7 +1011,7 @@ class Actions { | ... | @@ -1009,7 +1011,7 @@ class Actions { |
| 1009 | $invoice_post = $_POST; | 1011 | $invoice_post = $_POST; |
| 1010 | 1012 | ||
| 1011 | 1013 | ||
| 1012 | $details = Array('dietary', | 1014 | $details = Array('dietary','event_notes', |
| 1013 | 'mealopt_one','mealopt_two','mealopt_three','mealopt_four','mealopt_five','mealopt_six','mealopt_seven','mealopt_eight','mealopt_nine','mealopt_ten', | 1015 | 'mealopt_one','mealopt_two','mealopt_three','mealopt_four','mealopt_five','mealopt_six','mealopt_seven','mealopt_eight','mealopt_nine','mealopt_ten', |
| 1014 | 'session_one','session_two','session_three','session_four','session_five','session_six','session_seven','session_eight','session_nine','session_ten'); | 1016 | 'session_one','session_two','session_three','session_four','session_five','session_six','session_seven','session_eight','session_nine','session_ten'); |
| 1015 | 1017 | ||
| ... | @@ -1072,7 +1074,12 @@ class Actions { | ... | @@ -1072,7 +1074,12 @@ class Actions { |
| 1072 | 1074 | ||
| 1073 | 1075 | ||
| 1074 | //create($items = array(), $invoice_type = 'event', $title = "Invoice", $user_id = 0, $status = 'pending', $reference = '', $publish = 'draft') | 1076 | //create($items = array(), $invoice_type = 'event', $title = "Invoice", $user_id = 0, $status = 'pending', $reference = '', $publish = 'draft') |
| 1075 | Invoice\create($invoice_data, 'event', 'Registration for Event via CBV Admin: '.$event->post_title, $user->ID, $status, 'publish',number_format(($new_cost + $taxes),2)); | 1077 | $invoice_id = Invoice\create($invoice_data, 'event', 'Registration for Event via CBV Admin: '.$event->post_title, $user->ID, $status, 'publish',number_format(($new_cost + $taxes),2)); |
| 1078 | $extras['invoice_id'] = $invoice_id; | ||
| 1079 | $extras['discounts'] = array( | ||
| 1080 | 'member' => ($give_member_discount) ? "Y" : "N" | ||
| 1081 | , 'earlybird' => ($give_earlybird_discount) ? "Y" : "N" | ||
| 1082 | ); | ||
| 1076 | 1083 | ||
| 1077 | Events\set_attending($user->ID,$event_id,'paid',md5(rand()),$extras); | 1084 | Events\set_attending($user->ID,$event_id,'paid',md5(rand()),$extras); |
| 1078 | 1085 | ||
| ... | @@ -1268,6 +1275,8 @@ class Actions { | ... | @@ -1268,6 +1275,8 @@ class Actions { |
| 1268 | $user_event_meta = Array(); | 1275 | $user_event_meta = Array(); |
| 1269 | } | 1276 | } |
| 1270 | 1277 | ||
| 1278 | //CBV\trace($user_event_meta); | ||
| 1279 | |||
| 1271 | $post = Events\get_event($_GET['event_id']); | 1280 | $post = Events\get_event($_GET['event_id']); |
| 1272 | 1281 | ||
| 1273 | $show_dietary = get_post_meta($post->ID, 'show_dietary', true); | 1282 | $show_dietary = get_post_meta($post->ID, 'show_dietary', true); |
| ... | @@ -1297,6 +1306,10 @@ class Actions { | ... | @@ -1297,6 +1306,10 @@ class Actions { |
| 1297 | $mealopt_nine = get_post_meta($post->ID, 'mealopt_nine', true); | 1306 | $mealopt_nine = get_post_meta($post->ID, 'mealopt_nine', true); |
| 1298 | $mealopt_ten = get_post_meta($post->ID, 'mealopt_ten', true); | 1307 | $mealopt_ten = get_post_meta($post->ID, 'mealopt_ten', true); |
| 1299 | 1308 | ||
| 1309 | $early_bird_deadline = get_post_meta($post->ID,'early_bird_deadline',true); | ||
| 1310 | $early_bird_discount = get_post_meta($post->ID,'early_bird_discount',true); | ||
| 1311 | $member_discount = get_post_meta($post->ID,'student_member_discount',true); | ||
| 1312 | |||
| 1300 | require_once(__DIR__ . DIRECTORY_SEPARATOR . 'views' . DIRECTORY_SEPARATOR . 'partials' . DIRECTORY_SEPARATOR . 'edit_event.php'); | 1313 | require_once(__DIR__ . DIRECTORY_SEPARATOR . 'views' . DIRECTORY_SEPARATOR . 'partials' . DIRECTORY_SEPARATOR . 'edit_event.php'); |
| 1301 | 1314 | ||
| 1302 | $content = ob_get_contents(); | 1315 | $content = ob_get_contents(); |
| ... | @@ -1536,7 +1549,7 @@ HTML; | ... | @@ -1536,7 +1549,7 @@ HTML; |
| 1536 | add_submenu_page('cbv_users','New User', 'New User',CAPABILITY,'cbv_users_create',__NAMESPACE__ . '\create_user'); | 1549 | add_submenu_page('cbv_users','New User', 'New User',CAPABILITY,'cbv_users_create',__NAMESPACE__ . '\create_user'); |
| 1537 | add_submenu_page('cbv_users','New User', 'Awaiting Validation',CAPABILITY,'cbv_users_signups',__NAMESPACE__ . '\signups'); | 1550 | add_submenu_page('cbv_users','New User', 'Awaiting Validation',CAPABILITY,'cbv_users_signups',__NAMESPACE__ . '\signups'); |
| 1538 | add_submenu_page('cbv_users', 'Merge Users', 'Merge Users', CAPABILITY, 'cbv_users_merge', __NAMESPACE__ . '\merge_users'); | 1551 | add_submenu_page('cbv_users', 'Merge Users', 'Merge Users', CAPABILITY, 'cbv_users_merge', __NAMESPACE__ . '\merge_users'); |
| 1539 | add_submenu_page('cbv_users', 'Fix Unpaid', 'Fix Unpaid', CAPABILITY, 'cbv_users_fix_unpaid', __NAMESPACE__ . '\fix_unpaid'); | 1552 | //add_submenu_page('cbv_users', 'Fix Unpaid', 'Fix Unpaid', CAPABILITY, 'cbv_users_fix_unpaid', __NAMESPACE__ . '\fix_unpaid'); |
| 1540 | } | 1553 | } |
| 1541 | 1554 | ||
| 1542 | public static function admin_init() { | 1555 | public static function admin_init() { | ... | ... |
This diff is collapsed.
Click to expand it.
-
Please register or sign in to post a comment