<?php
session_start();
require_once('includes/config.php'); 
$service_id=$_POST['service_id'];
$subservice_id=$_POST['subservice_id'];
$sql="SELECT amenities_description.*,amenities.amenities_title FROM amenities INNER JOIN amenities_description ON  amenities.id=amenities_description.amenities_id WHERE amenities.service_id='$service_id' and amenities.subservice_id='$subservice_id' and amenities.status='1' order by amenities_description.amenities_id asc";
$result_rslt=$con->query($sql);
$amen_id="";
if ($result_rslt->num_rows > 0) {
while($row = $result_rslt->fetch_assoc()) {
$title="";
if($amen_id!=$row['amenities_id']){
 $title=$row['amenities_title'];   
}?>
<p><?php echo $title;?></p>
<div class="col-xs-12 text-center">
<div class="checkbox checkbox-circle checkbox-blue">
<input type="checkbox" name="service_name[]" value="<?php echo $row['id'];?>">
<label><?php echo $row['amenities_name'];?></label>
</div>
</div>
<?php $amen_id=$row['amenities_id'];}}?>