如果行状态为 1,则在 table 中显示批准状态

If row status is 1 show the approved status in the table

如果行状态= 1,我想输出你批准的声明,现在可以输出数据我只想要声明批准。

这是我的代码

<div class="row">
    <div class="col-md-12">
        <table class="table table-striped">
            <tr>
                <th>Nominee Name</th>
                <th>Year</th>
                <th>Department</th>
                <th>StudentID</th>
                <th>Position</th>
                <th>View File</th>
                <th>Nominee Photo</th>
                <th>Nominated by</th>
                <th>status</th>
            </tr>
            <?php
            foreach ($nominees as $noms) {
                ?>
                <tr>
                    <td><?php echo $noms['name']; ?></td>
                    <td><?php echo $noms['year']; ?></td>
                    <td><?php echo $noms['department']; ?></td>
                    <td><?php echo $noms['studentid']; ?></td>
                    <td><?php echo $noms['position']; ?></td>
                    <td><a href="<?php echo base_url(); ?>uploads/<?php echo $noms['pdf']; ?>"></a></td>
                    <td><img src="<?php echo base_url(); ?>uploads/<?php echo $noms['photo']; ?>" style='width:50px;height:50px;'></td>
                    <td><?php echo $noms['nomname']; ?></td>
                    <?php if ($noms['approve'] == 1) { ?>
                        <td>Approve</td>
                    <?php } else { ?>
                        <td>pending</td>
                    <?php } ?>

                </tr>

            <?php } ?>
        </table>
    </div>
</div>

如果 $nominees 数组 returns 保留,那么你可以这样做

<?php if ( $nom['status'] == 1) { ?>
                            <td>Approve</td>
                       <?php }else{ ?>
                       <td>pending</td>
                        <?php }?>