我有一个页面,其中有一个带有回显的 if 语句,即使满足条件,回显也不会打印到屏幕上。调试时 $invoicedetails schedule等于true
这是我认为的相关信息
<?php
if($invoicedetails['Invoice']['scheduled']==1)
{
$status = 'Scheduled';
$fcol = 'Black';
$bgcol = '#EBD8E8';
$pay = NULL;
$dispute = NULL;
}
else if($invoicedetails['Invoice']['paid']==1)
{
$status = 'Paid';
$fcol = 'Black';
$bgcol = '#B9FAEA';
$pay = NULL;
$dispute = NULL;
}
else if($invoicedetails['Invoice']['sender_id']==$accountid)
{
$status = 'Sent';
$fcol = 'Black';
$bgcol = '#F8FAC0';
$pay = NULL;
$dispute = NULL;
}
else if($invoicedetails['Invoice']['receiver_id']==$accountid)
{
$status = 'Received';
$fcol = 'Black';
$bgcol = '#FAB9B9';
$pay = $this->Html->link('Pay', array('controller' => 'Invoices','action'=>'pay_admin',$invoicedetails['Invoice']['id'] )) ;
$dispute = $this->Html->link('Dispute', array('controller' => 'Disputes','action'=>'add_admin',$invoicedetails['Invoice']['id'] ));
}
?>
<tr>
<th>Actions: </th>
<td>
<?php
if($invoicedetails['Invoice']['scheduled']=='true'){
echo $pay;
}
?>
<?php echo $dispute; ?></td>
</tr>