
    <table border="0" width="100%" cellspacing="0" cellpadding="2">
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td class="pageGeneralsign"><?php echo ABOVE_TITLE; ?></td>
            <td class="pageGeneralsign" align="right"><?php echo go_fetch_dividing_up('tranparentes.gif', 1, ABOVE_PICTURE_HEIGHT); ?></td>
            <td align="right"><table border="0" width="100%" cellspacing="0" cellpadding="0">
              <tr>
                <td class="smallText" align="right">
<?php
    echo go_fetch_form('search', NAME_OF_FILE_CATEGORIES, '', 'get');
    echo ABOVE_TITLE_SEARCH . ' ' . go_fetch_inputfeld('search');
    echo '</form>';
?>
                </td>
              </tr>
              <tr>
                <td class="smallText" align="right">
<?php
    echo go_fetch_form('goto', NAME_OF_FILE_CATEGORIES, '', 'get');
    echo ABOVE_TITLE_GOTO . ' ' . go_fetch_pull_down_menu('bigPfad', go_get_category_tree(), $current_category_id, 'onChange="this.form.submit();"');
    echo '</form>';
?>
                </td>
              </tr>
            </table></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="5">
          <tr>
            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="5">
              <tr class="tbUPCountData">
                <td class="tbUPDataInside"><?php echo DB_TBL_ABOVE_CATEGORIES_ITEMS; ?></td>
                <td class="tbUPDataInside"><?php echo DB_TBL_ABOVE_ART_Number; ?></td>
                <td class="tbUPDataInside"><?php echo DB_TBL_ABOVE_ANZAHL; ?></td>
                <td class="tbUPDataInside"><?php echo DB_TBL_ABOVE_GEWICHT; ?></td>
                <td class="tbUPDataInside"><?php echo DB_TBL_ABOVE_SYN; ?></td>
                <td class="tbUPDataInside" align="center"><?php echo DB_TBL_ABOVE_STATUS; ?></td>
                <td class="tbUPDataInside" align="right"><?php echo DB_TBL_ABOVE_ACTION; ?>&nbsp;</td>
              </tr>
<?php
    $categories_count = 0;
    $rows = 0;
    if (isset($_GET['search'])) {
      $search = go_db_producing_input($_GET['search']); 
        $categories_query = go_db_query("select c.categories_id, cd.categories_name,cd.categories_desc, c.categories_picture, c.parent_id, c.sort_order, c.date_added, c.last_modified, c.categories_status from " . DB_TBL_CATEGORIES . " c, " . DB_TBL_CATEGORIES_DESCRIPTION . " cd where c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' and cd.categories_name like '%" . go_db_input($search) . "%' order by c.sort_order, cd.categories_name");
    } else { 
      $categories_query = go_db_query("select c.categories_id, cd.categories_name, cd.categories_desc, c.categories_picture, c.parent_id, c.sort_order, c.date_added, c.last_modified, c.categories_status from " . DB_TBL_CATEGORIES . " c, " . DB_TBL_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by c.sort_order, cd.categories_name");
    }
    while ($categories = go_db_fetch_array($categories_query)) {
      $categories_count++;
      $rows++; 
      if (isset($_GET['search'])) $bigPfad= $categories['parent_id'];
      if ((!isset($_GET['bigID']) && !isset($_GET['bigID']) || (isset($_GET['bigID']) && ($_GET['bigID'] == $categories['categories_id']))) && !isset($bigwareInfo) && (substr($action, 0, 3) != 'new')) {
        $category_childs = array('childs_count' => go_childs_in_category_count($categories['categories_id']));
        $category_items = array('items_count' => go_items_in_category_count($categories['categories_id']));
        $bigwareInfo_array = array_merge($categories, $category_childs, $category_items);
        $bigwareInfo = new objectInfo($bigwareInfo_array);
      }
      if (isset($bigwareInfo) && is_object($bigwareInfo) && ($categories['categories_id'] == $bigwareInfo->categories_id) ) {
        echo '              <tr id="defaultSelected" class="tbCountDataSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . go_href_link(NAME_OF_FILE_CATEGORIES, go_get_path($categories['categories_id'])) . '\'">' . "\n";
      } else {
        echo '              <tr class="tbCountData" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . go_href_link(NAME_OF_FILE_CATEGORIES, 'bigPfad=' . $bigPfad . '&bigID=' . $categories['categories_id']) . '\'">' . "\n";
      }
?>
                <td class="TbInsideData">&nbsp;<?php echo '<a href="' . go_href_link(NAME_OF_FILE_CATEGORIES, go_get_path($categories['categories_id'])) . '">' . go_picture(FOLDER_RELATIV_ICONS . 'folder.gif', ICON_FOLDER) . '</a>&nbsp;<b>' . $categories['categories_name'] . '</b>'; ?></td>
                <td class="TbInsideData">&nbsp;</td>
                <td class="TbInsideData">&nbsp;</td>
                <td class="TbInsideData">&nbsp;</td>
                <td class="TbInsideData">&nbsp;</td>
                <td class="TbInsideData" align="center">&nbsp;
<?php
      if ($categories['categories_status'] == '1') {
        echo go_picture(FOLDER_RELATIV_PICTURES . 'icon_status_green.gif', PICTURE_ICON_STATUS_GREEN, 10, 10) . '&nbsp;&nbsp;<a href="' . go_href_link(NAME_OF_FILE_CATEGORIES, 'action=setflag_cat&flag=0&bigID=' . $categories['categories_id'] . '&bigPfad=' . $bigPfad) . '">' . go_picture(FOLDER_RELATIV_PICTURES . 'icon_status_red_light.gif', PICTURE_ICON_STATUS_RED_LIGHT, 10, 10) . '</a>';
      } else {
        echo '<a href="' . go_href_link(NAME_OF_FILE_CATEGORIES, 'action=setflag_cat&flag=1&bigID=' . $categories['categories_id'] . '&bigPfad=' . $bigPfad) . '">' . go_picture(FOLDER_RELATIV_PICTURES . 'icon_status_green_light.gif', PICTURE_ICON_STATUS_GREEN_LIGHT, 10, 10) . '</a>&nbsp;&nbsp;' . go_picture(FOLDER_RELATIV_PICTURES . 'icon_status_red.gif', PICTURE_ICON_STATUS_RED, 10, 10);
      }
?>
                </td>
                <td class="TbInsideData" align="right">&nbsp;<?php if (isset($bigwareInfo) && is_object($bigwareInfo) && ($categories['categories_id'] == $bigwareInfo->categories_id) ) { echo go_picture(FOLDER_RELATIV_PICTURES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . go_href_link(NAME_OF_FILE_CATEGORIES, 'bigPfad=' . $bigPfad . '&bigID=' . $categories['categories_id']) . '">' . go_picture(FOLDER_RELATIV_PICTURES . 'icon_info.gif', PICTURE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
              </tr>
<?php
    }
    $items_count = 0;
    if (isset($_GET['search'])) {   
      $items_query = go_db_query("select p.*, pd.*, p2c.categories_id from " . DB_TBL_ITEMS . " p, " . DB_TBL_ITEMS_DESCRIPTION . " pd, " . DB_TBL_ITEMS_TO_CATEGORIES . " p2c where p.items_id = pd.items_id and pd.language_id = '" . (int)$languages_id . "' and p.items_id = p2c.items_id and ( p.items_model like '%" . go_db_input($search) . "%' or pd.items_name like '%" . go_db_input($search) . "%') order by pd.items_name");
    
    } else {  
      $items_query = go_db_query("select p.*, pd.* from " . DB_TBL_ITEMS . " p, " . DB_TBL_ITEMS_DESCRIPTION . " pd, " . DB_TBL_ITEMS_TO_CATEGORIES . " p2c where p.items_id = pd.items_id and pd.language_id = '" . (int)$languages_id . "' and p.items_id = p2c.items_id and p2c.categories_id = '" . (int)$current_category_id . "' order by pd.items_name"); 
    }
    while ($items = go_db_fetch_array($items_query)) {
      $items_count++;
      $rows++; 
      if (isset($_GET['search'])) $bigPfad = $items['categories_id'];
      if ( (!isset($_GET['bigID']) && !isset($_GET['bigID']) || (isset($_GET['bigID']) && ($_GET['bigID'] == $items['items_id']))) && !isset($pInfo) && !isset($bigwareInfo) && (substr($action, 0, 3) != 'new')) { 
        $reviews_query = go_db_query("select (avg(reviews_rating) / 5 * 100) as average_rating from " . DB_TBL_REVIEWS . " where items_id = '" . (int)$items['items_id'] . "'");
        $reviews = go_db_fetch_array($reviews_query);
        $pInfo_array = array_merge($items, $reviews);
        $pInfo = new objectInfo($pInfo_array);
      }
      if (isset($pInfo) && is_object($pInfo) && ($items['items_id'] == $pInfo->items_id) ) {
        echo '              <tr id="defaultSelected" class="tbCountDataSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . go_href_link(NAME_OF_FILE_CATEGORIES, 'bigPfad=' . $bigPfad . '&bigID=' . $items['items_id'] . '&action=new_item') . '\'">' . "\n";
      } else {
        echo '              <tr class="tbCountData" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . go_href_link(NAME_OF_FILE_CATEGORIES, 'bigPfad=' . $bigPfad . '&bigID=' . $items['items_id']) . '\'">' . "\n";
      }
		if (file_exists(FOLDER_ABSOLUT_CATALOG . 'modules/ebay_description')) {
			$ebay_description_service = '<a href="' . go_href_link(NAME_OF_FILE_EBAY_DESC, 'bigID=' . $items['items_id']) . '">' . go_picture(FOLDER_RELATIV_ICONS . 'preview_ebay_desc.gif', ICON_PREVIEW_EBAY_DESC) . '</a>';
    } else {
           $ebay_description_service = '';
    }



      if ($items['domainservice_status'] == '1') {
?>
                <td class="TbInsideData">&nbsp;<?php echo $ebay_description_service . '&nbsp;<a href="' . go_href_link(NAME_OF_FILE_CATEGORIES, 'bigPfad=' . $bigPfad . '&bigID=' . $items['items_id'] . '&action=new_item') . '">' . go_picture(FOLDER_RELATIV_ICONS . 'preview_webservice.gif', ICON_PREVIEW_WEBSERVICE) . '</a>&nbsp;' . $items['items_name']; ?></td>
<?php
      } else {
?>
                <td class="TbInsideData">&nbsp;<?php echo $ebay_description_service . '&nbsp;<a href="' . go_href_link(NAME_OF_FILE_CATEGORIES, 'bigPfad=' . $bigPfad . '&bigID=' . $items['items_id'] . '&action=new_item') . '">' . go_picture(FOLDER_RELATIV_ICONS . 'preview.gif', ICON_PREVIEW) . '</a>&nbsp;' . $items['items_name']; ?></td>
<?php      
      }
?>

                <td class="TbInsideData">&nbsp;<?php echo $items['items_model']; ?></td>
                <td class="TbInsideData">&nbsp;<?php echo $items['items_quantity']; ?></td>
                <td class="TbInsideData">&nbsp;<?php echo $items['items_weight']; ?></td>
                <td class="TbInsideData">&nbsp;<?php echo $items['syn']; ?></td>
                <td class="TbInsideData" align="center">&nbsp;
                <?php
      if ($items['items_status'] == '1') {
        echo go_picture(FOLDER_RELATIV_PICTURES . 'icon_status_green.gif', PICTURE_ICON_STATUS_GREEN, 10, 10) . '&nbsp;&nbsp;<a href="' . go_href_link(NAME_OF_FILE_CATEGORIES, 'action=setflag&flag=0&bigID=' . $items['items_id'] . '&bigPfad=' . $bigPfad) . '">' . go_picture(FOLDER_RELATIV_PICTURES . 'icon_status_red_light.gif', PICTURE_ICON_STATUS_RED_LIGHT, 10, 10) . '</a>';
      } else {
        echo '<a href="' . go_href_link(NAME_OF_FILE_CATEGORIES, 'action=setflag&flag=1&bigID=' . $items['items_id'] . '&bigPfad=' . $bigPfad) . '">' . go_picture(FOLDER_RELATIV_PICTURES . 'icon_status_green_light.gif', PICTURE_ICON_STATUS_GREEN_LIGHT, 10, 10) . '</a>&nbsp;&nbsp;' . go_picture(FOLDER_RELATIV_PICTURES . 'icon_status_red.gif', PICTURE_ICON_STATUS_RED, 10, 10);
      }
?>
</td>
                <td class="TbInsideData" align="right">&nbsp;<?php if (isset($pInfo) && is_object($pInfo) && ($items['items_id'] == $pInfo->items_id)) { echo go_picture(FOLDER_RELATIV_PICTURES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . go_href_link(NAME_OF_FILE_CATEGORIES, 'bigPfad=' . $bigPfad . '&bigID=' . $items['items_id']) . '">' . go_picture(FOLDER_RELATIV_PICTURES . 'icon_info.gif', PICTURE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
              </tr>
<?php
    }
    $bigPfad_back = '';
    if (sizeof($bigPfad_array) > 0) {
      for ($i=0, $n=sizeof($bigPfad_array)-1; $i<$n; $i++) {
        if (empty($bigPfad_back)) {
          $bigPfad_back .= $bigPfad_array[$i];
        } else {
          $bigPfad_back .= '_' . $bigPfad_array[$i];
        }
      }
    }
    $bigPfad_back = (go_not_null($bigPfad_back)) ? 'bigPfad=' . $bigPfad_back . '&' : '';
?>
              <tr>
                <td colspan="3"><table border="0" width="100%" cellspacing="0" cellpadding="2">
                  <tr>
                    <td class="smallText"><?php echo TEXT_CATEGORIES . '&nbsp;' . $categories_count . '<br>' . TEXT_ITEMS . '&nbsp;' . $items_count; ?></td>
                    <?php if ($bigPfad == "") { ?>
                    <td align="right" class="smallText"><?php if (sizeof($bigPfad_array) > 0) echo '<a href="' . go_href_link(NAME_OF_FILE_CATEGORIES, $bigPfad_back . 'bigID=' . $current_category_id) . '">' . go_picture_button('button_back.gif', PICTURE_BACK) . '</a>&nbsp;'; if (!isset($_GET['search'])) echo '<a href="' . go_href_link(NAME_OF_FILE_CATEGORIES, 'bigPfad=' . $bigPfad . '&action=new_category') . '">' . go_picture_button('button_new_category.gif', PICTURE_NEW_CATEGORY); ?>&nbsp;<a href="javascript:alert('<?php echo JAVASCRIPT_ALERT_NOT_CAT; ?>')"><?php echo go_picture_button('button_new_item.gif', PICTURE_NEW_ITEM); ?></a></td>
                    
		    <?php } else{ ?>
                    <td align="right" class="smallText"><?php if (sizeof($bigPfad_array) > 0) echo '<a href="' . go_href_link(NAME_OF_FILE_CATEGORIES, $bigPfad_back . 'bigID=' . $current_category_id) . '">' . go_picture_button('button_back.gif', PICTURE_BACK) . '</a>&nbsp;'; if (!isset($_GET['search'])) echo '<a href="' . go_href_link(NAME_OF_FILE_CATEGORIES, 'bigPfad=' . $bigPfad . '&action=new_category') . '">' . go_picture_button('button_new_category.gif', PICTURE_NEW_CATEGORY) . '</a>&nbsp;<a href="' . go_href_link(NAME_OF_FILE_CATEGORIES, 'bigPfad=' . $bigPfad . '&action=new_item') . '">' . go_picture_button('button_new_item.gif', PICTURE_NEW_ITEM) . '</a>'; ?>&nbsp;</td>
                    <?php } ?>
                  </tr>
                </table></td>
              </tr>
            </table></td>
<?php
	require('main_bigware_11.php'); 
?>
          </tr>
        </table></td>
      </tr>
    </table>
