<?php
/*
  www.oscGold.com (C) Kamelia-Net Jacek Krysiak
  modul oscGold wer 4.0
*/
?>

<?php echo tep_draw_form('order', tep_href_link(FILENAME_CHECKOUT_SUCCESS, 'action=update', 'SSL')); ?>

<table border="0" width="100%" cellspacing="0" cellpadding="0">

 <!-- Naglowek BOF -->
 <tr>
  <td>
   <?php
   $info_box_contents = array();
   $info_box_contents[] = array('text' => sprintf(HEADING_TITLE));
   new contentBoxHeading($info_box_contents);
   ?>
  </td>
 </tr>
 <tr>
  <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '1'); ?></td>
 </tr>
 <!-- Naglowek EOF -->

 <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 align="center">
	     <h4><?php echo TEXT_SUCCESS; ?></h4>
        </td>
       </tr>
       <tr>
        <td class="main">
        <?php
        //PWA BOF
        if ($byl_gosc == false){
        //PWA BOF
		if ($global['global_product_notifications'] != '1') {
        if ($customer_id != 0) {
         echo TEXT_NOTIFY_PRODUCTS . '<br><p class="productsNotifications">';
         $products_displayed = array();
         for ($i=0, $n=sizeof($products_array); $i<$n; $i++) {
          if (!in_array($products_array[$i]['id'], $products_displayed)) {
           echo tep_draw_checkbox_field('notify[]', $products_array[$i]['id']) . ' ' . $products_array[$i]['text'] . '<br>';
           $products_displayed[] = $products_array[$i]['id'];
          }
         }
        echo '</p>';
		}
        } else {
         echo TEXT_SEE_ORDERS . '<br><br>' . TEXT_CONTACT_STORE_OWNER;
        }
        //PWA BOF
        }
        //PWA BOF
        ?>
        <h5><?php echo TEXT_THANKS_FOR_SHOPPING; ?></h5>
        </td>
       </tr>
	  </table>
	 </td>
	</tr>
   </table>
  </td>
 </tr>

 <!-- start pdf //-->
 <?php
 // only display pdf invoice link if * latest * order status is 3 (delivered)
// $delivered_query = tep_db_query("select max(osh.date_added) as los,  osh.orders_status_id from " . TABLE_ORDERS_STATUS_HISTORY . " osh where osh.orders_id = '" . (int)$HTTP_GET_VARS['order_id'] . "' group by osh.orders_status_id order by los desc limit 1");

 //$delivered_status = tep_db_fetch_array($delivered_query);
 //if ($delivered_status['orders_status_id'] == 3 || DISPLAY_PDF_DELIVERED_ONLY == 'false' ){
  ?>
  <?php if (tep_session_is_registered('customer_id')) { ?>
  <tr>
    <td>
      <fieldset>
      <legend><?php echo PDF_INVOICE; ?></legend>
        <table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr class="infoBoxContents">
            <td  class="main">
              <?php echo '' . PDF_DOWNLOAD_LINK . ' <a href="' . tep_href_link(FILENAME_CUSTOMER_PDF, 'order_id=' . (int)$orders['orders_id']) . '" target="_blank"> ' . tep_image(DIR_WS_TEMPLATES.'images/misc/icons/pdf.png') . '</a>'; ?>
            </td>
          </tr>
        </table>
      </fieldset>
    </td>
  </tr>
	<?php
  }
 ?>
 <!-- end pdf //-->

 <?php
 if (DOWNLOAD_ENABLED == 'true') {
   ?>
   <tr>
    <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '5'); ?></td>
   </tr>
   <?php
   include(DIR_WS_MODULES . 'downloads.php');
 }
 ?>


 <!-- Przyciski BOF -->
 <tr>
  <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '3'); ?></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" class="main"><?php echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>
        <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
       </tr>
      </table>
	 </td>
	</tr>
   </table>
  </td>
 </tr>
 <!-- Przyciski EOF -->

 <tr>
  <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
 </tr>
 <tr>
  <td>
   <table border="0" width="100%" cellspacing="0" cellpadding="0">
    <tr>
     <td width="33%">
	  <table border="0" width="100%" cellspacing="0" cellpadding="0">
       <tr>
        <td width="50%" align="right"><?php echo tep_draw_separator('pixel_silver.gif', '1', '5'); ?></td>
		<td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
       </tr>
      </table>
	 </td>
     <td width="33%">
	  <table border="0" width="100%" cellspacing="0" cellpadding="0">
       <tr>
        <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
        <td><?php echo tep_draw_separator('pixel_silver.gif', '1', '5'); ?></td>
		<td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
       </tr>
      </table>
     </td>
     <td width="33%">
	  <table border="0" width="100%" cellspacing="0" cellpadding="0">
       <tr>
	    <td width="48%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
        <td width="52%" align="left"><?php echo tep_image(DIR_WS_TEMPLATES . 'images/misc/checkout_bullet.gif'); ?></td>
       </tr>
      </table>
	 </td>
    </tr>
    <tr>
     <td align="center" width="33%" class="checkoutBarFrom"><?php echo CHECKOUT_BAR_SHIPPEY; ?></td>
     <td align="center" width="33%" class="checkoutBarTo"><?php echo CHECKOUT_BAR_CONFIRMATION; ?></td>
     <td align="center" width="33%" class="checkoutBarTo"><?php echo CHECKOUT_BAR_FINISHED; ?></td>
    </tr>
   </table>
  </td>
 </tr>


</table>
</form>