ステータスが1の場合は「アクティブな保険イベント」であり、2の場合は「完了した保険イベント」です。
if(!empty($ins_event))
{
echo "<tr><td> <img src='/check-icon.gif'> <a href='". matry::here(array('event_id'=>$ins_event['id'])) . "'>" . ( $ins_event['status'] == 2 ? "Completed Insurance Event": "Active Insurance Event") . "</a></td></tr>";
}
else
{
echo "<tr><td>" . cbox_return() . "<a href='". matry::here_to('new', array('tfilt'=>'IN', 'pfilt'=>$patient->code)) . "' style='color: #000; color:$rx_image_color'>**Ins Event Not Created**</td></tr>";
}
ここに色の変数があります:
<?php
$rx_event_colors = $rx_ev_status = '#009933';
?>
この変数を使用して2のステータスを取得し、フォントの色を変更するにはどうすればよいですか。
スクリプトを分割して、if {} else {}ステートメントを使用する必要がありますか?
更新されたコード:
echo "<tr><td> <img src='/check-icon.gif'> <a href='". matry::here(array('event_id'=>$ins_event['id'])) . "'" . ( $ins_event['status'] == 2 ? ' style="color: ' . $rx_ev_status . '">Completed Insurance Event' : '>Active Insurance Event') . "</a></td></tr>";