<div class="table-wrap">
    <div class="table-responsive">
        <table class="table table-sm text-white">
            <tbody>
                <tr>
                    <td><?php echo $this->lang->line('receiver'); ?> <?php echo $this->lang->line('type'); ?></td>
                    <td><?php echo $sms->role; ?></td>
                    <td><?php echo $this->lang->line('sms'); ?> <?php echo $this->lang->line('type'); ?></td>
                    <td><?php echo $this->lang->line($sms->sms_type); ?></td>
                </tr>
                <tr>
                    <td><?php echo $this->lang->line('total'); ?> <?php echo $this->lang->line('sms'); ?></td>
                    <td><?php echo count(explode(',', $sms->receivers)) > 0 ? count(explode(',', $sms->receivers)) - 1 : count(explode(',', $sms->receivers)); ?></td>
                    <td><?php echo $this->lang->line('status'); ?></td>
                    <td>
                        <?php if ($sms->status) { ?>
                            <span class="badge badge-success"><?php echo $this->lang->line('active'); ?></span>
                        <?php } else { ?>
                            <span class="badge badge-danger"><?php echo $this->lang->line('in_active'); ?></span>
                        <?php } ?>
                    </td>
                </tr>
                <tr>
                    <td colspan="4"><?php echo $this->lang->line('message'); ?></td>
                </tr>
                <tr>
                    <td colspan="4"><?php echo get_formatted_body($sms->body, $sms->role_id, explode(',', $sms->receivers)[0]); ?></td>
                </tr>
                <tr>
                    <td><?php echo $this->lang->line('created_by'); ?></td>
                    <td><?php echo $sms->created_by; ?></td>
                    <td><?php echo $this->lang->line('date'); ?></td>
                    <td><?php echo date('d F, Y h:i A', strtotime($sms->created_at)); ?></td>
                </tr>
                <?php if ($this->session->userdata('role_id') == SUPER_ADMIN || !empty(custom_permission('modified_by'))) { ?>
                    <tr>
                        <td><?php echo $this->lang->line('modified_by'); ?></td>
                        <td><?php echo $sms->modified_by; ?></td>
                        <td><?php echo $this->lang->line('date'); ?></td>
                        <td><?php echo $sms->modified_by ? date('d F, Y h:i A', strtotime($sms->modified_at)) : ''; ?>
                        </td>
                    </tr>
                <?php } ?>
            </tbody>
        </table>
    </div>
</div>