<?php
if (empty($_GET['no301'])) {
	if (!empty($_GET['products_id'])) $id = $_GET['products_id'];
	else $id = 0; 
	Header("HTTP/1.1 301 Moved Permanently");
	switch($id) {
		case 2: Header("Location: https://picosystems.store/product/4-axis-digital-to-analog-converter"); break; 
		case 3: Header("Location: https://picosystems.store/product/4-axis-encoder-counter"); break; 
		case 4: Header("Location: https://picosystems.store/product/8-slot-ppmc-motherboard"); break; 
		case 5: Header("Location: https://picosystems.store/product/digital-input-output-board"); break; 
		case 6: Header("Location: https://picosystems.store/product/ppmc-card-cage"); break; 
		case 7: Header("Location: https://picosystems.store/product/triple-output-power-supply"); break; 
		case 9: Header("Location: https://picosystems.store/product/universal-pwm-servo-controller"); break; 
		case 10: Header("Location: https://picosystems.store/product/brush-pwm-servo-amplifier"); break; 
		case 11: Header("Location: https://picosystems.store/product/brushless-pwm-servo-amplifier"); break; 
		case 12: Header("Location: https://picosystems.store/product/d-power-switch-and-braking-module"); break; 
		case 13: Header("Location: https://picosystems.store/product/12-v-power-supply"); break; 
		case 15: Header("Location: https://picosystems.store/product/connector-panel"); break; 
		case 16: Header("Location: https://picosystems.store/product/fanuc-encoder-converter"); break; 
		case 36: Header("Location: https://picosystems.store/product/fanuc-serial-encoder-converter-pulse-coder"); break; 
		case 17: Header("Location: https://picosystems.store/product/heat-sink-for-pwm-servo-amps-pre-drilled"); break; 
		case 18: Header("Location: https://picosystems.store/product/panasonic-encoder-converter"); break; 
		case 19: Header("Location: https://picosystems.store/product/size-23-brushless-servo-motor"); break; 
		case 14: Header("Location: https://picosystems.store/product/spindle-dac-2"); break; 
		case 20: Header("Location: https://picosystems.store/product/universal-step-pulse-generator"); break; 
		case 21: Header("Location: https://picosystems.store/product/gecko-interface"); break; 
		case 22: Header("Location: https://picosystems.store/product/spindle-dac-2"); break; // (NOTE DUPLICATE)
		case 23: Header("Location: https://picosystems.store/product/8-channel-resolver-converter"); break; 
		case 24: Header("Location: https://picosystems.store/product/copley-interface"); break; 
		case 25: Header("Location: https://picosystems.store/product/d-c-solid-state-relay"); break; 
		case 26: Header("Location: https://picosystems.store/product/eprom-update"); break; 
		case 33: Header("Location: https://picosystems.store/product/fanuc-encoder-converter"); break; 
		case 27: Header("Location: https://picosystems.store/product/fanuc-serial-encoder-converter-pulse-coder"); break; // (DUP)
		case 28: Header("Location: https://picosystems.store/product/ieee-1284-cable"); break; 
		case 32: Header("Location: https://picosystems.store/product/panasonic-encoder-converter"); break; 
		case 30: Header("Location: https://picosystems.store/product/pcie-parallel-port-card"); break; 
		case 31: Header("Location: https://picosystems.store/product/resolver-converter"); break; 
		default:
			break; 
	}
} ?>
<?php
/*
$Id: product_info.php 1857 2012-06-20 01:21:38Z michael.oscmax@gmail.com $

  osCmax e-Commerce
  http://www.oscmax.com
  adapted for Separate Pricing Per Customer v4.2 2007/06/23, Hide products and categories from groups 2008/08/05 by wkdwich

  Copyright 2000 - 2011 osCmax

  Released under the GNU General Public License
*/

// Most of this file is changed or moved to BTS - Basic Template System - format.
// For adding in contribution or modification - parts of this file has been moved to: catalog\templates\fallback\contents\<filename>.tpl.php as a default (sub 'fallback' with your current template to see if there is a template specife change).
//       catalog\templates\fallback\contents\<filename>.tpl.php as a default (sub 'fallback' with your current template to see if there is a template specife change).
// (Sub 'fallback' with your current template to see if there is a template specific file.)

  require('includes/application_top.php');

// LINE ADDED: MOD - Added for Dynamic MoPics v3.000
  require(DIR_WS_FUNCTIONS . 'dynamic_mopics.php');
  
  require(bts_select('language', FILENAME_PRODUCT_INFO));

//  $product_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$_GET['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
//  $product_check = tep_db_fetch_array($product_check_query);
// BOF Separate Pricing Per Customer, Hide products and categories from groups
      $product_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c using(products_id) left join " . TABLE_CATEGORIES . " c using(categories_id) where p.products_status > '0' and p.products_id = '" . (int)$_GET['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and find_in_set('".$customer_group_id."', products_hide_from_groups) = 0 and find_in_set('" . $customer_group_id . "', categories_hide_from_groups) = 0");
  $product_check = tep_db_fetch_array($product_check_query);
// EOF Separate Pricing Per Customer, Hide products and categories from groups

// BOF: Extra Product Fields
  $epf = array();
  if ($product_check['total'] > 0) {
    $epf_query = tep_db_query("select * from " . TABLE_EPF . " e join " . TABLE_EPF_LABELS . " l where e.epf_status and (e.epf_id = l.epf_id) and (l.languages_id = " . (int)$languages_id . ") and l.epf_active_for_language order by epf_order");
    while ($e = tep_db_fetch_array($epf_query)) {  // retrieve all active extra fields
      $field = 'extra_value';
      if ($e['epf_uses_value_list']) {
        if ($e['epf_multi_select']) {
          $field .= '_ms';
        } else {
          $field .= '_id';
        }
      }
      $field .= $e['epf_id'];
      $epf[] = array('id' => $e['epf_id'],
                     'label' => $e['epf_label'],
                     'uses_list' => $e['epf_uses_value_list'],
                     'multi_select' => $e['epf_multi_select'],
                     'columns' => $e['epf_num_columns'],
                     'display_type' => $e['epf_value_display_type'],
                     'show_chain' => $e['epf_show_parent_chain'],
                     'search' => $e['epf_advanced_search'],
                     'keyword' => $e['epf_use_as_meta_keyword'],
                     'field' => $field);
    }
    $query = "select p.products_date_added, p.products_last_modified, pd.products_name";
    foreach ($epf as $e) {
      if ($e['keyword']) $query .= ", pd." . $e['field'];
    }
    $query .= " from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status > '0' and p.products_id = '" . (int)$_GET['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'";
    $pname = tep_db_fetch_array(tep_db_query($query));
    $datemod = substr((tep_not_null($pname['products_last_modified']) ? $pname['products_last_modified'] : $pname['products_date_added']), 0, 10);
  } else {
    $pname = TEXT_PRODUCT_NOT_FOUND;
    $datemod = date('Y-m-d');
  }
// EOF: Extra Product Fields

  $content = CONTENT_PRODUCT_INFO;
  
  $javascript = $content . '.js.php';
  

  include (bts_select('main')); // BTSv1.5


  require(DIR_WS_INCLUDES . 'application_bottom.php');
	