I have a code below which seems not to be working so I would want to try case statement instead
I need help to solve the if statement or change it to case statement if it can work pliz.
Code:
<td>
<?php $is_author = $message->user_id == $this->session->userdata('id'); ?>
<?php if($is_author): ?>
<?php echo anchor('admin/messages/edit/'.$message->id.'', 'Edit', 'class="btn btn-primary"'); ?>
<?php echo anchor('admin/messages/delete/'.$message->id.'', 'Delete', 'class="btn btn-danger"'); ?>
<?php else: ?>
<?php echo anchor('admin/messages/approve/'.$message->id.'', 'Approve', 'class="btn btn-success"'); ?>
<?php endif; ?>
</td>I need help to solve the if statement or change it to case statement if it can work pliz.