version 2.5.9 released
This commit is contained in:
parent
b442c1a957
commit
9a88b3bc5c
|
@ -202,7 +202,8 @@ $meta = $_GET['meta_value'];
|
|||
|
||||
$posts = $wpdb->get_results($query);
|
||||
foreach ( $posts as $i=>$post ) {
|
||||
|
||||
$status = get_post_status($post->post_id);
|
||||
if($status=='publish'){
|
||||
if(isset($_GET['meta_value'])){
|
||||
$post_id = $post->post_id;
|
||||
$event = strip_tags($_GET['meta_value']);
|
||||
|
@ -224,6 +225,7 @@ $meta = $_GET['meta_value'];
|
|||
|
||||
|
||||
$data_rows[] = $row;
|
||||
}
|
||||
}
|
||||
$fh = @fopen( 'php://output', 'w' );
|
||||
fprintf( $fh, chr(0xEF) . chr(0xBB) . chr(0xBF) );
|
||||
|
|
|
@ -5,34 +5,30 @@ function mep_event_meta_box_add(){
|
|||
|
||||
add_meta_box( 'mep-event-meta', __('Event Venue','mage-eventpress'), 'mep_event_venue_meta_box_cb', 'mep_events', 'normal', 'high' );
|
||||
|
||||
|
||||
add_meta_box( 'mep-event-price', __('Event Price (Event Base price, It will not work if you add Event Ticket type Price)','mage-eventpress'), 'mep_event_price_meta_box_cb', 'mep_events', 'normal', 'high' );
|
||||
|
||||
|
||||
add_meta_box( 'mep-event-extra-price', __('Event Extra Service (Extra Service as Product that you can sell and it is not included on event package)','mage-eventpress'), 'mep_event_extra_price_option', 'mep_events', 'normal', 'high' );
|
||||
|
||||
|
||||
add_meta_box( 'mep-event-ticket-type', __('Event Ticket Type','mage-eventpress'), 'mep_event_ticket_type', 'mep_events', 'normal', 'high' );
|
||||
|
||||
|
||||
add_meta_box( 'mep-event-date', __('Event Date & Time','mage-eventpress'), 'mep_event_date_meta_box_cb', 'mep_events', 'normal', 'high' );
|
||||
|
||||
|
||||
add_meta_box( 'mep-event-emails', __('Event Email text','mage-eventpress'), 'mep_event_email_meta_box_cb', 'mep_events', 'normal', 'high' );
|
||||
|
||||
|
||||
add_meta_box( 'mep-event-template', __('Template','mage-eventpress'), 'mep_event_template_meta_box_cb', 'mep_events', 'side', 'low' );
|
||||
|
||||
|
||||
add_meta_box( 'mep-event-faq-box', __('Event F.A.Q','mage-eventpress'), 'mep_event_faq_meta_box_cb', 'mep_events', 'normal', 'high' );
|
||||
|
||||
|
||||
add_meta_box( 'mep-event-reg-on-off', __('Registration Status','mage-eventpress'), 'mep_event_change_reg_status_cb', 'mep_events', 'side', 'low' );
|
||||
|
||||
add_meta_box( 'mep-event-available-set-on-off', __('Show Available Seat Count?','mage-eventpress'), 'mep_event_available_seat_cb', 'mep_events', 'side', 'low' );
|
||||
|
||||
|
||||
add_meta_box( 'mep-event-day-details', __('Event Daywise Details','mage-eventpress'), 'mep_event_day_details_cb', 'mep_events', 'normal', 'high' );
|
||||
|
||||
if(get_option( 'woocommerce_calc_taxes' )=='yes'){
|
||||
add_meta_box( 'mep-event-tax-sec', __('Event Tax','mage-eventpress'), 'mep_event_tax_cb', 'mep_events', 'side', 'low' );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function mep_event_change_reg_status_cb($post){
|
||||
|
@ -50,6 +46,51 @@ function mep_event_change_reg_status_cb($post){
|
|||
<?php
|
||||
}
|
||||
|
||||
|
||||
function mep_event_tax_cb($post){
|
||||
$values = get_post_custom( $post->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 = ''; }
|
||||
|
||||
?>
|
||||
<div class='sec'>
|
||||
<label for="_tax_status"> <?php _e('Tax status','mage-eventpress'); ?>
|
||||
<select style="" id="_tax_status" name="_tax_status" class="select short">
|
||||
<option value="taxable" <?php if($tx_status=='taxable'){ echo 'Selected'; } ?>>Taxable</option>
|
||||
<option value="shipping" <?php if($tx_status=='shipping'){ echo 'Selected'; } ?>>Shipping only</option>
|
||||
<option value="none" <?php if($tx_status=='none'){ echo 'Selected'; } ?>>None</option>
|
||||
</select>
|
||||
</label>
|
||||
</div>
|
||||
<div class='sec'>
|
||||
<label for="_tax_class"> <?php _e('Tax class','mage-eventpress'); ?>
|
||||
<select style="" id="_tax_class" name="_tax_class" class="select short">
|
||||
<option value="standard" <?php if($tx_class=='standard'){ echo 'Selected'; } ?>>Standard</option>
|
||||
<?php
|
||||
$mep_get_tax_class = get_option( 'woocommerce_tax_classes' );
|
||||
$mep_get_tax_arr = explode( "\n", get_option( 'woocommerce_tax_classes' ));
|
||||
foreach ($mep_get_tax_arr as $mep_tax_class ) {
|
||||
$tax_slug = sanitize_title($mep_tax_class);
|
||||
?>
|
||||
<option value="<?php echo $tax_slug; ?>" <?php if($tx_class==$tax_slug){ echo 'Selected'; } ?>><?php echo $mep_tax_class; ?></option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</label>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function mep_event_available_seat_cb($post){
|
||||
$values = get_post_custom( $post->ID );
|
||||
wp_nonce_field( 'mep_event_reg_btn_nonce', 'mep_event_reg_btn_nonce' );
|
||||
|
@ -96,8 +137,22 @@ if(isset($_POST['mep_available_seat'])){
|
|||
$mep_available_seat = 'off';
|
||||
}
|
||||
|
||||
if(isset($_POST['_tax_status'])){
|
||||
$_tax_status = strip_tags($_POST['_tax_status']);
|
||||
}else{
|
||||
$_tax_status = 'none';
|
||||
}
|
||||
|
||||
if(isset($_POST['_tax_class'])){
|
||||
$_tax_class = strip_tags($_POST['_tax_class']);
|
||||
}else{
|
||||
$_tax_class = '';
|
||||
}
|
||||
|
||||
$update_ava_seat = update_post_meta( $post_id, 'mep_available_seat', $mep_available_seat);
|
||||
$update_seat = update_post_meta( $post_id, 'mep_reg_status', $mep_reg_status);
|
||||
$update__tax_status = update_post_meta( $post_id, '_tax_status', $_tax_status);
|
||||
$update__tax_class = update_post_meta( $post_id, '_tax_class', $_tax_class);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,3 +1,17 @@
|
|||
<?php
|
||||
the_post();
|
||||
$values = get_post_custom(get_the_id());
|
||||
if ( is_user_logged_in() ) {
|
||||
|
||||
$user = wp_get_current_user();
|
||||
|
||||
$ticket_user_id = $values['ea_user_id'][0];
|
||||
$current_user_id = get_current_user_id();
|
||||
|
||||
$qr_user_role = mep_get_option( 'mep_qr_user_role', 'qr_general_attendee_sec', 'administrator' );
|
||||
|
||||
if($ticket_user_id == $current_user_id || in_array( 'administrator', (array) $user->roles ) || in_array( $qr_user_role, (array) $user->roles )){
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
@ -80,11 +94,6 @@
|
|||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<?php
|
||||
the_post();
|
||||
$values = get_post_custom(get_the_id());
|
||||
if ( is_user_logged_in() ) {
|
||||
?>
|
||||
<div class="mep-wrapper">
|
||||
<div class="mep-reg-user-details">
|
||||
<table>
|
||||
|
@ -182,12 +191,17 @@ do_action('mep_attendee_table_row_end',get_the_id());
|
|||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
<?php
|
||||
}else{
|
||||
// header("Location: ".home_url());
|
||||
wp_redirect(home_url());
|
||||
exit();
|
||||
}
|
||||
do_action('at_footer');
|
||||
}else{
|
||||
echo '<div class="mep_event_error">';
|
||||
_e('You need to login to see this page content','mage-eventpress');
|
||||
echo '</div>';
|
||||
|
||||
wp_redirect(home_url());
|
||||
exit();
|
||||
}
|
||||
wp_footer();
|
||||
?>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* Plugin Name: Woocommerce Events Manager
|
||||
* Plugin URI: http://mage-people.com
|
||||
* Description: A Complete Event Solution for WordPress by MagePeople..
|
||||
* Version: 2.5.8
|
||||
* Version: 2.5.9
|
||||
* Author: MagePeople Team
|
||||
* Author URI: http://www.mage-people.com/
|
||||
* Text Domain: mage-eventpress
|
||||
|
@ -1205,6 +1205,77 @@ function mep_wc_price( $price, $args = array() ) {
|
|||
|
||||
|
||||
|
||||
function mep_get_event_total_seat($event_id){
|
||||
$event_meta = get_post_custom($event_id);
|
||||
$book_count = get_post_meta($event_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);
|
||||
$mep_event_ticket_type = get_post_meta($event_id, 'mep_event_ticket_type', true);
|
||||
|
||||
if($mep_event_ticket_type){
|
||||
$stc = 0;
|
||||
$leftt = 0;
|
||||
$res = 0;
|
||||
foreach ( $mep_event_ticket_type as $field ) {
|
||||
$qm = $field['option_name_t'];
|
||||
$tesqn = $event_id.str_replace(' ', '', $qm);
|
||||
$tesq = get_post_meta($event_id,"mep_xtra_$tesqn",true);
|
||||
$stc = $stc+$field['option_qty_t'];
|
||||
$res = $res + (int)$field['option_rsv_t'];
|
||||
$res = (int)$res;
|
||||
$llft = ($field['option_qty_t'] - (int)$tesq);
|
||||
$leftt = ($leftt+$llft);
|
||||
}
|
||||
$leftt = $leftt-$res;
|
||||
?>
|
||||
<h5> <?php echo $leftt; ?>/<?php echo $stc; ?> </h5>
|
||||
<?php
|
||||
|
||||
}else{
|
||||
if($event_meta['mep_total_seat'][0]){ ?>
|
||||
<h5> <?php echo ($event_meta['mep_total_seat'][0]- $total_book); ?>/<?php echo $event_meta['mep_total_seat'][0]; ?></h5>
|
||||
<?php }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Add the custom columns to the book post type:
|
||||
add_filter( 'manage_mep_events_posts_columns', 'mep_set_custom_mep_events_columns' );
|
||||
function mep_set_custom_mep_events_columns($columns) {
|
||||
|
||||
$columns['mep_event_seat'] = __( 'Seats', 'mage-eventpress' );
|
||||
|
||||
return $columns;
|
||||
}
|
||||
|
||||
|
||||
// Add the data to the custom columns for the book post type:
|
||||
add_action( 'manage_mep_events_posts_custom_column' , 'mep_mep_events_column', 10, 2 );
|
||||
function mep_mep_events_column( $column, $post_id ) {
|
||||
switch ( $column ) {
|
||||
|
||||
case 'mep_event_seat' :
|
||||
echo mep_get_event_total_seat($post_id);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue