<?php 

// Check to ensure this file is included in Freeway!
defined('_FEXEC') or die();
?>
<table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB;?>">
<?php
  if ($reservation_check['total'] < 1) {
?>
      <tr>
        <td><?php new infoBox(array(array('text' => TEXT_RESERVATION_NOT_FOUND))); ?></td>
      </tr>
      <tr>
        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
      </tr>
      <tr>
        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
          <tr class="infoBoxContents">
            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
              <tr>
                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
                <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_template_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
              </tr>
            </table></td>
          </tr>
        </table></td>
      </tr>
<?php
  } else {
    $reservation_query=tep_db_query("select rs.sessions_id,rs.sessions_fees,rs.final_fees,rs.tax_id from " . TABLE_RESERVATIONS . " s, " . TABLE_RESERVATIONS_SESSIONS . " rs where rs.reservation_id=s.reservation_id and s.customer_id='" . (int)$customer_id . "'");


$header_text =  TEXT_RESERVED .'<br>' . tep_draw_separator('pixel_trans.gif', '100%', '4');
// BOF: Lango Added for template MOD
if (MAIN_TABLE_BORDER == 'yes'){
table_image_border_top(false, false, $header_text);
}
// EOF: Lango Added for template MOD
?>
      <tr>
        <td class="main">
          <table width='100%' border="0" cellspacing="0" cellpadding="2" align="right">
            <tr class='dataTableHeadingContent'>
              <td align=center><?php echo TABLE_HEADING_DATE ?><td align=center><?php echo TABLE_HEADING_TIME ?><td><?php echo TABLE_HEADING_INSTRUCTOR ?><td><?php echo TABLE_HEADING_LOCATION ?><td><?php echo TABLE_HEADING_FEES ?><td>
	    </tr>
<?php 
             $cnt=1;
	     while($reservation = tep_db_fetch_array($reservation_query))
             {
		    $session_details_query = tep_db_query("select e.events_name,s.sessions_id, sd.sessions_description, s.sessions_fees, s.sessions_tax_class_id, s.sessions_start_date,s.sessions_end_date,time_format(s.sessions_start_time,'%h:%i') 
		                                   as sessions_start_time,time_format(s.sessions_end_time,'%h:%i') as sessions_end_time,s.sessions_instructor,s.sessions_location,s.sessions_date_added, s.sessions_date_available from " . TABLE_EVENTS_SESSIONS . " s, " . TABLE_EVENTS_SESSIONS_DESCRIPTION . " sd, " . TABLE_EVENTS . " e, where s.sessions_id = '" . $reservation['sessions_id'] . "' and s.event_id = e.events_id and s.sessions_id=sd_sessions_id and sd.language_id = '" . (int)$languages_id . "'");
		     $session_details=tep_db_fetch_array($session_details_query)
	              echo $cnt%2==0?"<tr class=dataTableRowEven>":"<tr class=dataTableRowOdd>";
		      echo "<td align=center>" . $session_details['sessions_start_date'] . "<br>to<br>" . $session_details['sessions_end_date'] . "<td align=center>" . $session_details['sessions_start_time'] .
		                    "<br>to<br>" . $session_details['sessions_end_time'] . "<td>" . $session_details['sessions_instructor'] . "<td>" . $session_details['sessions_location'] . "<td>" . $currencies->display_price($session_details['sessions_fees'], tep_get_tax_rate($session_details['sessions_tax_class_id'])) .
				    "<td align=right>" . tep_draw_form('cart_session' . $cnt, tep_href_link(FILENAME_SESSION_DETAILS, tep_get_all_get_params(array(eventaction))) . '&eventaction=add_session') . tep_draw_hidden_field('sessions_id', $session_details['sessions_id']) . tep_template_image_submit('button_reserve.gif', IMAGE_BUTTON_RESERVE) . '</form>';
				    
				    
	   	      echo "</tr>";
		      $cnt=$cnt+1;
	     }
?>
          </table>
        </td>
      </tr>
      <tr>
        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td></tr>
<?php

}
}
// BOF: Lango Added for template MOD
if (MAIN_TABLE_BORDER == 'yes'){
table_image_border_bottom();
}
// EOF: Lango Added for template MOD
?>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<tr>
<td><p align=center><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT ,tep_get_all_get_params('events_id')) . '">' . tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . "/images/buttons/" .  $language . "/button_back.gif",IMAGE_BUTTON_BACK) . "</a>"; ?></td>
</tr>
</table>



