ID; $event_meta = get_post_custom($post_id); $event_expire_on = mep_get_option( 'mep_event_expire_on_datetimes', 'general_setting_sec', 'event_start_datetime'); $event_expire_date = $event_meta[$event_expire_on][0]; $event_sqi = $event_meta['mep_sqi'][0]; $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]); $event_ecternal_link = ''; $book_count = get_post_meta($post_id,'total_booking', true); if($book_count){ $total_book = $book_count; }else{ $total_book = 0; } if(array_key_exists('mep_rsv_seat', $event_meta)){ $simple_rsv = $event_meta['mep_rsv_seat'][0]; }else{ $simple_rsv = ''; } if($simple_rsv){ $simple_rsv = $simple_rsv; }else{ $simple_rsv = 0; } $total_book = ($total_book + $simple_rsv); $seat_left = ((int)$event_meta['mep_total_seat'][0]- (int)$total_book); $time = strtotime($event_expire_date); $newformat = date('Y-m-d H:i:s',$time); $datetime1 = new DateTime(); $datetime2 = new DateTime($newformat); $interval = $datetime1->diff($datetime2); $mep_event_ticket_type = get_post_meta($post_id, 'mep_event_ticket_type', true); $total_seat = mep_event_total_seat(get_the_id(),'total'); $total_resv = mep_event_total_seat(get_the_id(),'resv'); $total_sold = mep_ticket_sold(get_the_id()); $total_left = $total_seat - ($total_sold + $total_resv); if (is_array($mep_event_ticket_type) || is_object($mep_event_ticket_type)){ foreach ($mep_event_ticket_type as $field ) { $qm = $field['option_name_t']; } }else{$qm='';} if($mep_event_ticket_type){ $seat_left = $total_left; }else{ $seat_left = $total_left; } $current = current_time('Y-m-d H:i:s'); $time = strtotime($event_expire_date); $newformat = date('Y-m-d H:i:s',$time); $recurring = get_post_meta($post_id, 'mep_enable_recurring', true) ? get_post_meta($post_id, 'mep_enable_recurring', true) : 'no'; if($recurring == 'yes'){ $event_more_dates = get_post_meta($post_id,'mep_event_more_date',true); $seat_left = 10; $md = end($event_more_dates); $more_date = $md['event_more_start_date'].' '.$md['event_more_start_time']; $newformat = date('Y-m-d H:i:s',strtotime($more_date)); } $default_timezone_val = get_option('timezone_string') ? get_option('timezone_string') : 'UTC'; date_default_timezone_set($default_timezone_val); $datetime1 = new DateTime($newformat); $datetime2 = new DateTime($current); $interval = date_diff($datetime2, $datetime1); if(strtotime(current_time('Y-m-d H:i:s')) > strtotime($newformat)){ ?> ID, 'mep_event_ticket_type', true); if(array_key_exists('mep_available_seat', $event_meta)){ $mep_available_seat = $event_meta['mep_available_seat'][0]; }else{ $mep_available_seat = 'on'; } $leftt = $total_left; $days = $interval->d; $hours = $interval->h; $minutes = $interval->i; if($days>0){ $dd = $days." days "; }else{ $dd=""; } if($hours>0){ $hh = $hours." hours "; }else{ $hh=""; } if($minutes>0){ $mm = $minutes." minutes "; }else{ $mm=""; } $qty_typec = $event_meta['qty_box_type'][0]; if(array_key_exists('mep_reg_status', $event_meta)){ $reg_status = $event_meta['mep_reg_status'][0]; }else{ $reg_status = ''; } if($reg_status!='off'){ ?>

0){ ?> "/>

ID, 'mep_event_ticket_type', true); if(!$mep_event_ticket_type){ if($qm){$qm=$qm;}else{$qm='';} ?>
ID; $event_meta = get_post_custom($post_id); $event_expire_date = $event_meta[mep_get_option( 'mep_event_expire_on_datetime', 'general_setting_sec', 'event_start_date' )][0]; $event_sqi = $event_meta['mep_sqi'][0]; $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]); $event_ecternal_link = ''; $book_count = get_post_meta($post_id,'total_booking', true); if($book_count){ $total_book = $book_count; }else{ $total_book = 0; } if(array_key_exists('mep_rsv_seat', $event_meta)){ $simple_rsv = $event_meta['mep_rsv_seat'][0]; }else{ $simple_rsv = ''; } if($simple_rsv){ $simple_rsv = $simple_rsv; }else{ $simple_rsv = 0; } $total_book = ($total_book + $simple_rsv); $seat_left = ((int)$event_meta['mep_total_seat'][0]- (int)$total_book); $time = strtotime($event_expire_date); $newformat = date('Y-m-d H:i:s',$time); $datetime1 = new DateTime(); $datetime2 = new DateTime($newformat); $interval = $datetime1->diff($datetime2); $mep_event_ticket_type = get_post_meta($post_id, 'mep_event_ticket_type', true); $stc = 0; $leftt = 0; if (is_array($mep_event_ticket_type) || is_object($mep_event_ticket_type)){ foreach ($mep_event_ticket_type as $field ) { $qm = $field['option_name_t']; $opt_qty = isset($field['option_qty_t']) ? $field['option_qty_t'] : 0; // $opt_rst_qty = $field['option_rsv_t'] ? $field['option_rsv_t'] : 0; $tesqn = $post_id.str_replace(' ', '', $qm); $tesq = get_post_meta($post_id,"mep_xtra_$tesqn",true); $stc = $stc+$opt_qty; $llft = ($opt_qty - (int)$tesq); $leftt = $leftt+$llft; } }else{$qm='';} if($mep_event_ticket_type){ $seat_left = $leftt; }else{ $seat_left = $seat_left; } $current = current_time('Y-m-d H:i:s'); $time = strtotime($event_expire_date); $newformat = date('Y-m-d H:i:s',$time); date_default_timezone_set(get_option('timezone_string')); $datetime1 = new DateTime($newformat); $datetime2 = new DateTime($current); $interval = date_diff($datetime2, $datetime1); // $days = $interval->days; // $hours = $interval->h; // $minutes = $interval->i; // if($days>0){ $dd = $days." days "; }else{ $dd=""; } // if($hours>0){ $hh = $hours." hours "; }else{ $hh=""; } // if($minutes>0){ $mm = $minutes." minutes "; }else{ $mm=""; } // echo "$dd $hh $mm"; if(time() > strtotime($newformat)){ ?> ID, 'mep_event_ticket_type', true); if(array_key_exists('mep_available_seat', $event_meta)){ $mep_available_seat = $event_meta['mep_available_seat'][0]; }else{ $mep_available_seat = 'on'; } if($mep_event_ticket_type){ $stc = 0; $leftt = 0; $res = 0; foreach ( $mep_event_ticket_type as $field ) { $qm = $field['option_name_t']; $opt_qty = isset($field['option_qty_t']) ? $field['option_qty_t'] : 0; $opt_rst_qty = isset($field['option_rsv_t']) ? $field['option_rsv_t'] : 0; $tesqn = $post->ID.str_replace(' ', '', $qm); $tesq = get_post_meta($post->ID,"mep_xtra_$tesqn",true); $stc = $stc+$opt_qty; $res = $res + (int)$opt_rst_qty; $res = (int)$res; $llft = ($opt_qty - (int)$tesq); $leftt = ($leftt+$llft); } $leftt = $leftt-$res; }else{ $leftt = $event_meta['mep_total_seat'][0]- $total_book; } $days = $interval->d; $hours = $interval->h; $minutes = $interval->i; if($days>0){ $dd = $days." days "; }else{ $dd=""; } if($hours>0){ $hh = $hours." hours "; }else{ $hh=""; } if($minutes>0){ $mm = $minutes." minutes "; }else{ $mm=""; } $qty_typec = $event_meta['qty_box_type'][0]; if(array_key_exists('mep_reg_status', $event_meta)){ $reg_status = $event_meta['mep_reg_status'][0]; }else{ $reg_status = ''; } if($reg_status!='off'){ ?>
ID, 'mep_event_ticket_type', true); if(array_key_exists('mep_available_seat', $event_meta)){ $mep_available_seat = $event_meta['mep_available_seat'][0]; }else{ $mep_available_seat = 'on'; } if($mep_event_ticket_type){ $stc = 0; $leftt = 0; $res = 0; foreach ( $mep_event_ticket_type as $field ) { $qm = $field['option_name_t']; $opt_qty = isset($field['option_qty_t']) ? $field['option_qty_t'] : 0; $opt_rst_qty = isset($field['option_rsv_t']) ? $field['option_rsv_t'] : 0; $tesqn = $post->ID.str_replace(' ', '', $qm); $tesq = get_post_meta($post->ID,"mep_xtra_$tesqn",true); $stc = $stc+$opt_qty; $res = $res + (int)$opt_rst_qty; $res = (int)$res; $llft = ($opt_qty - (int)$tesq); $leftt = ($leftt+$llft); } $leftt = $leftt-$res; }else{ $leftt = $event_meta['mep_total_seat'][0]- $total_book; } if($leftt>0){ do_action('mep_event_ticket_types_list'); do_action('mep_event_extra_service_list'); }else{ ?> 0){ ?> "/>

ID, 'mep_event_ticket_type', true); if(!$mep_event_ticket_type){ if($qm){$qm=$qm;}else{$qm='';} ?>