    <?php echo go_fetch_form('cart_quantity', go_href_link(NAME_OF_FILE_SHOP_BASKET, 'action=update_item')); ?><table border="0" width="100%" cellspacing="0" cellpadding="0">
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td class="pageGeneralsign"></td>
            <td class="pageGeneralsign" align="right"></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td><?php echo go_fetch_dividing_up('tranparentes.gif', '100%', '10'); ?></td>
      </tr>
<?php
  if ($cart->count_contents() > 0) {
?>
      <tr>
        <td>
<?php
    $info_frame_contents = array();
    $info_frame_contents[0][] = array('align' => 'center',
                                    'params' => 'class="itemListing-heading"',
                                    'text' => DB_TBL_ABOVE_REMOVE);

    $info_frame_contents[0][] = array('params' => 'class="itemListing-heading"',
                                    'text' => DB_TBL_ABOVE_ITEMS);

    $info_frame_contents[0][] = array('align' => 'center',
                                    'params' => 'class="itemListing-heading"',
                                    'text' => DB_TBL_ABOVE_QUANTITY);

    $info_frame_contents[0][] = array('align' => 'right',
                                    'params' => 'class="itemListing-heading"',
                                    'text' => DB_TBL_ABOVE_TOTAL);

    $any_out_of_stock = 0;
    $items = $cart->get_items();
		
		for ($i=0, $n=sizeof($items); $i<$n; $i++) {
		
		$getImMeterQuery[$i] = go_db_query("select immeter, inmeter_breite from price_option where id=".$items[$i]['items_price_option']);
		if (mysql_num_rows($getImMeterQuery[$i])!=0) {
			$getImMeter[$i] = mysql_result($getImMeterQuery[$i],0,'immeter');
			$getInMeter_breite[$i] = mysql_result($getImMeterQuery[$i],0,'inmeter_breite');
			}
		else {
			$getImMeter[$i]=1000;
			$getInMeter_breite[$i]=1000;
			}
		


				if (go_session_is_registered('attendee_id')) {
	
					$item_laenge_breite_query = go_db_query("select attendees_basket_laenge, attendees_basket_breite, attendees_basket_price_option, price_option_comment from " . DB_TBL_ATTENDEES_BASKET . " where attendees_id = '" . (int)$attendee_id . "' and items_id = '" . $items[$i]['id'] . "'");
					
					if (@mysql_num_rows($item_laenge_breite_query)!=0) {	
						
						$item_laenge_breite_result = go_db_fetch_array($item_laenge_breite_query);
						$items[$i]['laenge'] = $item_laenge_breite_result['attendees_basket_laenge'];
						$items[$i]['breite'] = $item_laenge_breite_result['attendees_basket_breite'];
						$items[$i]['price_option_comment'] = $item_laenge_breite_result['price_option_comment'];
						
					
					}
					else {
						if ($items[$i]['laenge']=="") {$items[$i]['laenge']=1000;}
						if ($items[$i]['breite']=="") {$items[$i]['breite']=1000;}
					}				
				
				}
				else {
					if ($items[$i]['laenge']=="") {$items[$i]['laenge']=1000;}
					if ($items[$i]['breite']=="") {$items[$i]['breite']=1000;}

				}

		
	
// Push all characteristics information in an array
      if (isset($items[$i]['characteristics']) && is_array($items[$i]['characteristics'])) {
        while (list($option, $value) = each($items[$i]['characteristics'])) {
				  if (is_array($value)) {
					 $value_keys = array_keys($value);
					 for ($v=0;$v<sizeof($value_keys);$v++){
					  echo go_fetch_hidden_field('id[' . $items[$i]['id'] . '][' . $option . ']['.$value_keys[$v].']', $value[$value_keys[$v]]);
					 }
					}
					else {
          echo go_fetch_hidden_field('id[' . $items[$i]['id'] . '][' . $option . ']', $value);}
					
					if (KONFIGURATOR=='true'){
					 if (is_array($value)){
					  $value_keys = array_keys($value);
						for ($v=0;$v<sizeof($value_keys);$v++){
						 $characteristics = go_db_query("select popt.items_options_conf_name, poval.items_options_conf_values_name, pa.options_conf_values_price, pa.price_prefix, pa.items_characteristics_conf_id
                                      from " . DB_TBL_ITEMS_OPTIONS_CONF . " popt, " . DB_TBL_ITEMS_OPTIONS_CONF_VALUES . " poval, " . DB_TBL_ITEMS_CHARACTERISTICS_CONF . " pa
                                      where pa.items_id = '" . $items[$i]['id'] . "'
                                       and pa.options_conf_id = '" . $option . "'
                                       and pa.options_conf_id = popt.items_options_conf_id
                                       and pa.options_conf_values_id = '" . $value[$value_keys[$v]] . "'
                                       and pa.options_conf_values_id = poval.items_options_conf_values_id
                                       and popt.language_id = '" . $languages_id . "'
                                       and poval.language_id = '" . $languages_id . "'");
            $characteristics_values = go_db_fetch_array($characteristics);

            $items[$i][$option]['items_options_conf_name'][$value_keys[$v]] = $characteristics_values['items_options_conf_name'];
            $items[$i][$option]['options_conf_values_id'][$value_keys[$v]] = $value[$value_keys[$v]];
            $items[$i][$option]['items_options_conf_values_name'][$value_keys[$v]] = $characteristics_values['items_options_conf_values_name'];
            $items[$i][$option]['options_conf_values_price'][$value_keys[$v]] = $characteristics_values['options_conf_values_price'];
            $items[$i][$option]['price_prefix'][$value_keys[$v]] = $characteristics_values['price_prefix'];
            $items[$i][$option]['items_characteristics_conf_id'][$value_keys[$v]] = $characteristics_values['items_characteristics_conf_id'];
						}
					 }
					 else {
					  $characteristics = go_db_query("select popt.items_options_conf_name, poval.items_options_conf_values_name, pa.options_conf_values_price, pa.price_prefix, pa.items_characteristics_conf_id
                                      from " . DB_TBL_ITEMS_OPTIONS_CONF . " popt, " . DB_TBL_ITEMS_OPTIONS_CONF_VALUES . " poval, " . DB_TBL_ITEMS_CHARACTERISTICS_CONF . " pa
                                      where pa.items_id = '" . $items[$i]['id'] . "'
                                       and pa.options_conf_id = '" . $option . "'
                                       and pa.options_conf_id = popt.items_options_conf_id
                                       and pa.options_conf_values_id = '" . $value . "'
                                       and pa.options_conf_values_id = poval.items_options_conf_values_id
                                       and popt.language_id = '" . $languages_id . "'
                                       and poval.language_id = '" . $languages_id . "'");
            $characteristics_values = go_db_fetch_array($characteristics);

            $items[$i][$option]['items_options_conf_name'] = $characteristics_values['items_options_conf_name'];
            $items[$i][$option]['options_conf_values_id'] = $value;
            $items[$i][$option]['items_options_conf_values_name'] = $characteristics_values['items_options_conf_values_name'];
            $items[$i][$option]['options_conf_values_price'] = $characteristics_values['options_conf_values_price'];
            $items[$i][$option]['price_prefix'] = $characteristics_values['price_prefix'];
            $items[$i][$option]['items_characteristics_conf_id'] = $characteristics_values['items_characteristics_conf_id'];
					 }//not array
					 
					}
					else {
          $characteristics = go_db_query("select popt.items_options_name, poval.items_options_values_name, pa.options_values_price, pa.price_prefix, pa.items_characteristics_id
                                      from " . DB_TBL_ITEMS_OPTIONS . " popt, " . DB_TBL_ITEMS_OPTIONS_VALUES . " poval, " . DB_TBL_ITEMS_CHARACTERISTICS . " pa
                                      where pa.items_id = '" . $items[$i]['id'] . "'
                                       and pa.options_id = '" . $option . "'
                                       and pa.options_id = popt.items_options_id
                                       and pa.options_values_id = '" . $value . "'
                                       and pa.options_values_id = poval.items_options_values_id
                                       and popt.language_id = '" . $languages_id . "'
                                       and poval.language_id = '" . $languages_id . "'");
          $characteristics_values = go_db_fetch_array($characteristics);

          $items[$i][$option]['items_options_name'] = $characteristics_values['items_options_name'];
          $items[$i][$option]['options_values_id'] = $value;
          $items[$i][$option]['items_options_values_name'] = $characteristics_values['items_options_values_name'];
          $items[$i][$option]['options_values_price'] = $characteristics_values['options_values_price'];
          $items[$i][$option]['price_prefix'] = $characteristics_values['price_prefix'];
          $items[$i][$option]['items_characteristics_id'] = $characteristics_values['items_characteristics_id'];
				 }//not konfigurator	
				// echo "<pre>";print_r($items[$i][$option]);echo "</pre>";
        }
      }
    }
$zaehler_attr_anzahl = 0;
    for ($i=0, $n=sizeof($items); $i<$n; $i++) {
      if (($i/2) == floor($i/2)) {
        $info_frame_contents[] = array('params' => 'class="itemListing-even"');
      } else {
        $info_frame_contents[] = array('params' => 'class="itemListing-odd"');
      }

      $cur_row = sizeof($info_frame_contents) - 1;

      $info_frame_contents[$cur_row][] = array('align' => 'center',
                                             'params' => 'class="itemListing-data" valign="top"',
                                             'text' => go_fetch_checkbox_field('cart_delete[]', $items[$i]['id']));

/////////// Rahmen /////////////////////////////////////////////    	

$query = "SELECT * FROM rahmen WHERE id = '1'";
$result = MYSQL_QUERY($query);
$number = MYSQL_NUMROWS($result);
			
$rahmennummer = mysql_result($result,0,"rahmennummer");
if ($rahmennummer != 3){
$frame_für_schleife1 = <<<EOT
<div align="left">
<table cellspacing = 0 cellpadding = 0 border = 0>
<tr><td width="1">
  <img border="0" src="picture/rahmen/oben_links$rahmennummer.gif"></td>
  <td background="picture/rahmen/oben_linie$rahmennummer.gif" width="1">
  <img border="0" src="picture/rahmen/oben_linie$rahmennummer.gif"></td><td width="1">
  <img border="0" src="picture/rahmen/oben_rechts$rahmennummer.gif"></td></tr>
<tr><td background="picture/rahmen/links_linie$rahmennummer.gif" width="1">
  <img border="0" src="picture/rahmen/links_linie$rahmennummer.gif"></td>
  <td bgcolor="#FFFFFF" align="center">
EOT;

$endeframe_für_schleife = <<<EOT
  </td>
  <td background="picture/rahmen/rechts_linie$rahmennummer.gif" width="1">
  <img border="0" src="picture/rahmen/rechts_linie$rahmennummer.gif"></td></tr>
<tr><td width="1">
  <img border="0" src="picture/rahmen/unten_links$rahmennummer.gif"></td>
  <td background="picture/rahmen/unten_linie$rahmennummer.gif" width="1">
  <img border="0" src="picture/rahmen/unten_linie$rahmennummer.gif"></td><td width="1">
  <img border="0" src="picture/rahmen/unten_rechts$rahmennummer.gif"></td></tr>
</TABLE> 
</div>
EOT;
}
///////////////// Rahmen Ende //////////////////////////////  	

      $items_name = '<table border="0" cellspacing="2" cellpadding="2">' .
                       '  <tr>' .
                       '    <td class="itemListing-data" align="center">' . $frame_für_schleife1 . '<a href="' . go_href_link(NAME_OF_FILE_ITEM_INFO, 'items_id=' . $items[$i]['id']) . '">' . go_picture(FOLDER_RELATIV_PICTURES . $items[$i]['picture'], $items[$i]['name'], SMALL_PICTURE_WIDTH, SMALL_PICTURE_HEIGHT) . $endeframe_für_schleife .'</a></td>' .
                       '    <td class="itemListing-data" valign="top"><a href="' . go_href_link(NAME_OF_FILE_ITEM_INFO, 'items_id=' . $items[$i]['id']) . '"><b>' . $items[$i]['name'] . '<br><br><img src="picture/details.gif" border="0"></b></a> ';

      if (STOCK_CHECK == 'true') {
        $stock_check = go_check_stock($items[$i]['id'], $items[$i]['quantity']);
        if (go_not_null($stock_check)) {
          $any_out_of_stock = 1;

          $items_name .= $stock_check;
        }
      }
      

			  if (isset($items[$i]['characteristics']) && is_array($items[$i]['characteristics'])) {
        reset($items[$i]['characteristics']);
        
        while (list($option, $value) = each($items[$i]['characteristics'])) {
				// print_r($value);
				  if (KONFIGURATOR=='true'){
					 if (is_array($value)){
					  $value_keys = array_keys($value);
						for ($v=0;$v<sizeof($value_keys);$v++){
						  if ($items[$i][$option]['items_options_conf_values_name'][$value_keys[$v]]!=""){
 		  	  
					   $values_qty_query = go_db_query("SELECT qty FROM " . DB_TBL_ITEMS_CHARACTERISTICS_CONF . " WHERE items_characteristics_conf_id='" . $items[$i][$option]['items_characteristics_conf_id'][$value_keys[$v]] . "'");
			       $values_qty_query_result=go_db_fetch_array($values_qty_query);       		
			       if ($values_qty_query_result['qty'] < $items[$i]['quantity']){
				      if ($values_qty_query_result['qty'] != ""){
					     $output_attr_anzahl = " <font color=\"#FF0000\">(Verfügbar: " . $values_qty_query_result['qty'] . ")</font>";
					     $zaehler_attr_anzahl += 1;	
				      }
			       }
			       else{
				      $output_attr_anzahl = "";
				      $zaehler_attr_anzahl += 0;
			       }
          		$items_name .= '<br><small><i> - ' . $items[$i][$option]['items_options_conf_name'][$value_keys[$v]] . ': ' . $items[$i][$option]['items_options_conf_values_name'][$value_keys[$v]] . $output_attr_anzahl .'</i></small>';
        	   }//if
						}
					 }
					 else {
					   if ($items[$i][$option]['items_options_conf_values_name']!=""){
 		  	  
					  $values_qty_query = go_db_query("SELECT qty FROM " . DB_TBL_ITEMS_CHARACTERISTICS_CONF . " WHERE items_characteristics_conf_id='" . $items[$i][$option]['items_characteristics_id'] . "'");
			      $values_qty_query_result=go_db_fetch_array($values_qty_query);       		
			      if ($values_qty_query_result['qty'] < $items[$i]['quantity']){
				     if ($values_qty_query_result['qty'] != ""){
					    $output_attr_anzahl = " <font color=\"#FF0000\">(Verfügbar: " . $values_qty_query_result['qty'] . ")</font>";
					    $zaehler_attr_anzahl += 1;	
				     }
			      }
			      else{
				     $output_attr_anzahl = "";
				     $zaehler_attr_anzahl += 0;
			      }
          		$items_name .= '<br><small><i> - ' . $items[$i][$option]['items_options_conf_name'] . ': ' . $items[$i][$option]['items_options_conf_values_name'] . $output_attr_anzahl .'</i></small>';
        	  }//if
					 }//not array
					}//if konfigurator
					else {
					 if ($items[$i][$option]['items_options_values_name']!=""){
 		  	  
					 $values_qty_query = go_db_query("SELECT qty FROM " . DB_TBL_ITEMS_CHARACTERISTICS . " WHERE items_characteristics_id='" . $items[$i][$option]['items_characteristics_id'] . "'");
			     $values_qty_query_result=go_db_fetch_array($values_qty_query);       		
			     if ($values_qty_query_result['qty'] < $items[$i]['quantity']){
				    if ($values_qty_query_result['qty'] != ""){
					   $output_attr_anzahl = " <font color=\"#FF0000\">(Verfügbar: " . $values_qty_query_result['qty'] . ")</font>";
					   $zaehler_attr_anzahl += 1;	
				    }
			     }
			    else{
				    $output_attr_anzahl = "";
				   $zaehler_attr_anzahl += 0;
			     }
          		$items_name .= '<br><small><i> - ' . $items[$i][$option]['items_options_name'] . ': ' . $items[$i][$option]['items_options_values_name'] . $output_attr_anzahl .'</i></small>';
        	 }//if
					}
					
					
        	
					
					
        }//while
      }//if characteristics

      $items_name .= '    </td>' .
                        '  </tr>' .
                        '</table>';

      $info_frame_contents[$cur_row][] = array('params' => 'class="itemListing-data"',
                                             'text' => $items_name);

			if ($items[$i]['items_price_option']!=0){
			
				if ($items[$i]['items_price_option']==1){$price_option_name="qm";}
				elseif ($items[$i]['items_price_option']==2){$price_option_name="qmm";}
				elseif ($items[$i]['items_price_option']==3){$price_option_name="lfdm";}
				elseif ($items[$i]['items_price_option']==4){$price_option_name="U lfdm";}
				
				
				  if ($items[$i]['items_price_option'] == 4){
				  	$quadratur_display = (($items[$i]['laenge']*2/$getImMeter[$i])+($items[$i]['breite']*2/$getInMeter_breite[$i]));	
				  } 
				  else {
			      		$quadratur_display = (($items[$i]['laenge']/$getImMeter[$i])*($items[$i]['breite']/$getInMeter_breite[$i]));
			      	}
				
				
				$displayDim = '<br>' . $items[$i]['quantity'] . ' x ' . $quadratur_display . ' ' . $price_option_name . ' x ' . $currencies->display_price($items[$i]['final_price'], go_get_tax_rate($items[$i]['tax_class_id'])) . '<br>Abmessung: ' . $items[$i]['laenge'].' mm x '.$items[$i]['breite']. ' mm<br>' . $items[$i]['price_option_comment'];
			}
			else { $displayDim="";}
			
      $info_frame_contents[$cur_row][] = array('align' => 'center',
                                             'params' => 'class="itemListing-data" valign="top"',
                                             'text' => go_fetch_inputfeld('cart_quantity[]', $items[$i]['quantity'], 'size="4"') . go_fetch_hidden_field('items_id[]', $items[$i]['id']).go_fetch_hidden_field('cart_laenge[]', $items[$i]['laenge']).go_fetch_hidden_field('cart_breite[]', $items[$i]['breite']).go_fetch_hidden_field('cart_immeter[]', $items[$i]['immeter']).go_fetch_hidden_field('cart_inmeter_breite[]', $items[$i]['inmeter_breite']).go_fetch_hidden_field('cart_price_option_comment[]', $items[$i]['price_option_comment']). $displayDim);





      $info_frame_contents[$cur_row][] = array('align' => 'right',
                                             'params' => 'class="itemListing-data" valign="top"',
                                             'text' => '<b>' . $currencies->display_price_shopping_card($items[$i]['final_price'], go_get_tax_rate($items[$i]['tax_class_id']), $items[$i]['quantity'],$items[$i]['laenge'],$items[$i]['breite'],$getImMeter[$i],$getInMeter_breite[$i],$items[$i]['items_price_option'], $items[$i]['price_option_comment']) . '</b>');
    }

    new itemListingBox($info_frame_contents);
?>
        </td>
      </tr>
      <tr>
        <td><?php echo go_fetch_dividing_up('tranparentes.gif', '100%', '10'); ?></td>
      </tr>
      <tr>
        <td align="right" class="main"><b><?php echo SUB_TITLE_SUB_TOTAL; ?> <?php  echo $currencies->format($cart->show_total()); ?></b></td>
      </tr>
<?php
    if ($any_out_of_stock == 1) {
      if (STOCK_ALLOW_CHECKOUT == 'true') {
?>
      <tr>
        <td class="stockWarning" align="center"><br><?php echo OUT_OF_STOCK_CAN_CHECKOUT; ?></td>
      </tr>
<?php
      } else {
?>
      <tr>
        <td class="stockWarning" align="center"><br><?php echo OUT_OF_STOCK_CANT_CHECKOUT; ?></td>
      </tr>
<?php
      }
    }
?>
      <tr>
        <td><?php echo go_fetch_dividing_up('tranparentes.gif', '100%', '10'); ?></td>
      </tr>
      <tr>
        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
          <tr class="infoFrameInsides">
            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
              <tr>
                <td width="10"><?php echo go_fetch_dividing_up('tranparentes.gif', '10', '1'); ?></td>
                <td class="main"><?php echo go_picture_submit('button_update_cart.gif', PICTURE_BUTTON_UPDATE_CART); ?></td>
<?php
   $back = sizeof($navigation->path)-2;
	 
	 //print_r($navigation->path);

	  if ($navigation->path[$back]['page']=="item_info.php") {$back--;}

    if (isset($navigation->path[$back])) {
?>
                <td class="main"><?php   echo '<a href="' . go_href_link($navigation->path[$back]['page'], go_array_to_string($navigation->path[$back]['get'], array('action')), $navigation->path[$back]['mode']) . '">' . go_picture_button('button_continue_shopping.gif', PICTURE_BUTTON_CONTINUE_SHOPPING) . '</a>'; ?></td>
<?php
    }
?>
                <td align="right" class="main">
                <?php
                if ($zaehler_attr_anzahl == 0){
                	echo '<a href="' . go_href_link(NAME_OF_FILE_SHIP_ORDER_WAY, '', 'SSL') . '">' . go_picture_button('button_checkout.gif', PICTURE_BUTTON_CHECKOUT) . '</a>'; 
                }
                else{
                	echo '<font color="#FF0000">Ein Artikel ist nicht in der erforderlichen Menge auf Lager (siehe Merkmale). Bitte ändern Sie die Anzahl.</font>';
                }
                 ?>
                 </td>
                <td width="10"><?php echo go_fetch_dividing_up('tranparentes.gif', '10', '1'); ?></td>
              </tr>
            </table></td>
          </tr>
        </table></td>
      </tr>
<?php
  } else {
?>
      <tr>
        <td align="center" class="main"><?php new infoBox(array(array('text' => TEXT_CART_EMPTY))); ?></td>
      </tr>
      <tr>
        <td><?php echo go_fetch_dividing_up('tranparentes.gif', '100%', '10'); ?></td>
      </tr>
      <tr>
        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
          <tr class="infoFrameInsides">
            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
              <tr>
                <td width="10"><?php echo go_fetch_dividing_up('tranparentes.gif', '10', '1'); ?></td>
                <td align="right" class="main"><?php echo '<a href="' . go_href_link(NAME_OF_FILE_DEFAULT) . '">' . go_picture_button('button_continue.gif', PICTURE_BUTTON_CONTINUE) . '</a>'; ?></td>
                <td width="10"><?php echo go_fetch_dividing_up('tranparentes.gif', '10', '1'); ?></td>
              </tr>
            </table></td>
          </tr>
        </table></td>
      </tr>
<?php
  }
?>
    </table></form>

