gpt4 book ai didi

javascript - 当状态为 "paid"时禁用支付按钮

转载 作者:行者123 更新时间:2023-11-29 18:04:47 25 4
gpt4 key购买 nike

我想在已付款状态时禁用付款按钮。

我的代码:

<table id="simple-table" class="table  table-bordered table-hover">
<thead>
<tr>
<th width="30%">Month </th>
<th width="20%">DPS Amount</th>
<th width="20%">Status</th>
<th width="30%">Options</th>
</tr>
</thead>
<tbody>
<?php
$acc=$_GET['acc'];
$result = $db->prepare("SELECT * FROM dps_schedule WHERE account_number= :userid");
$result->bindParam(':userid', $acc);
$result->execute();
$counter = 0;
for($i=0; $row = $result->fetch(); $i++){
?>
<tr class="record">
<td>Month-<?php echo ++$counter; ?></td>
<td><?php echo $row['dps_payment']; ?></td>
<td class="status"><?php echo $row['status']; ?></td>
<td class="dis"><a rel="facebox" href="dps_installment.php?id=<?php echo $row['id']; ?>"><button class="btn btn-success btn-mini"><i class="icon-edit"></i> PAY </button></a></td>
</tr>
<?php
}
?>
</tbody>
</table>

代码 View :

enter image description here

现在想在已付款状态时禁用付款按钮。

最佳答案

如果您不想显示已付款订单的付款按钮,您可以添加如下条件:

<?php if($row['status']!="Paid"){ ?> 
<td class="dis"><a rel="facebox" href="dps_installment.php?id=<?php echo $row['id']; ?>"><button class="btn btn-success btn-mini"><i class="icon-edit"></i> PAY </button></a></td>
<?php } ?>

您还可以将按钮显示为“已付费”,并使用 if else 条件删除其上方的链接,如下所示:

<?php if($row['status']=="Paid"){ ?> 
<td class="dis"><button class="btn btn-success btn-mini"><i class="icon-edit"></i> PAID </button></td>
<?php } else { ?>
<td class="dis"><a rel="facebox" href="dps_installment.php?id=<?php echo $row['id']; ?>"><button class="btn btn-success btn-mini"><i class="icon-edit">
</i> PAY </button></a></td>
<?php } ?>

关于javascript - 当状态为 "paid"时禁用支付按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47976877/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com