Advertisement
Guest User

Event Espresso - Choose a Seat Button - actions.php

a guest
Apr 9th, 2013
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.41 KB | None | 0 0
  1. //Creates a field to select a seat in the seating chart
  2. function espresso_seating_chart_select($event_id, $booking_info=''){
  3.     global $wpdb;
  4.     $seating_chart_id = seating_chart::check_event_has_seating_chart($event_id);
  5.     if ( $seating_chart_id !== false ){
  6. ?>
  7.         <div class="event_questions" id="event_seating_chart">
  8.        
  9.        
  10.         <p class="event_form_field">
  11.         <label <?php echo is_admin() ? '' : 'style=""'; ?>><?php _e('Select a Seat:', 'event_espresso'); ?></label>
  12.         <a onclick="javascript:document.getElementById('myFocusField').click();" class="helpLink" >Sitzplatz erste Person</a><br>
  13.         <input name="seat_id" id="myFocusField" type="text" class="ee_s_select_seat required" title="<?php _e('Please select a seat.', 'event_espresso'); ?>" value="<?php echo $booking_info ?>" size="30" readonly="readonly" event_id="<?php echo $event_id; ?>"  />
  14. <?php
  15.         $seating_chart = $wpdb->get_row("select * from ".EVENTS_SEATING_CHART_TABLE." where id = $seating_chart_id");
  16.         if (trim($seating_chart->image_name) != "" && file_exists(EVENT_ESPRESSO_UPLOAD_DIR.'seatingchart/images/'.$seating_chart->image_name) ){
  17. ?>
  18.             <br/>
  19.             <a href="<?php echo EVENT_ESPRESSO_UPLOAD_URL.'seatingchart/images/'.$seating_chart->image_name; ?>" target="_blank"><?php _e('Seating chart image', 'event_espresso'); ?></a>
  20. <?php
  21.         }
  22. ?>
  23.         </p>
  24.         </div>
  25. <?php
  26.     }
  27. }
  28. add_action( 'espresso_seating_chart_select', 'espresso_seating_chart_select', 10, 2 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement