Advertisement
Apina

Modified default ticket template

Apr 29th, 2014
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.72 KB | None | 0 0
  1. <?php
  2. global $org_options;
  3.  
  4. //Build the path to the css files
  5. if (file_exists(EVENT_ESPRESSO_UPLOAD_DIR . "tickets/templates/css/base.css")) {
  6. $base_dir = EVENT_ESPRESSO_UPLOAD_URL . 'tickets/templates/css/';//If the template files have been moved to the uploads folder
  7. } else {
  8. $base_dir = ESPRESSO_TICKETING_FULL_URL.'templates/css/';//Default location
  9. }
  10.  
  11. //Output the $data (array) variable that contains the attendee information and ticket settings
  12. //echo "<pre>".print_r($data,true)."</pre>";
  13. ?>
  14.  
  15. <?php
  16.  
  17. $a_sql = "SELECT * FROM " . EVENTS_ATTENDEE_TABLE . " WHERE event_id='" . $data->event->id . "'";
  18. $a_sql .= $paid_only == 'true'? " AND (payment_status='Completed' OR payment_status='Pending') ":'';
  19. $a_sql .= $sort;
  20. //echo $a_sql;
  21. $attendees = $wpdb->get_results($a_sql);
  22.  
  23. //var_dump($attendees);
  24. //var_dump($data);
  25.  
  26. foreach ($attendees as $attendee){
  27. $id = $attendee->id;
  28. $lname = $attendee->lname;
  29. $fname = $attendee->fname;
  30. $city = $attendee->city;
  31. $state = $attendee->state;
  32. $country = $attendee->state;
  33. $email = $attendee->email;
  34. $gravatar = $show_gravatar == 'true'? get_avatar( $email, $size = '100', $default = 'http://www.gravatar.com/avatar/' ) : '';
  35. $city_state = $city != '' || $state != '' ? '
  36. ' . ($city != '' ? $city :'') . ($state != '' ? ', ' . $state :' ') :'';
  37. }
  38.  
  39.  
  40. ?>
  41.  
  42.  
  43. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  44. <html>
  45. <head>
  46. <title><?php echo stripslashes_deep($org_options['organization']) ?> <?php _e('Ticket for', 'event_espresso'); ?> <?php echo stripslashes_deep($data->attendee->fname . ' ' .$data->attendee->lname) ?> | <?php echo $data->attendee->registration_id ?></title>
  47. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  48. <!-- Base Stylesheet do not change or remove -->
  49. <link rel="stylesheet" type="text/css" href="<?php echo $base_dir; ?>base.css" media="screen" />
  50.  
  51. <!-- Primary Style Sheet -->
  52. <link rel="stylesheet" type="text/css" href="<?php echo $base_dir.$data->event->css_file; ?>" />
  53.  
  54. <!-- Make sure the buttons don't print -->
  55. <style type="text/css">
  56. @media print{
  57. .noPrint{display:none!important;}
  58. }
  59.  
  60.  
  61.  
  62. </style>
  63. </head>
  64. <body>
  65. <div class="outside">
  66. <div class="print_button_div">
  67. <form>
  68. <input class="print_button noPrint" type="button" value=" <?php _e( 'Print Ticket', 'event_espresso' ); ?> " onclick="window.print();return false;" />
  69. </form>
  70. <form method="post" action="<?php echo espresso_ticket_url($data->attendee->id, $data->attendee->registration_id, '&pdf=true'); ?>" >
  71. <input class="print_button noPrint" type="submit" value=" <?php _e( 'Download PDF', 'event_espresso' ); ?> " />
  72. </form>
  73. </div>
  74. <div class="instructions"><?php _e('Print and bring this ticket with you to the event', 'event_espresso'); ?></div>
  75. <div class="ticket">
  76. <table width="100%" border="0">
  77. <tr>
  78. <td width="55%" rowspan="2" valign="top"><span class="top_event_title">[event_name]</span><br>
  79. [start_date] [start_time] <br>
  80. [ticket_type]<br>
  81. [venue_title]<br>
  82. <?php echo do_shortcode( '[EE_ANSWER q="10" a="'.$data->attendee->id.'" ]' ); ?>
  83.  
  84. <div class="logo">[ticket_logo_image]</div></td>
  85. <td width="22%" align="right" valign="top"><div class="gravatar">[gravatar]</div></td>
  86. <td width="23%" align="right" valign="top"><div class="qr_code">[qr_code]</div></td>
  87. </tr>
  88. <tr>
  89. <td colspan="2" align="right" valign="top"><span class="price">[cost]</span><br>
  90. [fname] [lname] (<?php _e('ID:', 'event_espresso'); ?> [att_id])<br>
  91. [registration_id]<br>
  92. <?php _e('Qty.', 'event_espresso'); ?> [ticket_qty]</td>
  93. </tr>
  94. </table>
  95. </div>
  96. <div class="extra_info">
  97. <div class="divider"></div>
  98. <table width="100%" border="0">
  99. <tr>
  100. <td width="45%" height="35" align="left" valign="top"><p><strong><?php _e('Location:', 'event_espresso'); ?></strong><br>
  101. [venue_title]<br>
  102. [venue_address]<br>
  103. [venue_address2]<br>
  104. [venue_city], [venue_state]<br>
  105. [venue_phone]</p>
  106. <p><strong><?php _e('More Information:', 'event_espresso'); ?></strong></p>
  107. <p>[venue_description]</p>
  108. <p><strong><?php _e('Ticket Instructions:', 'event_espresso'); ?></strong></p>
  109. <p>[ticket_content]</p></td>
  110. <td width="55%" valign="top">[google_map_image]</td>
  111. </tr>
  112. </table>
  113. </div>
  114. <div class="footer"><?php echo sprintf( __( 'Powered by the <a href="%s" target="_blank">Event Espresso Ticketing System</a> for WordPress', 'event_espresso' ) , 'http://eventespresso.com' ); ?></div>
  115. </div>
  116. </body>
  117. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement