require('includes/application_top3.php'); function starts_with($s, $prefix){ return strpos($s, $prefix) === 0; } $products_id_num = (int)$_GET['id']; $recenzja_z_zam = 0; if( isset($_GET['oid']) ) { /****************** REDIRECT TO NEW REVIEW FORM ************************/ /******** REMOVE COMMENTS AFTER RELEASE ****************************/ $product_2_order_query = tep_db_query("select o.orders_id, o.token, o.customers_id from orders_products op, orders o where op.products_id = " . $products_id_num . " and o.orders_id=" . $_GET['oid'] . " and o.orders_id = op.orders_id"); $product_2_order = tep_db_fetch_array($product_2_order_query); if(!$product_2_order['orders_id']) { header("HTTP/1.0 404 Not Found"); tep_redirect('http://fabrykaform.pl/brak_produktu.php'); } header ('HTTP/1.1 301 Moved Permanently'); tep_redirect('http://fabrykaform.pl/recenzje/dodaj/'.$product_2_order['token']); return ; //********* END REMOVE COMMENTS /**********************************************/ $product_2_order_query = tep_db_query("select o.orders_id, o.customers_id from orders_products op, orders o where op.products_id = " . $products_id_num . " and o.orders_id=" . $_GET['oid'] . " and o.orders_id = op.orders_id"); $product_2_order = tep_db_fetch_array($product_2_order_query); // if(!tep_db_num_rows($product_2_order_query)) tep_redirect('http://fabrykaform.pl/brak_produktu.php'); if(!$product_2_order['orders_id']) { header("HTTP/1.0 404 Not Found"); tep_redirect('http://fabrykaform.pl/brak_produktu.php'); } if(!tep_session_is_registered('customer_id') && $product_2_order['customers_id']) $_SESSION['customer_id'] = $product_2_order['customers_id']; $recenzja_z_zam = 1; } elseif (tep_href_seo_link(2, $products_id_num)) tep_redirect(tep_href_seo_link(2, $products_id_num)); else tep_redirect('http://fabrykaform.pl'); die(); if( empty($_SESSION['customer_id']) && $recenzja_z_zam) { $_SESSION['navigation']->set_snapshot(); tep_redirect(tep_href_link('klient/logowanie', '', 'SSL')); } $the_manufacturer_query = tep_db_query("select m.manufacturers_id, m.manufacturers_name, m.manufacturers_image, mi.manufacturers_url from (" . TABLE_MANUFACTURERS . " m) left join " . TABLE_MANUFACTURERS_INFO . " mi on (m.manufacturers_id = mi.manufacturers_id), " . TABLE_PRODUCTS . " p where p.products_id = '" . $products_id_num . "' and p.manufacturers_id = m.manufacturers_id"); $the_manufacturers = tep_db_fetch_array($the_manufacturer_query); $product_info_query = tep_db_query("select products_date_added, p.products_id, pd.products_name, pd.products_description, p.products_status, pd.products_info, pd.products_description2, p.products_weight, p.products_quantity, p.products_designer, p.products_image, p.products_image_med, p.products_image_lrg, p.products_image_sm_1, p.products_image_xl_1, p.products_image_sm_2, p.products_image_xl_2, p.products_image_sm_3, p.products_image_xl_3, p.products_price, p.manufacturers_id, p.products_has_slaves, p.products_master, p.products_add, p.products_availability, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from (" . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd) left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_id = '" . $products_id_num . "' and pd.products_id = p.products_id"); $product_info = tep_db_fetch_array($product_info_query); if($product_info['products_master']!=0){ //tep_redirect(tep_href_link('dodaj_recenzje.php', 'id=' . $product_info['products_master'],'','','',$the_manufacturers['manufacturers_name'])); $products_id_num = $product_info['products_master']; $product_info_query = tep_db_query("select products_date_added, p.products_id, pd.products_name, pd.products_description, pd.products_info, pd.products_description2, p.products_weight, p.products_quantity, p.products_designer, p.products_image, p.products_image_med, p.products_image_lrg, p.products_image_sm_1, p.products_image_xl_1, p.products_image_sm_2, p.products_image_xl_2, p.products_image_sm_3, p.products_image_xl_3, p.products_status, p.products_price, p.manufacturers_id, p.products_has_slaves, p.products_master, p.products_add, p.products_availability, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from (" . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd) left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_id = '" . $product_info['products_master'] . "' and pd.products_id = p.products_id"); $product_info = tep_db_fetch_array($product_info_query); if(!$product_info['products_id']) { header("HTTP/1.0 404 Not Found"); // tep_redirect('http://fabrykaform.pl/brak_produktu.php'); die(); } } if(!$product_info['products_id'] || !$product_info['products_status']) { die('Przepraszamy, produkt został wycofany z oferty i nie jest możliwe jego ocenienie.'); header("HTTP/1.0 404 Not Found"); //tep_redirect('http://fabrykaform.pl/brak_produktu.php'); } $the_product_name = strip_tags ($product_info['products_name'], ""); $the_product_description = strip_tags ($product_info['products_description'], ""); $product_info['products_price'] = tep_xppp_getproductprice($product_info['products_id']); $products_name = $product_info['products_name']; require(DIR_WS_INCLUDES . 'header_part1.php'); echo '