";
foreach ($seatLayoutArray as $seatNumber) {
$seatLayout .= "";
if (empty($seatNumber)) {
$seatLayout .= "";
} else {
$is_book = isSeatBooked($bus,$bus_id, $book_date, $seatNumber);
$gender = getgender($bus,$bus_id, $book_date, $seatNumber);
if(!$is_book)
{
$book =0;
$imageSource = $isSleeper ? 'images/sofavisible.png' : 'images/chairvisible.png';
}
else
{
$book =1;
if($gender == 'FEMALE')
{
$imageSource = $isSleeper ? 'images/sofaladis.png' : 'images/chairladis.png';
}
else
{
$imageSource = $isSleeper ? 'images/sofabooked.png' : 'images/chairbooked.png';
}
}
$seatLayout .= "";
$leftPosition = ($isSleeper ? '30%' : '40%') . ';'; // Default left position
// Check if $seatNumber is a 2-digit number
if (strlen($seatNumber) == 2) {
$leftPosition = ($isSleeper ? '30%' : '30%') . ';';
}
$seatLayout .= " " . $seatNumber . " ";
}
$seatLayout .= " | ";
}
$seatLayout .= "
";
}
}
return $seatLayout;
}
$data = $bus->query("select * from tbl_bus where id=" . $bus_id . "")->fetch_assoc();
$decker = $data['decker'];
$is_sleeper = $data['is_sleeper'];
$driver_direction = $data['driver_direction'];
$seatLayoutData = explode('$;', $data['seat_layout']);
?>