php warning

This commit is contained in:
magepeopleteam 2019-04-06 11:00:54 +00:00
parent d85a842c5e
commit b5a24bf0f6
5 changed files with 31 additions and 9 deletions

View File

@ -351,7 +351,7 @@ $values = get_post_custom( $post->ID );
<tbody> <tbody>
<tr> <tr>
<td align="center"><input id='mep_ev_8' type="text" name='mep_price_label' value='<?php if(array_key_exists('mep_price_label', $values)){ echo $values['mep_price_label'][0];} ?>'></td> <td align="center"><input id='mep_ev_8' type="text" name='mep_price_label' value='<?php if(array_key_exists('mep_price_label', $values)){ echo $values['mep_price_label'][0];} ?>'></td>
<td align="center"><input style="width: 100px;" id='mep_ev_9' type="number" name='_price' required min='0' value='<?php if(array_key_exists('_price', $values)){ echo $values['_price'][0]; } else{ echo 0; } ?>'></td> <td align="center"><input style="width: 100px;" id='mep_ev_9' type="number" name='_price' step="0.01" required min='0' value='<?php if(array_key_exists('_price', $values)){ echo $values['_price'][0]; } else{ echo 0; } ?>'></td>
<td align="center"><input style="width: 100px;" id='mep_ev_1' type="number" name='mep_total_seat' value='<?php if(array_key_exists('mep_total_seat', $values)){ echo $values['mep_total_seat'][0]; } ?>'> </td> <td align="center"><input style="width: 100px;" id='mep_ev_1' type="number" name='mep_total_seat' value='<?php if(array_key_exists('mep_total_seat', $values)){ echo $values['mep_total_seat'][0]; } ?>'> </td>
<td align="center"><input id='mep_ev_1' style="width: 100px;" type="number" name='mep_rsv_seat' value='<?php if(array_key_exists('mep_rsv_seat', $values)){ echo $values['mep_rsv_seat'][0]; } ?>'> </td> <td align="center"><input id='mep_ev_1' style="width: 100px;" type="number" name='mep_rsv_seat' value='<?php if(array_key_exists('mep_rsv_seat', $values)){ echo $values['mep_rsv_seat'][0]; } ?>'> </td>
<td align="center"> <?php if(array_key_exists('qty_box_type', $values)){ $qty_typec = $values['qty_box_type'][0]; }else{ $qty_typec=""; } ?> <td align="center"> <?php if(array_key_exists('qty_box_type', $values)){ $qty_typec = $values['qty_box_type'][0]; }else{ $qty_typec=""; } ?>
@ -679,7 +679,7 @@ function mep_event_extra_price_option() {
<tr> <tr>
<td><input type="text" class="widefat" name="option_name[]" value="<?php if($field['option_name'] != '') echo esc_attr( $field['option_name'] ); ?>" /></td> <td><input type="text" class="widefat" name="option_name[]" value="<?php if($field['option_name'] != '') echo esc_attr( $field['option_name'] ); ?>" /></td>
<td><input type="number" class="widefat" name="option_price[]" value="<?php if ($field['option_price'] != '') echo esc_attr( $field['option_price'] ); else echo ''; ?>" /></td> <td><input type="number" step="0.01" class="widefat" name="option_price[]" value="<?php if ($field['option_price'] != '') echo esc_attr( $field['option_price'] ); else echo ''; ?>" /></td>
<td><input type="number" class="widefat" name="option_qty[]" value="<?php if ($field['option_qty'] != '') echo esc_attr( $field['option_qty'] ); else echo ''; ?>" /></td> <td><input type="number" class="widefat" name="option_qty[]" value="<?php if ($field['option_qty'] != '') echo esc_attr( $field['option_qty'] ); else echo ''; ?>" /></td>
@ -774,7 +774,7 @@ function mep_event_ticket_type() {
<tr> <tr>
<td><input type="text" class="widefat" name="option_name_t[]" value="<?php if($field['option_name_t'] != '') echo esc_attr( $field['option_name_t'] ); ?>" /></td> <td><input type="text" class="widefat" name="option_name_t[]" value="<?php if($field['option_name_t'] != '') echo esc_attr( $field['option_name_t'] ); ?>" /></td>
<td><input type="number" class="widefat" name="option_price_t[]" value="<?php if ($field['option_price_t'] != '') echo esc_attr( $field['option_price_t'] ); else echo ''; ?>" /></td> <td><input type="number" step="0.01" class="widefat" name="option_price_t[]" value="<?php if ($field['option_price_t'] != '') echo esc_attr( $field['option_price_t'] ); else echo ''; ?>" /></td>
<td><input type="number" class="widefat" name="option_qty_t[]" value="<?php if ($field['option_qty_t'] != '') echo esc_attr( $field['option_qty_t'] ); else echo ''; ?>" /></td> <td><input type="number" class="widefat" name="option_qty_t[]" value="<?php if ($field['option_qty_t'] != '') echo esc_attr( $field['option_qty_t'] ); else echo ''; ?>" /></td>

View File

@ -23,7 +23,11 @@ function mep_get_event_reg_btn(){
if($book_count){ $total_book = $book_count; }else{ $total_book = 0; } if($book_count){ $total_book = $book_count; }else{ $total_book = 0; }
$simple_rsv = $event_meta['mep_rsv_seat'][0]; if(array_key_exists('mep_rsv_seat', $event_meta)){
$simple_rsv = $event_meta['mep_rsv_seat'][0];
}else{
$simple_rsv = '';
}
if($simple_rsv){ if($simple_rsv){
$simple_rsv = $simple_rsv; $simple_rsv = $simple_rsv;
}else{ }else{
@ -72,7 +76,11 @@ elseif($seat_left<=0){
} }
else{ else{
$simple_rsv = $event_meta['mep_rsv_seat'][0]; if(array_key_exists('mep_rsv_seat', $event_meta)){
$simple_rsv = $event_meta['mep_rsv_seat'][0];
}else{
$simple_rsv = '';
}
if($simple_rsv){ if($simple_rsv){
$simple_rsv = $simple_rsv; $simple_rsv = $simple_rsv;
}else{ }else{

View File

@ -5,7 +5,11 @@ function mep_output_add_to_cart_custom_fields() {
global $post,$event_meta,$total_book; global $post,$event_meta,$total_book;
if(array_key_exists('mep_rsv_seat', $event_meta)){
$simple_rsv = $event_meta['mep_rsv_seat'][0]; $simple_rsv = $event_meta['mep_rsv_seat'][0];
}else{
$simple_rsv = '';
}
if($simple_rsv){ if($simple_rsv){
$simple_rsv = $simple_rsv; $simple_rsv = $simple_rsv;
}else{ }else{

View File

@ -5,7 +5,11 @@ add_action('mep_event_seat','mep_ev_seat');
function mep_ev_seat(){ function mep_ev_seat(){
global $post,$event_meta,$total_book; global $post,$event_meta,$total_book;
if(array_key_exists('mep_rsv_seat', $event_meta)){
$simple_rsv = $event_meta['mep_rsv_seat'][0]; $simple_rsv = $event_meta['mep_rsv_seat'][0];
}else{
$simple_rsv = '';
}
if($simple_rsv){ if($simple_rsv){
$simple_rsv = $simple_rsv; $simple_rsv = $simple_rsv;
}else{ }else{

View File

@ -892,7 +892,13 @@ $org_id = $org_arr[0]->term_id;
function mep_get_total_available_seat($event_id, $event_meta){ function mep_get_total_available_seat($event_id, $event_meta){
$book_count = get_post_meta(get_the_id(),'total_booking', true); $book_count = get_post_meta(get_the_id(),'total_booking', true);
if($book_count){ $total_book = $book_count; }else{ $total_book = 0; } 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]; $simple_rsv = $event_meta['mep_rsv_seat'][0];
}else{
$simple_rsv = '';
}
if($simple_rsv){ if($simple_rsv){
$simple_rsv = $simple_rsv; $simple_rsv = $simple_rsv;
}else{ }else{