From 51e101be13ad1176135c76a002deac58c612b633 Mon Sep 17 00:00:00 2001 From: magepeopleteam Date: Mon, 14 Dec 2020 12:10:30 +0000 Subject: [PATCH] file update --- css/admin_style.css | 32 +- inc/mep_event_fw_meta.php | 112 +- inc/mep_event_meta.php | 2368 ++++++++++++++++--------------------- js/mkb-admin.js | 18 +- 4 files changed, 1168 insertions(+), 1362 deletions(-) diff --git a/css/admin_style.css b/css/admin_style.css index 16c1596..b89a215 100644 --- a/css/admin_style.css +++ b/css/admin_style.css @@ -153,7 +153,7 @@ a.button.remove-faq-row { display: inline-block; width: 60px; height: 24px; - float: right; + margin: -5px 0 0 20px; } .post-type-mep_events .switch input {display: none;} @@ -335,6 +335,36 @@ div#mep_event_list_thumbnail_meta_boxes table td input#enable_global_qty { float: left; order:2; } +.wrap.mage_settings_panel_wrap { + display: block; + overflow: hidden; + position: relative; + display: -webkit-flex;display: flex;-webkit-flex-wrap: wrap;flex-wrap: wrap; +} +.wrap.mage_settings_panel_wrap h2.nav-tab-wrapper { + width: 20%; + padding: 0; + margin: 0; + float: left; + order:2; +} +.mp_tab_item .item .content input { + display: block; + width: 100%; + border: 1px solid #333; + border-radius: 0; + margin: 10px 0; + padding: 10px; +} + +.mp_tab_item .item .content textarea { + width: 100%; + margin: 10px 0; + border-radius: 0; + padding: 10px; + min-height: 200px; +} +#wp-mep_event_cc_email_text-media-buttons button{width:auto !important;} .wrap.mage_settings_panel_wrap #setting-error-tgmpa{order: 0;width: 100%;} #mp_event_all_info_in_tab table.form-table{table-layout: inherit;} #mp_event_all_info_in_tab table.form-table th{width: 35%;} diff --git a/inc/mep_event_fw_meta.php b/inc/mep_event_fw_meta.php index cb7c694..fcba1c3 100644 --- a/inc/mep_event_fw_meta.php +++ b/inc/mep_event_fw_meta.php @@ -113,6 +113,117 @@ function mep_fw_meta_boxs() + $events_faq_boxs = array( + 'page_nav' => __('Event FAQ', 'mage-eventpress'), + 'priority' => 10, + 'sections' => array( + 'section_2' => array( + 'title' => __('', 'mage-eventpress'), + 'description' => __('', 'mage-eventpress'), + 'options' => array( + array( + 'id' => 'mep_event_faq', + 'title' => __('F.A.Q Details', 'mage-eventpress'), + 'details' => __('', 'mage-eventpress'), + 'collapsible' => true, + 'type' => 'repeatable', + 'btn_text' => 'Add New F.A.Q', + 'title_field' => 'mep_faq_title', + 'fields' => array( + array( + 'type' => 'text', + 'default' => '', + 'item_id' => 'mep_faq_title', + 'name' => 'Title' + ), + array( + 'type' => 'textarea', + 'default' => '', + 'item_id' => 'mep_faq_content', + 'name' => 'Content' + ), + ), + ), + ) + ), + + ), + ); + $events_faq_meta_args = array( + 'meta_box_id' => 'mep_event_faq_meta_boxes', + 'meta_box_title' => '  '.__('F.A.Q', 'mage-eventpress'), + 'screen' => array('mep_events'), + 'context' => 'normal', + 'priority' => 'high', + 'callback_args' => array(), + 'nav_position' => 'none', + 'item_name' => "MagePeople", + 'item_version' => "2.0", + 'panels' => array( + 'events_faq_meta_boxs' => $events_faq_boxs + ) + ); + new AddMetaBox($events_faq_meta_args); + + + + + + $events_dd_boxs = array( + 'page_nav' => __('Event Daywise Details', 'mage-eventpress'), + 'priority' => 10, + 'sections' => array( + 'section_2' => array( + 'title' => __('', 'mage-eventpress'), + 'description' => __('', 'mage-eventpress'), + 'options' => array( + array( + 'id' => 'mep_event_day', + 'title' => __('Daywise Details', 'mage-eventpress'), + 'details' => __('', 'mage-eventpress'), + 'collapsible' => true, + 'type' => 'repeatable', + 'btn_text' => 'Add New Days', + 'title_field' => 'mep_day_title', + 'fields' => array( + array( + 'type' => 'text', + 'default' => '', + 'item_id' => 'mep_day_title', + 'name' => 'Title' + ), + array( + 'type' => 'textarea', + 'default' => '', + 'item_id' => 'mep_day_content', + 'name' => 'Content' + ), + ), + ), + ) + ), + + ), + ); + $events_dd_meta_args = array( + 'meta_box_id' => 'mep_event_dd_meta_boxes', + 'meta_box_title' => '  '.__('Daywise Details', 'mage-eventpress'), + 'screen' => array('mep_events'), + 'context' => 'normal', + 'priority' => 'high', + 'callback_args' => array(), + 'nav_position' => 'none', + 'item_name' => "MagePeople", + 'item_version' => "2.0", + 'panels' => array( + 'events_dd_meta_boxs' => $events_dd_boxs + ) + ); + new AddMetaBox($events_dd_meta_args); + + + + @@ -201,7 +312,6 @@ function mep_fw_meta_boxs() 'speakers_meta_boxs' => $email_body_meta_boxs ), ); - new AddMetaBox( $email_body_meta_args ); diff --git a/inc/mep_event_meta.php b/inc/mep_event_meta.php index 1e37452..833d431 100644 --- a/inc/mep_event_meta.php +++ b/inc/mep_event_meta.php @@ -1,1305 +1,987 @@ '.$event_label.' Information : ', 'mage-eventpress' ) . get_the_title( get_the_id() ), array( $this, 'mp_event_all_in_tab' ), 'mep_events', 'normal', 'high' ); - - add_meta_box( 'mep-event-template', __( 'Template', 'mage-eventpress' ), array( $this, 'mep_event_template_meta_box_cb' ), 'mep_events', 'side', 'low' ); + add_meta_box('mp_event_all_info_in_tab', __('' . $event_label . ' Information : ', 'mage-eventpress') . get_the_title(get_the_id()), array($this, 'mp_event_all_in_tab'), 'mep_events', 'normal', 'high'); + add_meta_box('mep-event-template', __('Template', 'mage-eventpress'), array($this, 'mep_event_template_meta_box_cb'), 'mep_events', 'side', 'low'); } - public function mp_event_all_in_tab() { - $event_label = mep_get_option('mep_event_label', 'general_setting_sec', 'Events'); + public function mp_event_all_in_tab() + { + $event_label = mep_get_option('mep_event_label', 'general_setting_sec', 'Events'); $post_id = get_the_id(); - ?> -
-
-
    - -
  • -    +?> +
    +
    +
      + +
    • +   
    • - -
    • -    + +
    • +   
    • - -
    • -    + +
    • +   
    • - -
    • -    + + +
    • +   
    • - -
    • -    -
    • - -
    • -    -
    • - - -
    • -    -
    • + + +
    • +    +
    • - -
    • -    + +
    • +   
    • - - + + + +
    • +    +
    • -
    • -    -
    • - - -
    -
    -
    - -
    -

    -
    - mp_event_venue( $post_id ); ?> + +
+
+
+ +
+

+
+ mp_event_venue($post_id); ?>
- -
-

-
- mep_event_ticket_type( $post_id ); ?> + +
+

+
+ mep_event_ticket_type($post_id); ?> +

+
+ mep_event_extra_price_option($post_id); ?> +
+ +
+

+
+ mep_event_date_meta_box_cb($post_id); ?> + +
+ -

-
- mep_event_extra_price_option( $post_id ); ?> +
+

+
+ mp_event_rich_text($post_id); ?>
- -
-

-
- mep_event_date_meta_box_cb( $post_id ); ?> - + +
+

+
+ mp_event_settings($post_id); ?>
- -
-

-
- mep_event_faq_meta_box_cb( $post_id ); ?> -
- -
-

-
- mep_event_day_details_cb( $post_id ); ?> -
- -
-

-
- mp_event_rich_text( $post_id ); ?> -
- -
-

-
- mp_event_settings( $post_id ); ?> -
- - -
- -

-
- mp_event_tax( $post_id ); ?> -
+ + +
+ +

+
+ mp_event_tax($post_id); ?> +
- + -
- -
- - -
-
- + +
+ +
+ + - - - - - -
- -

- -

-
+ $values = get_post_custom($post_id); + $user_api = mep_get_option('google-map-api', 'general_setting_sec', ''); + $map_type = mep_get_option('mep_google_map_type', 'general_setting_sec', 'iframe'); + $mep_org_address = array_key_exists('mep_org_address', $values) ? $values['mep_org_address'][0] : 0; + $map_visible = array_key_exists('mep_sgm', $values) ? $values['mep_sgm'][0] : 0; + ?> + + + + + +
+ +

+ +

+
+
+ + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+ + + +
+
-
- - - - - - - - - - - - - - - - - - - -
- - - -
- - - -
- - - -
-
- -
-
- +
+
+ -
- -
+ if ($map_type == 'iframe') { + ?> +
+ +
- -
- '/> -
+
+ ' /> +
- - + + +
+ + No Google MAP API Key Found. Please enter API KEY Here"; + } -
+ if (array_key_exists('latitude', $values) && !empty($values['latitude'][0])) { + $lat = $values['latitude'][0]; + } else { + $lat = '37.0902'; + } + + if (array_key_exists('longitude', $values) && !empty($values['longitude'][0])) { + $lon = $values['longitude'][0]; + } else { + $lon = '95.7129'; + } + ?> + No Google MAP API Key Found. Please enter API KEY Here"; - } - - - if ( array_key_exists( 'latitude', $values ) && ! empty( $values['latitude'][0] ) ) { - $lat = $values['latitude'][0]; - } else { - $lat = '37.0902'; - } - - - if ( array_key_exists( 'longitude', $values ) && ! empty( $values['longitude'][0] ) ) { - $lon = $values['longitude'][0]; - } else { - $lon = '95.7129'; } ?> - - +
+ - ') + } + }) + + - - - - - - - - ' . esc_html__( "Reserve Qty", "mage-eventpress" ) . ''; - apply_filters( 'mep_add_extra_column', $rsvqty ); ?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ' ?> - - - - - -
- - -
- -
-
-
- - -
-

- -

- -

Extra Service as Product that you can sell and it is not included on event package

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- - - - - -
-

- - - - -

- -
- - - - - - - - - - - - - - - - + public function mep_event_ticket_type($post_id) + { + $mep_event_ticket_type = get_post_meta($post_id, 'mep_event_ticket_type', true); + wp_nonce_field('mep_event_ticket_type_nonce', 'mep_event_ticket_type_nonce'); + ?> +
- - - - - - - - -
+ + + + + + + ' . esc_html__("Reserve Qty", "mage-eventpress") . ''; + apply_filters('mep_add_extra_column', $rsvqty); ?> + + + + + - - - - - - + - - - - - + + + + + + + + + + + + + - - - - - - - - -
- - - - - - + if ($mep_event_ticket_type) : + $count = 0; + foreach ($mep_event_ticket_type as $field) { + $qty_t_type = esc_attr($field['option_qty_t_type']); + $count++; + ?> +
-
- -
-
-
+ + +
+ +
+
+
- - - - - - - - - -
- - -
- - + + + + + + ' ?> + + + + + + + + + +

+ +

+ - + + + + + + + + + + + + + if ($mep_events_extra_prices) : - - - - - - + + + + + + + + + + + + endif; + ?> - - - + + + - - - - - - - - -
-
- - - -
-
+ + +
+ +
+
+
-
- - + +
-

- - - -

- - + + + + + + +

+ +

+ - - - - - +
+
+ + + + + + + + + + + + + + + + - - - - - - - - - - -
+ + + + + + + + +
-
- - - -
-
-
- - - - - - -
- -
-

- - - -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + +
- -
- -
- -
- -

- -

+
+ + + + + + + + + +
+ +
+
+
+ + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - -
+ +
+ +
+ +
+ +

+ +

+ -
- + + + - + public function mp_event_settings($post_id) + { + $event_label = mep_get_option('mep_event_label', 'general_setting_sec', 'Events'); + ?> +
mp_event_reg_status( $post_id ); - $this->mp_event_available_seat_status( $post_id ); - $this->mp_event_reset_booking_count( $post_id ); - do_action('mp_event_switching_button_hook',$post_id); + $this->mp_event_reg_status($post_id); + $this->mp_event_available_seat_status($post_id); + $this->mp_event_reset_booking_count($post_id); + do_action('mp_event_switching_button_hook', $post_id); $this->mp_event_speaker_ticket_type($post_id); ?> -
- + - - - - + + + - - - - - - - + + + + + + + - - - - - - - - -

- -

- - - + + + + + + + + +

+ +

+ + + - - - - - - - - + + + + + + + + - - - - - - - - - -
- -
- -

- Settings->Tax Area', 'mage-eventpress' ); ?> -

-
- + + + + + + + + + +
+ +
+ +

+ Settings->Tax Area', 'mage-eventpress'); ?> +

+
+ ID ); - $global_template = mep_get_option( 'mep_global_single_template', 'general_setting_sec', 'theme-2' ); - if ( array_key_exists( 'mep_event_template', $values ) ) { + public function mep_event_template_meta_box_cb($post) + { + $values = get_post_custom($post->ID); + $global_template = mep_get_option('mep_global_single_template', 'general_setting_sec', 'theme-2'); + if (array_key_exists('mep_event_template', $values)) { $current_template = $values['mep_event_template'][0]; } else { $current_template = ''; } - if ( $current_template ) { + if ($current_template) { $_current_template = $current_template; } else { $_current_template = $global_template; } - ?> -
- -
- +
+ +
+prefix . 'event_extra_options'; - if ( ! isset( $_POST['mep_events_extra_price_nonce'] ) || - ! wp_verify_nonce( $_POST['mep_events_extra_price_nonce'], 'mep_events_extra_price_nonce' ) ) { + if ( + !isset($_POST['mep_events_extra_price_nonce']) || + !wp_verify_nonce($_POST['mep_events_extra_price_nonce'], 'mep_events_extra_price_nonce') + ) { return; } - if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) { + if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) { return; } - if ( ! current_user_can( 'edit_post', $post_id ) ) { + if (!current_user_can('edit_post', $post_id)) { return; } - if ( get_post_type( $post_id ) == 'mep_events' ) { + if (get_post_type($post_id) == 'mep_events') { - $old = get_post_meta( $post_id, 'mep_events_extra_prices', true ); + $old = get_post_meta($post_id, 'mep_events_extra_prices', true); $new = array(); - // $options = hhs_get_sample_options(); - $names = $_POST['option_name']; - // $selects = $_POST['select']; $urls = $_POST['option_price']; $qty = $_POST['option_qty']; $qty_type = $_POST['option_qty_type']; - // $required = $_POST['option_required']; - // $total_sold = $_POST['option_sold']; - $order_id = 0; - $count = count( $names ); + $count = count($names); - for ( $i = 0; $i < $count; $i ++ ) { + for ($i = 0; $i < $count; $i++) { - if ( $names[ $i ] != '' ) : - $new[ $i ]['option_name'] = stripslashes( strip_tags( $names[ $i ] ) ); + if ($names[$i] != '') : + $new[$i]['option_name'] = stripslashes(strip_tags($names[$i])); endif; - if ( $urls[ $i ] != '' ) : - $new[ $i ]['option_price'] = stripslashes( strip_tags( $urls[ $i ] ) ); + if ($urls[$i] != '') : + $new[$i]['option_price'] = stripslashes(strip_tags($urls[$i])); endif; - if ( $qty[ $i ] != '' ) : - $new[ $i ]['option_qty'] = stripslashes( strip_tags( $qty[ $i ] ) ); + if ($qty[$i] != '') : + $new[$i]['option_qty'] = stripslashes(strip_tags($qty[$i])); endif; - if ( $qty_type[ $i ] != '' ) : - $new[ $i ]['option_qty_type'] = stripslashes( strip_tags( $qty_type[ $i ] ) ); + if ($qty_type[$i] != '') : + $new[$i]['option_qty_type'] = stripslashes(strip_tags($qty_type[$i])); endif; - - // if ( $required[$i] != '' ) : - // $new[$i]['option_required'] = stripslashes( strip_tags( $required[$i] ) ); - // endif; - - - $opt_name = $post_id . str_replace( ' ', '', $names[ $i ] ); - - // update_post_meta( $post_id, "mep_xtra_$opt_name",0 ); - } - if ( ! empty( $new ) && $new != $old ) { - update_post_meta( $post_id, 'mep_events_extra_prices', $new ); - } elseif ( empty( $new ) && $old ) { - delete_post_meta( $post_id, 'mep_events_extra_prices', $old ); + if (!empty($new) && $new != $old) { + update_post_meta($post_id, 'mep_events_extra_prices', $new); + } elseif (empty($new) && $old) { + delete_post_meta($post_id, 'mep_events_extra_prices', $old); } } - } + + /** * Now Saving the Event Meta Field Data */ -add_action( 'save_post', 'mep_event_meta_save' ); -function mep_event_meta_save( $post_id ) { +add_action('save_post', 'mep_event_meta_save'); +function mep_event_meta_save($post_id) +{ - if ( ! isset( $_POST['mep_event_ricn_text_nonce'] ) || ! wp_verify_nonce( $_POST['mep_event_ricn_text_nonce'], 'mep_event_ricn_text_nonce' ) ) { + if (!isset($_POST['mep_event_ricn_text_nonce']) || !wp_verify_nonce($_POST['mep_event_ricn_text_nonce'], 'mep_event_ricn_text_nonce')) { return; } - if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) { + if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) { return; } - if ( ! current_user_can( 'edit_post', $post_id ) ) { + if (!current_user_can('edit_post', $post_id)) { return; } @@ -1457,25 +1117,24 @@ function mep_event_meta_save( $post_id ) { /** * If the saving post is event then go on */ - if ( get_post_type( $post_id ) == 'mep_events' ) { - $pid = $post_id; + if (get_post_type($post_id) == 'mep_events') { - $oldm = get_post_meta( $post_id, 'mep_event_more_date', true ); - - $more_start_date = isset( $_POST['event_more_start_date'] ) ? $_POST['event_more_start_date'] : array(); - $more_start_time = isset( $_POST['event_more_start_time'] ) ? $_POST['event_more_start_time'] : ''; - $more_end_date = isset( $_POST['event_more_end_date'] ) ? $_POST['event_more_end_date'] : ''; - $more_end_time = isset( $_POST['event_more_end_time'] ) ? $_POST['event_more_end_time'] : ''; + $pid = $post_id; + $oldm = get_post_meta($post_id, 'mep_event_more_date', true); + $more_start_date = isset($_POST['event_more_start_date']) ? $_POST['event_more_start_date'] : array(); + $more_start_time = isset($_POST['event_more_start_time']) ? $_POST['event_more_start_time'] : ''; + $more_end_date = isset($_POST['event_more_end_date']) ? $_POST['event_more_end_date'] : ''; + $more_end_time = isset($_POST['event_more_end_time']) ? $_POST['event_more_end_time'] : ''; $mdate = []; - $mcount = count( $more_start_date ); + $mcount = count($more_start_date); - for ( $m = 0; $m < $mcount; $m ++ ) { - if ( $more_start_date[ $m ] != '' ) : - $mdate[ $m ]['event_more_start_date'] = stripslashes( strip_tags( $more_start_date[ $m ] ) ); - $mdate[ $m ]['event_more_start_time'] = stripslashes( strip_tags( $more_start_time[ $m ] ) ); - $mdate[ $m ]['event_more_end_date'] = stripslashes( strip_tags( $more_end_date[ $m ] ) ); - $mdate[ $m ]['event_more_end_time'] = stripslashes( strip_tags( $more_end_time[ $m ] ) ); + for ($m = 0; $m < $mcount; $m++) { + if ($more_start_date[$m] != '') : + $mdate[$m]['event_more_start_date'] = stripslashes(strip_tags($more_start_date[$m])); + $mdate[$m]['event_more_start_time'] = stripslashes(strip_tags($more_start_time[$m])); + $mdate[$m]['event_more_end_date'] = stripslashes(strip_tags($more_end_date[$m])); + $mdate[$m]['event_more_end_time'] = stripslashes(strip_tags($more_end_time[$m])); endif; } @@ -1486,114 +1145,119 @@ function mep_event_meta_save( $post_id ) { $seat = 0; $rsvs = 0; - $mep_location_venue = isset( $_POST['mep_location_venue'] ) ? strip_tags( $_POST['mep_location_venue'] ) : ""; - $mep_street = isset( $_POST['mep_street'] ) ? strip_tags( $_POST['mep_street'] ) : ""; - $mep_city = isset( $_POST['mep_city'] ) ? strip_tags( $_POST['mep_city'] ) : ""; - $mep_state = isset( $_POST['mep_state'] ) ? strip_tags( $_POST['mep_state'] ) : ""; - $mep_postcode = isset( $_POST['mep_postcode'] ) ? strip_tags( $_POST['mep_postcode'] ) : ""; - $mep_country = isset( $_POST['mep_country'] ) ? strip_tags( $_POST['mep_country'] ) : ""; - // $mep_price_label = isset($_POST['mep_price_label']) ? strip_tags( $_POST['mep_price_label'] ) : ""; - // $mep_sqi = isset($_POST['mep_sqi']) ? strip_tags( $_POST['mep_sqi'] ) : ""; - // $qty_box_type = isset($_POST['qty_box_type']) ? strip_tags( $_POST['qty_box_type'] ) : ""; - $mep_sgm = isset( $_POST['mep_sgm'] ) ? strip_tags( $_POST['mep_sgm'] ) : ""; - $mep_org_address = isset( $_POST['mep_org_address'] ) ? strip_tags( $_POST['mep_org_address'] ) : ""; - $_price = isset( $_POST['_price'] ) ? strip_tags( $_POST['_price'] ) : ""; + $mep_location_venue = isset($_POST['mep_location_venue']) ? strip_tags($_POST['mep_location_venue']) : ""; + $mep_street = isset($_POST['mep_street']) ? strip_tags($_POST['mep_street']) : ""; + $mep_city = isset($_POST['mep_city']) ? strip_tags($_POST['mep_city']) : ""; + $mep_state = isset($_POST['mep_state']) ? strip_tags($_POST['mep_state']) : ""; + $mep_postcode = isset($_POST['mep_postcode']) ? strip_tags($_POST['mep_postcode']) : ""; + $mep_country = isset($_POST['mep_country']) ? strip_tags($_POST['mep_country']) : ""; - $event_start_date = strip_tags( $_POST['event_start_date'] ); - $event_start_time = strip_tags( $_POST['event_start_time'] ); - $event_end_date = strip_tags( $_POST['event_end_date'] ); - $event_end_time = strip_tags( $_POST['event_end_time'] ); - // $mep_event_end_date = strip_tags($_POST['mep_event_end_date']); - // $mep_event_cc_email_text = $_POST['mep_event_cc_email_text']; + $mep_sgm = isset($_POST['mep_sgm']) ? strip_tags($_POST['mep_sgm']) : ""; + $mep_org_address = isset($_POST['mep_org_address']) ? strip_tags($_POST['mep_org_address']) : ""; + $_price = isset($_POST['_price']) ? strip_tags($_POST['_price']) : ""; + + $event_start_date = strip_tags($_POST['event_start_date']); + $event_start_time = strip_tags($_POST['event_start_time']); + $event_end_date = strip_tags($_POST['event_end_date']); + $event_end_time = strip_tags($_POST['event_end_time']); + + $latitude = isset($_POST['latitude']) ? strip_tags($_POST['latitude']) : ""; + $longitude = isset($_POST['latitude']) ? strip_tags($_POST['longitude']) : ""; + $location_name = isset($_POST['location_name']) ? strip_tags($_POST['location_name']) : ""; + + $mep_full_name = isset($_POST['mep_full_name']) ? strip_tags($_POST['mep_full_name']) : ""; + $mep_reg_email = isset($_POST['mep_reg_email']) ? strip_tags($_POST['mep_reg_email']) : ""; + $mep_reg_phone = isset($_POST['mep_reg_phone']) ? strip_tags($_POST['mep_reg_phone']) : ""; + $mep_reg_address = isset($_POST['mep_reg_address']) ? strip_tags($_POST['mep_reg_address']) : ""; + $mep_reg_designation = isset($_POST['mep_reg_designation']) ? strip_tags($_POST['mep_reg_designation']) : ""; + $mep_reg_website = isset($_POST['mep_reg_website']) ? strip_tags($_POST['mep_reg_website']) : ""; + $mep_reg_veg = isset($_POST['mep_reg_veg']) ? strip_tags($_POST['mep_reg_veg']) : ""; + $mep_reg_company = isset($_POST['mep_reg_company']) ? strip_tags($_POST['mep_reg_company']) : ""; + $mep_reg_gender = isset($_POST['mep_reg_gender']) ? strip_tags($_POST['mep_reg_gender']) : ""; + $mep_reg_tshirtsize = isset($_POST['mep_reg_tshirtsize']) ? strip_tags($_POST['mep_reg_tshirtsize']) : ""; + $mep_reg_tshirtsize_list = isset($_POST['mep_reg_tshirtsize_list']) ? strip_tags($_POST['mep_reg_tshirtsize_list']) : ""; + $mep_event_template = isset($_POST['mep_event_template']) ? strip_tags($_POST['mep_event_template']) : ""; - $latitude = isset( $_POST['latitude'] ) ? strip_tags( $_POST['latitude'] ) : ""; - $longitude = isset( $_POST['latitude'] ) ? strip_tags( $_POST['longitude'] ) : ""; - $location_name = isset( $_POST['location_name'] ) ? strip_tags( $_POST['location_name'] ) : ""; - - $mep_full_name = isset( $_POST['mep_full_name'] ) ? strip_tags( $_POST['mep_full_name'] ) : ""; - $mep_reg_email = isset( $_POST['mep_reg_email'] ) ? strip_tags( $_POST['mep_reg_email'] ) : ""; - $mep_reg_phone = isset( $_POST['mep_reg_phone'] ) ? strip_tags( $_POST['mep_reg_phone'] ) : ""; - $mep_reg_address = isset( $_POST['mep_reg_address'] ) ? strip_tags( $_POST['mep_reg_address'] ) : ""; - $mep_reg_designation = isset( $_POST['mep_reg_designation'] ) ? strip_tags( $_POST['mep_reg_designation'] ) : ""; - $mep_reg_website = isset( $_POST['mep_reg_website'] ) ? strip_tags( $_POST['mep_reg_website'] ) : ""; - $mep_reg_veg = isset( $_POST['mep_reg_veg'] ) ? strip_tags( $_POST['mep_reg_veg'] ) : ""; - $mep_reg_company = isset( $_POST['mep_reg_company'] ) ? strip_tags( $_POST['mep_reg_company'] ) : ""; - $mep_reg_gender = isset( $_POST['mep_reg_gender'] ) ? strip_tags( $_POST['mep_reg_gender'] ) : ""; - $mep_reg_tshirtsize = isset( $_POST['mep_reg_tshirtsize'] ) ? strip_tags( $_POST['mep_reg_tshirtsize'] ) : ""; - $mep_reg_tshirtsize_list = isset( $_POST['mep_reg_tshirtsize_list'] ) ? strip_tags( $_POST['mep_reg_tshirtsize_list'] ) : ""; - $mep_event_template = isset( $_POST['mep_event_template'] ) ? strip_tags( $_POST['mep_event_template'] ) : ""; + $event_start_datetime = date('Y-m-d H:i:s', strtotime($event_start_date . ' ' . $event_start_time)); + $event_end_datetime = date('Y-m-d H:i:s', strtotime($event_end_date . ' ' . $event_end_time)); + $md = sizeof($mdate) > 0 ? end($mdate) : array(); + $event_expire_datetime = sizeof($md) > 0 ? date('Y-m-d H:i:s', strtotime($md['event_more_end_date'] . ' ' . $md['event_more_end_time'])) : $event_end_datetime; - $event_start_datetime = date( 'Y-m-d H:i:s', strtotime( $event_start_date . ' ' . $event_start_time ) ); - $event_end_datetime = date( 'Y-m-d H:i:s', strtotime( $event_end_date . ' ' . $event_end_time ) ); - $md = sizeof( $mdate ) > 0 ? end( $mdate ) : array(); - $event_expire_datetime = sizeof( $md ) > 0 ? date( 'Y-m-d H:i:s', strtotime( $md['event_more_end_date'] . ' ' . $md['event_more_end_time'] ) ) : $event_end_datetime; + + $mep_reg_status = isset($_POST['mep_reg_status']) ? strip_tags($_POST['mep_reg_status']) : 'off'; + $mep_reset_status = isset($_POST['mep_reset_status']) ? strip_tags($_POST['mep_reset_status']) : 'off'; + $mep_available_seat = isset($_POST['mep_available_seat']) ? strip_tags($_POST['mep_available_seat']) : 'off'; + $_tax_status = isset($_POST['_tax_status']) ? strip_tags($_POST['_tax_status']) : 'none'; + $_tax_class = isset($_POST['_tax_class']) ? strip_tags($_POST['_tax_class']) : ''; + + if ($mep_reset_status == 'on') { + mep_reset_event_booking($post_id); + } + + update_post_meta($post_id, 'mep_available_seat', $mep_available_seat); + update_post_meta($post_id, 'mep_reg_status', $mep_reg_status); + update_post_meta($post_id, '_tax_status', $_tax_status); + update_post_meta($post_id, '_tax_class', $_tax_class); - update_post_meta( $post_id, 'mep_rt_event_status', $event_rt_status ); - update_post_meta( $post_id, 'mep_rt_event_attandence_mode', $event_rt_atdnce_mode ); - update_post_meta( $post_id, 'mep_rt_event_prvdate', $event_rt_prv_date ); + update_post_meta($post_id, 'mep_rt_event_status', $event_rt_status); + update_post_meta($post_id, 'mep_rt_event_attandence_mode', $event_rt_atdnce_mode); + update_post_meta($post_id, 'mep_rt_event_prvdate', $event_rt_prv_date); - update_post_meta( $pid, 'mep_full_name', $mep_full_name ); - update_post_meta( $pid, 'mep_reg_email', $mep_reg_email ); - update_post_meta( $pid, 'mep_reg_phone', $mep_reg_phone ); - update_post_meta( $pid, 'mep_reg_address', $mep_reg_address ); - update_post_meta( $pid, 'mep_reg_designation', $mep_reg_designation ); - update_post_meta( $pid, 'mep_reg_website', $mep_reg_website ); - update_post_meta( $pid, 'mep_reg_veg', $mep_reg_veg ); - update_post_meta( $pid, 'mep_reg_company', $mep_reg_company ); - update_post_meta( $pid, 'mep_reg_gender', $mep_reg_gender ); - update_post_meta( $pid, 'mep_reg_tshirtsize', $mep_reg_tshirtsize ); - update_post_meta( $pid, 'mep_reg_tshirtsize_list', $mep_reg_tshirtsize_list ); - update_post_meta( $pid, 'mep_event_template', $mep_event_template ); - update_post_meta( $pid, 'mep_org_address', $mep_org_address ); + update_post_meta($pid, 'mep_full_name', $mep_full_name); + update_post_meta($pid, 'mep_reg_email', $mep_reg_email); + update_post_meta($pid, 'mep_reg_phone', $mep_reg_phone); + update_post_meta($pid, 'mep_reg_address', $mep_reg_address); + update_post_meta($pid, 'mep_reg_designation', $mep_reg_designation); + update_post_meta($pid, 'mep_reg_website', $mep_reg_website); + update_post_meta($pid, 'mep_reg_veg', $mep_reg_veg); + update_post_meta($pid, 'mep_reg_company', $mep_reg_company); + update_post_meta($pid, 'mep_reg_gender', $mep_reg_gender); + update_post_meta($pid, 'mep_reg_tshirtsize', $mep_reg_tshirtsize); + update_post_meta($pid, 'mep_reg_tshirtsize_list', $mep_reg_tshirtsize_list); + update_post_meta($pid, 'mep_event_template', $mep_event_template); + update_post_meta($pid, 'mep_org_address', $mep_org_address); - update_post_meta( $pid, 'event_start_date', $event_start_date ); - update_post_meta( $pid, 'event_start_time', $event_start_time ); - update_post_meta( $pid, 'event_end_date', $event_end_date ); - update_post_meta( $pid, 'event_end_time', $event_end_time ); - update_post_meta( $post_id, 'event_start_datetime', $event_start_datetime ); - update_post_meta( $post_id, 'event_end_datetime', $event_end_datetime ); - update_post_meta( $post_id, 'event_expire_datetime', $event_expire_datetime ); - //update_post_meta( $pid, '_manage_stock', $st_msg ); - update_post_meta( $pid, '_stock', $seat ); - update_post_meta( $pid, '_stock_msg', 'new' ); - update_post_meta( $pid, 'longitude', $longitude ); - update_post_meta( $pid, 'latitude', $latitude ); - update_post_meta( $pid, 'location_name', $location_name ); - update_post_meta( $pid, 'mep_location_venue', $mep_location_venue ); - update_post_meta( $pid, 'mep_street', $mep_street ); - update_post_meta( $pid, '_sold_individually', 'no' ); - update_post_meta( $pid, 'mep_city', $mep_city ); - update_post_meta( $pid, 'mep_state', $mep_state ); - update_post_meta( $pid, 'mep_postcode', $mep_postcode ); - update_post_meta( $pid, 'mep_country', $mep_country ); - // update_post_meta( $pid, 'mep_sqi', $mep_sqi); - // update_post_meta( $pid, 'qty_box_type', $qty_box_type); - update_post_meta( $pid, 'mep_sgm', $mep_sgm ); - // update_post_meta( $pid, 'mep_price_label', $mep_price_label); - update_post_meta( $pid, '_price', 0 ); - update_post_meta( $pid, '_virtual', 'yes' ); - // update_post_meta( $pid, 'mep_event_cc_email_text', $mep_event_cc_email_text); - update_post_meta( $pid, '_sku', $pid ); + update_post_meta($pid, 'event_start_date', $event_start_date); + update_post_meta($pid, 'event_start_time', $event_start_time); + update_post_meta($pid, 'event_end_date', $event_end_date); + update_post_meta($pid, 'event_end_time', $event_end_time); + update_post_meta($post_id, 'event_start_datetime', $event_start_datetime); + update_post_meta($post_id, 'event_end_datetime', $event_end_datetime); + update_post_meta($post_id, 'event_expire_datetime', $event_expire_datetime); + update_post_meta($pid, '_stock', $seat); + update_post_meta($pid, '_stock_msg', 'new'); + update_post_meta($pid, 'longitude', $longitude); + update_post_meta($pid, 'latitude', $latitude); + update_post_meta($pid, 'location_name', $location_name); + update_post_meta($pid, 'mep_location_venue', $mep_location_venue); + update_post_meta($pid, 'mep_street', $mep_street); + update_post_meta($pid, '_sold_individually', 'no'); + update_post_meta($pid, 'mep_city', $mep_city); + update_post_meta($pid, 'mep_state', $mep_state); + update_post_meta($pid, 'mep_postcode', $mep_postcode); + update_post_meta($pid, 'mep_country', $mep_country); + update_post_meta($pid, 'mep_sgm', $mep_sgm); + update_post_meta($pid, '_price', 0); + update_post_meta($pid, '_virtual', 'yes'); + update_post_meta($pid, '_sku', $pid); - if ( isset( $_POST['mep_event_type'] ) && strip_tags( $_POST['mep_event_type'] )) { + if (isset($_POST['mep_event_type']) && strip_tags($_POST['mep_event_type'])) { $mep_event_type = 'online'; } else { $mep_event_type = 'offline'; } - update_post_meta( $pid, 'mep_event_type', $mep_event_type ); - $mp_event_virtual_type_des = isset( $_POST['mp_event_virtual_type_des'] ) ? strip_tags( $_POST['mp_event_virtual_type_des'] ) : ""; - update_post_meta( $pid, 'mp_event_virtual_type_des', $mp_event_virtual_type_des ); + update_post_meta($pid, 'mep_event_type', $mep_event_type); + $mp_event_virtual_type_des = isset($_POST['mp_event_virtual_type_des']) ? strip_tags($_POST['mp_event_virtual_type_des']) : ""; + update_post_meta($pid, 'mp_event_virtual_type_des', $mp_event_virtual_type_des); - if ( ! empty( $mdate ) && $mdate != $oldm ) { - update_post_meta( $post_id, 'mep_event_more_date', $mdate ); - } elseif ( empty( $mdate ) && $oldm ) { - delete_post_meta( $post_id, 'mep_event_more_date', $oldm ); + if (!empty($mdate) && $mdate != $oldm) { + update_post_meta($post_id, 'mep_event_more_date', $mdate); + } elseif (empty($mdate) && $oldm) { + delete_post_meta($post_id, 'mep_event_more_date', $oldm); } } - - -} \ No newline at end of file +} diff --git a/js/mkb-admin.js b/js/mkb-admin.js index 1c89378..8c8addc 100644 --- a/js/mkb-admin.js +++ b/js/mkb-admin.js @@ -1,8 +1,10 @@ -jQuery(document).ready(function ($) { +(function ($) { "use strict"; // Tabs $(window).load(function () { - $('.mp_event_all_meta_in_tab .mp_tab_menu li:first-child[data-target-tabs]').trigger('click'); + $('.mp_tab_menu').each(function () { + $(this).find('ul li:first-child').trigger('click'); + }); if ($('[name="mep_org_address"]').val() > 0) { $('.mp_event_address').slideUp(250); } @@ -11,10 +13,10 @@ jQuery(document).ready(function ($) { $(document).on('click', '[data-target-tabs]', function () { if (!$(this).hasClass('active')) { let tabsTarget = $(this).attr('data-target-tabs'); - let targetParent = $(this).parents('.mp_event_all_meta_in_tab'); - targetParent.find('.mp_tab_item.active').removeClass('active').slideUp('fast'); - targetParent.find('.mp_tab_item[data-tab-item="' + tabsTarget + '"]').addClass('active').slideDown(250); - targetParent.find('li.active').removeClass('active'); + let targetParent = $(this).closest('.mp_event_tab_area').find('.mp_tab_details').first(); + targetParent.children('.mp_tab_item:visible').slideUp('fast'); + targetParent.children('.mp_tab_item[data-tab-item="' + tabsTarget + '"]').slideDown(250); + $(this).siblings('li.active').removeClass('active'); $(this).addClass('active'); } return false; @@ -36,7 +38,7 @@ jQuery(document).ready(function ($) { row.removeClass('empty-row-t screen-reader-text'); row.insertBefore('#repeatable-fieldset-one-t tbody>tr:last'); $('#mep_ticket_type_empty option[value=inputbox]').attr('selected', 'selected'); - jQuery('.empty-row-t #mep_ticket_type_empty option[value=inputbox]').removeAttr('selected'); + $('.empty-row-t #mep_ticket_type_empty option[value=inputbox]').removeAttr('selected'); return false; }); @@ -84,4 +86,4 @@ jQuery(document).ready(function ($) { } }); -}); \ No newline at end of file +}(jQuery)); \ No newline at end of file