<span class="title-divider"></span> <div id="container" class="container"> <div id="gallery"> <div id="gallery-header"> <div id="gallery-header-center"> <div id="gallery-header-center-left"> <!-- <div id="gallery-header-center-left-icon"> </div> --> <div id="gallery-header-center-left-title">All Galleries</div> </div> <div id="gallery-header-center-right"> <div class="gallery-header-center-right-links" id="filter-all">All</div> <?php $categories = Categories::getAll("WHERE category_status=1"); $pictures = ViewGallery::getAll("WHERE image_status=1"); // <!--Buttons --> foreach ($categories as $category) { echo "<div class='gallery-header-center-right-links' id='filter-{$category->category}'>{$category->category}</div>"; } //<!--Buttons end --> ?> </div> </div> </div> <div id="gallery-content"> <div id="gallery-content-center"> <!--Images --> <?php
/*************************************************************************************************************************/ $all_cat = Categories::getAll("WHERE category_status=1"); $first_category = $all_cat[0]->category; foreach ($all_cat as $cat) { echo "<li class='" . ($first_category == $cat->category ? 'active' : '') . " '><a href='#{$cat->category}' data-toggle='tab'>{$cat->category}</a></li>"; } /*************************************************************************************************************************/ ?> </ul> <div class="tab-content"> <?php /*************************************************************************************************************************/ foreach ($all_cat as $categ) { echo "<div class='tab-pane fade " . ($first_category == $categ->category ? 'active in' : '') . " ' id='{$categ->category}'>\n <h4> {$categ->category} </h4>\n <div>"; /*************************************************************************************************************************/ $images_in_category = ViewGallery::getAll("WHERE category='" . $categ->category . "'"); foreach ($images_in_category as $image) { echo "<img src='./../img/{$image->image_url}' style='width: 200px'>"; } /*************************************************************************************************************************/ //print_r($all_cat); ?> <div> </div> <?php echo " </div></div>"; } ?> </div> </div>