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

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

 <!-- Naglowek BOF -->
 <tr>
  <td>
   <?php
   $info_box_contents = array();
   $info_box_contents[] = array('text' => HEADING_TITLE);
   new contentBoxHeading($info_box_contents);
   ?>
  </td>
 </tr>
 <tr>
  <td colspan="2"><?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  valign="top"><b><?php echo $products_name; ?></b></td>
	    <td align="right" valign="MIDDLE"><span class="Cena"><?php echo (($review['products_price'] > 0) ? $products_price : ''); ?></span></td>
       </tr>
	   <tr>
		 <td colspan="2" align="right">
<!-- // Points/Rewards Module V2.1rc2a bof //-->
<?php
   if ((USE_POINTS_SYSTEM == 'true') && (tep_not_null(USE_POINTS_FOR_REVIEWS))) {
?>
		<table border="0"  width="100%" cellspacing="1" cellpadding="2">
          <tr>
            <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
          </tr>
          <tr>
            <td align="center" class="smallText" style="font-weight:bold"><?php echo sprintf(REVIEW_HELP_LINK, $currencies->format(tep_calc_shopping_pvalue(USE_POINTS_FOR_REVIEWS)), '<a class="boxLink" style="font-weight:bold" href="' . tep_href_link(FILENAME_MY_POINTS_HELP,'faq_item=13', 'NONSSL') . '" title="' . BOX_INFORMATION_MY_POINTS_HELP . '">' . BOX_INFORMATION_MY_POINTS_HELP . '</a>'); ?></td>
          </tr>
          <tr>
            <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
          </tr>		  
		</table> 		
<?php
  }
?>
<!-- // Points/Rewards Module V2.1rc2a eof //-->
          </td>		 
      </table>
     </td>
	  </tr>
   </table>
  </td>
 </tr>

 <tr>
  <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '3'); ?></td>
 </tr>

 <tr>
  <td>
   <table border="0" width="100%" cellspacing="0" cellpadding="2">
    <tr>
     <td class="main"><?php echo '<b>' . sprintf(TEXT_REVIEW_BY, tep_output_string_protected($review['customers_name'])) . '</b>'; ?></td>
     <td class="smallText" align="right"><?php echo sprintf(TEXT_REVIEW_DATE_ADDED, tep_date_long($review['date_added'])); ?></td>
    </tr>
   </table>
  </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 valign="top" class="main"><?php echo tep_break_string(nl2br(tep_output_string_protected($review['reviews_text'])), 60, '-<br>') . '<br><br><i>' . sprintf(TEXT_REVIEW_RATING, tep_image(DIR_WS_TEMPLATES . 'images/misc/stars_' . $review['reviews_rating'] . '.gif', sprintf(TEXT_OF_5_STARS, $review['reviews_rating'])), sprintf(TEXT_OF_5_STARS, $review['reviews_rating'])) . '</i>'; ?></td>
        <td width="10" align="right">
		 <TABLE border="0" width="<?php echo SMALL_IMAGE_WIDTH + 20; ?>" cellspacing="0" cellpadding="2">
		  <TR>
		   <td width="<?php echo SMALL_IMAGE_WIDTH + 20; ?>" align="right" valign="top">
		    <table border="0" cellspacing="0" cellpadding="3">
		     <tr>
		      <td align="center" class="smallText">
			   <?php
			   if (tep_not_null($review['products_image'])) {
					$szerokosc = DISPLAY_IMAGE_WIDTH + 10;
					$wysokosc = DISPLAY_IMAGE_HEIGHT + 10;
					
					if (FOTO_OPCJE == 'true') {
						?>
						<table border="0" cellpadding="0" cellspacing="0"><tr><td align="center">
                            <?php
                            if ($review['products_image'] != '') {
                            echo tep_image(DIR_WS_IMAGES . $review['products_image'], $review['products_name'], DISPLAY_IMAGE_WIDTH, DISPLAY_IMAGE_HEIGHT,'','','','',DIR_WS_IMAGES . $review['products_image'],true,' rel="lytebox" title="'.$review['products_name'].'"');
                            }
                            ?>
							</td></tr>
						</table>
						<?php
						} else {
						?>
						<table border="0" cellpadding="0" cellspacing="0"><tr><td align="center">
                                <?php
                                if (FOTO_OPCJE != 'true') {
                                ?>
                                    <script type="text/javascript" src="includes/javascript/prototype/prototype.js"></script>
                                    <script type="text/javascript" src="includes/javascript/prototype/effects.js"></script>
                                    <script type="text/javascript" src="includes/javascript/prototype/window.js"></script>
                                    <script type="text/javascript" src="includes/javascript/prototype/window_effects.js"></script>

                                    <link rel="stylesheet" type="text/css" href="<?php echo (bts_select('stylesheet','themes/default.css')); // BTSv1.5 ?>">
                                    <link rel="stylesheet" type="text/css" href="<?php echo (bts_select('stylesheet','themes/spread.css')); // BTSv1.5 ?>">
                                <?php
                                }
                                ?>									
                                
                                <?php
                                $obraz_name = DIR_WS_IMAGES . $review['products_image'];
                                $obrazz = getimagesize($obraz_name);      //tworzy tablice z rozmiarami obrazka

                                if ($obrazz[0] < 550 && $obrazz[1] < 450) {
                                    if ($obrazz[0] < 340 && $obrazz[1] < 340) {
                                        $szerok_box = 400;
                                        $wysok_box = 400;
                                        $szerok = $obrazz[0];
                                        $wysok = $obrazz[1];			
                                      } else {
                                        $szerok_box = $obrazz[0]+60;
                                        $wysok_box = $obrazz[1]+60;		  
                                        $szerok = $obrazz[0];
                                        $wysok = $obrazz[1];
                                    }
                                  } else {
                                    $szeiz = 500 / $obrazz[0];       //oblicza wspolczynnik szerokosci okna do szerokosci obrazka
                                    $wysiz = 400 / $obrazz[1];				
                                    if ($szeiz <= $wysiz) {
                                        $szerok_box = (($obrazz[0] * $szeiz)-2)+60;
                                        $wysok_box = (($obrazz[1] * $szeiz)-2)+60;	
                                        $szerok = ($obrazz[0] * $szeiz)-2;		// szerokosc okna
                                        $wysok = ($obrazz[1] * $szeiz)-2;		// wysokosc okna
                                       } else {
                                        $szerok_box = (($obrazz[0] * $wysiz)-2)+60;
                                        $wysok_box = (($obrazz[1] * $wysiz)-2)+60;			   
                                        $szerok = ($obrazz[0] * $wysiz)-2;
                                        $wysok = ($obrazz[1] * $wysiz)-2;				   
                                    }
                                }								
                                ?>									
                                <script Language="JavaScript1.1"  type="text/javascript">							
                                function ShowPictureReview(pictures_name,name,szerokosc,wysokosc,sz_box,wy_box) {
                                    var imageObject = new Image();
                                    imageObject.src = pictures_name;										
                                    win = new Window( { className: 'spread', destroyOnClose: true, recenterAuto:true, minimizable:false, maximizable:false } );
                                    win.setSize(sz_box, wy_box);
                                                                
                                    win.getContent().innerHTML= unescape("<table cellpadding='0' cellspacing='6' border='0' align='center' width='100%' height='100%'><tr><td width='100%'>"+
                                                                "<table cellpadding='0' cellspacing='0' border='0' align='center' width='100%'>"+
                                                                "<tr><td height='30px' style='font-family:Tahoma,Arial;color:#000;font-size:15px;font-weight:bold;padding-left:5px;'>"+name.substr(0,70)+"<%2Ftd><%2Ftr>"+
                                                                "<%2Ftable><%2Ftd><%2Ftr>"+
                                                                "<tr><td height='100%' align='center' valign='middle' colspan='3' style='background:#ffffff; border:1px solid #c0c0c0;'><img src=\""+pictures_name+"\" width=\""+szerokosc+"\" height=\""+wysokosc+"\" border=\"0\"><%2Ftd><%2Ftr><%2Ftable><%2Fdiv>");																	
                                    win.showCenter();
                                  }  

                                </script>
                                <?php
                                if ($review['products_image'] != '') {
                                echo tep_image(DIR_WS_IMAGES . $review['products_image'], $review['products_name'], DISPLAY_IMAGE_WIDTH, DISPLAY_IMAGE_HEIGHT,'','','','',"javascript:ShowPictureReview('".DIR_WS_IMAGES . $review['products_image']."','".addslashes($review['products_name'])."','".$szerok."','".$wysok."','".$szerok_box."','".$wysok_box."')",true);
                                }
                                ?>
							</td></tr>
						</table>
					<?php
					}
			   }
			   echo '</td></tr><tr><td align="center" class="main" valign="middle">';
//			   echo '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now') . '">' . (($review['products_price'] > 0) ?   tep_image_button('button_in_cart.gif', IMAGE_BUTTON_IN_CART) : '') . '</a>'; 
// Begin Buy Now button mod
 echo '<form name="buy_now" method="post" action="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now', 'NONSSL') . '"><input type="hidden" name="products_id" value="' . $review['products_id'] . '">' . ((USE_SHOP_AS_CATALOG == 'true') ? '' : '<input type="hidden" name="quantity" value="1">' . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART)) . ' </form>';
// End Buy Now button mod
			   ?>
		      </td>
		     </tr>
		    </table>
		   </td>
		  </TR>
		 </TABLE>
	    </td>
       </tr>
      </table>
	 </td>
    </tr>
   </table>
  </td>
 </tr>

 <!-- 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 class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params(array('reviews_id'))) . '">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
        <td class="main" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_WRITE, tep_get_all_get_params(array('reviews_id'))) . '">' . tep_image_button('button_write_review.gif', IMAGE_BUTTON_WRITE_REVIEW) . '</a>'; ?></td>
        <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
       </tr>
      </table>
	 </td>
    </tr>
   </table>
  </td>
 </tr>
 <!-- Przyciski EOF -->

</table>