ID );
wp_nonce_field( 'mep_event_reset_btn_nonce', 'mep_event_reset_btn_nonce' );
?>
ID );
wp_nonce_field( 'mep_event_reg_btn_nonce', 'mep_event_reg_btn_nonce' );
?>
ID );
wp_nonce_field( 'mep_event_reg_btn_nonce', 'mep_event_reg_btn_nonce' );
echo $values['_tax_status'][0];
if(array_key_exists('_tax_status', $values)){ $tx_status = $values['_tax_status'][0]; }else{ $tx_status = ''; }
if(array_key_exists('_tax_class', $values)){ $tx_class = $values['_tax_class'][0]; }else{ $tx_class = ''; }
?>
ID );
wp_nonce_field( 'mep_event_reg_btn_nonce', 'mep_event_reg_btn_nonce' );
?>
/>
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');
?>
> Yes (If Yes, Organizer Address will show from organizer area.)
'>
'>
'>
'>
'>
'>
> Yes
'/>
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'; }
?>
ID );
?>
ID, 'mep_event_faq', true);
wp_nonce_field( 'mep_event_faq_nonce', 'mep_event_faq_nonce' );
?>
ID, 'mep_event_day', true);
wp_nonce_field( 'mep_event_day_nonce', 'mep_event_day_nonce' );
?>
ID, 'mep_events_extra_prices', true);
wp_nonce_field( 'mep_events_extra_price_nonce', 'mep_events_extra_price_nonce' );
?>
ID, 'mep_event_ticket_type', true);
wp_nonce_field( 'mep_event_ticket_type_nonce', 'mep_event_ticket_type_nonce' );
?>
ID );
$more_date = get_post_meta($post->ID, 'mep_event_more_date', true);
// print_r($values);
?>
'>
'>
ID );
?>
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){
$_current_template = $current_template;
}else{
$_current_template = $global_template;
}
?>
prefix . 'mep_event_ticket_type';
if ( ! isset( $_POST['mep_event_ticket_type_nonce'] ) ||
! wp_verify_nonce( $_POST['mep_event_ticket_type_nonce'], 'mep_event_ticket_type_nonce' ) )
return;
if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
return;
if (!current_user_can('edit_post', $post_id))
return;
if (get_post_type($post_id) == 'mep_events') {
$old = get_post_meta($post_id, 'mep_event_ticket_type', true);
$new = array();
// $options = hhs_get_sample_options();
$names = $_POST['option_name_t'];
// $selects = $_POST['select'];
$urls = $_POST['option_price_t'];
$qty = $_POST['option_qty_t'];
$rsv = $_POST['option_rsv_t'];
$qty_type = $_POST['option_qty_t_type'];
// $required = $_POST['option_required_t'];
// $total_sold = $_POST['option_sold'];
$order_id = 0;
$count = count( $names );
for ( $i = 0; $i < $count; $i++ ) {
if ( $names[$i] != '' ) :
$new[$i]['option_name_t'] = stripslashes( strip_tags( $names[$i] ) );
endif;
if ( $urls[$i] != '' ) :
$new[$i]['option_price_t'] = stripslashes( strip_tags( $urls[$i] ) );
endif;
if ( $qty[$i] != '' ) :
$new[$i]['option_qty_t'] = stripslashes( strip_tags( $qty[$i] ) );
endif;
if ( $qty[$i] != '' ) :
$new[$i]['option_rsv_t'] = stripslashes( strip_tags( $rsv[$i] ) );
endif;
if ( $qty_type[$i] != '' ) :
$new[$i]['option_qty_t_type'] = stripslashes( strip_tags( $qty_type[$i] ) );
endif;
// if ( $required[$i] != '' ) :
// $new[$i]['option_required_t'] = 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_event_ticket_type', $new );
elseif ( empty($new) && $old )
delete_post_meta( $post_id, 'mep_event_ticket_type', $old );
}
}
add_action('save_post', 'mep_events_repeatable_meta_box_save');
function mep_events_repeatable_meta_box_save($post_id) {
global $wpdb;
$table_name = $wpdb->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' ) )
return;
if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
return;
if (!current_user_can('edit_post', $post_id))
return;
if (get_post_type($post_id) == 'mep_events') {
$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 );
for ( $i = 0; $i < $count; $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] ) );
endif;
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] ) );
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 );
}
}
add_action('save_post','mep_events_meta_save');
function mep_events_meta_save($post_id){
global $post;
if($post){
$pid = $post->ID;
if ($post->post_type != 'mep_events'){
return;
}
}else{
$pid='';
}
if (get_post_type($post_id) == 'mep_events') {
$oldm = get_post_meta($post_id, 'mep_event_more_date', true);
$mdate = array();
// $options = hhs_get_sample_options();
if(isset($_POST['event_more_date'])){$more_date = $_POST['event_more_date'];}else{$more_date=array();}
$mcount = count( $more_date );
for ( $m = 0; $m < $mcount; $m++ ) {
if ( $more_date[$m] != '' ) :
$mdate[$m]['event_more_date'] = stripslashes( strip_tags( $more_date[$m] ) );
endif;
}
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 you get here then it's your post type so do your thing....
if(isset($_POST['mep_total_seat'])){
$seat = strip_tags($_POST['mep_total_seat']);
$rsvs = strip_tags($_POST['mep_rsv_seat']);
$mep_location_venue = strip_tags($_POST['mep_location_venue']);
$mep_street = strip_tags($_POST['mep_street']);
$mep_city = strip_tags($_POST['mep_city']);
$mep_state = strip_tags($_POST['mep_state']);
$mep_postcode = strip_tags($_POST['mep_postcode']);
$mep_country = strip_tags($_POST['mep_country']);
$mep_price_label = strip_tags($_POST['mep_price_label']);
$mep_sqi = strip_tags($_POST['mep_sqi']);
$qty_box_type = strip_tags($_POST['qty_box_type']);
$mep_sgm = strip_tags($_POST['mep_sgm']);
$mep_org_address = strip_tags($_POST['mep_org_address']);
$_price = strip_tags($_POST['_price']);
$mep_event_start_date = strip_tags($_POST['mep_event_start_date']);
$mep_event_end_date = strip_tags($_POST['mep_event_end_date']);
$mep_event_cc_email_text = strip_tags($_POST['mep_event_cc_email_text']);
$latitude = strip_tags($_POST['latitude']);
$longitude = strip_tags($_POST['longitude']);
$location_name = strip_tags($_POST['location_name']);
$mep_full_name = strip_tags($_POST['mep_full_name']);
$mep_reg_email = strip_tags($_POST['mep_reg_email']);
$mep_reg_phone = strip_tags($_POST['mep_reg_phone']);
$mep_reg_address = strip_tags($_POST['mep_reg_address']);
$mep_reg_designation = strip_tags($_POST['mep_reg_designation']);
$mep_reg_website = strip_tags($_POST['mep_reg_website']);
$mep_reg_veg = strip_tags($_POST['mep_reg_veg']);
$mep_reg_company = strip_tags($_POST['mep_reg_company']);
$mep_reg_gender = strip_tags($_POST['mep_reg_gender']);
$mep_reg_tshirtsize = strip_tags($_POST['mep_reg_tshirtsize']);
$mep_reg_tshirtsize_list = strip_tags($_POST['mep_reg_tshirtsize_list']);
$mep_event_template = strip_tags($_POST['mep_event_template']);
$update_reg_name = update_post_meta( $pid, 'mep_full_name', $mep_full_name);
$update_reg_email = update_post_meta( $pid, 'mep_reg_email', $mep_reg_email);
$update_reg_phone = update_post_meta( $pid, 'mep_reg_phone', $mep_reg_phone);
$update_reg_address = update_post_meta( $pid, 'mep_reg_address', $mep_reg_address);
$update_reg_desg = update_post_meta( $pid, 'mep_reg_designation', $mep_reg_designation);
$update_reg_web = update_post_meta( $pid, 'mep_reg_website', $mep_reg_website);
$update_reg_veg = update_post_meta( $pid, 'mep_reg_veg', $mep_reg_veg);
$update_reg_comapny = update_post_meta( $pid, 'mep_reg_company', $mep_reg_company);
$update_reg_gender = update_post_meta( $pid, 'mep_reg_gender', $mep_reg_gender);
$update_tshirtsize = update_post_meta( $pid, 'mep_reg_tshirtsize', $mep_reg_tshirtsize);
$mep_reg_tshirtsize_list = update_post_meta( $pid, 'mep_reg_tshirtsize_list', $mep_reg_tshirtsize_list);
$update_template = update_post_meta( $pid, 'mep_event_template', $mep_event_template);
$update_mep_org_address = update_post_meta( $pid, 'mep_org_address', $mep_org_address);
$mep_event_ticket_type = get_post_meta($pid, 'mep_event_ticket_type', true);
if($mep_event_ticket_type){
$st_msg = 'no';
$seat = "";
$_price =0;
$rsvs =0;
}else{
$st_msg = 'yes';
$_price = $_price;
$seat = $seat;
$rsvs = $rsvs;
}
$update_seat = update_post_meta( $pid, 'mep_total_seat', $seat);
$update_seat = update_post_meta( $pid, 'mep_rsv_seat', $rsvs);
$update_seat_stock_status = update_post_meta( $pid, '_manage_stock', $st_msg);
$update_seat_stock = update_post_meta( $pid, '_stock', $seat);
$sts_msg = update_post_meta( $pid, '_stock_msg', 'new');
// $ttl_booking = update_post_meta( $pid, 'total_booking', '0');
$longitude = update_post_meta( $pid, 'longitude', $longitude);
$latitude = update_post_meta( $pid, 'latitude', $latitude);
$location_name = update_post_meta( $pid, 'location_name', $location_name);
$update_location = update_post_meta( $pid, 'mep_location_venue', $mep_location_venue);
$update_mep_street = update_post_meta( $pid, 'mep_street', $mep_street);
$update_seat_stock_status = update_post_meta( $pid, '_sold_individually', 'no');
$update_city = update_post_meta( $pid, 'mep_city', $mep_city);
$update_mep_state = update_post_meta( $pid, 'mep_state', $mep_state);
$update_postcode = update_post_meta( $pid, 'mep_postcode', $mep_postcode);
$update_conuntry = update_post_meta( $pid, 'mep_country', $mep_country);
$update_sqi = update_post_meta( $pid, 'mep_sqi', $mep_sqi);
$qty_box_type = update_post_meta( $pid, 'qty_box_type', $qty_box_type);
$update_mep_sgm = update_post_meta( $pid, 'mep_sgm', $mep_sgm);
$update_price_label = update_post_meta( $pid, 'mep_price_label', $mep_price_label);
$update_price = update_post_meta( $pid, '_price', $_price);
$update_start = update_post_meta( $pid, 'mep_event_start_date', $mep_event_start_date);
$update_virtual = update_post_meta( $pid, '_virtual', 'yes');
$update_end = update_post_meta( $pid, 'mep_event_end_date', $mep_event_end_date);
$mep_event_cc_email_text = update_post_meta( $pid, 'mep_event_cc_email_text', $mep_event_cc_email_text);
$mep_event_sku = update_post_meta( $pid, '_sku', $pid);
}
}
}
add_action( 'add_meta_boxes', 'mep_meta_box_add' );
function mep_meta_box_add(){
add_meta_box( 'my-meta-box-id', 'Information', 'mep_meta_box_cb', 'mep_events_attendees', 'normal', 'high' );
}
function mep_meta_box_cb($post){
$values = get_post_custom( $post->ID );
$event_meta = get_post_custom($values['ea_event_id'][0]);
$ticket_type = get_post_meta( $post->ID, 'ea_ticket_type', true );
$mep_full_name = strip_tags($event_meta['mep_full_name'][0]);
$mep_reg_email = strip_tags($event_meta['mep_reg_email'][0]);
$mep_reg_phone = strip_tags($event_meta['mep_reg_phone'][0]);
$mep_reg_address = strip_tags($event_meta['mep_reg_address'][0]);
$mep_reg_designation = strip_tags($event_meta['mep_reg_designation'][0]);
$mep_reg_website = strip_tags($event_meta['mep_reg_website'][0]);
$mep_reg_veg = strip_tags($event_meta['mep_reg_veg'][0]);
$mep_reg_company = strip_tags($event_meta['mep_reg_company'][0]);
$mep_reg_gender = strip_tags($event_meta['mep_reg_gender'][0]);
$mep_reg_tshirtsize = strip_tags($event_meta['mep_reg_tshirtsize'][0]);
$order = wc_get_order( $values['ea_order_id'][0] );
foreach ( $order->get_items() as $item_id => $item_values ) {
$product_id = $item_values->get_product_id();
$item_data = $item_values->get_data();
$product_id = $item_data['product_id'];
$item_quantity = $item_values->get_quantity();
$product = get_page_by_title( $item_data['name'], OBJECT, 'mep_events' );
$event_name = $item_data['name'];
$event_id = $product->ID;
$item_id = $item_id;
}
$extra_info_arr = wc_get_order_item_meta($item_id,'_event_service_info',true);
?>
:
0){
$rs[] = $_exs['option_name']." (".$_exs['option_qty'].")";
if($ticket_type != $_exs['option_name']){
?>