// Go ahead and set it to the max to kick off a new div $iTotalInView = 8; $cClass = ' active'; foreach ($oItem as $item) { $iCnt++; if ($iCnt > $iTotalInView) { if ($cClass == '') { $this_content .= '</div>'; } $this_content .= '<div class="item' . $cClass . '">'; $iCnt = 1; } $objItemImage = new ItemImage(); $oItemImage = $objItemImage->getAllItemImageByItemIdItemImageSide($item->Id, 'Front'); $this_content .= '<div class="menu-item menu-nav-item col-sm-3">'; $this_content .= ' <a href="single-product.php?id=' . $item->Id . '"><img src="' . $objItemImage->getPath() . $oItemImage[0]->ItemImageUrl . '" alt="' . $item->ItemName . '"></a>'; $this_content .= ' <a href="single-product.php?id=' . $item->Id . '">' . $item->ItemName . '</a>'; $this_content .= '</div>'; $cClass = ''; // Turn off active after first item } echo " category_names[" . $cat->Id . "] = '" . $cat->CategoryName . "';\n"; $this_content .= "</div>"; $cat_content[$cat->Id] = $this_content; echo " category_content[" . $cat->Id . "] = '" . $this_content . "';\n"; } $objTechnology = new Technology(); $tech_content = array(); foreach ($oCategory as $cat) { $this_content = ""; $oTechnology = $objTechnology->GetAllTechnologyByCategoryId($cat->Id);
// --> <div class="menu-nav-container bottom-nav"> <?php $nGetNum = 3; $fGetSome = true; $iCnt = 0; $iIndex = 3; // 4th item but array is zero-based while ($fGetSome) { $iCnt++; $objItemImage = new ItemImage(); $oItemImage = $objItemImage->getAllItemImageByItemIdItemImageSide($oItem[$iIndex]->Id, 'Front'); echo '<div class="menu-item menu-nav-item col-sm-4 css-mousedown">' . PHP_EOL; echo ' <div class="menu-nav-item-bg"></div>' . PHP_EOL; echo ' <a href="single-product.php?id=' . $oItem[$iIndex]->Id . '"><img src="' . $objItemImage->getPath() . $oItemImage[0]->ItemImageUrl . '" alt="' . $oItem[$iIndex]->ItemName . '"></a>' . PHP_EOL; echo '</div>' . PHP_EOL; $iIndex++; if ($iCnt == $nGetNum) { $fGetSome = false; } } ?> </div> <?php // Must set cat_id prior to flyout-menu $cat_id = $_REQUEST['id']; include 'flyout-menu.php'; ?> <div class="transparent-bg"></div> </body>