0
我正在一個標籤,我可以有一個鏈接的圖像,有一個數據映射 - 突出顯示,我怎麼做,如果其他語句工作內屬性?在聲明上將包含另一個屬性。如果其他語句裏面的屬性和一個屬性如果其他語句
這裏是我的代碼:
<map id="ground" name="ground">
<?php
$sql = "SELECT * FROM stall s
LEFT JOIN tenant t
ON t.stall_id = s.stall_id
LEFT JOIN rent r
ON r.tenant_id = t.tenant_id
AND r.rent_status = 1
WHERE s.stall_id = 1";
$query = $conn->prepare($sql);
$query->execute();
$fetch = $query->fetchAll();
foreach ($fetch as $key => $value) { ?>
<area id="9" shape="rect" coords="9,98,46,117" data-toggle="modal" class = "stallstyle1"
href="#stall_modal9"
value="<?php echo $value['rent_status']?>"
<?php
if ($value ['rent_status'] == 1) {
data-maphilight='{"strokeColor":"008000","strokeWidth":3,"fillColor":"7CFC00","fillOpacity":0.6,"alwaysOn":true}'>
} else {
data-maphilight='{"strokeColor":"FF0000","strokeWidth":3,"fillColor":"FF3333","fillOpacity":0.6,"alwaysOn":true}'>
}
?>
<?php } ?>
顏色仍然沒有變化。 –
$ value ['rent_status']的值是多少? –
rent_status的值爲1,如果我將其更改爲0,映射消失 –