/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
$products_count = $result->RecordCount(); $productArray = $result->GetArray(); $productSum = 0; foreach($productArray as $price){ } if ($median > 100){ $median = $median*100; } $second_price = $median; $lower_count = 0; $lower_median_sum =0; foreach ($productArray as $price){ if ($price['products_price'] < $median){ $lower_count++; $lower_median_sum = $price['products_price'] + $lower_median_sum; } } if ($lower_count > 1){ } $upper_count = 0; $upper_median_sum = 0; foreach ($productArray as $price){ if ($price['products_price'] > $median){ $upper_count++; $upper_median_sum = $price['products_price'] + $upper_median_sum; } } if ($upper_count > 1){ } if ($first_price > 100){ $first_price = $first_price*100; } if ($third_price > 100){ $third_price = $third_price*100; } //return self::getPriceRangeArray($row['totalProduct'],$row['sum'],$productStatus,$brandID,$categoryIds); $i=0; if($products_count > 1 ){ if(self::checkPriceRange(0,$first_price,$productStatus,$brandID,$categoryIds)>0) { $priceRangeArray[$i]['range'] = '0-'.$first_price; $priceRangeArray[$i]['label'] = 'Below Rs.'.$first_price; $i++; } if(self::checkPriceRange($first_price,$second_price,$productStatus,$brandID,$categoryIds)>0) { $priceRangeArray[$i]['range'] = $first_price.'-'.$second_price; $priceRangeArray[$i]['label'] = 'Rs.'.$first_price .' - Rs.'.$second_price; $i++; } } else { if(self::checkPriceRange(0,$second_price,$productStatus,$brandID,$categoryIds)>0) { $priceRangeArray[$i]['range'] = '0-'.$second_price; $priceRangeArray[$i]['label'] = 'Below Rs.'.$second_price; $i++; } } if(self::checkPriceRange($second_price,$third_price,$productStatus,$brandID,$categoryIds)>0) { $priceRangeArray[$i]['range'] = $second_price.'-'.$third_price; $priceRangeArray[$i]['label'] = 'Rs.'.$second_price .' - Rs.'.$third_price; $i++; } if(self::checkPriceRange($third_price,999999,$productStatus,$brandID,$categoryIds)>0) { $priceRangeArray[$i]['range'] = $third_price.'-99999999'; $priceRangeArray[$i]['label'] = 'Rs.'.$third_price.' Above'; $i++; } } else { if(self::checkPriceRange($second_price,999999,$productStatus,$brandID,$categoryIds)>0) { $priceRangeArray[$i]['range'] = $second_price.'-99999999'; $priceRangeArray[$i]['label'] = 'Rs.'.$second_price.' Above'; $i++; } }