2018-02-05 02:05:26 -05:00
|
|
|
<?php
|
|
|
|
if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access pages directly.
|
|
|
|
add_action( 'add_meta_boxes', 'mep_event_meta_box_add' );
|
|
|
|
function mep_event_meta_box_add(){
|
|
|
|
add_meta_box( 'mep-event-meta', 'Event Venue', 'mep_event_venue_meta_box_cb', 'mep_events', 'normal', 'high' );
|
|
|
|
|
|
|
|
add_meta_box( 'mep-event-price', 'Event Price', 'mep_event_price_meta_box_cb', 'mep_events', 'normal', 'high' );
|
|
|
|
|
|
|
|
add_meta_box( 'mep-event-date', 'Event Date & Time', 'mep_event_date_meta_box_cb', 'mep_events', 'normal', 'high' );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function mep_event_venue_meta_box_cb($post){
|
|
|
|
$values = get_post_custom( $post->ID );
|
|
|
|
?>
|
|
|
|
|
|
|
|
<div class='sec'>
|
|
|
|
<label for="mep_ev_1"> Seat Capacity: </label>
|
|
|
|
<span><input id='mep_ev_1' type="number" name='mep_total_seat' value='<?php echo $values['mep_total_seat'][0]; ?>'> </span>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class='sec'>
|
|
|
|
<label for="mep_ev_2"> Location/Venue: </label>
|
|
|
|
<span><input id='mep_ev_2' type="text" name='mep_location_venue' value='<?php echo $values['mep_location_venue'][0]; ?>'> </span>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='sec'>
|
|
|
|
<label for="mep_ev_3"> Street: </label>
|
|
|
|
<span><input id='mep_ev_3' type="text" name='mep_street' value='<?php echo $values['mep_street'][0]; ?>'> </span>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='sec'>
|
|
|
|
<label for="mep_ev_4"> City: </label>
|
|
|
|
<span><input id='mep_ev_4' type="text" name='mep_city' value='<?php echo $values['mep_city'][0]; ?>'> </span>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='sec'>
|
|
|
|
<label for="mep_ev_5"> State: </label>
|
|
|
|
<span><input id='mep_ev_5' type="text" name='mep_state' value='<?php echo $values['mep_state'][0]; ?>'> </span>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='sec'>
|
|
|
|
<label for="mep_ev_6"> Postcode: </label>
|
|
|
|
<span><input id='mep_ev_6' type="text" name='mep_postcode' value='<?php echo $values['mep_postcode'][0]; ?>'> </span>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='sec'>
|
|
|
|
<label for="mep_ev_7"> Country: </label>
|
|
|
|
<span><input id='mep_ev_7' type="text" name='mep_country' value='<?php echo $values['mep_country'][0]; ?>'> </span>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function mep_event_price_meta_box_cb($post){
|
|
|
|
$values = get_post_custom( $post->ID );
|
|
|
|
?>
|
|
|
|
|
2018-02-15 07:00:25 -05:00
|
|
|
<div class='sec'>
|
|
|
|
<label for="mep_ev_98"> Show Quantity Input Box: </label>
|
|
|
|
<span><input style='text-align: left;width: auto;' id='mep_ev_98' type="checkbox" name='mep_sqi' value='1' <?php $sqi = $values['mep_sqi'][0]; if($sqi==1){ echo 'checked'; } ?> > Yes</span>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
2018-02-05 02:05:26 -05:00
|
|
|
<div class='sec'>
|
|
|
|
<label for="mep_ev_8"> Price Label: </label>
|
|
|
|
<span><input id='mep_ev_8' type="text" name='mep_price_label' value='<?php echo $values['mep_price_label'][0]; ?>'> </span>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class='sec'>
|
|
|
|
<label for="mep_ev_9"> Price: </label>
|
|
|
|
<span><input id='mep_ev_9' type="number" name='_price' value='<?php echo $values['_price'][0]; ?>'> </span>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function mep_event_date_meta_box_cb($post){
|
|
|
|
$values = get_post_custom( $post->ID );
|
|
|
|
?>
|
|
|
|
|
|
|
|
|
|
|
|
<div class='sec'>
|
|
|
|
<label for="event_start_date"> Start Date & Time: </label>
|
|
|
|
<span><input class='event_start' id='event_start_date' type="text" name='mep_event_start_date' value='<?php echo $values['mep_event_start_date'][0]; ?>'> </span>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class='sec'>
|
|
|
|
<label for="event_end_date"> End Date & Time: </label>
|
|
|
|
<span><input class='event_end' id='event_end_date' type="text" name='mep_event_end_date' value='<?php echo $values['mep_event_end_date'][0]; ?>'> </span>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
add_action('save_post','mep_events_meta_save');
|
|
|
|
function mep_events_meta_save($post_id){
|
|
|
|
global $post;
|
|
|
|
$pid = $post->ID;
|
|
|
|
if ($post->post_type != 'mep_events'){
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
//if you get here then it's your post type so do your thing....
|
2018-02-15 07:00:25 -05:00
|
|
|
$seat = strip_tags($_POST['mep_total_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']);
|
|
|
|
$_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']);
|
|
|
|
|
|
|
|
|
|
|
|
$update_seat = update_post_meta( $pid, 'mep_total_seat', $seat);
|
|
|
|
$update_seat_stock_status = update_post_meta( $pid, '_manage_stock', 'yes');
|
|
|
|
$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');
|
|
|
|
|
|
|
|
|
|
|
|
$update_location = update_post_meta( $pid, 'mep_location_venue', $mep_location_venue);
|
2018-02-05 02:05:26 -05:00
|
|
|
$update_mep_street = update_post_meta( $pid, 'mep_street', $mep_street);
|
2018-02-15 07:00:25 -05:00
|
|
|
$update_city = update_post_meta( $pid, 'mep_city', $mep_city);
|
2018-02-05 02:05:26 -05:00
|
|
|
$update_mep_state = update_post_meta( $pid, 'mep_state', $mep_state);
|
2018-02-15 07:00:25 -05:00
|
|
|
$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);
|
2018-02-05 02:05:26 -05:00
|
|
|
$update_price_label = update_post_meta( $pid, 'mep_price_label', $mep_price_label);
|
2018-02-15 07:00:25 -05:00
|
|
|
$update_price = update_post_meta( $pid, '_price', $_price);
|
|
|
|
$update_start = update_post_meta( $pid, 'mep_event_start_date', $mep_event_start_date);
|
|
|
|
$update_end = update_post_meta( $pid, 'mep_event_end_date', $mep_event_end_date);
|
2018-02-05 02:05:26 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
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 );
|
|
|
|
?>
|
|
|
|
<div class='sec'>
|
|
|
|
<label for="my_meta_box_text"> Event: </label>
|
|
|
|
<span><?php echo $values['ea_event_name'][0]; ?> </span>
|
|
|
|
</div>
|
|
|
|
<div class='sec'>
|
|
|
|
<label for="my_meta_box_text"> Full Name: </label>
|
|
|
|
<span><?php echo $values['ea_first_name'][0]; ?> <?php echo $values['ea_last_name'][0]; ?></span>
|
|
|
|
</div>
|
|
|
|
<div class='sec'>
|
|
|
|
<label for="my_meta_box_text">Company: </label>
|
|
|
|
<span><?php echo $values['ea_company_name'][0]; ?></span>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class='sec'>
|
|
|
|
<label for="my_meta_box_text">Email: </label>
|
|
|
|
<span><?php echo $values['ea_email'][0]; ?></span>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class='sec'>
|
|
|
|
<label for="my_meta_box_text">Phone: </label>
|
|
|
|
<span><?php echo $values['ea_phone'][0]; ?></span>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class='sec'>
|
|
|
|
<label for="my_meta_box_text">Addres: </label>
|
|
|
|
<span>
|
|
|
|
<?php echo $values['ea_address_1'][0]; ?>
|
|
|
|
<?php echo $values['ea_address_2'][0]; ?>
|
|
|
|
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class='sec'>
|
|
|
|
<label for="my_meta_box_text">State: </label>
|
|
|
|
<span>
|
|
|
|
<?php echo $values['ea_state'][0]; ?>
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class='sec'>
|
|
|
|
<label for="my_meta_box_text">City: </label>
|
|
|
|
<span>
|
|
|
|
<?php echo $values['ea_city'][0]; ?>
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
<div class='sec'>
|
|
|
|
<label for="my_meta_box_text">Country: </label>
|
|
|
|
<span>
|
|
|
|
<?php echo $values['ea_country'][0]; ?>
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class='sec'>
|
|
|
|
<label for="my_meta_box_text">Order ID: </label>
|
|
|
|
<span>
|
|
|
|
<?php echo $values['ea_order_id'][0]; ?>
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
<div class='sec'>
|
|
|
|
<span>
|
|
|
|
<a href="<?php echo get_site_url(); ?>/wp-admin/post.php?post=<?php echo $values['ea_order_id'][0]; ?>&action=edit" class='button button-primary button-large'>View Order</a>
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
<?php
|
|
|
|
}
|