<?php
/*
###################################################################################
  Bigware Shop 2.3
  Release Datum: 23.08.2015
  
  Bigware Shop
  http://www.bigware.de

  Copyright (c) 2015 Bigware LTD
  (c) 2000-2001 The Exchange Project  (earlier name of osCommerce)
  (c) 2015	Bigware LTD

  Copyrightvermerke duerfen nicht entfernt werden.
  ------------------------------------------------------------------------
  Dieses Programm ist freie Software. Sie koennen es unter den Bedingungen
  der GNU General Public License, wie von der Free Software Foundation
  veroeffentlicht, weitergeben und/oder modifizieren, entweder gemaess Version 2 
  der Lizenz oder (nach Ihrer Option) jeder spaeteren Version.
  Die Veroeffentlichung dieses Programms erfolgt in der Hoffnung, dass es Ihnen
  von Nutzen sein wird, aber OHNE IRGENDEINE GARANTIE, sogar ohne die
  implizite Garantie der MARKTREIFE oder der VERWENDBARKEIT FUER EINEN
  BESTIMMTEN ZWECK. Details finden Sie in der GNU General Public License.
  
  Sie sollten eine Kopie der GNU General Public License zusammen mit diesem
  Programm erhalten haben. Falls nicht, schreiben Sie an die Free Software
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.

  Infos:
  ------------------------------------------------------------------------
  Der Bigware Shop wurde vor vielen Jahren bereits aus dem bekannten Shopsystem osCommerce
  weiter- und neuentwickelt.
  Der Bigware Shop legt im hohen Masse Wert auf Bedienerfreundlichkeit, beinhaltet eine leichte
  Installation, viele neue professionelle Werkzeuge und zeichnet sich aus durch eine grosse 
  Community, die bei Problemen weiterhelfen kann.
  
  Der Bigware Shop ist auf jedem System lauffaehig, welches eine PHP Umgebung
  (ab PHP 4.1.3) und mySQL zur Verfuegung stellt und auf Linux basiert.
 
  Hilfe erhalten Sie im Forum auf www.bigware.de 
  
  -----------------------------------------------------------------------
  
 ##################################################################################




*/

$text_query = go_db_query("SELECT * FROM item_template where aktiviert = '1' AND template_id = '1'");
$werte = go_db_fetch_array($text_query);
$template_inhalt = $werte["template_inhalt"];   


if ($item_check['total'] < 1) {
	$template_inhalt = preg_replace('/<-ONSUBMIT->/', '', $template_inhalt);
	$template_inhalt = preg_replace('/&lt;-ONSUBMIT-&gt;/', '', $template_inhalt);
	?>
		<table border="0" style="width:100%" cellspacing="0" cellpadding="0">
		<tr>
		<td><?php new infoBox(array(array('text' => TEXT_ITEM_NOT_FOUND))); ?></td>
		</tr>
		<tr>
		<td><?php echo go_fetch_dividing_up('tranparentes.gif', '100%', '10'); ?></td>
		</tr>
		<tr>
		<td><table border="0" style="width:100%" cellspacing="1" cellpadding="2" class="infoBox">
		<tr class="infoFrameInsides">
		<td><table border="0" style="width:100%" cellspacing="0" cellpadding="2">
		<tr>
		<td style="width:10px"><?php echo go_fetch_dividing_up('tranparentes.gif', '10', '1'); ?></td>
		<td align="right"><?php echo '<a href="' . go_href_link($GLOBALS[CONFIG_NAME_FILE][main_bigware_29]) . '">' . go_picture_button('button_continue.gif', PICTURE_BUTTON_CONTINUE) . '</a>'; ?></td>
		<td style="width:10px"><?php echo go_fetch_dividing_up('tranparentes.gif', '10', '1'); ?></td>
		</tr>
		</table></td>
		</tr>
		</table></td>
		</tr>
		</table>
		<?php
} else {

	$date_availability = 'AND (to_days(items_date_available_end) IS NULL OR (to_days(items_date_available_end) IS NOT NULL AND to_days(now()) <= to_days(items_date_available_end)))';
	$item_info_query = go_db_query("select p.*, pd.* from " . DB_TBL_ITEMS . " p, " . DB_TBL_ITEMS_DESCRIPTION . " pd where p.items_status = '1' and p.items_id = '" . (int)$_GET['items_id'] . "' and pd.items_id = p.items_id and pd.language_id = '" . (int)$languages_id . "' $date_availability ");
	$item_info = go_db_fetch_array($item_info_query);
  


	if (file_exists(FOLDER_ABSOLUT_CATALOG . 'modules/masseinheitenartikel')) {
		require(FOLDER_ABSOLUT_CATALOG . 'modules/masseinheitenartikel/content/main_bigware_34b.tpl.php');
	}
	else{
		$javascript_masseinheiten = '';
	}

	$javascript = "
<script>
	" . $javascript_masseinheiten . "
	function changeQuadratur(laenge,breite,anzahl,cform) { 
		qu = (parseInt(laenge)/1000)*(parseInt(breite)/1000)*parseInt(anzahl); 
		cform.elements['quadratur'].value = qu.toString();
		if (cform.elements['total_price']) {
			if (cform.elements['basis_price']) {
				total_price = (qu * cform.elements['price_unit_total'].value) + (parseInt(anzahl) * cform.elements['basis_price'].value);
			} else {
				total_price = (qu * cform.elements['price_unit_total'].value);
			}
			cform.elements['total_price'].value=total_price.toFixed(2);
		}
	} 
	function changeQuadraturU(laenge,breite,anzahl,cform) { 
		qu=((parseInt(laenge)*2/1000)+(parseInt(breite)*2/1000))*parseInt(anzahl); 
		cform.elements['quadratur'].value=qu.toString();
		if (cform.elements['total_price']) {
			total_price = (qu * cform.elements['price_unit_total'].value) + (parseInt(anzahl) * cform.elements['basis_price'].value);
			cform.elements['total_price'].value=total_price.toFixed(2);
		}
	} 
	function validate_form() {
		validity = true; 
		if (!check_empty(document.cart_quantity.quadratur.value)) {
			validity = false; alert('" . LAENGE_IN_MM_ERROR . "'); 
			document.cart_quantity.laenge.focus()
		}  
		return validity;
	}
	function check_empty(text) {
		return (text.length > 0); 
	}
</script>
		"; 

		if (file_exists(FOLDER_ABSOLUT_CATALOG . 'modules/domain_reg')) {
			require(FOLDER_ABSOLUT_CATALOG . 'modules/domain_reg/content/main_bigware_34.tpl.php');
		}
		else{
			$formbeginn = '<form name="cart_quantity" action="' . go_href_link($GLOBALS[CONFIG_NAME_FILE][main_bigware_34], go_get_all_get_parameter(array('action')) . 'action=add_item') . '"<-ONSUBMIT-> method="post">';
			$zahlungsintervall = '';
		}	

	$template_inhalt = $javascript.$formbeginn.$template_inhalt;
	$uvp_anzeigen = $werte["uvp_anzeigen"];
	$items_name2_anzeigen = $werte["items_name2_anzeigen"];
	$text_uvp = $werte["text_uvp"];
	$text_price = $werte["text_price"];
	$anzahl_select = $werte["anzahl_select"];


	if ($item_info['items_price_option']!=0) { 
		$getPriceOptionQuery = go_db_query("select text,immeter, inmeter_breite from price_option where id=".$item_info['items_price_option']);
		if (go_db_num_rows($getPriceOptionQuery)!=0) {
			$getPriceOption = mysqli_result($getPriceOptionQuery,0,'text'); 
			$getImMeter=mysqli_result($getPriceOptionQuery,0,'immeter');
			$getInMeter_breite=mysqli_result($getPriceOptionQuery,0,'inmeter_breite');
		}
		else {
			$getPriceOption='qm';
			$getImMeter=1000;
		}
		$items_price_option_text = ' / '.$getPriceOption;
		$showLaengeBreite = true;
		$template_inhalt = preg_replace('/<-ONSUBMIT->/', ' onSubmit="return validate_form(this.form)"', $template_inhalt);
		$template_inhalt = preg_replace('/&lt;-ONSUBMIT-&gt;/', ' onSubmit="return validate_form(this.form)"', $template_inhalt);
	}
	else {
		$items_price_option_text=""; 
		$showLaengeBreite = false;
		$template_inhalt = preg_replace('/<-ONSUBMIT->/', '', $template_inhalt);
		$template_inhalt = preg_replace('/&lt;-ONSUBMIT-&gt;/', '', $template_inhalt);
	}
	
	go_db_query("update " . DB_TBL_ITEMS_DESCRIPTION . " set items_viewed = items_viewed+1 where items_id = '" . (int)$_GET['items_id'] . "' and language_id = '" . (int)$languages_id . "'");
		if ($item_info['items_price']=="123456.7890"){
			$preistext = QUERYTEXT1  . $item_info['items_name'] . QUERYTEXT2 . $item_info['items_model'] . QUERYTEXT3 ;
			$preistext = urlencode($preistext);
			$items_price = PRICE_ON_DEMAND_TEXT1 . "<a href=\"" . $GLOBALS[CONFIG_NAME_FILE][main_bigware_8] . "?enquiry=$preistext\">" . PRICE_ON_DEMAND_TEXT2 . "</a>";
			$auf_anfrage = 1;
		}
		else{ 
			$items_price = $currencies->display_special_pricing($item_info,$attendee_id).'<input type="hidden" name="immeter" value="'.$getImMeter.'"><input type="hidden" name="inmeter_breite" value="'.$getInMeter_breite.'">';
		}

	$description = stripslashes($item_info['items_description']);
	if (substr($description,0,11) == "page_insert"){ 
		$explode_description = explode(chr(40).chr(41),$description);
		$index = (int)$_GET['page_index'];
		if (count($explode_description) < 2){
			$template_inhalt = preg_replace('/<-description->/', $description, $template_inhalt);
			$template_inhalt = preg_replace('/&lt;-description-&gt;/', $description, $template_inhalt);
		}
		else{
			if ($index >= count($explode_description)){ 
				$index = 1;
			} 
			if ($index < 1)
				$index = 1;
			$file = fopen ("$explode_description[$index]", "r");
			if (!$file) {
				$line = "<p>" . FILE_NOT_OPEN . "\n";
				exit;
			}
			while (!feof ($file)) {
				$line .= fgets ($file, 4096);
			}
			$template_inhalt = preg_replace('/<-description->/', $line, $template_inhalt);
			$template_inhalt = preg_replace('/&lt;-description-&gt;/', $line, $template_inhalt);
			fclose($file);
		}
	}
	else{
		$template_inhalt = preg_replace('/<-description->/', $description, $template_inhalt);
		$template_inhalt = preg_replace('/&lt;-description-&gt;/', $description, $template_inhalt);
	}

	$items_price_uvp = $currencies->format($item_info['items_price_uvp'], false);
	$items_herstellernummer = $item_info['herstellernummer'];
	$template_inhalt = preg_replace('/<-items_herstellernummer->/', $items_herstellernummer, $template_inhalt);
	$template_inhalt = preg_replace('/&lt;-items_herstellernummer-&gt;/', $items_herstellernummer, $template_inhalt);     

	if (go_not_null($item_info['items_model'])) { 
		$item_info_neu = $item_info['items_model'];
		$items_name_for_domainservice = $item_info['items_name'];
		if ($items_name2_anzeigen == "ja"){
			$anzeigen_produkt2 = '<span class="smallText">' . $item_info['items_name2'] . '</span><br>';
		}
		if (SHOW_ITEMCODE == "true"){
			$items_name = '<H1>' . $item_info['items_name'] . '</H1></H1>' . $anzeigen_produkt2 . '<span class="smallText">[' . $item_info_neu  . ']</span>';
		}
		else{
			$items_name = '<H1>' . $item_info['items_name'] . '</H1></H1>' . $anzeigen_produkt2;
		}
	} else {
		if ($items_name2_anzeigen == "ja"){
			$anzeigen_produkt2 = '<span class="smallText">' . $item_info['items_name2'] . '</span>';
		}
		$items_name = '<H1>' . $item_info['items_name'] . '</H1></H1>' . $anzeigen_produkt2;
	}


	if ($auf_anfrage != 1){ 

		if ($zahlungsintervall != '') {
			$items_price = $items_price . $zahlungsintervall;
			$items_price_domainservice = strip_tags($items_price);
		}  
		if ($uvp_anzeigen == "ja"){
			//$items_price = $text_price . '<br>' . $items_price . '<br> <a class="shipping" href="' . go_href_link($GLOBALS[CONFIG_NAME_FILE][main_bigware_67]). '" target="_blank">' . TEXT_SHIPPING_INFO .'</a>';
			$items_price = $text_price . '<br>' . $items_price .$currencies->shipping_tag($item_info);
			
			if ($items_price_uvp > 0){
				$items_price .= '<br><span class="smallText">' . $text_uvp . '<br>' . $items_price_uvp . '</span>';
			}
		}else{
		//	$items_price = $items_price . '<br> <a class="shipping" href="' . go_href_link($GLOBALS[CONFIG_NAME_FILE][main_bigware_67]). '" target="_blank">' . TEXT_SHIPPING_INFO .'</a>';
			$items_price = $items_price . $currencies->shipping_tag($item_info);
		}
	}

	if (file_exists(FOLDER_ABSOLUT_CATALOG . 'modules/download')) {
		require(FOLDER_ABSOLUT_CATALOG . 'modules/download/content/main_bigware_34.tpl.php');
	}
	$template_inhalt = preg_replace('/<-items_name->/', $items_name, $template_inhalt);
	$template_inhalt = preg_replace('/&lt;-items_name-&gt;/', $items_name, $template_inhalt);  
	if (PRICES_LOGGED_IN == 'false') {
		$item_price_d = $items_price;
		$showbutton = false;
	}
	if ((PRICES_LOGGED_IN == 'true') && (!go_session_is_registered('attendee_id'))) {
		$item_price_d = ('<a href="' . go_href_link($GLOBALS[CONFIG_NAME_FILE][main_bigware_40], '','SSL') . '">'  . PRICES_LOGGED_IN_SUBMIT . '</a>&nbsp;' );
	}
	else{
		if (file_exists(FOLDER_ABSOLUT_CATALOG . 'modules/masseinheitenartikel')) {
			require(FOLDER_ABSOLUT_CATALOG . 'modules/masseinheitenartikel/content/main_bigware_34c.tpl.php');
		}
		if ($item_info['iss_masseinheit'] == '1') {
			$item_price_d = $item_price_d;
		}
		else{
			$item_price_d = $items_price;
			$showbutton = true;    
		}                       
	}

	$price_unit_total = round($item_info['items_price'] * (1 + go_get_tax_rate($item_info['items_tax_class_id'])/100),2);
	$template_inhalt .= '<input type="hidden" name="price_unit_total" value="'.$price_unit_total.'">';

	if ($item_info['items_basis_price'] > 0) {
		$items_basis_price = $currencies->display_price($item_info['items_basis_price'], go_get_tax_rate($item_info['items_tax_class_id']));
		$basis_price_vat = round($item_info['items_basis_price'] * (1 + go_get_tax_rate($item_info['items_tax_class_id'])/100),2);
		$template_inhalt = preg_replace('/<-items_basis_price->/i', $items_basis_price, $template_inhalt);
		$template_inhalt = preg_replace('/&lt;-items_basis_price-&gt;/i', $items_basis_price, $template_inhalt);
		$template_inhalt = preg_replace('/\[BASIS\-PRICE\]/i', '', $template_inhalt);
		$template_inhalt.= '<input type="hidden" name="basis_price" value="'.$basis_price_vat.'">';
	} else {
		$template_inhalt = preg_replace('/\[BASIS\-PRICE\].+\[BASIS\-PRICE\]/is', '', $template_inhalt);
	}

	$template_inhalt = preg_replace('/<-items_price->/', $item_price_d, $template_inhalt); 
	$template_inhalt = preg_replace('/&lt;-items_price-&gt;/', $item_price_d, $template_inhalt);  
	$template_inhalt = preg_replace('/<-bezeichnung1->/', $item_info['bezeichnung1'], $template_inhalt);  
	$template_inhalt = preg_replace('/&lt;-bezeichnung1-&gt;/', $item_info['bezeichnung1'], $template_inhalt);
	$template_inhalt = preg_replace('/<-items_quantity->/', $item_info['items_quantity'], $template_inhalt);  
	$template_inhalt = preg_replace('/&lt;-items_quantity-&gt;/', $item_info['items_quantity'], $template_inhalt);
	$template_inhalt = preg_replace('/<-inhalt1->/', $item_info['inhalt1'], $template_inhalt);
	$template_inhalt = preg_replace('/&lt;-inhalt1-&gt;/', $item_info['inhalt1'], $template_inhalt);
	$template_inhalt = preg_replace('/<-bezeichnung2->/', $item_info['bezeichnung2'], $template_inhalt);
	$template_inhalt = preg_replace('/&lt;-bezeichnung2-&gt;/', $item_info['bezeichnung2'], $template_inhalt);
	$template_inhalt = preg_replace('/<-inhalt2->/', $item_info['inhalt2'], $template_inhalt);
	$template_inhalt = preg_replace('/&lt;-inhalt2-&gt;/', $item_info['inhalt2'], $template_inhalt);
	$template_inhalt = preg_replace('/<-bezeichnung3->/', $item_info['bezeichnung3'], $template_inhalt);
	$template_inhalt = preg_replace('/&lt;-bezeichnung3-&gt;/', $item_info['bezeichnung3'], $template_inhalt);
	$template_inhalt = preg_replace('/<-inhalt3->/', $item_info['inhalt3'], $template_inhalt);
	$template_inhalt = preg_replace('/&lt;-inhalt3-&gt;/', $item_info['inhalt3'], $template_inhalt);
	$template_inhalt = preg_replace('/<-bezeichnung4->/', $item_info['bezeichnung4'], $template_inhalt);
	$template_inhalt = preg_replace('/&lt;-bezeichnung4-&gt;/', $item_info['bezeichnung4'], $template_inhalt);
	$template_inhalt = preg_replace('/<-inhalt4->/', $item_info['inhalt4'], $template_inhalt);
	$template_inhalt = preg_replace('/&lt;-inhalt4-&gt;/', $item_info['inhalt4'], $template_inhalt);
	$template_inhalt = preg_replace('/<-bezeichnung5->/', $item_info['bezeichnung5'], $template_inhalt);
	$template_inhalt = preg_replace('/&lt;-bezeichnung5-&gt;/', $item_info['bezeichnung5'], $template_inhalt);
	$template_inhalt = preg_replace('/<-inhalt5->/', $item_info['inhalt5'], $template_inhalt);
	$template_inhalt = preg_replace('/&lt;-inhalt5-&gt;/', $item_info['inhalt5'], $template_inhalt);
	$template_inhalt = preg_replace('/<-bezeichnung6->/', $item_info['bezeichnung6'], $template_inhalt);
	$template_inhalt = preg_replace('/&lt;-bezeichnung6-&gt;/', $item_info['bezeichnung6'], $template_inhalt);
	$template_inhalt = preg_replace('/<-inhalt6->/', $item_info['inhalt6'], $template_inhalt);  
	$template_inhalt = preg_replace('/&lt;-inhalt6-&gt;/', $item_info['inhalt6'], $template_inhalt);     
	$items_characteristics_query = go_db_query("select count(*) as total from " . DB_TBL_ITEMS_OPTIONS . " popt, " . DB_TBL_ITEMS_CHARACTERISTICS . " patrib where patrib.items_id='" . (int)$_GET['items_id'] . "' and patrib.options_id = popt.items_options_id and popt.language_id = '" . (int)$languages_id . "'");
	$items_characteristics = go_db_fetch_array($items_characteristics_query);
	if ($items_characteristics['total'] > 0) {
		if (go_not_null(TEXT_ITEM_OPTIONS)) { 
			$template_inhalt = preg_replace('/<-items_options_ueberschrift->/', TEXT_ITEM_OPTIONS, $template_inhalt); 
			$template_inhalt = preg_replace('/&lt;-items_options_ueberschrift-&gt;/', TEXT_ITEM_OPTIONS, $template_inhalt);            
		}
		else{
			$template_inhalt = preg_replace('/<-items_options_ueberschrift->/', "", $template_inhalt);
			$template_inhalt = preg_replace('/&lt;-items_options_ueberschrift-&gt;/', "", $template_inhalt); 

		}

		$items_options_name_query = go_db_query("select distinct popt.items_options_id, popt.items_options_name from " . DB_TBL_ITEMS_OPTIONS . " popt, " . DB_TBL_ITEMS_CHARACTERISTICS . " patrib where patrib.items_id='" . (int)$_GET['items_id'] . "' and patrib.options_id = popt.items_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.items_options_name");
		$mehroptionen = '<table border="0" cellspacing="0" cellpadding="0">';
		$i = 0;
		///////////////////////////////////////////
		global $attendee_id;
		$attendee_group_query = go_db_query("select attendees_group_id from " . DB_TBL_ATTENDEES . " where attendees_id =  '" . $attendee_id . "'");
		$attendee_group = go_db_fetch_array($attendee_group_query);
		$attendee_group_discount = 0;
		if ( $attendee_group['attendees_group_id'] != 0) {
			$attendee_group_discount_query = go_db_query("select attendees_group_discount from " . DB_TBL_ATTENDEES_GROUPS . " where attendees_group_id = " . $attendee_group['attendees_group_id']);
			$attendee_group_discount = go_db_fetch_array($attendee_group_discount_query);
		}
		///////////////////////////////////////////
		while ($items_options_name = go_db_fetch_array($items_options_name_query)) {
			$i++;
			$mehroptionen .= "<tr><td height=8></td></tr><tr><td class=\"main\"><-items_options_name$i-></td><td class=\"main\"><-items_options_select$i-></td></tr>";	
		}
		$mehroptionen .= '</table>';
		$template_inhalt = preg_replace('/<-items_options_select->/', "$mehroptionen", $template_inhalt);
		$template_inhalt = preg_replace('/&lt;-items_options_select-&gt;/', "$mehroptionen", $template_inhalt);
		$template_inhalt = preg_replace('/<-items_options_name->/', "", $template_inhalt);
		$template_inhalt = preg_replace('/&lt;-items_options_name-&gt;/', "", $template_inhalt);
		$i = 0;
		$items_options_name_query = go_db_query("select distinct popt.items_options_id, popt.items_options_name from " . DB_TBL_ITEMS_OPTIONS . " popt, " . DB_TBL_ITEMS_CHARACTERISTICS . " patrib where patrib.items_id='" . (int)$_GET['items_id'] . "' and patrib.options_id = popt.items_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.items_options_name");
		while ($items_options_name = go_db_fetch_array($items_options_name_query)) {
			$items_options_array = array();
			$items_options_query = go_db_query("select pov.items_options_values_id, pov.items_options_values_name, pa.options_values_price, pa.price_prefix from " . DB_TBL_ITEMS_CHARACTERISTICS . " pa, " . DB_TBL_ITEMS_OPTIONS_VALUES . " pov where pa.items_id = '" . (int)$_GET['items_id'] . "' and pa.options_id = '" . (int)$items_options_name['items_options_id'] . "' and pa.options_values_id = pov.items_options_values_id and pov.language_id = '" . (int)$languages_id . "' ORDER BY pa.attributs_sort_order ASC");
			//echo "select pov.items_options_values_id, pov.items_options_values_name, pa.options_values_price, pa.price_prefix from " . DB_TBL_ITEMS_CHARACTERISTICS . " pa, " . DB_TBL_ITEMS_OPTIONS_VALUES . " pov where pa.items_id = '" . (int)$_GET['items_id'] . "' and pa.options_id = '" . (int)$items_options_name['items_options_id'] . "' and pa.options_values_id = pov.items_options_values_id and pov.language_id = '" . (int)$languages_id . "' ORDER BY pa.attributs_sort_order ASC";
			while ($items_options = go_db_fetch_array($items_options_query)) {
				$items_options_array[] = array('id' => $items_options['items_options_values_id'], 'text' => $items_options['items_options_values_name']); 

				if ($items_options['options_values_price'] != '0') {
					$option_price_display = ' (' . $items_options['price_prefix'] . $currencies->display_price($items_options['options_values_price']*((100 - $attendee_group_discount['attendees_group_discount']) / 100), go_get_tax_rate($item_info['items_tax_class_id'])) .') ';

					if (PRICES_LOGGED_IN == 'false') { 
						$option_price_display_d = $option_price_display;
					}
					if ((PRICES_LOGGED_IN == 'true') && (!go_session_is_registered('attendee_id'))) {
						$option_price_display_d = '';
					}  else  {
						$option_price_display_d = $option_price_display;
					}   
					$items_options_array[sizeof($items_options_array)-1]['text'] .= $option_price_display_d; 
				}
			}
			if (isset($cart->contents[$_GET['items_id']]['characteristics'][$items_options_name['items_options_id']])) {
				$selected_characteristic = $cart->contents[$_GET['items_id']]['characteristics'][$items_options_name['items_options_id']];
			} else {
				$selected_characteristic = false;
			}

			$i++;
			$template_inhalt = preg_replace("/<-items_options_name$i->/",  $items_options_name['items_options_name'] . ':', $template_inhalt);
			$template_inhalt = preg_replace("/&lt;-items_options_name$i-&gt;/",  $items_options_name['items_options_name'] . ':', $template_inhalt);  

			$a = array();
			foreach($items_options_array as $select_optionen) {
				$z = 0;
				$value_id = "";
				$nicht_anzeigen = "";
				foreach ($select_optionen as $value_text) {



					if ($z == '0'){	    	
						$value_id = $value_text;
						$values_qty_query = go_db_query("SELECT qty FROM " . DB_TBL_ITEMS_CHARACTERISTICS . " WHERE items_id='" . (int)$_GET['items_id'] . "' AND options_values_id='" . $value_id . "' AND options_id='" . (int)$items_options_name['items_options_id'] . "'");
						$values_qty_query_result=go_db_fetch_array($values_qty_query);

						if ($values_qty_query_result['qty'] =='0'){
							$nicht_anzeigen = 1;	
						}    
					}
					elseif ($z == '1'){
						if ($nicht_anzeigen != 1){
							$a[] = array('id' => $value_id, 'text' => $value_text);
						}
					}
					$z++;
				}
			}  
			$items_options_array = $a;
			$template_inhalt = preg_replace("/<-items_options_select$i->/",  go_fetch_pull_down_menu('id[' . $items_options_name['items_options_id'] . ']', $items_options_array, $selected_characteristic), $template_inhalt); 
			$template_inhalt = preg_replace("/&lt;-items_options_select$i-&gt;/",  go_fetch_pull_down_menu('id[' . $items_options_name['items_options_id'] . ']', $items_options_array, $selected_characteristic), $template_inhalt); 
		}
	}
	else{
		$template_inhalt = preg_replace('/<-items_options_name->/', "", $template_inhalt);
		$template_inhalt = preg_replace('/&lt;-items_options_name-&gt;/', "", $template_inhalt);
		$template_inhalt = preg_replace('/<-items_options_select->/', "", $template_inhalt);
		$template_inhalt = preg_replace('/&lt;-items_options_select-&gt;/', "", $template_inhalt);
		$template_inhalt = preg_replace('/<-items_options_ueberschrift->/', "", $template_inhalt);
		$template_inhalt = preg_replace('/&lt;-items_options_ueberschrift-&gt;/', "", $template_inhalt);
	}
	$reviews_query = go_db_query("select count(*) as count from " . DB_TBL_REVIEWS . " where items_id = '" . (int)$_GET['items_id'] . "'");
	$reviews = go_db_fetch_array($reviews_query);
	if ($reviews['count'] > 0) {
		$template_inhalt = preg_replace('/<-aktuelle_meinung->/', TEXT_CURRENT_REVIEWS . ' ' . $reviews['count'], $template_inhalt);
		$template_inhalt = preg_replace('/&lt;-aktuelle_meinung-&gt;/', TEXT_CURRENT_REVIEWS . ' ' . $reviews['count'], $template_inhalt); 
	}
	else{
		$template_inhalt = preg_replace('/<-aktuelle_meinung->/', "", $template_inhalt); 
		$template_inhalt = preg_replace('/&lt;-aktuelle_meinung-&gt;/', "", $template_inhalt); 
	}
	if (go_not_null($item_info['items_url'])) {
		$template_inhalt = preg_replace('/<-item_url->/', sprintf(TEXT_MORE_INFORMATION, go_href_link($GLOBALS[CONFIG_NAME_FILE][main_bigware_63], 'action=url&goto=' . urlencode($item_info['items_url']), 'NONSSL', true, false)), $template_inhalt); 
		$template_inhalt = preg_replace('/&lt;-item_url-&gt;/', sprintf(TEXT_MORE_INFORMATION, go_href_link($GLOBALS[CONFIG_NAME_FILE][main_bigware_63], 'action=url&goto=' . urlencode($item_info['items_url']), 'NONSSL', true, false)), $template_inhalt);     	
	}
	else{
		$template_inhalt = preg_replace('/<-item_url->/', "", $template_inhalt); 
		$template_inhalt = preg_replace('/&lt;-item_url-&gt;/', "", $template_inhalt);    
	}

// Erweiterung Bert Bestandsanzeige ;
	$prod_quantity = go_get_items_stock($_GET['items_id']);

// ist die Bestandsanzeige per Ampel eingeschaltet ?
            if (STOCK_LIMIT_LEVEL == 'true' ) {

// wenn ja 

// die Einstellungen f�r die gelbe und orange Ampel aus der DB holen 
$orange_light_query = go_db_query("SELECT * FROM " . DB_TBL_LIMIT_LEVEL_CONFIG . " WHERE set_it_up_key = 'SHOW_ORANGE_TRAFFIC_LIGHT' ");
$orange_light_sql = go_db_fetch_array($orange_light_query);
$orange_light = $orange_light_sql["set_it_up_value"];

$yellow_light_query = go_db_query("SELECT * FROM " . DB_TBL_LIMIT_LEVEL_CONFIG . " WHERE set_it_up_key = 'SHOW_YELLOW_TRAFFIC_LIGHT' ");
$yellow_light_sql = go_db_fetch_array($yellow_light_query);
$yellow_light = $yellow_light_sql["set_it_up_value"];

// wenn Artikelbestand weniger "1" ist die Ampel "ROT" 
                if ($prod_quantity < 1){
		  				  $ampel = '<img src="' . FOLDER_RELATIV_PIC_SYSTEM_TEMPLATES . 'ampel_rot.gif" border="0" title="Artikel zur Zeit nicht verf�gbar">';
                }
// wenn Artikelbestand weniger oder gleich "ORANGE" 
                elseif ($prod_quantity <= $orange_light){
		  				  $ampel = '<img src="' . FOLDER_RELATIV_PIC_SYSTEM_TEMPLATES . 'ampel_orange.gif" border="0" title="Artikel nur noch sehr begrenzt verf�gbar">';
                }
// wenn Artikelbestand weniger oder gleich "GELB" 
                elseif ($prod_quantity <= $yellow_light){
		  				  $ampel = '<img src="' . FOLDER_RELATIV_PIC_SYSTEM_TEMPLATES . 'ampel_gelb.gif" border="0" title="Artikel begrenzt verf�gbar">';
                }
// wenn Artikelbestand mehr als "GELB" ist die Ampel gr�n 
                elseif ($prod_quantity > $yellow_light){
		  				  $ampel = '<img src="' . FOLDER_RELATIV_PIC_SYSTEM_TEMPLATES . 'ampel_gruen.gif" border="0" title="Artikel ausreichend verf�gbar">';
                }
            }
            else {

// Ampelanzeige ist ausgeschaltet 
              	if ($prod_quantity < 1){
            		$ampel = '<img src="' . FOLDER_RELATIV_PIC_SYSTEM_TEMPLATES . 'rote_ampel.jpg" border="0">';
              	}
              	else{
            		$ampel = '<img src="' . FOLDER_RELATIV_PIC_SYSTEM_TEMPLATES . 'gruene_ampel.jpg" border="0">';
              	} 
            }
// Ende ;

	$template_inhalt = preg_replace('/<-ampel->/', $ampel, $template_inhalt); 
	$template_inhalt = preg_replace('/&lt;-ampel-&gt;/', $ampel, $template_inhalt); 

	$picture_frame = picture_frame();


	if (go_not_null($item_info['items_picture'])) {
		$template_inhalt = preg_replace('/<-items_picture->/', $picture_frame['begin_frame'] . make_picture_popup($item_info['items_id'], $item_info['items_picture'], $item_info['items_name'], TEXT_CLICK_TO_ENLARGE, '2') . $picture_frame['end_frame'], $template_inhalt);
		$template_inhalt = preg_replace('/&lt;-items_picture-&gt;/', $picture_frame['begin_frame'] . make_picture_popup($item_info['items_id'], $item_info['items_picture'], $item_info['items_name'], TEXT_CLICK_TO_ENLARGE, '2') . $picture_frame['end_frame'], $template_inhalt);
	}
	else{
		$template_inhalt = preg_replace('/<-items_picture->/', "", $template_inhalt);
		$template_inhalt = preg_replace('/&lt;-items_picture-&gt;/', "", $template_inhalt);    
	}
	if (go_not_null($item_info['items_picture'])) {
		$template_inhalt = preg_replace('/<-items_picture_minus->/', go_picture(FOLDER_RELATIV_PICTURES . $item_info['items_picture'], $item_info['items_name'], '', '', 'hspace="5" vspace="5"'), $template_inhalt);
		$template_inhalt = preg_replace('/&lt;-items_picture_minus-&gt;/', go_picture(FOLDER_RELATIV_PICTURES . $item_info['items_picture'], $item_info['items_name'], '', '', 'hspace="5" vspace="5"'), $template_inhalt);
	}
	else{
		$template_inhalt = preg_replace('/<-items_picture_minus->/', "", $template_inhalt);
		$template_inhalt = preg_replace('/&lt;-items_picture_minus-&gt;/', "", $template_inhalt);    
	}
	if (go_not_null($item_info['items_bpicture'])) {
		$template_inhalt = preg_replace('/<-items_bpicture->/', go_picture(FOLDER_RELATIV_PICTURES . $item_info['items_bpicture'], $item_info['items_name'], '', '', 'hspace="5" vspace="5"'), $template_inhalt);
		$template_inhalt = preg_replace('/&lt;-items_bpicture-&gt;/', go_picture(FOLDER_RELATIV_PICTURES . $item_info['items_bpicture'], $item_info['items_name'], '', '', 'hspace="5" vspace="5"'), $template_inhalt);
	}
	else{
		$template_inhalt = preg_replace('/<-items_bpicture->/', "", $template_inhalt); 
		$template_inhalt = preg_replace('/&lt;-items_bpicture-&gt;/', "", $template_inhalt);    
	}
	if (go_not_null($item_info['items_3picture'])) {
		$template_inhalt = preg_replace('/<-items_3picture->/', go_picture(FOLDER_RELATIV_PICTURES . $item_info['items_3picture'], $item_info['items_name'], '', '', 'hspace="5" vspace="5"'), $template_inhalt);
		$template_inhalt = preg_replace('/&lt;-items_3picture-&gt;/', go_picture(FOLDER_RELATIV_PICTURES . $item_info['items_3picture'], $item_info['items_name'], '', '', 'hspace="5" vspace="5"'), $template_inhalt);
	}
	else{
		$template_inhalt = preg_replace('/<-items_3picture->/', "", $template_inhalt); 
		$template_inhalt = preg_replace('/&lt;-items_3picture-&gt;/', "", $template_inhalt);    
	}
	if (go_not_null($item_info['items_4picture'])) {
		$template_inhalt = preg_replace('/<-items_4picture->/', go_picture(FOLDER_RELATIV_PICTURES . $item_info['items_4picture'], $item_info['items_name'], '', '', 'hspace="5" vspace="5"'), $template_inhalt);
		$template_inhalt = preg_replace('/&lt;-items_4picture-&gt;/', go_picture(FOLDER_RELATIV_PICTURES . $item_info['items_4picture'], $item_info['items_name'], '', '', 'hspace="5" vspace="5"'), $template_inhalt);
	}
	else{
		$template_inhalt = preg_replace('/<-items_4picture->/', "", $template_inhalt); 
		$template_inhalt = preg_replace('/&lt;-items_4picture-&gt;/', "", $template_inhalt);    
	}
	if (go_not_null($item_info['items_5picture'])) {
		$template_inhalt = preg_replace('/<-items_5picture->/', go_picture(FOLDER_RELATIV_PICTURES . $item_info['items_5picture'], $item_info['items_name'], '', '', 'hspace="5" vspace="5"'), $template_inhalt);
		$template_inhalt = preg_replace('/&lt;-items_5picture-&gt;/', go_picture(FOLDER_RELATIV_PICTURES . $item_info['items_5picture'], $item_info['items_name'], '', '', 'hspace="5" vspace="5"'), $template_inhalt);
	} else {
		$template_inhalt = preg_replace('/<-items_5picture->/', "", $template_inhalt); 
		$template_inhalt = preg_replace('/&lt;-items_5picture-&gt;/', "", $template_inhalt);    
	}

	if (go_not_null($item_info['items_bpicture'])) {
		$template_inhalt = preg_replace('/<-items_bpicture_plus->/', $picture_frame['begin_frame'] . make_picture_popup($item_info['items_id'], $item_info['items_bpicture'], $item_info['items_name'], TEXT_CLICK_TO_ENLARGE, '1') . $picture_frame['end_frame'], $template_inhalt);
		$template_inhalt = preg_replace('/&lt;-items_bpicture_plus-&gt;/', $picture_frame['begin_frame'] . make_picture_popup($item_info['items_id'], $item_info['items_bpicture'], $item_info['items_name'], TEXT_CLICK_TO_ENLARGE, '1') . $picture_frame['end_frame'], $template_inhalt);
	}
	else{
		$template_inhalt = preg_replace('/<-items_bpicture_plus->/', "", $template_inhalt); 
		$template_inhalt = preg_replace('/&lt;-items_bpicture_plus-&gt;/', "", $template_inhalt);    
	}


	if (go_not_null($item_info['items_3picture'])) {
		$template_inhalt = preg_replace('/<-items_3picture_plus->/', $picture_frame['begin_frame'] . make_picture_popup($item_info['items_id'], $item_info['items_3picture'], $item_info['items_name'], TEXT_CLICK_TO_ENLARGE, '3') . $picture_frame['end_frame'], $template_inhalt);
		$template_inhalt = preg_replace('/&lt;-items_3picture_plus-&gt;/', $picture_frame['begin_frame'] . make_picture_popup($item_info['items_id'], $item_info['items_3picture'], $item_info['items_name'], TEXT_CLICK_TO_ENLARGE, '3') . $picture_frame['end_frame'], $template_inhalt);
	}
	else{
		$template_inhalt = preg_replace('/<-items_3picture_plus->/', "", $template_inhalt); 
		$template_inhalt = preg_replace('/&lt;-items_3picture_plus-&gt;/', "", $template_inhalt);    
	}
	if (go_not_null($item_info['items_4picture'])) {
		$template_inhalt = preg_replace('/<-items_4picture_plus->/', $picture_frame['begin_frame'] . make_picture_popup($item_info['items_id'], $item_info['items_4picture'], $item_info['items_name'], TEXT_CLICK_TO_ENLARGE, '4') . $picture_frame['end_frame'], $template_inhalt);
		$template_inhalt = preg_replace('/&lt;-items_4picture_plus-&gt;/', $picture_frame['begin_frame'] . make_picture_popup($item_info['items_id'], $item_info['items_4picture'], $item_info['items_name'], TEXT_CLICK_TO_ENLARGE, '4') . $picture_frame['end_frame'], $template_inhalt);
	}
	else{
		$template_inhalt = preg_replace('/<-items_4picture_plus->/', "", $template_inhalt); 
		$template_inhalt = preg_replace('/&lt;-items_4picture_plus-&gt;/', "", $template_inhalt);    
	}
	if (go_not_null($item_info['items_5picture'])) {
		$template_inhalt = preg_replace('/<-items_5picture_plus->/', $picture_frame['begin_frame'] . make_picture_popup($item_info['items_id'], $item_info['items_5picture'], $item_info['items_name'], TEXT_CLICK_TO_ENLARGE, '5') . $picture_frame['end_frame'], $template_inhalt);
		$template_inhalt = preg_replace('/&lt;-items_5picture_plus-&gt;/', $picture_frame['begin_frame'] . make_picture_popup($item_info['items_id'], $item_info['items_5picture'], $item_info['items_name'], TEXT_CLICK_TO_ENLARGE, '5') . $picture_frame['end_frame'], $template_inhalt);
	}
	else{
		$template_inhalt = preg_replace('/<-items_5picture_plus->/', "", $template_inhalt); 
		$template_inhalt = preg_replace('/&lt;-items_5picture_plus-&gt;/', "", $template_inhalt);    
	}


	if ($item_info['items_date_available'] > date('Y-m-d H:i:s')) {

		$template_inhalt = preg_replace('/<-items_datum->/', sprintf(TEXT_DATE_AVAILABLE, go_date_long($item_info['items_date_available'])), $template_inhalt);
		$template_inhalt = preg_replace('/&lt;-items_datum-&gt;/', sprintf(TEXT_DATE_AVAILABLE, go_date_long($item_info['items_date_available'])), $template_inhalt);
	} else {

		$template_inhalt = preg_replace('/<-items_datum->/', sprintf($GLOBALS[CONFIG_LANG_DATA][main_bigware_34][TEXT_DATE_ADDED], go_date_long($item_info['items_date_added'])), $template_inhalt);
		$template_inhalt = preg_replace('/&lt;-items_datum-&gt;/', sprintf($GLOBALS[CONFIG_LANG_DATA][main_bigware_34][TEXT_DATE_ADDED], go_date_long($item_info['items_date_added'])), $template_inhalt);
	}
	if ($item_info['items_ship_price'] > 0){
		define('TEXT_SHIP_PRICE', VERSANDPREIS_FOR_THIS . ' ' . $currencies->display_price($item_info['items_ship_price'], ''));
		$template_inhalt = preg_replace('/<-items_individueller_versandpreis->/', sprintf(TEXT_SHIP_PRICE, ($item_info['items_ship_price'])), $template_inhalt);
		$template_inhalt = preg_replace('/&lt;-items_individueller_versandpreis-&gt;/', sprintf(TEXT_SHIP_PRICE, ($item_info['items_ship_price'])), $template_inhalt);
	}
	else{
		$template_inhalt = preg_replace('/<-items_individueller_versandpreis->/', '', $template_inhalt);
		$template_inhalt = preg_replace('/&lt;-items_individueller_versandpreis-&gt;/', '', $template_inhalt);
	}
	if ($item_info['items_ship_price_two'] > 0){	
		define('TEXT_SHIP_PRICE_TWO', VERSANDPREIS_FOR_THIS_SECOND . ' ' . $currencies->display_price($item_info['items_ship_price_two'], ''));
		$template_inhalt = preg_replace('/<-items_individueller_versandpreis_zwei->/', sprintf(TEXT_SHIP_PRICE_TWO, ($item_info['items_ship_price_two'])), $template_inhalt);
		$template_inhalt = preg_replace('/&lt;-items_individueller_versandpreis_zwei-&gt;/', sprintf(TEXT_SHIP_PRICE_TWO, ($item_info['items_ship_price_two'])), $template_inhalt);
	}
	else{
		$template_inhalt = preg_replace('/<-items_individueller_versandpreis_zwei->/', '', $template_inhalt);
		$template_inhalt = preg_replace('/&lt;-items_individueller_versandpreis_zwei-&gt;/', '', $template_inhalt);
	}
	//for ($i=0; $i<$prod_quantity; $i++) {
	//for ($i=0; $i<$anzahl_select; $i++) {
	//	$qty_array[] = array('id' => $i+1, 'text' => $i+1);
	//}
	
	if (STOCK_CHECK == 'true') {
		for ($i=0; $i<$prod_quantity; $i++) {
			$qty_array[] = array('id' => $i+1, 'text' => $i+1);
		}
	} else {
		for ($i=0; $i<$anzahl_select; $i++) {
			$qty_array[] = array('id' => $i+1, 'text' => $i+1);
		}
	}

	
	$template_inhalt = preg_replace('/<-bewerten_button->/', '<a href="' . go_href_link($GLOBALS[CONFIG_NAME_FILE][main_bigware_35], go_get_all_get_parameter()) . '">' . go_picture_button('button_reviews.gif', PICTURE_BUTTON_REVIEWS) . '</a>', $template_inhalt);
	$template_inhalt = preg_replace('/&lt;-bewerten_button-&gt;/', '<a href="' . go_href_link($GLOBALS[CONFIG_NAME_FILE][main_bigware_35], go_get_all_get_parameter()) . '">' . go_picture_button('button_reviews.gif', PICTURE_BUTTON_REVIEWS) . '</a>', $template_inhalt);
	if ($auf_anfrage == 1){
		$template_inhalt = preg_replace('/<-kaufen_button->/', '<a href="' . $GLOBALS[CONFIG_NAME_FILE][main_bigware_8] . '?enquiry=' . $preistext . '">' . go_picture_button('button_fragen_now.gif', PICTURE_BUTTON_BUY_NOW) . '</a>', $template_inhalt);
		$template_inhalt = preg_replace('/&lt;-kaufen_button-&gt;/', '<a href="' . $GLOBALS[CONFIG_NAME_FILE][main_bigware_8] . '?enquiry=' . $preistext . '">' . go_picture_button('button_fragen_now.gif', PICTURE_BUTTON_BUY_NOW) . '</a>', $template_inhalt);
	}
	else{ 
		if (PRICES_LOGGED_IN == 'false')
			if ($item_info['domainservice_status'] == '1'){
				$submit_button = go_picture_submit('button_buy_now_domain.gif', PICTURE_BUTTON_IN_CART);
			}
			else{
				$submit_button = go_picture_submit('button_in_cart.gif', PICTURE_BUTTON_IN_CART);
			}
		$submit_item_quant = go_fetch_pull_down_menu('cart_quantity', $qty_array, 1); 
		if ( (PRICES_LOGGED_IN == 'true') && (!go_session_is_registered('attendee_id'))) {
			$submit_button = '<a href="' . go_href_link($GLOBALS[CONFIG_NAME_FILE][main_bigware_40], '','SSL') . '">'  . PRICES_LOGGED_IN_SUBMIT . '</a>&nbsp;';
			$submit_item_quant = ''; 
		}  else {
			if ($item_info['domainservice_status'] == '1'){
				$submit_button = go_picture_submit('button_buy_now_domain.gif', PICTURE_BUTTON_IN_CART);
			}
			else{
				if ($item_info['iss_masseinheit'] == '1'){
					if (file_exists(FOLDER_ABSOLUT_CATALOG . 'modules/masseinheitenartikel')) {
						require(FOLDER_ABSOLUT_CATALOG . 'modules/masseinheitenartikel/content/main_bigware_34e.tpl.php');
					}
				}
				else{
					$submit_button = go_picture_submit('button_in_cart.gif', PICTURE_BUTTON_IN_CART);
				}
			}
			$submit_item_quant = go_fetch_pull_down_menu('cart_quantity', $qty_array, 1); 
		} 
		if ($item_info['domainservice_status'] == '1'){
			$submit_button = '
				<input type="hidden" name="items_price_domainservice" value="' . $items_price_domainservice . '">
				<input type="hidden" name="gewuenschtes_paket" value="' . $items_name_for_domainservice . '">
				<input type="hidden" name="items_id" value="' . $item_info['items_id'] . '">
				' . $submit_button; 
		}else{
			$submit_button = '<input type="hidden" name="items_id" value="' . $item_info['items_id'] . '">' . $submit_button; 
		}

		if ((STOCK_ALLOW_CHECKOUT == 'false')&&(go_get_items_stock($item_info['items_id']) < 1)) {
			$template_inhalt = preg_replace('/<-kaufen_button->/','<font color="#FF0000">' . THIS_ITEM_NOT_THERE . '</font>' , $template_inhalt);
			$template_inhalt = preg_replace('/&lt;-kaufen_button-&gt;/','<font color="#FF0000">' . THIS_ITEM_NOT_THERE . '</font>' , $template_inhalt);
		}
		else{
			$template_inhalt = preg_replace('/<-kaufen_button->/',$submit_button , $template_inhalt);
			$template_inhalt = preg_replace('/&lt;-kaufen_button-&gt;/',$submit_button , $template_inhalt);
		}
	}
	if ($item_info['domainservice_status'] == '1'){
		$template_inhalt = preg_replace('/<-anzahl_select->/', go_fetch_hidden_field('quantity', 1,''), $template_inhalt);	
		$template_inhalt = preg_replace('/&lt;-anzahl_select-&gt;/', go_fetch_hidden_field('quantity', 1,''), $template_inhalt);	
	} else {
		if ($getPriceOption == 'U lfdm'){
			$template_inhalt = preg_replace('/<-anzahl_select->/', go_fetch_pull_down_menu('quantity', $qty_array, 1,'onChange=changeQuadraturU(form.elements[\'laenge\'].value,form.elements[\'breite\'].value,this.options[selectedIndex].value,this.form)'), $template_inhalt);	
			$template_inhalt = preg_replace('/&lt;-anzahl_select-&gt;/', go_fetch_pull_down_menu('quantity', $qty_array, 1,'onChange=changeQuadraturU(form.elements[\'laenge\'].value,form.elements[\'breite\'].value,this.options[selectedIndex].value,this.form)'), $template_inhalt);	
		}
		else{
			$template_inhalt = preg_replace('/<-anzahl_select->/', go_fetch_pull_down_menu('quantity', $qty_array, 1,'onChange=changeQuadratur(form.elements[\'laenge\'].value,form.elements[\'breite\'].value,this.options[selectedIndex].value,this.form)'), $template_inhalt);
			$template_inhalt = preg_replace('/&lt;-anzahl_select-&gt;/', go_fetch_pull_down_menu('quantity', $qty_array, 1,'onChange=changeQuadratur(form.elements[\'laenge\'].value,form.elements[\'breite\'].value,this.options[selectedIndex].value,this.form)'), $template_inhalt);
		}	
	}

	if ($showLaengeBreite) {
		if (file_exists(FOLDER_ABSOLUT_CATALOG . 'modules/lfdm_qm_qmm_Ulfdm')) {
			require(FOLDER_ABSOLUT_CATALOG . 'modules/lfdm_qm_qmm_Ulfdm/content/main_bigware_34.tpl.php');
		}
		$template_inhalt = preg_replace('/\[AREA\-INFO\]/i', '', $template_inhalt);
	} else {
		$template_inhalt = preg_replace('/<-laenge->/', '', $template_inhalt);
		$template_inhalt = preg_replace('/&lt;-laenge-&gt;/', '', $template_inhalt);
		$template_inhalt = preg_replace('/<-breite->/', '', $template_inhalt);
		$template_inhalt = preg_replace('/&lt;-breite-&gt;/', '', $template_inhalt);
		$template_inhalt = preg_replace('/<-quadratur->/', '', $template_inhalt);
		$template_inhalt = preg_replace('/&lt;-quadratur-&gt;/', '', $template_inhalt);
		$template_inhalt = preg_replace('/\[AREA\-INFO\].+\[AREA\-INFO\]/is', '', $template_inhalt);
	}

	// Loopthrough0

	if (file_exists(FOLDER_ABSOLUT_CATALOG . 'modules/extra_costumer_input_for_items')) {
		require(FOLDER_ABSOLUT_CATALOG . 'modules/extra_costumer_input_for_items/content/main_bigware_34.tpl.php');
	}
	if (file_exists(FOLDER_ABSOLUT_CATALOG . 'modules/masseinheitenartikel')) {
		require(FOLDER_ABSOLUT_CATALOG . 'modules/masseinheitenartikel/content/main_bigware_34.tpl.php');
	}


	$template_inhalt = preg_replace('/<-extra_item_costumer_input_text_preceded->/', '', $template_inhalt);
	$template_inhalt = preg_replace('/<-extra_item_costumer_input_text->/', '', $template_inhalt);
	$template_inhalt = preg_replace('/&lt;-extra_item_costumer_input_text_preceded-&gt;/', '', $template_inhalt);
	$template_inhalt = preg_replace('/&lt;-extra_item_costumer_input_text-&gt;/', '', $template_inhalt);


	if (file_exists(FOLDER_ABSOLUT_CATALOG . 'modules/bundle')) {
		require(FOLDER_ABSOLUT_CATALOG . 'modules/bundle/content/main_bigware_34.tpl.php');
	}
	else{
		$template_inhalt = preg_replace('/<-bundle->/', '', $template_inhalt);
		$template_inhalt = preg_replace('/&lt;-bundle-&gt;/', '', $template_inhalt);
	}
	echo $template_inhalt;
	?>
		<br><br>
		<?php 
		if ( (USE_CACHE == 'true') && !SID) { 
			echo go_cache_also_purchased(3600);
			echo "<br>";
			include(FOLDER_RELATIV_MODULES . $GLOBALS[CONFIG_NAME_FILE][xsell_items]);
		} else {

			include(FOLDER_RELATIV_MODULES . $GLOBALS[CONFIG_NAME_FILE][xsell_items]);
			echo "<br>";
			include(FOLDER_RELATIV_MODULES . $GLOBALS[CONFIG_NAME_FILE][also_purchased_items]);
		}
}
?>
</form>
