<?php
include("config/koneksi2.php");
$content_per_page = 3;	
$group_no  = strtolower(trim(str_replace("/","",$_REQUEST['group_no'])));
$start = ceil($group_no * $content_per_page);
$sql="SELECT * FROM bs_stok WHERE tipe = 'BIKE'";
    if(isset($_GET['brand']) && $_GET['brand']!="") :
        $brand = $_GET['brand'];
        $sql.=" AND brand IN ('".implode("','",$brand)."')";
    endif;

    if(isset($_GET['material']) && $_GET['material']!="") :
        $material = $_GET['material'];
        $sql.=" AND kategori IN ('".implode("','",$material)."')";
    endif;

    if(isset($_GET['size']) && $_GET['size']!="") :
        $size = $_GET['size'];
        $sql.=" AND size_ax IN (".implode(',',$size).")";
    endif;
	$sql.=" LIMIT $start, $content_per_page";
	$all_product=mysql_query($sql);
    $rowcount=mysql_num_rows($all_product);
	// echo $sql; exit;

    function url_clean($String)
    {
    	return str_replace('_',' ',$String); 
    }
	function data_clean($str)
    {
        return str_replace(' ','_',$str);
    }

?>
 
					
<!-- listing -->
        <?php if(isset($all_product) && count($all_product) && $rowcount > 0) : $i = 0; ?>
            <?php while($products=mysql_fetch_array($all_product))
			{ ?>
                <article class="col-md-4 col-sm-6">
                    <div class="thumbnail product">
                        <figure>
                            <!--<a href="#"><img src="product_images/<?php echo $products['photo']; ?>" alt="<?php echo $products['nama']; ?>" /></a>-->
                        </figure>
                        <div class="caption">
                           <!-- <a href="" class="product-name"><?php echo $products['nama']; ?></a>
                            <div class="price">Rp.<?php echo $products['dealer']; ?>/-</div>
                            <h6>Brand : <?php echo $products['brand']; ?></h6>
                            <h6>Kategori : <?php echo $products['kategori']; ?></h6>
                            <h6>Size : <?php echo $products['size_ax']; ?></h6>-->
							                            <h6>Brand : <?php echo $products['brand']; ?></h6>

                        </div>
                    </div>
                </article>
            <?php $i++; }?> 
        <?php endif; ?>
                     
<!-- /.listing -->