2018-02-05 02:05:26 -05:00
< ? php
2020-12-14 07:10:30 -05:00
if ( ! defined ( 'ABSPATH' )) {
2020-12-13 07:25:42 -05:00
die ;
} // Cannot access pages directly.
2020-12-14 07:10:30 -05:00
class MP_Event_All_Info_In_One
{
public function __construct ()
{
add_action ( 'add_meta_boxes' , array ( $this , 'mp_event_all_info_in_tab' ));
2020-12-13 07:25:42 -05:00
}
2020-12-14 07:10:30 -05:00
public function mp_event_all_info_in_tab ()
{
2020-12-13 07:25:42 -05:00
$event_label = mep_get_option ( 'mep_event_label' , 'general_setting_sec' , 'Events' );
2022-04-05 03:42:16 -04:00
add_meta_box ( 'mp_event_all_info_in_tab' , __ ( '<i class="fas fa-info-circle"></i> ' . $event_label . ' Information : ' , 'mage-eventpress' ) . get_the_title ( get_the_id ()), array ( $this , 'mp_event_all_in_tab' ), 'mep_events' , 'normal' , 'high' );
2020-12-14 07:10:30 -05:00
add_meta_box ( 'mep-event-template' , __ ( 'Template' , 'mage-eventpress' ), array ( $this , 'mep_event_template_meta_box_cb' ), 'mep_events' , 'side' , 'low' );
2020-12-13 07:25:42 -05:00
}
2020-12-14 07:10:30 -05:00
public function mp_event_all_in_tab ()
{
$event_label = mep_get_option ( 'mep_event_label' , 'general_setting_sec' , 'Events' );
2021-01-26 01:04:24 -05:00
$post_id = get_the_id ();
2020-12-14 07:10:30 -05:00
?>
< div class = " mp_event_all_meta_in_tab mp_event_tab_area " >
< div class = " mp_tab_menu " >
< ul >
< ? php do_action ( 'mep_admin_event_details_before_tab_name_location' , $post_id ); ?>
< li data - target - tabs = " #mp_event_venue " >
2022-04-05 03:42:16 -04:00
< i class = " fas fa-map-marked " ></ i >< ? php esc_html_e ( 'Venue/Location' , 'mage-eventpress' ); ?>
2020-12-13 07:25:42 -05:00
</ li >
2020-12-14 07:10:30 -05:00
< ? php do_action ( 'mep_admin_event_details_after_tab_name_location' , $post_id ); ?>
< li data - target - tabs = " #mp_ticket_type_pricing " >
2022-04-05 03:42:16 -04:00
< i class = " fas fa-dollar-sign " ></ i >< ? php esc_html_e ( 'Ticket & Pricing' , 'mage-eventpress' ); ?>
2020-12-13 07:25:42 -05:00
</ li >
2020-12-14 07:10:30 -05:00
< ? php do_action ( 'mep_admin_event_details_before_tab_name_ticket_type' , $post_id ); ?>
< li data - target - tabs = " #mp_event_time " >
2022-04-05 03:42:16 -04:00
< i class = " far fa-calendar-alt " ></ i >< ? php esc_html_e ( 'Date & Time' , 'mage-eventpress' ); ?>
2020-12-13 07:25:42 -05:00
</ li >
2020-12-14 07:10:30 -05:00
< ? php do_action ( 'mep_admin_event_details_before_tab_name_date_time' , $post_id ); ?>
< li data - target - tabs = " #mp_event_settings " >
2022-04-05 03:42:16 -04:00
< i class = " fas fa-users-cog " ></ i >< ? php esc_html_e ( 'Settings' , 'mage-eventpress' ); ?>
2020-12-13 07:25:42 -05:00
</ li >
2020-12-14 07:10:30 -05:00
< ? php do_action ( 'mep_admin_event_details_before_tab_name_settings' , $post_id ); ?>
< ? php if ( get_option ( 'woocommerce_calc_taxes' ) == 'yes' ) { ?>
< li data - target - tabs = " #mp_event_tax_settings " >
2021-10-31 07:01:04 -04:00
< span class = " dashicons dashicons-admin-settings " ></ span >& nbsp ; & nbsp ; < ? php esc_html_e ( 'Tax' , 'mage-eventpress' ); ?>
2020-12-14 07:10:30 -05:00
</ li >
2020-12-13 07:25:42 -05:00
< ? php } ?>
2020-12-14 07:10:30 -05:00
< ? php do_action ( 'mep_admin_event_details_before_tab_name_tax' , $post_id ); ?>
< li data - target - tabs = " #mp_event_rich_text " >
2022-04-05 03:42:16 -04:00
< i class = " far fa-newspaper " ></ i >< ? php esc_html_e ( 'Rich text' , 'mage-eventpress' ); ?>
2020-12-13 07:25:42 -05:00
</ li >
2020-12-14 07:10:30 -05:00
< ? php do_action ( 'mep_admin_event_details_before_tab_name_rich_text' , $post_id ); ?>
< ? php do_action ( 'mp_event_all_in_tab_menu' ); ?>
2021-10-29 02:57:05 -04:00
2020-12-14 07:10:30 -05:00
< ? php do_action ( 'mep_admin_event_details_end_of_tab_name' , $post_id ); ?>
</ ul >
</ div >
< div class = " mp_tab_details " >
< ? php do_action ( 'mep_admin_event_details_before_tab_details_location' , $post_id ); ?>
< div class = " mp_tab_item active " data - tab - item = " #mp_event_venue " >
2022-08-23 02:57:23 -04:00
< ? php do_action ( 'mep_event_tab_before_location' , $post_id ); ?>
< div class = 'mep_event_tab_location_content' >
< h3 >< ? php echo esc_html ( $event_label ); esc_html_e ( ' Location :' , 'mage-eventpress' ); ?> </h3>
2020-12-14 07:10:30 -05:00
< hr />
< ? php $this -> mp_event_venue ( $post_id ); ?>
2022-08-23 02:57:23 -04:00
</ div >
2022-08-04 00:45:25 -04:00
< ? php do_action ( 'mep_event_tab_after_location' ); ?>
2020-12-13 07:25:42 -05:00
</ div >
2020-12-14 07:10:30 -05:00
< ? php do_action ( 'mep_admin_event_details_after_tab_details_location' , $post_id ); ?>
< div class = " mp_tab_item " data - tab - item = " #mp_ticket_type_pricing " >
2022-08-23 02:57:23 -04:00
< ? php do_action ( 'mep_event_tab_before_ticket_pricing' , $post_id ); ?>
< div class = 'mep_ticket_type_setting_sec' >
2021-10-31 07:01:04 -04:00
< h3 >< ? php esc_html_e ( 'Ticket Type List :' , 'mage-eventpress' ); ?> </h3>
2020-12-14 07:10:30 -05:00
< hr />
< ? php $this -> mep_event_ticket_type ( $post_id ); ?>
2021-10-31 07:01:04 -04:00
< h3 >< ? php esc_html_e ( 'Extra service Area :' , 'mage-eventpress' ); ?> </h3>
2020-12-14 07:10:30 -05:00
< hr />
< ? php $this -> mep_event_extra_price_option ( $post_id ); ?>
2022-08-23 02:57:23 -04:00
</ div >
2022-08-04 00:45:25 -04:00
< ? php do_action ( 'mep_event_tab_after_ticket_pricing' ); ?>
2020-12-13 07:25:42 -05:00
</ div >
2020-12-14 07:10:30 -05:00
< ? php do_action ( 'mep_admin_event_details_after_tab_details_ticket_type' , $post_id ); ?>
< div class = " mp_tab_item " data - tab - item = " #mp_event_time " >
2021-10-31 07:01:04 -04:00
< h3 >< ? php echo esc_html ( $event_label );
esc_html_e ( ' Date & TIme :' , 'mage-eventpress' ); ?> </h3>
2020-12-14 07:10:30 -05:00
< hr />
< ? php $this -> mep_event_date_meta_box_cb ( $post_id ); ?>
< ? php do_action ( 'mp_event_recurring_every_day_setting' , $post_id ); ?>
2020-12-13 07:25:42 -05:00
</ div >
2020-12-14 07:10:30 -05:00
< ? php do_action ( 'mep_admin_event_details_after_tab_details_date_time' , $post_id ); ?>
< div class = " mp_tab_item " data - tab - item = " #mp_event_rich_text " >
2021-10-31 07:01:04 -04:00
< h3 >< ? php echo esc_html ( $event_label );
esc_html_e ( ' Rich Texts for SEO & Google Schema Text :' , 'mage-eventpress' ); ?> </h3>
2020-12-14 07:10:30 -05:00
< hr />
< ? php $this -> mp_event_rich_text ( $post_id ); ?>
2022-08-04 00:45:25 -04:00
< ? php do_action ( 'mep_event_tab_after_rich_text' ); ?>
2020-12-13 07:25:42 -05:00
</ div >
2020-12-14 07:10:30 -05:00
< ? php do_action ( 'mep_admin_event_details_after_tab_details_rich_text' , $post_id ); ?>
< div class = " mp_tab_item " data - tab - item = " #mp_event_settings " >
2021-10-31 07:01:04 -04:00
< h3 >< ? php echo esc_html ( $event_label );
esc_html_e ( ' Settings :' , 'mage-eventpress' ); ?> </h3>
2020-12-14 07:10:30 -05:00
< hr />
< ? php $this -> mp_event_settings ( $post_id ); ?>
2022-08-04 00:45:25 -04:00
< ? php do_action ( 'mep_event_tab_after_settings' ); ?>
2020-12-13 07:25:42 -05:00
</ div >
2020-12-14 07:10:30 -05:00
< ? php do_action ( 'mep_admin_event_details_after_tab_details_settings' , $post_id ); ?>
< ? php if ( get_option ( 'woocommerce_calc_taxes' ) == 'yes' ) { ?>
< div class = " mp_tab_item " data - tab - item = " #mp_event_tax_settings " >
2021-10-31 07:01:04 -04:00
< h3 >< ? php echo esc_html ( $event_label );
esc_html_e ( ' Tax Settings :' , 'mage-eventpress' ); ?> </h3>
2020-12-14 07:10:30 -05:00
< hr />
< ? php $this -> mp_event_tax ( $post_id ); ?>
2022-08-04 00:45:25 -04:00
< ? php do_action ( 'mep_event_tab_after_tax_settings' ); ?>
2020-12-14 07:10:30 -05:00
</ div >
2020-12-13 07:25:42 -05:00
< ? php } ?>
2020-12-14 07:10:30 -05:00
< ? php do_action ( 'mp_event_all_in_tab_item' , $post_id ); ?>
2020-12-13 07:25:42 -05:00
< ? php
2020-12-14 07:10:30 -05:00
do_action ( 'mep_admin_event_details_end_of_tab_details' , $post_id ); ?>
</ div >
</ div >
2021-01-03 23:55:45 -05:00
< script type = " text/javascript " >
jQuery ( function ( $ ) {
2021-10-29 02:57:05 -04:00
$ ( " #mp_event_all_info_in_tab " ) . parent () . removeClass ( 'meta-box-sortables' );
2021-01-03 23:55:45 -05:00
});
</ script >
2021-10-29 02:57:05 -04:00
< ? php
2020-12-13 07:25:42 -05:00
}
2021-10-29 02:57:05 -04:00
public function is_gutenberg_active ()
{
2021-02-09 00:57:05 -05:00
$gutenberg = false ;
$block_editor = false ;
2021-10-29 02:57:05 -04:00
if ( has_filter ( 'replace_editor' , 'gutenberg_init' )) {
2021-02-09 00:57:05 -05:00
// Gutenberg is installed and activated.
$gutenberg = true ;
}
2021-10-29 02:57:05 -04:00
if ( version_compare ( $GLOBALS [ 'wp_version' ], '5.0-beta' , '>' )) {
2021-02-09 00:57:05 -05:00
// Block editor.
$block_editor = true ;
}
2021-10-29 02:57:05 -04:00
if ( ! $gutenberg && ! $block_editor ) {
2021-02-09 00:57:05 -05:00
return false ;
}
include_once ABSPATH . 'wp-admin/includes/plugin.php' ;
2021-10-29 02:57:05 -04:00
if ( ! is_plugin_active ( 'classic-editor/classic-editor.php' )) {
2021-02-09 00:57:05 -05:00
return true ;
}
2021-10-29 02:57:05 -04:00
$use_block_editor = ( get_option ( 'classic-editor-replace' ) === 'no-replace' );
2021-02-09 00:57:05 -05:00
return $use_block_editor ;
}
2020-12-14 07:10:30 -05:00
public function mp_event_venue ( $post_id )
{
2021-01-26 01:04:24 -05:00
$event_label = mep_get_option ( 'mep_event_label' , 'general_setting_sec' , 'Events' );
2020-12-14 07:10:30 -05:00
$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 ;
2021-10-29 02:57:05 -04:00
$author_id = get_post_field ( 'post_author' , $post_id );
2021-02-09 00:57:05 -05:00
2021-10-29 02:57:05 -04:00
if ( $this -> is_gutenberg_active ()) { ?>
2021-10-31 07:01:04 -04:00
< input type = " hidden " name = " post_author_gutenberg " value = " <?php echo esc_attr( $author_id ); ?> " >
2021-02-09 00:57:05 -05:00
< ? php }
2021-10-29 02:57:05 -04:00
?>
< div class = " mp_ticket_type_table " >
< table >
< tr >
2021-10-31 07:01:04 -04:00
< th style = " min-width: 160px; " >< ? php esc_html_e ( " Location Source: " , " mage-eventpress " ); ?> </th>
2021-10-29 02:57:05 -04:00
< td colspan = " 3 " style = " min-width: 450px; " >
2022-08-23 02:57:23 -04:00
< label for = 'mep_org_address_list' >
< select class = " mp_formControl " name = " mep_org_address " class = 'mep_org_address_list' id = 'mep_org_address_list' >
2021-10-31 07:01:04 -04:00
< option value = " 0 " < ? php echo ( $mep_org_address == 0 ) ? esc_attr ( 'selected' ) : '' ; ?> ><?php echo esc_html($event_label);
2021-10-29 02:57:05 -04:00
_e ( ' Details' , 'mage-eventpress' ); ?> </option>
2021-10-31 07:01:04 -04:00
< option value = " 1 " < ? php echo ( $mep_org_address == 1 ) ? esc_attr ( 'selected' ) : '' ; ?> ><?php esc_html_e('Organizer', 'mage-eventpress'); ?></option>
2021-10-29 02:57:05 -04:00
</ select >
</ label >
< p class = " event_meta_help_txt " >
2022-04-05 03:42:16 -04:00
< ? php esc_html_e ( 'Select Organizer if you have already saved the organizer details. Please remember that if you select organizer and have not checked the organizer from the Event Organizer list from the right sidebar, the Event Location section of the front end will be blank.' , 'mage-eventpress' ); ?>
2021-10-29 02:57:05 -04:00
</ p >
</ td >
</ tr >
< tr class = " mp_event_address " >
2021-10-31 07:01:04 -04:00
< th >< ? php esc_html_e ( 'Location/Venue:' , 'mage-eventpress' ); ?> </th>
2021-10-29 02:57:05 -04:00
< td >
< label >
< input type = " text " name = 'mep_location_venue' placeholder = " Ex: New york Meeting Center " class = " mp_formControl " value = '<?php echo mep_get_event_locaion_item($post_id, ' mep_location_venue '); ?>' >
</ label >
</ td >
2021-10-31 07:01:04 -04:00
< th >< span >< ? php esc_html_e ( 'Street:' , 'mage-eventpress' ); ?> </span></th>
2021-10-29 02:57:05 -04:00
< td >
< label >
< input type = " text " name = 'mep_street' placeholder = " Ex: 10 E 33rd St " class = " mp_formControl " value = '<?php echo mep_get_event_locaion_item($post_id, ' mep_street '); ?>' >
</ label >
</ td >
</ tr >
< tr class = " mp_event_address " >
2021-10-31 07:01:04 -04:00
< th >< span >< ? php esc_html_e ( 'City: ' , 'mage-eventpress' ); ?> </span></th>
2021-10-29 02:57:05 -04:00
< td >
< label >
< input type = " text " name = 'mep_city' placeholder = " Ex: New York " class = " mp_formControl " value = '<?php echo mep_get_event_locaion_item($post_id, ' mep_city '); ?>' >
</ label >
</ td >
2021-10-31 07:01:04 -04:00
< th >< span >< ? php esc_html_e ( 'State: ' , 'mage-eventpress' ); ?> </span></th>
2021-10-29 02:57:05 -04:00
< td >
< label >
< input type = " text " name = 'mep_state' placeholder = " Ex: NY " class = " mp_formControl " value = '<?php echo mep_get_event_locaion_item($post_id, ' mep_state '); ?>' >
</ label >
</ td >
</ tr >
< tr class = " mp_event_address " >
2021-10-31 07:01:04 -04:00
< th >< span >< ? php esc_html_e ( 'Postcode: ' , 'mage-eventpress' ); ?> </span></th>
2021-10-29 02:57:05 -04:00
< td >
< label >
< input type = " text " name = 'mep_postcode' placeholder = " Ex: 10016 " class = " mp_formControl " value = '<?php echo mep_get_event_locaion_item($post_id, ' mep_postcode '); ?>' >
</ label >
</ td >
2021-10-31 07:01:04 -04:00
< th >< span >< ? php esc_html_e ( 'Country: ' , 'mage-eventpress' ); ?> </span></th>
2021-10-29 02:57:05 -04:00
< td >
< label >
< input type = " text " name = 'mep_country' placeholder = " Ex: USA " class = " mp_formControl " value = '<?php echo mep_get_event_locaion_item($post_id, ' mep_country '); ?>' >
</ label >
</ td >
</ tr >
</ table >
</ div >
2020-12-14 07:10:30 -05:00
< div class = " mp_form_area " >
< div class = " mp_form_item " >
< label >
2021-11-01 15:17:17 -04:00
< input type = " checkbox " name = 'mep_sgm' value = '1' < ? php echo esc_attr ( $map_visible ) > 0 ? esc_attr ( 'checked' ) : '' ; ?> >
2021-10-31 07:01:04 -04:00
< span >< ? php esc_html_e ( 'Show Google Map ' , 'mage-eventpress' ); ?> </span>
2020-12-14 07:10:30 -05:00
</ label >
2020-12-13 07:25:42 -05:00
< ? php
2020-12-14 07:10:30 -05:00
if ( $map_type == 'iframe' ) {
?>
< div id = " show_gmap " >
< iframe id = " gmap_canvas " src = " https://maps.google.com/maps?q=<?php echo mep_get_event_locaion_item( $post_id , 'mep_location_venue'); ?>&t=&z=19&ie=UTF8&iwloc=&output=embed " frameborder = " 0 " scrolling = " no " marginheight = " 0 " marginwidth = " 0 " ></ iframe >
</ div >
2020-12-13 07:25:42 -05:00
2020-12-14 07:10:30 -05:00
< ? php }
if ( $map_type == 'api' ) {
if ( $user_api ) {
2020-12-13 07:25:42 -05:00
?>
2020-12-14 07:10:30 -05:00
< div class = 'sec' >
2021-10-31 07:01:04 -04:00
< input id = " pac-input " name = 'location_name' value = '' />
2020-12-14 07:10:30 -05:00
</ div >
2020-12-13 07:25:42 -05:00
2020-12-14 07:10:30 -05:00
< input type = " hidden " class = " form-control " required name = " latitude " value = " <?php if (array_key_exists('latitude', $values )) {
2021-10-31 07:01:04 -04:00
echo esc_attr ( $values [ 'latitude' ][ 0 ]);
2020-12-14 07:10:30 -05:00
} ?> ">
< input type = " hidden " class = " form-control " required name = " longitude " value = " <?php if (array_key_exists('longitude', $values )) {
2021-10-31 07:01:04 -04:00
echo esc_attr ( $values [ 'longitude' ][ 0 ]);
2020-12-14 07:10:30 -05:00
} ?> ">
< div id = " map " ></ div >
2020-12-13 07:25:42 -05:00
2020-12-14 07:10:30 -05:00
< ? php
} else {
2021-10-31 07:01:04 -04:00
?>
< span class = mep_status >< span class = err >
< ? php esc_html_e ( 'No Google MAP API Key Found. Please enter API KEY' , 'mage-eventpress' ); ?> <a href="<?php echo get_site_url() . esc_url('/wp-admin/options-general.php?page=mep_event_settings_page'); ?>"><?php esc_html_e('Here','mage-eventpress'); ?></a></span>
</ span >
< ? php
2020-12-14 07:10:30 -05:00
}
2020-12-13 07:25:42 -05:00
2020-12-14 07:10:30 -05:00
if ( array_key_exists ( 'latitude' , $values ) && ! empty ( $values [ 'latitude' ][ 0 ])) {
$lat = $values [ 'latitude' ][ 0 ];
} else {
$lat = '37.0902' ;
}
2020-12-13 07:25:42 -05:00
2020-12-14 07:10:30 -05:00
if ( array_key_exists ( 'longitude' , $values ) && ! empty ( $values [ 'longitude' ][ 0 ])) {
$lon = $values [ 'longitude' ][ 0 ];
} else {
$lon = '95.7129' ;
}
?>
< script >
function initMap () {
var map = new google . maps . Map ( document . getElementById ( 'map' ), {
center : {
2021-10-31 07:01:04 -04:00
lat : < ? php echo esc_attr ( $lat ); ?> ,
lng : < ? php echo esc_attr ( $lon ); ?>
2020-12-14 07:10:30 -05:00
},
zoom : 17
});
var input = /** @type {!HTMLInputElement} */ (
document . getElementById ( 'pac-input' ));
var types = document . getElementById ( 'type-selector' );
map . controls [ google . maps . ControlPosition . TOP_LEFT ] . push ( input );
map . controls [ google . maps . ControlPosition . TOP_LEFT ] . push ( types );
var autocomplete = new google . maps . places . Autocomplete ( input );
autocomplete . bindTo ( 'bounds' , map );
var infowindow = new google . maps . InfoWindow ();
var marker = new google . maps . Marker ({
map : map ,
anchorPoint : new google . maps . Point ( 0 , - 29 ),
draggable : true ,
position : {
2021-10-31 07:01:04 -04:00
lat : < ? php echo esc_attr ( $lat ); ?> ,
lng : < ? php echo esc_attr ( $lon ); ?>
2020-12-14 07:10:30 -05:00
}
});
google . maps . event . addListener ( marker , 'dragend' , function () {
document . getElementsByName ( 'latitude' )[ 0 ] . value = marker . getPosition () . lat ();
document . getElementsByName ( 'longitude' )[ 0 ] . value = marker . getPosition () . lng ();
})
autocomplete . addListener ( 'place_changed' , function () {
infowindow . close ();
marker . setVisible ( false );
var place = autocomplete . getPlace ();
if ( ! place . geometry ) {
window . alert ( " Autocomplete's returned place contains no geometry " );
return ;
}
// If the place has a geometry, then present it on a map.
if ( place . geometry . viewport ) {
map . fitBounds ( place . geometry . viewport );
} else {
map . setCenter ( place . geometry . location );
map . setZoom ( 17 ); // Why 17? Because it looks good.
}
marker . setIcon ( /** @type {google.maps.Icon} */ ({
url : 'http://maps.google.com/mapfiles/ms/icons/red.png' ,
size : new google . maps . Size ( 71 , 71 ),
origin : new google . maps . Point ( 0 , 0 ),
anchor : new google . maps . Point ( 17 , 34 ),
scaledSize : new google . maps . Size ( 35 , 35 )
}));
marker . setPosition ( place . geometry . location );
marker . setVisible ( true );
var address = '' ;
if ( place . address_components ) {
address = [
( place . address_components [ 0 ] && place . address_components [ 0 ] . short_name || '' ),
( place . address_components [ 1 ] && place . address_components [ 1 ] . short_name || '' ),
( place . address_components [ 2 ] && place . address_components [ 2 ] . short_name || '' )
] . join ( ' ' );
}
var latitude = place . geometry . location . lat ();
var longitude = place . geometry . location . lng ();
2021-06-10 07:41:06 -04:00
// $("input[name=coordinate]").val(address);
jQuery ( " input[name=latitude] " ) . val ( latitude );
jQuery ( " input[name=longitude] " ) . val ( longitude );
2020-12-14 07:10:30 -05:00
});
}
google . maps . event . addDomListener ( window , " load " , initMap );
</ script >
< ? php
}
?>
</ div >
</ div >
< script type = " text/javascript " >
jQuery ( '[name="mep_org_address"]' ) . change ( function () {
let source = jQuery ( this ) . val ();
if ( source === '1' ) {
jQuery ( '.mp_event_address' ) . slideUp ( 250 );
jQuery ( '[name="mep_location_venue"]' ) . val ( '<?php echo mep_event_org_location_item($post_id, ' org_location '); ?>' );
jQuery ( '[name="mep_street"]' ) . val ( '<?php echo mep_event_org_location_item($post_id, ' org_street '); ?>' );
jQuery ( '[name="mep_city"]' ) . val ( '<?php echo mep_event_org_location_item($post_id, ' org_city '); ?>' );
jQuery ( '[name="mep_state"]' ) . val ( '<?php echo mep_event_org_location_item($post_id, ' org_state '); ?>' );
jQuery ( '[name="mep_postcode"]' ) . val ( '<?php echo mep_event_org_location_item($post_id, ' org_postcode '); ?>' );
jQuery ( '[name="mep_country"]' ) . val ( '<?php echo mep_event_org_location_item($post_id, ' org_country '); ?>' );
let location = jQuery ( '[name="mep_location_venue"]' ) . val ();
jQuery ( '#show_gmap' ) . html ( '<iframe id="gmap_canvas" src="https://maps.google.com/maps?q=' + location + '&t=&z=19&ie=UTF8&iwloc=&output=embed" frameborder="0" scrolling="no" marginheight="0" marginwidth="0"></iframe>' )
2020-12-13 07:25:42 -05:00
} else {
2020-12-14 07:10:30 -05:00
jQuery ( '.mp_event_address' ) . slideDown ();
jQuery ( '[name="mep_location_venue"]' ) . val ( '<?php echo mep_event_location_item($post_id, ' mep_location_venue '); ?>' );
jQuery ( '[name="mep_street"]' ) . val ( '<?php echo mep_event_location_item($post_id, ' mep_street '); ?>' );
jQuery ( '[name="mep_city"]' ) . val ( '<?php echo mep_event_location_item($post_id, ' mep_city '); ?>' );
jQuery ( '[name="mep_state"]' ) . val ( '<?php echo mep_event_location_item($post_id, ' mep_state '); ?>' );
jQuery ( '[name="mep_postcode"]' ) . val ( '<?php echo mep_event_location_item($post_id, ' mep_postcode '); ?>' );
jQuery ( '[name="mep_country"]' ) . val ( '<?php echo mep_event_location_item($post_id, ' mep_country '); ?>' );
let location = jQuery ( '[name="mep_location_venue"]' ) . val ();
jQuery ( '#show_gmap' ) . html ( '<iframe id="gmap_canvas" src="https://maps.google.com/maps?q=' + location + '&t=&z=19&ie=UTF8&iwloc=&output=embed" frameborder="0" scrolling="no" marginheight="0" marginwidth="0"></iframe>' )
2020-12-13 07:25:42 -05:00
}
2020-12-14 07:10:30 -05:00
})
jQuery ( '[name="mep_location_venue"]' ) . keypress ( function () {
let location = jQuery ( this ) . val ();
if ( location === '' ) {
// alert('Please Enter Location First');
2020-12-13 07:25:42 -05:00
} else {
2020-12-14 07:10:30 -05:00
jQuery ( '#show_gmap' ) . html ( '<iframe id="gmap_canvas" src="https://maps.google.com/maps?q=' + location + '&t=&z=19&ie=UTF8&iwloc=&output=embed" frameborder="0" scrolling="no" marginheight="0" marginwidth="0"></iframe>' )
2020-12-13 07:25:42 -05:00
}
2020-12-14 07:10:30 -05:00
})
</ script >
< ? php
2020-12-13 07:25:42 -05:00
}
2020-12-14 07:10:30 -05:00
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' );
?>
2021-10-29 02:57:05 -04:00
< div class = " mp_ticket_type_table " >
< table id = " repeatable-fieldset-one-t " >
2020-12-14 07:10:30 -05:00
< thead >
< tr >
2021-10-31 07:01:04 -04:00
< th style = " min-width: 80px; " title = " <?php esc_attr_e('Ticket Type Name', 'mage-eventpress'); ?> " >< ? php esc_html_e ( 'Ticket' , 'mage-eventpress' ); ?> </th>
< th style = " min-width: 80px; " title = " <?php esc_attr_e('Ticket Price', 'mage-eventpress'); ?> " >< ? php esc_html_e ( 'Price' , 'mage-eventpress' ); ?> </th>
2021-10-29 02:57:05 -04:00
< ? php do_action ( 'mep_pricing_table_head_after_price_col' ); ?>
2022-08-04 00:45:25 -04:00
< th style = " min-width: 80px; " title = " <?php esc_attr_e('Available Qty', 'mage-eventpress'); ?> " >< ? php esc_html_e ( 'Capacity' , 'mage-eventpress' ); ?> </th>
< th style = " min-width: 80px; " title = " <?php esc_attr_e('Default Qty', 'mage-eventpress'); ?> " >< ? php esc_html_e ( 'Default Qty' , 'mage-eventpress' ); ?> </th>
< th style = " min-width: 80px; " title = " <?php esc_attr_e('Reserve Qty', 'mage-eventpress'); ?> " >< ? php esc_html_e ( 'Reserve Qty' , 'mage-eventpress' ); ?>
< ? php do_action ( 'add_extra_field_icon' , $post_id ); ?>
</ th >
2021-12-06 05:53:55 -05:00
< ? php do_action ( 'mep_add_extra_column' ); ?>
2021-10-31 07:01:04 -04:00
< th style = " min-width: 150px; " title = " <?php esc_attr_e('Sale End Date', 'mage-eventpress'); ?> " >< ? php esc_html_e ( 'Sale End Date' , 'mage-eventpress' ); ?> </th>
< th style = " min-width: 120px; " title = " <?php esc_attr_e('Sale End Time', 'mage-eventpress'); ?> " >< ? php esc_html_e ( 'Sale End Time' , 'mage-eventpress' ); ?> </th>
< th style = " min-width: 140px; " title = " <?php esc_attr_e('Qty Box Type', 'mage-eventpress'); ?> " >< ? php esc_html_e ( 'Qty Box' , 'mage-eventpress' ); ?> </th>
< th style = " min-width: 80px; " >< ? php esc_html_e ( 'Action' , 'mage-eventpress' ); ?> </th>
2020-12-14 07:10:30 -05:00
</ tr >
2021-10-29 02:57:05 -04:00
</ thead >
< tbody class = " mp_event_type_sortable " >
2020-12-13 07:25:42 -05:00
< ? php
2021-10-29 02:57:05 -04:00
if ( $mep_event_ticket_type ) :
$count = 0 ;
foreach ( $mep_event_ticket_type as $field ) {
$qty_t_type = array_key_exists ( 'option_qty_t_type' , $field ) ? esc_attr ( $field [ 'option_qty_t_type' ]) : 'inputbox' ;
$count ++ ;
?>
2020-12-14 07:10:30 -05:00
< tr >
< td >
2021-10-29 02:57:05 -04:00
< input type = " text " class = " mp_formControl " name = " option_name_t[] " placeholder = " Ex: Adult " value = " <?php if ( $field['option_name_t'] != '') {
echo esc_attr ( $field [ 'option_name_t' ]);
} ?> " />
2020-12-14 07:10:30 -05:00
</ td >
2021-10-29 02:57:05 -04:00
2020-12-14 07:10:30 -05:00
< td >
2021-10-29 02:57:05 -04:00
< input type = " number " size = " 4 " pattern = " [0-9]* " step = " 0.001 " class = " mp_formControl " name = " option_price_t[] " placeholder = " Ex: 10 " value = " <?php if (array_key_exists('option_price_t', $field ) && $field['option_price_t'] != '') {
echo esc_attr ( $field [ 'option_price_t' ]);
} else {
echo '' ;
} ?> " />
</ td >
< ? php do_action ( 'mep_pricing_table_data_after_price_col' , $field , $post_id ); ?>
< td >
< input type = " number " size = " 4 " pattern = " [0-9]* " step = " 1 " class = " mp_formControl " name = " option_qty_t[] " placeholder = " Ex: 500 " value = " <?php if (isset( $field['option_qty_t'] )) {
2021-10-31 07:01:04 -04:00
echo esc_attr ( $field [ 'option_qty_t' ]);
2021-10-29 02:57:05 -04:00
} else {
echo 0 ;
} ?> " />
2020-12-14 07:10:30 -05:00
</ td >
< td >
2021-10-29 02:57:05 -04:00
< input type = " number " size = " 2 " pattern = " [0-9]* " step = " 1 " class = " mp_formControl " name = " option_default_qty_t[] " placeholder = " Ex: 1 " value = " <?php if (isset( $field['option_default_qty_t'] )) {
2021-10-31 07:01:04 -04:00
echo esc_attr ( $field [ 'option_default_qty_t' ]);
2021-10-29 02:57:05 -04:00
} else {
echo 0 ;
} ?> " />
2020-12-14 07:10:30 -05:00
</ td >
< td >
2021-10-29 02:57:05 -04:00
< input type = " number " class = " mp_formControl " name = " option_rsv_t[] " placeholder = " Ex: 5 " value = " <?php if (isset( $field['option_rsv_t'] )) {
2021-10-31 07:01:04 -04:00
echo esc_attr ( $field [ 'option_rsv_t' ]);
2021-10-29 02:57:05 -04:00
} else {
echo 0 ;
} ?> " />
</ td >
2020-12-14 07:10:30 -05:00
2022-08-04 00:45:25 -04:00
< ? php do_action ( 'mep_add_extra_input_box' , $field , $count ) ?>
2021-10-29 02:57:05 -04:00
< td >
< div class = " sell_expire_date " >
< input type = " date " id = " ticket_sale_start_date " class = " mp_formControl " value = '<?php if (array_key_exists(' option_sale_end_date_t ', $field) && $field[' option_sale_end_date_t '] != ' ' ) {
echo esc_attr ( date ( 'Y-m-d' , strtotime ( $field [ 'option_sale_end_date_t' ])));
} ?> ' name="option_sale_end_date[]" />
</ div >
</ td >
< td >
< div class = " sell_expire_date " >
< input type = " time " id = " ticket_sale_start_time " class = " mp_formControl " value = '<?php if (array_key_exists(' option_sale_end_date_t ', $field) && $field[' option_sale_end_date_t '] != ' ' ) {
echo esc_attr ( date ( 'H:i' , strtotime ( $field [ 'option_sale_end_date_t' ])));
} ?> ' name="option_sale_end_time[]" />
</ div >
2020-12-14 07:10:30 -05:00
</ td >
2021-10-29 02:57:05 -04:00
< td >
< select name = " option_qty_t_type[] " class = 'mp_formControl' >
< option value = " inputbox " < ? php if ( $qty_t_type == 'inputbox' ) {
2021-10-31 07:01:04 -04:00
echo esc_attr ( " Selected " );
} ?> ><?php esc_html_e('Input Box', 'mage-eventpress'); ?></option>
2021-10-29 02:57:05 -04:00
< option value = " dropdown " < ? php if ( $qty_t_type == 'dropdown' ) {
2021-10-31 07:01:04 -04:00
echo esc_attr ( " Selected " );
} ?> ><?php esc_html_e('Dropdown List', 'mage-eventpress'); ?></option>
2021-10-29 02:57:05 -04:00
</ select >
</ td >
2020-12-14 07:10:30 -05:00
< td >
< div class = " mp_event_remove_move " >
2021-10-29 02:57:05 -04:00
< button class = " button remove-row-t " type = " button " >< span class = " dashicons dashicons-trash " ></ span ></ button >
2020-12-14 07:10:30 -05:00
< div class = " mp_event_type_sortable_button " >< span class = " dashicons dashicons-move " ></ span ></ div >
</ div >
</ td >
</ tr >
< ? php
}
else :
2021-10-29 02:57:05 -04:00
// show a blank one
2020-12-14 07:10:30 -05:00
endif ;
?>
2021-10-29 02:57:05 -04:00
<!-- empty hidden one for jQuery -->
< tr class = " empty-row-t screen-reader-text " >
< td >< input type = " text " class = " mp_formControl " name = " option_name_t[] " placeholder = " Ex: Adult " /></ td >
< td >< input type = " number " size = " 4 " pattern = " [0-9]* " class = " mp_formControl " step = " 0.001 " name = " option_price_t[] " placeholder = " Ex: 10 " value = " " /></ td >
< ? php do_action ( 'mep_pricing_table_empty_after_price_col' ); ?>
< td >< input type = " number " size = " 4 " pattern = " [0-9]* " step = " 1 " class = " mp_formControl " name = " option_qty_t[] " placeholder = " Ex: 15 " value = " " /></ td >
< td >< input type = " number " size = " 2 " pattern = " [0-9]* " class = " mp_formControl " name = " option_default_qty_t[] " placeholder = " Ex: 1 " value = " " /></ td >
2021-11-02 03:28:50 -04:00
< ? php $option_rsv_t = '<td><input type="number" class="mp_formControl" name="option_rsv_t[]" placeholder="Ex: 5" value=""/></td>' ; ?>
< ? php echo apply_filters ( 'mep_add_field_to_ticket_type' , mep_esc_html ( $option_rsv_t )); ?>
2022-04-05 03:42:16 -04:00
< ? php do_action ( 'mep_add_extra_column_empty' ); ?>
2020-12-14 07:10:30 -05:00
< td >
2021-10-29 02:57:05 -04:00
< div class = " sell_expire_date " >
< input type = " date " id = " ticket_sale_start_date " value = '' name = " option_sale_end_date[] " />
</ div >
2020-12-14 07:10:30 -05:00
</ td >
< td >
2021-10-29 02:57:05 -04:00
< div class = " sell_expire_date " >
< input type = " time " id = " ticket_sale_start_time " value = '' name = " option_sale_end_time[] " />
</ div >
2020-12-14 07:10:30 -05:00
</ td >
< td >
2021-10-29 02:57:05 -04:00
< select name = " option_qty_t_type[] " class = 'mp_formControl' >
2021-10-31 07:01:04 -04:00
< option value = '' >< ? php esc_html_e ( 'Please Select' , 'mage-eventpress' ); ?> </option>
< option value = " inputbox " >< ? php esc_html_e ( 'Input Box' , 'mage-eventpress' ); ?> </option>
< option value = " dropdown " >< ? php esc_html_e ( 'Dropdown List' , 'mage-eventpress' ); ?> </option>
2021-10-29 02:57:05 -04:00
</ select >
2020-12-14 07:10:30 -05:00
</ td >
< td >
2022-04-05 03:42:16 -04:00
< button class = " button remove-row-t " type = " button " >< i class = " fas fa-trash " ></ i ></ button >
2020-12-14 07:10:30 -05:00
</ td >
2021-10-29 02:57:05 -04:00
</ tr >
</ tbody >
</ table >
</ div >
< p >
2022-08-04 00:45:25 -04:00
< button id = " add-row-t " class = " button " type = " button " >< i class = " fas fa-plus-circle " ></ i > < ? php esc_html_e ( 'Add New Ticket Type' , 'mage-eventpress' ); ?> </button>
2021-10-29 02:57:05 -04:00
</ p >
< ? php
}
public function mep_event_extra_price_option ( $post_id )
{
$mep_events_extra_prices = get_post_meta ( $post_id , 'mep_events_extra_prices' , true );
wp_nonce_field ( 'mep_events_extra_price_nonce' , 'mep_events_extra_price_nonce' );
?>
2021-10-31 07:01:04 -04:00
< p class = " event_meta_help_txt " >< ? php esc_html_e ( 'Extra Service as Product that you can sell and it is not included on event package' , 'mage-eventpress' ); ?> </p>
2021-10-29 02:57:05 -04:00
< div class = " mp_ticket_type_table " >
< table id = " repeatable-fieldset-one " >
< thead >
< tr >
2021-10-31 07:01:04 -04:00
< th title = " <?php esc_attr_e('Extra Service Name', 'mage-eventpress'); ?> " >< ? php esc_html_e ( 'Name' , 'mage-eventpress' ); ?> </th>
< th title = " <?php esc_attr_e('Extra Service Price', 'mage-eventpress'); ?> " >< ? php esc_html_e ( 'Price' , 'mage-eventpress' ); ?> </th>
2022-08-04 00:45:25 -04:00
< th title = " <?php esc_attr_e('Available Qty', 'mage-eventpress'); ?> " >< ? php esc_html_e ( 'Available Qty' , 'mage-eventpress' ); ?> </th>
2021-10-31 07:01:04 -04:00
< th title = " <?php esc_attr_e('Qty Box Type', 'mage-eventpress'); ?> " style = " min-width: 140px; " >< ? php esc_html_e ( 'Qty Box' , 'mage-eventpress' ); ?> </th>
2021-10-29 02:57:05 -04:00
< th ></ th >
</ tr >
</ thead >
< tbody class = " mp_event_type_sortable " >
< ? php
if ( $mep_events_extra_prices ) :
foreach ( $mep_events_extra_prices as $field ) {
$qty_type = array_key_exists ( 'option_qty_type' , $field ) ? esc_attr ( $field [ 'option_qty_type' ]) : 'inputbox' ;
?>
< tr >
< td >< input type = " text " class = " mp_formControl " name = " option_name[] " placeholder = " Ex: Cap " value = " <?php if ( $field['option_name'] != '') {
echo esc_attr ( $field [ 'option_name' ]);
} ?> " /></td>
< td >< input type = " number " step = " 0.001 " class = " mp_formControl " name = " option_price[] " placeholder = " Ex: 10 " value = " <?php if ( $field['option_price'] != '') {
echo esc_attr ( $field [ 'option_price' ]);
} else {
echo '' ;
} ?> " /></td>
2021-10-31 07:01:04 -04:00
< td >
< input type = " number " class = " mp_formControl " name = " option_qty[] "
placeholder = " Ex: 100 "
value = " <?php echo esc_attr(( $field['option_qty'] != '') ? $field['option_qty'] : ''); ?> " />
</ td >
2021-10-29 02:57:05 -04:00
< td align = " center " >
< select name = " option_qty_type[] " class = 'mp_formControl' >
< option value = " inputbox " < ? php if ( $qty_type == 'inputbox' ) {
2021-10-31 07:01:04 -04:00
echo esc_attr ( " Selected " );
} ?> ><?php esc_html_e('Input Box', 'mage-eventpress'); ?></option>
2021-10-29 02:57:05 -04:00
< option value = " dropdown " < ? php if ( $qty_type == 'dropdown' ) {
2021-10-31 07:01:04 -04:00
echo esc_attr ( " Selected " );
} ?> ><?php esc_html_e('Dropdown List', 'mage-eventpress'); ?></option>
2021-10-29 02:57:05 -04:00
</ select >
</ td >
< td >
< div class = " mp_event_remove_move " >
2022-04-05 03:42:16 -04:00
< button class = " button remove-row " type = " button " >< i class = " fas fa-trash " ></ i ></ button >
< div class = " mp_event_type_sortable_button " >< i class = " fas fa-grip-vertical " ></ i ></ div >
2021-10-29 02:57:05 -04:00
</ div >
</ td >
</ tr >
< ? php
}
else :
// show a blank one
endif ;
?>
<!-- empty hidden one for jQuery -->
< tr class = " empty-row screen-reader-text " >
< td >< input type = " text " class = " mp_formControl " name = " option_name[] " placeholder = " Ex: Cap " /></ td >
< td >< input type = " number " class = " mp_formControl " step = " 0.001 " name = " option_price[] " placeholder = " Ex: 10 " value = " " /></ td >
< td >< input type = " number " class = " mp_formControl " name = " option_qty[] " placeholder = " Ex: 100 " value = " " /></ td >
< td >< select name = " option_qty_type[] " class = 'mp_formControl' >
2021-10-31 07:01:04 -04:00
< option value = " " >< ? php esc_html_e ( 'Please Select Type' , 'mage-eventpress' ); ?> </option>
< option value = " inputbox " >< ? php esc_html_e ( 'Input Box' , 'mage-eventpress' ); ?> </option>
< option value = " dropdown " >< ? php esc_html_e ( 'Dropdown List' , 'mage-eventpress' ); ?> </option>
2021-10-29 02:57:05 -04:00
</ select ></ td >
2020-12-14 07:10:30 -05:00
< td >
2022-04-05 03:42:16 -04:00
< button class = " button remove-row " >< i class = " fas fa-trash " ></ i ></ button >
2020-12-14 07:10:30 -05:00
</ td >
</ tr >
</ tbody >
</ table >
2021-10-29 02:57:05 -04:00
</ div >
< p >
2022-04-05 03:42:16 -04:00
< button id = " add-row " class = " button " >< i class = " fas fa-plus-circle " ></ i > < ? php esc_html_e ( 'Add Extra Price' , 'mage-eventpress' ); ?> </button>
2021-10-29 02:57:05 -04:00
</ p >
< ? php
}
public function mep_event_date_meta_box_cb ( $post_id )
{
$values = get_post_custom ( $post_id );
?>
< div class = " sec " >
< div class = " mp_ticket_type_table " >
< table id = " repeatable-fieldset-one-d " >
< thead >
2021-10-31 07:01:04 -04:00
< th style = " min-width: 120px; " >< ? php esc_html_e ( 'Start Date' , 'mage-eventpress' ); ?> </th>
< th style = " min-width: 120px; " >< ? php esc_html_e ( 'Start Time' , 'mage-eventpress' ); ?> </th>
< th style = " min-width: 120px; " >< ? php esc_html_e ( 'End Date' , 'mage-eventpress' ); ?> </th>
< th style = " min-width: 120px; " >< ? php esc_html_e ( 'End Time' , 'mage-eventpress' ); ?> </th>
2021-10-29 02:57:05 -04:00
< ? php do_action ( 'mep_date_table_head' , $post_id ); ?>
2021-10-31 07:01:04 -04:00
< th style = " min-width: 60px; " >< ? php esc_html_e ( 'Action' , 'mage-eventpress' ); ?> </th>
2021-10-29 02:57:05 -04:00
</ thead >
< tbody class = " mp_event_type_sortable " >
< tr >
< td >
< input type = " date " class = " mp_formControl " name = " event_start_date " placeholder = " Start Date " value = " <?php if (array_key_exists('event_start_date', $values )) {
2021-10-31 07:01:04 -04:00
echo esc_attr ( $values [ 'event_start_date' ][ 0 ]);
2021-10-29 02:57:05 -04:00
} ?> " />
</ td >
< td >
< input type = " time " class = " mp_formControl " name = " event_start_time " placeholder = " Start Time " value = " <?php if (array_key_exists('event_start_time', $values )) {
2021-10-31 07:01:04 -04:00
echo esc_attr ( $values [ 'event_start_time' ][ 0 ]);
2021-10-29 02:57:05 -04:00
} ?> " />
</ td >
< td >
< input type = " date " class = " mp_formControl " name = " event_end_date " placeholder = " End Date " value = " <?php if (array_key_exists('event_end_date', $values )) {
2021-10-31 07:01:04 -04:00
echo esc_attr ( $values [ 'event_end_date' ][ 0 ]);
2021-10-29 02:57:05 -04:00
} ?> " />
</ td >
< td >
< input type = " time " class = " mp_formControl " name = " event_end_time " placeholder = " End Time " value = " <?php if (array_key_exists('event_end_time', $values )) {
2021-10-31 07:01:04 -04:00
echo esc_attr ( date ( 'H:i' , strtotime ( $values [ 'event_end_time' ][ 0 ])));
2021-10-29 02:57:05 -04:00
} ?> " />
</ td >
< ? php do_action ( 'mep_date_table_body_default_date' , $post_id ); ?>
< td >
</ td >
</ tr >
< ? php
$mep_event_multi_date = get_post_meta ( $post_id , 'mep_event_more_date' , true );
if ( $mep_event_multi_date ) :
?>
< ? php
foreach ( $mep_event_multi_date as $field ) {
?>
< tr >
< td >
< input type = " date " class = " mp_formControl " name = " event_more_start_date[] " placeholder = " Start Date " value = " <?php if ( $field['event_more_start_date'] != '') {
2021-10-31 07:01:04 -04:00
echo esc_attr ( date ( 'Y-m-d' , strtotime ( $field [ 'event_more_start_date' ])));
2021-10-29 02:57:05 -04:00
} ?> " />
</ td >
< td >
< input type = " time " class = " mp_formControl " name = " event_more_start_time[] " placeholder = " Start Time " value = " <?php if ( $field['event_more_start_time'] != '') {
2021-10-31 07:01:04 -04:00
echo esc_attr ( date ( 'H:i' , strtotime ( $field [ 'event_more_start_time' ])));
2021-10-29 02:57:05 -04:00
} ?> " />
</ td >
< td >
< input type = " date " class = " mp_formControl " name = " event_more_end_date[] " placeholder = " End Date " value = " <?php if ( $field['event_more_end_date'] != '') {
2021-10-31 07:01:04 -04:00
echo esc_attr ( date ( 'Y-m-d' , strtotime ( $field [ 'event_more_end_date' ])));
2021-10-29 02:57:05 -04:00
} ?> " />
</ td >
< td >
< input type = " time " class = " mp_formControl " name = " event_more_end_time[] " placeholder = " End Time " value = " <?php if ( $field['event_more_end_time'] != '') {
2021-10-31 07:01:04 -04:00
echo esc_attr ( date ( 'H:i' , strtotime ( $field [ 'event_more_end_time' ])));
2021-10-29 02:57:05 -04:00
} ?> " />
</ td >
< ? php do_action ( 'mep_date_table_body_more_date' , $post_id , $field ); ?>
< td >
< div class = " mp_event_remove_move " >
2022-04-05 03:42:16 -04:00
< button class = " button remove-row-d " type = " button " >< i class = " fas fa-trash " ></ i ></ button >
< div class = " mp_event_type_sortable_button " >< i class = " fas fa-grip-vertical " ></ i ></ div >
2021-10-29 02:57:05 -04:00
</ div >
</ td >
</ tr >
< ? php
}
else :
endif ;
?>
< tr class = " empty-row-d screen-reader-text " >
< td >
< input type = " date " class = " mp_formControl " name = " event_more_start_date[] " placeholder = " Start Date " value = " " />
</ td >
< td >
< input type = " time " class = " mp_formControl " name = " event_more_start_time[] " placeholder = " Start Time " value = " " />
</ td >
< td >
< input type = " date " class = " mp_formControl " name = " event_more_end_date[] " placeholder = " End Date " value = " " />
</ td >
< td >
< input type = " time " class = " mp_formControl " name = " event_more_end_time[] " placeholder = " End Time " value = " " />
</ td >
< ? php do_action ( 'mep_date_table_empty' , $post_id ); ?>
< td >
2022-04-05 03:42:16 -04:00
< button class = " button remove-row-d " >< i class = " fas fa-trash " ></ i ></ button >
2021-10-29 02:57:05 -04:00
</ td >
</ tr >
</ tbody >
</ table >
</ div >
2022-04-05 03:42:16 -04:00
< button id = " add-new-date-row " class = " button " >< i class = " fas fa-plus-circle " ></ i > < ? php esc_html_e ( 'Add More Dates' , 'mage-eventpress' ); ?> </button>
2020-12-14 07:10:30 -05:00
</ div >
< ? php
do_action ( 'mep_after_date_section' , $post_id );
}
2020-12-13 07:25:42 -05:00
2020-12-14 07:10:30 -05:00
public function mp_event_rich_text ( $post_id )
{
wp_nonce_field ( 'mep_event_ricn_text_nonce' , 'mep_event_ricn_text_nonce' );
$event_start_date = get_post_meta ( $post_id , 'event_start_datetime' , true ) ? get_post_meta ( $post_id , 'event_start_datetime' , true ) : '' ;
$event_end_date = get_post_meta ( $post_id , 'event_end_datetime' , true ) ? get_post_meta ( $post_id , 'event_end_datetime' , true ) : '' ;
$event_rt_status = get_post_meta ( $post_id , 'mep_rt_event_status' , true ) ? get_post_meta ( $post_id , 'mep_rt_event_status' , true ) : '' ;
$event_rt_atdnce_mode = get_post_meta ( $post_id , 'mep_rt_event_attandence_mode' , true ) ? get_post_meta ( $post_id , 'mep_rt_event_attandence_mode' , true ) : '' ;
$event_rt_prv_date = get_post_meta ( $post_id , 'mep_rt_event_prvdate' , true ) ? get_post_meta ( $post_id , 'mep_rt_event_prvdate' , true ) : $event_start_date ;
2020-12-30 00:23:11 -05:00
$rt_status = get_post_meta ( $post_id , 'mep_rich_text_status' , true ) ? get_post_meta ( $post_id , 'mep_rich_text_status' , true ) : 'enable' ;
2020-12-14 07:10:30 -05:00
?>
2021-03-22 08:13:03 -04:00
< div class = 'mep_rich_text_status_section' >
2021-10-29 02:57:05 -04:00
< label for = 'mep_rich_text_status' >
< ? php _e ( 'Rich Text Status' , 'mage-eventpress' ); ?>
< select id = 'mep_rich_text_status' name = 'mep_rich_text_status' >
< option value = 'enable' < ? php if ( $rt_status == 'enable' ) {
2021-10-31 07:01:04 -04:00
echo esc_html ( 'Selected' );
} ?> ><?php esc_html_e('Enable', 'mage-eventpress'); ?></option>
2021-10-29 02:57:05 -04:00
< option value = 'disable' < ? php if ( $rt_status == 'disable' ) {
2021-10-31 07:01:04 -04:00
echo esc_html ( 'Selected' );
} ?> ><?php esc_html_e('Disable', 'mage-eventpress'); ?></option>
2021-10-29 02:57:05 -04:00
</ select >
</ label >
2021-03-22 08:13:03 -04:00
</ div >
2021-10-29 02:57:05 -04:00
< table id = 'mep_rich_text_table' < ? php if ( $rt_status == 'disable' ) { ?> style='display:none;' <?php } ?>>
2020-12-14 07:10:30 -05:00
< tr >
2021-10-31 07:01:04 -04:00
< th >< span >< ? php esc_html_e ( 'Type :' , 'mage-eventpress' ); ?> </span></th>
< td colspan = " 3 " >< ? php esc_html_e ( 'Event' , 'mage-eventpress' ); ?> </td>
2020-12-14 07:10:30 -05:00
</ tr >
< tr >
2021-10-31 07:01:04 -04:00
< th >< span >< ? php esc_html_e ( 'Name :' , 'mage-eventpress' ); ?> </span></th>
2020-12-14 07:10:30 -05:00
< td colspan = " 3 " >< ? php echo get_the_title ( $post_id ); ?> </td>
</ tr >
< tr >
2021-10-31 07:01:04 -04:00
< th >< span >< ? php esc_html_e ( 'Start Date :' , 'mage-eventpress' ); ?> </span></th>
2021-11-01 15:17:17 -04:00
< td colspan = " 3 " >< ? php echo esc_attr ( $event_start_date ) ? get_mep_datetime ( $event_start_date , 'date-time-text' ) : '' ; ?> </td>
2020-12-14 07:10:30 -05:00
</ tr >
< tr >
< th >< span >< ? php _e ( 'End Date :' , 'mage-eventpress' ); ?> </span></th>
2021-11-01 15:17:17 -04:00
< td colspan = " 3 " >< ? php echo esc_attr ( $event_end_date ) ? get_mep_datetime ( $event_end_date , 'date-time-text' ) : '' ; ?> </td>
2020-12-14 07:10:30 -05:00
</ tr >
< tr >
2021-10-31 07:01:04 -04:00
< th >< span >< ? php esc_html_e ( 'Event Status:' , 'mage-eventpress' ); ?> </span></th>
2020-12-14 07:10:30 -05:00
< td colspan = " 3 " >
< label >
< select class = " mp_formControl " name = " mep_rt_event_status " >
2021-10-31 07:01:04 -04:00
< option value = " EventRescheduled " < ? php echo ( $event_rt_status == 'EventMovedOnline' ) ? esc_attr ( 'selected' ) : '' ; ?> ><?php esc_html_e('Event Rescheduled', 'mage-eventpress'); ?></option>
< option value = " EventMovedOnline " < ? php echo ( $event_rt_status == 'EventMovedOnline' ) ? esc_attr ( 'selected' ) : '' ; ?> ><?php esc_html_e('Event Moved Online', 'mage-eventpress'); ?></option>
< option value = " EventPostponed " < ? php echo ( $event_rt_status == 'EventPostponed' ) ? esc_attr ( 'selected' ) : '' ; ?> ><?php esc_html_e('Event Postponed', 'mage-eventpress'); ?></option>
< option value = " EventCancelled " < ? php echo ( $event_rt_status == 'EventCancelled' ) ? esc_attr ( 'selected' ) : '' ; ?> ><?php esc_html_e('Event Cancelled', 'mage-eventpress'); ?></option>
2020-12-14 07:10:30 -05:00
</ select >
</ label >
</ td >
</ tr >
< tr >
2021-10-31 07:01:04 -04:00
< th >< span >< ? php esc_html_e ( 'Event Attendance Mode:' , 'mage-eventpress' ); ?> </span></th>
2020-12-14 07:10:30 -05:00
< td colspan = " 3 " >
< label >
< select class = " mp_formControl " name = " mep_rt_event_attandence_mode " >
2021-10-31 07:01:04 -04:00
< option value = " OfflineEventAttendanceMode " < ? php echo ( $event_rt_atdnce_mode == 'OfflineEventAttendanceMode' ) ? esc_attr ( 'selected' ) : '' ; ?> ><?php esc_html_e('OfflineEventAttendanceMode', 'mage-eventpress'); ?></option>
< option value = " OnlineEventAttendanceMode " < ? php echo ( $event_rt_atdnce_mode == 'OnlineEventAttendanceMode' ) ? esc_attr ( 'selected' ) : '' ; ?> ><?php esc_html_e('OnlineEventAttendanceMode', 'mage-eventpress'); ?></option>
< option value = " MixedEventAttendanceMode " < ? php echo ( $event_rt_atdnce_mode == 'MixedEventAttendanceMode' ) ? esc_attr ( 'selected' ) : '' ; ?> ><?php esc_html_e('MixedEventAttendanceMode', 'mage-eventpress'); ?></option>
2020-12-14 07:10:30 -05:00
</ select >
</ label >
</ td >
</ tr >
< tr >
2021-10-31 07:01:04 -04:00
< th >< span >< ? php esc_html_e ( 'Previous Start Date:' , 'mage-eventpress' ); ?> </span></th>
2020-12-14 07:10:30 -05:00
< td colspan = " 3 " >
< label >
2021-10-31 07:01:04 -04:00
< input type = 'text' class = " mp_formControl " name = " mep_rt_event_prvdate " value = '<?php echo esc_attr($event_rt_prv_date); ?>' />
2020-12-14 07:10:30 -05:00
</ label >
</ td >
</ tr >
< tr >
< td colspan = " 4 " >
< ? php
if ( $post_id ) {
?>
< p class = " event_meta_help_txt " >
2021-10-31 07:01:04 -04:00
< a href = 'https://search.google.com/test/rich-results?utm_campaign=devsite&utm_medium=jsonld&utm_source=event&url=<?php echo get_the_permalink($post_id); ?>&user_agent=2' target = " _blank " >< ? php esc_html_e ( 'Check Rich Text Status' , 'mage-eventpress' ); ?> </a>
2020-12-14 07:10:30 -05:00
</ p >
2020-12-13 07:25:42 -05:00
< ? php
}
?>
2020-12-14 07:10:30 -05:00
</ td >
</ tr >
</ table >
2021-03-22 08:13:03 -04:00
< script >
jQuery ( '[name="mep_rich_text_status"]' ) . change ( function () {
var rich_status = jQuery ( this ) . val () ? jQuery ( this ) . val () : 'enable' ;
2021-10-29 02:57:05 -04:00
if ( rich_status == 'enable' ) {
2021-03-22 08:13:03 -04:00
// mep_rich_text_table
jQuery ( '#mep_rich_text_table' ) . show ( 500 );
2021-10-29 02:57:05 -04:00
} else if ( rich_status == 'disable' ) {
2021-03-22 08:13:03 -04:00
jQuery ( '#mep_rich_text_table' ) . hide ( 500 );
}
});
</ script >
2020-12-14 07:10:30 -05:00
< ? php
2020-12-13 07:25:42 -05:00
}
2020-12-14 07:10:30 -05:00
public function mp_event_settings ( $post_id )
{
$event_label = mep_get_option ( 'mep_event_label' , 'general_setting_sec' , 'Events' );
?>
< table >
2021-10-29 02:57:05 -04:00
< ? php
2020-12-14 07:10:30 -05:00
$this -> mp_event_reg_status ( $post_id );
2021-09-03 06:25:05 -04:00
$this -> mp_event_enddatetime_status ( $post_id );
2020-12-14 07:10:30 -05:00
$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 );
2020-12-13 07:25:42 -05:00
$this -> mp_event_speaker_ticket_type ( $post_id );
?>
2020-12-14 07:10:30 -05:00
</ table >
< ? php
2020-12-13 07:25:42 -05:00
}
2021-09-03 06:25:05 -04:00
2021-10-29 02:57:05 -04:00
2021-09-03 06:25:05 -04:00
public function mp_event_enddatetime_status ( $post_id )
{
$values = get_post_custom ( $post_id );
// wp_nonce_field('mep_event_reg_btn_nonce', 'mep_event_reg_btn_nonce');
$mep_show_end_datetime = '' ;
2021-11-01 15:17:17 -04:00
if ( array_key_exists ( 'mep_show_end_datetime' , $values )) {
2021-09-03 06:25:05 -04:00
if ( $values [ 'mep_show_end_datetime' ][ 0 ] == 'yes' ) {
$mep_show_end_datetime = 'checked' ;
}
} else {
2021-10-31 07:01:04 -04:00
$mep_show_end_datetime = 'checked' ;
2021-09-03 06:25:05 -04:00
}
?>
< tr >
< th >< span >< ? php _e ( 'Display End Datetime:' , 'mage-eventpress' ); ?> </span></th>
< td colspan = " 3 " >
< label >
2021-10-31 07:01:04 -04:00
< input class = " mp_opacity_zero " type = " checkbox " name = " mep_show_end_datetime " value = 'yes' < ? php echo esc_attr ( $mep_show_end_datetime ); ?> />
2021-09-03 06:25:05 -04:00
< span class = " slider round " ></ span >
</ label >
</ td >
</ tr >
< ? php
}
2020-12-13 07:25:42 -05:00
2020-12-14 07:10:30 -05:00
public function mp_event_reg_status ( $post_id )
{
$values = get_post_custom ( $post_id );
wp_nonce_field ( 'mep_event_reg_btn_nonce' , 'mep_event_reg_btn_nonce' );
2020-12-13 07:25:42 -05:00
$reg_checked = '' ;
2020-12-14 07:10:30 -05:00
if ( array_key_exists ( 'mep_reg_status' , $values )) {
if ( $values [ 'mep_reg_status' ][ 0 ] == 'on' ) {
2020-12-13 07:25:42 -05:00
$reg_checked = 'checked' ;
}
} else {
$reg_checked = 'checked' ;
}
2020-12-14 07:10:30 -05:00
?>
2022-08-23 02:57:23 -04:00
<!-- < tr >
2021-10-31 07:01:04 -04:00
< th title = " <?php esc_html_e('Event SKU No:', 'mage-eventpress'); ?> " >< span >< ? php esc_html_e ( 'SKU No:' , 'mage-eventpress' ); ?> </span></th>
2020-12-14 07:10:30 -05:00
< td colspan = " 3 " >
< label >
2021-10-29 02:57:05 -04:00
< input class = " mep_input_text " type = " text " name = " mep_event_sku " value = " <?php echo get_post_meta( $post_id , '_sku', true); ?> " />
2021-02-03 06:44:54 -05:00
</ label >
</ td >
</ tr >
2020-12-14 07:10:30 -05:00
2021-02-03 06:44:54 -05:00
< tr >
2021-10-31 07:01:04 -04:00
< th >< span >< ? php esc_html_e ( 'Registration On/Off:' , 'mage-eventpress' ); ?> </span></th>
2021-02-03 06:44:54 -05:00
< td colspan = " 3 " >
< label >
2021-10-31 07:01:04 -04:00
< input class = " mp_opacity_zero " type = " checkbox " name = " mep_reg_status " < ? php echo esc_attr ( $reg_checked ); ?> />
2020-12-14 07:10:30 -05:00
< span class = " slider round " ></ span >
</ label >
</ td >
2022-08-23 02:57:23 -04:00
</ tr > -->
2020-12-14 07:10:30 -05:00
< ? php
2020-12-13 07:25:42 -05:00
}
2020-12-14 07:10:30 -05:00
public function mp_event_available_seat_status ( $post_id )
{
$values = get_post_custom ( $post_id );
wp_nonce_field ( 'mep_event_reg_btn_nonce' , 'mep_event_reg_btn_nonce' );
2020-12-13 07:25:42 -05:00
$seat_checked = '' ;
2020-12-14 07:10:30 -05:00
if ( array_key_exists ( 'mep_available_seat' , $values )) {
if ( $values [ 'mep_available_seat' ][ 0 ] == 'on' ) {
2020-12-13 07:25:42 -05:00
$seat_checked = 'checked' ;
}
} else {
$seat_checked = 'checked' ;
}
2020-12-14 07:10:30 -05:00
?>
< tr >
2021-10-31 07:01:04 -04:00
< th >< span >< ? php esc_html_e ( 'Show Available Seat?' , 'mage-eventpress' ); ?> </span></th>
2020-12-14 07:10:30 -05:00
< td colspan = " 3 " >
< label >
2021-10-31 07:01:04 -04:00
< input class = " mp_opacity_zero " type = " checkbox " name = " mep_available_seat " < ? php echo esc_attr ( $seat_checked ); ?> />
2020-12-14 07:10:30 -05:00
< span class = " slider round " ></ span >
</ label >
</ td >
</ tr >
< ? php
}
public function mp_event_reset_booking_count ( $post_id )
{
wp_nonce_field ( 'mep_event_reset_btn_nonce' , 'mep_event_reset_btn_nonce' );
?>
< tr >
2021-10-31 07:01:04 -04:00
< th >< span >< ? php esc_html_e ( 'Reset Booking Count :' , 'mage-eventpress' ); ?> </span></th>
2020-12-14 07:10:30 -05:00
< td colspan = " 3 " >
< label >
< input class = " mp_opacity_zero " type = " checkbox " name = " mep_reset_status " class = " switch_checkbox " />
< span class = " slider round " ></ span >
2021-10-31 07:01:04 -04:00
< span style = " padding: 0 0 0 60px; " >< ? php esc_html_e ( 'Current Booking Status :' , 'mage-eventpress' ); ?> </span>
2020-12-14 07:10:30 -05:00
< span >< ? php mep_get_event_total_seat ( $post_id ); ?> </span>
</ label >
</ td >
</ tr >
< tr >
< td colspan = " 4 " >
< p class = " event_meta_help_txt " >
2021-10-31 07:01:04 -04:00
< ? php esc_html_e ( 'If you reset this count, All booking information will be removed including attendee list & its impossible to undo' , 'mage-eventpress' ); ?>
2020-12-14 07:10:30 -05:00
</ p >
</ td >
</ tr >
< ? php
2020-12-13 07:25:42 -05:00
}
2020-12-14 07:10:30 -05:00
public function mp_event_speaker_ticket_type ( $post_id )
{
$event_label = mep_get_option ( 'mep_event_label' , 'general_setting_sec' , 'Events' );
2021-02-25 06:55:25 -05:00
$event_type = get_post_meta ( $post_id , 'mep_event_type' , true );
$event_member_type = get_post_meta ( $post_id , 'mep_member_only_event' , true );
$saved_user_role = get_post_meta ( $post_id , 'mep_member_only_user_role' , true ) ? get_post_meta ( $post_id , 'mep_member_only_user_role' , true ) : [];
2021-11-12 01:49:30 -05:00
$description = html_entity_decode ( get_post_meta ( $post_id , 'mp_event_virtual_type_des' , true ));
2021-02-25 06:55:25 -05:00
$checked = ( $event_type == 'online' ) ? 'checked' : '' ;
$member_checked = ( $event_member_type == 'member_only' ) ? 'checked' : '' ;
2020-12-14 07:10:30 -05:00
?>
2022-08-23 02:57:23 -04:00
<!-- < tr >
2021-10-31 07:01:04 -04:00
< th >< span >< ? php esc_html_e ( 'Virtual ' , 'mage-eventpress' );
echo esc_html ( $event_label . '?' ); ?> </span></th>
2020-12-14 07:10:30 -05:00
< td colspan = " 3 " >
< label class = " mp_event_virtual_type_des_switch " >
2021-10-31 07:01:04 -04:00
< input class = " mp_opacity_zero " type = " checkbox " name = " mep_event_type " < ? php echo esc_attr ( $checked ); ?> />
2020-12-14 07:10:30 -05:00
< span class = " slider round " ></ span >
</ label >
2020-12-17 06:28:55 -05:00
< p ></ p >
2021-10-31 07:01:04 -04:00
< label class = " mp_event_virtual_type_des <?php echo ( $event_type == 'online') ? esc_attr('active') : ''; ?> " >
2021-11-12 01:49:30 -05:00
< ? php wp_editor ( html_entity_decode ( nl2br ( $description )), 'mp_event_virtual_type_des' ); ?>
2021-10-31 07:01:04 -04:00
< p class = " event_meta_help_txt " >< ? php esc_html_e ( 'Please Enter Your Virtual event joining details Information. these information will send to buyer with confirmation email.' , 'mage-eventpress' ) ?> </p>
2020-12-14 07:10:30 -05:00
</ label >
</ td >
2022-08-23 02:57:23 -04:00
</ tr > -->
2021-02-25 06:55:25 -05:00
< tr >
2021-10-31 07:01:04 -04:00
< th >< span >< ? php esc_html_e ( 'Member Only Event?' , 'mage-eventpress' ); ?> </span></th>
2021-02-25 06:55:25 -05:00
< td colspan = " 3 " >
< label class = " mp_event_virtual_type_des_switch " >
2021-10-31 07:01:04 -04:00
< input class = " mp_opacity_zero " type = " checkbox " name = " mep_member_only_event " < ? php echo esc_attr ( $member_checked ); ?> />
2021-02-25 06:55:25 -05:00
< span class = " slider round " ></ span >
</ label >
< p ></ p >
2021-10-31 07:01:04 -04:00
< label class = " mp_event_virtual_type_des <?php echo ( $event_member_type == 'member_only') ? esc_attr('active') : ''; ?> " >
2021-02-25 06:55:25 -05:00
< select name = 'mep_member_only_user_role[]' multiple >
2021-11-12 01:49:30 -05:00
< option value = " all " < ? php if ( in_array ( 'all' , $saved_user_role )) { echo esc_attr ( 'Selected' ); } ?> ><?php esc_html_e('For Any Logged in user', 'mage-eventpress'); ?> </option>
2021-02-25 06:55:25 -05:00
< ? php echo mep_get_user_list ( $saved_user_role ); ?>
2021-10-29 02:57:05 -04:00
</ select >
2021-02-25 06:55:25 -05:00
</ label >
</ td >
</ tr >
2020-12-14 07:10:30 -05:00
< ? php
2020-12-13 07:25:42 -05:00
}
2020-12-14 07:10:30 -05:00
public function mp_event_tax ( $post_id )
{
$values = get_post_custom ( $post_id );
wp_nonce_field ( 'mep_event_reg_btn_nonce' , 'mep_event_reg_btn_nonce' );
if ( array_key_exists ( '_tax_status' , $values )) {
2020-12-13 07:25:42 -05:00
$tx_status = $values [ '_tax_status' ][ 0 ];
} else {
$tx_status = '' ;
}
2020-12-14 07:10:30 -05:00
if ( array_key_exists ( '_tax_class' , $values )) {
2020-12-13 07:25:42 -05:00
$tx_class = $values [ '_tax_class' ][ 0 ];
} else {
$tx_class = '' ;
}
2020-12-14 07:10:30 -05:00
?>
< table >
< tr >
2021-10-31 07:01:04 -04:00
< th >< span >< ? php esc_html_e ( 'Tax status:' , 'mage-eventpress' ); ?> </span></th>
2020-12-14 07:10:30 -05:00
< td colspan = " 3 " >
< label >
< select class = " mp_formControl " name = " _tax_status " >
2021-10-31 07:01:04 -04:00
< option value = " taxable " < ? php echo ( $tx_status == 'taxable' ) ? esc_attr ( 'selected' ) : '' ; ?> ><?php esc_html_e('Taxable', 'mage-eventpress'); ?></option>
< option value = " shipping " < ? php echo ( $tx_status == 'shipping' ) ? esc_attr ( 'selected' ) : '' ; ?> ><?php esc_html_e('Shipping only', 'mage-eventpress'); ?></option>
< option value = " none " < ? php echo ( $tx_status == 'none' ) ? esc_attr ( 'selected' ) : '' ; ?> ><?php esc_html_e('None', 'mage-eventpress'); ?></option>
2020-12-14 07:10:30 -05:00
</ select >
</ label >
</ td >
</ tr >
< tr >
2021-10-31 07:01:04 -04:00
< th >< span >< ? php esc_html_e ( 'Tax class:' , 'mage-eventpress' ); ?> </span></th>
2021-10-29 02:57:05 -04:00
< td colspan = " 3 " >
2020-12-14 07:10:30 -05:00
< label >
< select class = " mp_formControl " name = " _tax_class " >
2021-10-31 07:01:04 -04:00
< option value = " standard " < ? php echo ( $tx_class == 'standard' ) ? esc_attr ( 'selected' ) : '' ; ?> ><?php esc_html_e('Standard', 'mage-eventpress'); ?></option>
2021-02-03 23:01:42 -05:00
< ? php mep_get_all_tax_list ( $tx_class ); ?>
2020-12-14 07:10:30 -05:00
</ select >
</ label >
< p class = " event_meta_help_txt " >
2021-10-31 07:01:04 -04:00
< ? php esc_html_e ( 'To add any new tax class , Please go to WooCommerce ->Settings->Tax Area' , 'mage-eventpress' ); ?>
2020-12-14 07:10:30 -05:00
</ p >
</ td >
</ tr >
</ table >
< ? php
2020-12-13 07:25:42 -05:00
}
//side meta box
2020-12-14 07:10:30 -05:00
public function mep_event_template_meta_box_cb ( $post )
{
$values = get_post_custom ( $post -> ID );
2022-04-12 01:00:35 -04:00
$global_template = mep_get_option ( 'mep_global_single_template' , 'single_event_setting_sec' , 'theme-2' );
2020-12-14 07:10:30 -05:00
if ( array_key_exists ( 'mep_event_template' , $values )) {
2020-12-13 07:25:42 -05:00
$current_template = $values [ 'mep_event_template' ][ 0 ];
} else {
$current_template = '' ;
}
2020-12-14 07:10:30 -05:00
if ( $current_template ) {
2020-12-13 07:25:42 -05:00
$_current_template = $current_template ;
} else {
$_current_template = $global_template ;
}
2020-12-14 07:10:30 -05:00
?>
< div class = 'sec' >
< span >< ? php event_single_template_list ( $_current_template ); ?> </span>
</ div >
< ? php
2020-12-13 07:25:42 -05:00
}
2019-04-17 07:54:24 -04:00
}
2020-12-13 07:25:42 -05:00
new MP_Event_All_Info_In_One ();
2018-07-05 06:10:06 -04:00
2018-07-02 04:39:41 -04:00
2020-12-14 07:10:30 -05:00
add_action ( 'save_post' , 'mep_events_ticket_type_save' );
function mep_events_ticket_type_save ( $post_id )
{
2020-12-13 07:25:42 -05:00
global $wpdb ;
2018-07-02 04:39:41 -04:00
2020-12-14 07:10:30 -05:00
if (
! isset ( $_POST [ 'mep_event_ticket_type_nonce' ]) ||
! wp_verify_nonce ( $_POST [ 'mep_event_ticket_type_nonce' ], 'mep_event_ticket_type_nonce' )
) {
2020-12-13 07:25:42 -05:00
return ;
}
2018-07-02 04:39:41 -04:00
2020-12-14 07:10:30 -05:00
if ( defined ( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
2020-12-13 07:25:42 -05:00
return ;
}
2018-07-02 04:39:41 -04:00
2020-12-14 07:10:30 -05:00
if ( ! current_user_can ( 'edit_post' , $post_id )) {
2020-12-13 07:25:42 -05:00
return ;
}
2018-07-02 04:39:41 -04:00
2020-12-14 07:10:30 -05:00
if ( get_post_type ( $post_id ) == 'mep_events' ) {
2018-07-02 04:39:41 -04:00
2020-12-14 07:10:30 -05:00
$old = get_post_meta ( $post_id , 'mep_event_ticket_type' , true ) ? get_post_meta ( $post_id , 'mep_event_ticket_type' , true ) : array ();
2018-07-02 04:39:41 -04:00
2021-03-22 08:13:03 -04:00
$new = array ();
2021-10-29 02:57:05 -04:00
$names = $_POST [ 'option_name_t' ] ? mage_array_strip ( $_POST [ 'option_name_t' ]) : array ();
$ticket_price = $_POST [ 'option_price_t' ] ? mage_array_strip ( $_POST [ 'option_price_t' ]) : array ();
$qty = $_POST [ 'option_qty_t' ] ? mage_array_strip ( $_POST [ 'option_qty_t' ]) : array ();
$dflt_qty = $_POST [ 'option_default_qty_t' ] ? mage_array_strip ( $_POST [ 'option_default_qty_t' ]) : array ();
$rsv = $_POST [ 'option_rsv_t' ] ? mage_array_strip ( $_POST [ 'option_rsv_t' ]) : array ();
$qty_type = $_POST [ 'option_qty_t_type' ] ? mage_array_strip ( $_POST [ 'option_qty_t_type' ]) : array ();
$sale_end_date = $_POST [ 'option_sale_end_date' ] ? mage_array_strip ( $_POST [ 'option_sale_end_date' ]) : array ();
$sale_end_time = $_POST [ 'option_sale_end_time' ] ? mage_array_strip ( $_POST [ 'option_sale_end_time' ]) : array ();
2018-07-02 04:39:41 -04:00
2020-12-14 07:10:30 -05:00
$count = count ( $names );
2018-07-02 04:39:41 -04:00
2020-12-14 07:10:30 -05:00
for ( $i = 0 ; $i < $count ; $i ++ ) {
2018-07-02 04:39:41 -04:00
2020-12-14 07:10:30 -05:00
if ( $names [ $i ] != '' ) :
2021-10-31 07:01:04 -04:00
$new [ $i ][ 'option_name_t' ] = stripslashes ( strip_tags ( $names [ $i ]));
2020-12-13 07:25:42 -05:00
endif ;
2018-07-02 04:39:41 -04:00
2020-12-14 07:10:30 -05:00
if ( $ticket_price [ $i ] != '' ) :
2021-10-31 07:01:04 -04:00
$new [ $i ][ 'option_price_t' ] = stripslashes ( strip_tags ( $ticket_price [ $i ]));
2020-12-13 07:25:42 -05:00
endif ;
2018-07-05 06:10:06 -04:00
2020-12-14 07:10:30 -05:00
if ( $qty [ $i ] != '' ) :
2021-10-31 07:01:04 -04:00
$new [ $i ][ 'option_qty_t' ] = stripslashes ( strip_tags ( $qty [ $i ]));
2020-12-13 07:25:42 -05:00
endif ;
2019-04-17 07:54:24 -04:00
2020-12-14 07:10:30 -05:00
if ( $rsv [ $i ] != '' ) :
2021-10-31 07:01:04 -04:00
$new [ $i ][ 'option_rsv_t' ] = stripslashes ( strip_tags ( $rsv [ $i ]));
2020-12-13 07:25:42 -05:00
endif ;
2019-01-31 06:55:36 -05:00
2020-12-14 07:10:30 -05:00
if ( $dflt_qty [ $i ] != '' ) :
2021-10-31 07:01:04 -04:00
$new [ $i ][ 'option_default_qty_t' ] = stripslashes ( strip_tags ( $dflt_qty [ $i ]));
2020-12-13 07:25:42 -05:00
endif ;
2018-07-02 04:39:41 -04:00
2020-12-14 07:10:30 -05:00
if ( $qty_type [ $i ] != '' ) :
2021-10-31 07:01:04 -04:00
$new [ $i ][ 'option_qty_t_type' ] = stripslashes ( strip_tags ( $qty_type [ $i ]));
2020-12-13 07:25:42 -05:00
endif ;
2021-01-25 00:15:36 -05:00
2021-02-08 05:25:56 -05:00
if ( $sale_end_date [ $i ] != '' ) :
2021-10-31 07:01:04 -04:00
$new [ $i ][ 'option_sale_end_date' ] = stripslashes ( strip_tags ( $sale_end_date [ $i ]));
2021-02-08 05:25:56 -05:00
endif ;
if ( $sale_end_time [ $i ] != '' ) :
2021-10-31 07:01:04 -04:00
$new [ $i ][ 'option_sale_end_time' ] = stripslashes ( strip_tags ( $sale_end_time [ $i ]));
2021-02-08 05:25:56 -05:00
endif ;
if ( $sale_end_date [ $i ] != '' ) :
2021-10-31 07:01:04 -04:00
$new [ $i ][ 'option_sale_end_date_t' ] = stripslashes ( strip_tags ( $sale_end_date [ $i ] . ' ' . $sale_end_time [ $i ]));
2021-01-25 00:15:36 -05:00
endif ;
2020-12-13 07:25:42 -05:00
}
2018-07-02 04:39:41 -04:00
2020-12-14 07:10:30 -05:00
$ticket_type_list = apply_filters ( 'mep_ticket_type_arr_save' , $new );
2018-07-02 04:39:41 -04:00
2020-12-14 07:10:30 -05:00
if ( ! empty ( $ticket_type_list ) && $ticket_type_list != $old ) {
update_post_meta ( $post_id , 'mep_event_ticket_type' , $ticket_type_list );
} elseif ( empty ( $ticket_type_list ) && $old ) {
delete_post_meta ( $post_id , 'mep_event_ticket_type' , $old );
2020-12-13 07:25:42 -05:00
}
}
2019-04-17 07:54:24 -04:00
}
2018-07-02 04:39:41 -04:00
2020-12-14 07:10:30 -05:00
add_action ( 'save_post' , 'mep_events_repeatable_meta_box_save' );
function mep_events_repeatable_meta_box_save ( $post_id )
{
2020-12-13 07:25:42 -05:00
global $wpdb ;
$table_name = $wpdb -> prefix . 'event_extra_options' ;
2020-12-14 07:10:30 -05:00
if (
! isset ( $_POST [ 'mep_events_extra_price_nonce' ]) ||
! wp_verify_nonce ( $_POST [ 'mep_events_extra_price_nonce' ], 'mep_events_extra_price_nonce' )
) {
2020-12-13 07:25:42 -05:00
return ;
}
2018-07-02 04:39:41 -04:00
2020-12-14 07:10:30 -05:00
if ( defined ( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
2020-12-13 07:25:42 -05:00
return ;
}
2018-07-02 04:39:41 -04:00
2020-12-14 07:10:30 -05:00
if ( ! current_user_can ( 'edit_post' , $post_id )) {
2020-12-13 07:25:42 -05:00
return ;
}
2018-07-02 04:39:41 -04:00
2020-12-14 07:10:30 -05:00
if ( get_post_type ( $post_id ) == 'mep_events' ) {
2021-10-29 17:14:29 -04:00
2021-01-26 01:04:24 -05:00
$old = get_post_meta ( $post_id , 'mep_events_extra_prices' , true );
$new = array ();
2021-10-29 02:57:05 -04:00
$names = isset ( $_POST [ 'option_name' ]) ? mage_array_strip ( $_POST [ 'option_name' ]) : [];
$urls = isset ( $_POST [ 'option_price' ]) ? mage_array_strip ( $_POST [ 'option_price' ]) : [];
$qty = isset ( $_POST [ 'option_qty' ]) ? mage_array_strip ( $_POST [ 'option_qty' ]) : [];
2021-10-29 17:14:29 -04:00
$qty_type = isset ( $_POST [ 'option_qty_type' ]) ? mage_array_strip ( $_POST [ 'option_qty_type' ]) : [];
2020-12-13 07:25:42 -05:00
$order_id = 0 ;
2020-12-14 07:10:30 -05:00
$count = count ( $names );
2018-07-02 04:39:41 -04:00
2020-12-14 07:10:30 -05:00
for ( $i = 0 ; $i < $count ; $i ++ ) {
if ( $names [ $i ] != '' ) :
$new [ $i ][ 'option_name' ] = stripslashes ( strip_tags ( $names [ $i ]));
2020-12-13 07:25:42 -05:00
endif ;
2018-07-02 04:39:41 -04:00
2020-12-14 07:10:30 -05:00
if ( $urls [ $i ] != '' ) :
$new [ $i ][ 'option_price' ] = stripslashes ( strip_tags ( $urls [ $i ]));
2020-12-13 07:25:42 -05:00
endif ;
2019-04-17 07:54:24 -04:00
2020-12-14 07:10:30 -05:00
if ( $qty [ $i ] != '' ) :
$new [ $i ][ 'option_qty' ] = stripslashes ( strip_tags ( $qty [ $i ]));
2020-12-13 07:25:42 -05:00
endif ;
2018-07-02 04:39:41 -04:00
2020-12-14 07:10:30 -05:00
if ( $qty_type [ $i ] != '' ) :
$new [ $i ][ 'option_qty_type' ] = stripslashes ( strip_tags ( $qty_type [ $i ]));
2020-12-13 07:25:42 -05:00
endif ;
}
2018-07-02 04:39:41 -04:00
2020-12-14 07:10:30 -05:00
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 );
2020-12-13 07:25:42 -05:00
}
}
2019-04-17 07:54:24 -04:00
}
2018-07-02 04:39:41 -04:00
2020-12-14 07:10:30 -05:00
2020-05-08 06:09:24 -04:00
/**
* Now Saving the Event Meta Field Data
*/
2020-12-14 07:10:30 -05:00
add_action ( 'save_post' , 'mep_event_meta_save' );
function mep_event_meta_save ( $post_id )
{
2021-02-09 00:57:05 -05:00
global $wpdb ;
$table_name = $wpdb -> prefix . " posts " ;
2020-12-13 07:25:42 -05:00
2020-12-14 07:10:30 -05:00
if ( ! isset ( $_POST [ 'mep_event_ricn_text_nonce' ]) || ! wp_verify_nonce ( $_POST [ 'mep_event_ricn_text_nonce' ], 'mep_event_ricn_text_nonce' )) {
2020-12-13 07:25:42 -05:00
return ;
}
2020-12-14 07:10:30 -05:00
if ( defined ( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
2020-12-13 07:25:42 -05:00
return ;
}
2020-12-14 07:10:30 -05:00
if ( ! current_user_can ( 'edit_post' , $post_id )) {
2020-12-13 07:25:42 -05:00
return ;
}
/**
* If the saving post is event then go on
*/
2020-12-14 07:10:30 -05:00
if ( get_post_type ( $post_id ) == 'mep_events' ) {
$pid = $post_id ;
$oldm = get_post_meta ( $post_id , 'mep_event_more_date' , true );
2021-10-29 02:57:05 -04:00
$more_start_date = isset ( $_POST [ 'event_more_start_date' ]) ? mage_array_strip ( $_POST [ 'event_more_start_date' ]) : array ();
$more_start_time = isset ( $_POST [ 'event_more_start_time' ]) ? mage_array_strip ( $_POST [ 'event_more_start_time' ]) : '' ;
$more_end_date = isset ( $_POST [ 'event_more_end_date' ]) ? mage_array_strip ( $_POST [ 'event_more_end_date' ]) : '' ;
$more_end_time = isset ( $_POST [ 'event_more_end_time' ]) ? mage_array_strip ( $_POST [ 'event_more_end_time' ]) : '' ;
2020-12-13 07:25:42 -05:00
$mdate = [];
2021-02-09 00:57:05 -05:00
2020-12-14 07:10:30 -05:00
$mcount = count ( $more_start_date );
2020-12-13 07:25:42 -05:00
2020-12-14 07:10:30 -05:00
for ( $m = 0 ; $m < $mcount ; $m ++ ) {
if ( $more_start_date [ $m ] != '' ) :
2021-09-20 01:52:52 -04:00
$mdate [ $m ][ 'event_more_start_date' ] = stripslashes ( sanitize_text_field ( $more_start_date [ $m ]));
$mdate [ $m ][ 'event_more_start_time' ] = stripslashes ( sanitize_text_field ( $more_start_time [ $m ]));
$mdate [ $m ][ 'event_more_end_date' ] = stripslashes ( sanitize_text_field ( $more_end_date [ $m ]));
$mdate [ $m ][ 'event_more_end_time' ] = stripslashes ( sanitize_text_field ( $more_end_time [ $m ]));
2020-12-13 07:25:42 -05:00
endif ;
}
2021-09-20 01:52:52 -04:00
$event_rt_status = sanitize_text_field ( $_POST [ 'mep_rt_event_status' ]);
$event_rt_atdnce_mode = sanitize_text_field ( $_POST [ 'mep_rt_event_attandence_mode' ]);
$event_rt_prv_date = sanitize_text_field ( $_POST [ 'mep_rt_event_prvdate' ]);
$seat = 0 ;
$rsvs = 0 ;
$mep_location_venue = isset ( $_POST [ 'mep_location_venue' ]) ? sanitize_text_field ( $_POST [ 'mep_location_venue' ]) : " " ;
$mep_street = isset ( $_POST [ 'mep_street' ]) ? sanitize_text_field ( $_POST [ 'mep_street' ]) : " " ;
$mep_city = isset ( $_POST [ 'mep_city' ]) ? sanitize_text_field ( $_POST [ 'mep_city' ]) : " " ;
$mep_state = isset ( $_POST [ 'mep_state' ]) ? sanitize_text_field ( $_POST [ 'mep_state' ]) : " " ;
$mep_postcode = isset ( $_POST [ 'mep_postcode' ]) ? sanitize_text_field ( $_POST [ 'mep_postcode' ]) : " " ;
$mep_country = isset ( $_POST [ 'mep_country' ]) ? sanitize_text_field ( $_POST [ 'mep_country' ]) : " " ;
$mep_sgm = isset ( $_POST [ 'mep_sgm' ]) ? sanitize_text_field ( $_POST [ 'mep_sgm' ]) : " " ;
$mep_org_address = isset ( $_POST [ 'mep_org_address' ]) ? sanitize_text_field ( $_POST [ 'mep_org_address' ]) : " " ;
$_price = isset ( $_POST [ '_price' ]) ? sanitize_text_field ( $_POST [ '_price' ]) : " " ;
$event_start_date = sanitize_text_field ( $_POST [ 'event_start_date' ]);
$event_start_time = sanitize_text_field ( $_POST [ 'event_start_time' ]);
$event_end_date = sanitize_text_field ( $_POST [ 'event_end_date' ]);
$event_end_time = sanitize_text_field ( $_POST [ 'event_end_time' ]);
$latitude = isset ( $_POST [ 'latitude' ]) ? sanitize_text_field ( $_POST [ 'latitude' ]) : " " ;
$longitude = isset ( $_POST [ 'latitude' ]) ? sanitize_text_field ( $_POST [ 'longitude' ]) : " " ;
$location_name = isset ( $_POST [ 'location_name' ]) ? sanitize_text_field ( $_POST [ 'location_name' ]) : " " ;
$mep_full_name = isset ( $_POST [ 'mep_full_name' ]) ? sanitize_text_field ( $_POST [ 'mep_full_name' ]) : " " ;
$mep_reg_email = isset ( $_POST [ 'mep_reg_email' ]) ? sanitize_text_field ( $_POST [ 'mep_reg_email' ]) : " " ;
$mep_reg_phone = isset ( $_POST [ 'mep_reg_phone' ]) ? sanitize_text_field ( $_POST [ 'mep_reg_phone' ]) : " " ;
$mep_reg_address = isset ( $_POST [ 'mep_reg_address' ]) ? sanitize_text_field ( $_POST [ 'mep_reg_address' ]) : " " ;
$mep_reg_designation = isset ( $_POST [ 'mep_reg_designation' ]) ? sanitize_text_field ( $_POST [ 'mep_reg_designation' ]) : " " ;
$mep_reg_website = isset ( $_POST [ 'mep_reg_website' ]) ? sanitize_text_field ( $_POST [ 'mep_reg_website' ]) : " " ;
$mep_reg_veg = isset ( $_POST [ 'mep_reg_veg' ]) ? sanitize_text_field ( $_POST [ 'mep_reg_veg' ]) : " " ;
$mep_reg_company = isset ( $_POST [ 'mep_reg_company' ]) ? sanitize_text_field ( $_POST [ 'mep_reg_company' ]) : " " ;
$mep_reg_gender = isset ( $_POST [ 'mep_reg_gender' ]) ? sanitize_text_field ( $_POST [ 'mep_reg_gender' ]) : " " ;
$mep_reg_tshirtsize = isset ( $_POST [ 'mep_reg_tshirtsize' ]) ? sanitize_text_field ( $_POST [ 'mep_reg_tshirtsize' ]) : " " ;
$mep_reg_tshirtsize_list = isset ( $_POST [ 'mep_reg_tshirtsize_list' ]) ? sanitize_text_field ( $_POST [ 'mep_reg_tshirtsize_list' ]) : " " ;
$mep_event_template = isset ( $_POST [ 'mep_event_template' ]) ? sanitize_text_field ( $_POST [ 'mep_event_template' ]) : " " ;
2020-12-14 07:10:30 -05:00
2021-01-26 01:04:24 -05:00
$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 ;
2020-12-14 07:10:30 -05:00
2021-09-20 01:52:52 -04:00
$mep_reg_status = isset ( $_POST [ 'mep_reg_status' ]) ? sanitize_text_field ( $_POST [ 'mep_reg_status' ]) : 'off' ;
$mep_show_end_datetime = isset ( $_POST [ 'mep_show_end_datetime' ]) ? sanitize_text_field ( $_POST [ 'mep_show_end_datetime' ]) : 'no' ;
$mep_reset_status = isset ( $_POST [ 'mep_reset_status' ]) ? sanitize_text_field ( $_POST [ 'mep_reset_status' ]) : 'off' ;
$mep_available_seat = isset ( $_POST [ 'mep_available_seat' ]) ? sanitize_text_field ( $_POST [ 'mep_available_seat' ]) : 'off' ;
$_tax_status = isset ( $_POST [ '_tax_status' ]) ? sanitize_text_field ( $_POST [ '_tax_status' ]) : 'none' ;
$_tax_class = isset ( $_POST [ '_tax_class' ]) ? sanitize_text_field ( $_POST [ '_tax_class' ]) : '' ;
2021-10-29 02:57:05 -04:00
$mep_member_only_user_role = isset ( $_POST [ 'mep_member_only_user_role' ]) ? mage_array_strip ( maybe_unserialize ( $_POST [ 'mep_member_only_user_role' ])) : maybe_unserialize ( array ( 'all' ));
2021-09-20 01:52:52 -04:00
$sku = isset ( $_POST [ 'mep_event_sku' ]) ? sanitize_text_field ( $_POST [ 'mep_event_sku' ]) : $post_id ;
$mep_rich_text_status = isset ( $_POST [ 'mep_rich_text_status' ]) ? sanitize_text_field ( $_POST [ 'mep_rich_text_status' ]) : 'enable' ;
2020-12-14 07:10:30 -05:00
if ( $mep_reset_status == 'on' ) {
mep_reset_event_booking ( $post_id );
}
2021-09-03 06:25:05 -04:00
update_post_meta ( $post_id , 'mep_show_end_datetime' , $mep_show_end_datetime );
2020-12-30 00:23:11 -05:00
update_post_meta ( $post_id , 'mep_rich_text_status' , $mep_rich_text_status );
2020-12-14 07:10:30 -05:00
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 ( $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 );
2021-01-25 00:15:36 -05:00
2020-12-14 07:10:30 -05:00
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 , '_stock' , $seat );
2021-01-25 00:15:36 -05:00
2020-12-14 07:10:30 -05:00
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' );
2021-10-29 02:57:05 -04:00
2020-12-14 07:10:30 -05:00
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' );
2021-02-03 06:44:54 -05:00
update_post_meta ( $pid , '_sku' , $sku );
2021-02-25 06:55:25 -05:00
update_post_meta ( $pid , 'mep_member_only_user_role' , $mep_member_only_user_role );
2020-12-14 07:10:30 -05:00
2021-10-29 23:39:27 -04:00
if ( isset ( $_POST [ 'mep_event_type' ]) && mage_array_strip ( $_POST [ 'mep_event_type' ])) {
2020-12-13 07:25:42 -05:00
$mep_event_type = 'online' ;
} else {
$mep_event_type = 'offline' ;
}
2021-10-29 23:39:27 -04:00
if ( isset ( $_POST [ 'mep_member_only_event' ]) && mage_array_strip ( $_POST [ 'mep_member_only_event' ])) {
2021-02-25 06:55:25 -05:00
$mep_event_member_type = 'member_only' ;
} else {
$mep_event_member_type = 'for_all' ;
}
update_post_meta ( $pid , 'mep_member_only_event' , $mep_event_member_type );
2020-12-14 07:10:30 -05:00
update_post_meta ( $pid , 'mep_event_type' , $mep_event_type );
2021-10-29 23:39:27 -04:00
$mp_event_virtual_type_des = isset ( $_POST [ 'mp_event_virtual_type_des' ]) ? htmlspecialchars ( mage_array_strip ( $_POST [ 'mp_event_virtual_type_des' ])) : " " ;
2020-12-14 07:10:30 -05:00
update_post_meta ( $pid , 'mp_event_virtual_type_des' , $mp_event_virtual_type_des );
2020-12-13 07:25:42 -05:00
2021-10-29 02:57:05 -04:00
2021-03-22 08:13:03 -04:00
$_mdate = apply_filters ( 'mep_more_date_arr_save' , $mdate );
2020-12-13 07:25:42 -05:00
2021-03-22 08:13:03 -04:00
if ( ! empty ( $_mdate ) && $_mdate != $oldm ) {
update_post_meta ( $post_id , 'mep_event_more_date' , $_mdate );
} elseif ( empty ( $_mdate ) && $oldm ) {
2020-12-14 07:10:30 -05:00
delete_post_meta ( $post_id , 'mep_event_more_date' , $oldm );
2020-12-13 07:25:42 -05:00
}
}
2021-09-20 01:52:52 -04:00
}