<?php
$user_id = $this->session->userdata('user_id');

if ($type == 'content') {
    if ($post_value->posted_by == $user_id) {

        if ($post_value->post_status == 1) {
            ?>
            <a href="javascript:void(0)" onclick="changePostStatus('<?php echo base_url() . 'post/change_post_status/' . $post_value->post_id . '/inactive/content' ?>', 'content', '<?php echo $post_value->post_id ?>')">
                <i class="fa fa-user-times " title="Inactive"></i>
            </a>&nbsp;
        <?php } else { ?>
            <a href="javascript:void(0)" onclick="changePostStatus('<?php echo base_url() . 'post/change_post_status/' . $post_value->post_id . '/active/content' ?>', 'content', '<?php echo $post_value->post_id ?>')">
                <i class="fa fa-user-plus " title="Active"></i>
            </a>&nbsp;
        <?php } ?>
        <a href="javascript:void(0)" onclick="changePostStatus('<?php echo base_url() . 'post/change_post_status/' . $post_value->post_id . '/delete/content' ?>', 'content', '<?php echo $post_value->post_id ?>')">
            <i class="fa fa-trash-o" title="Delete"></i>
        </a>&nbsp;&nbsp;
        <a href="<?php echo base_url().'view-content/'.$post_value->post_id;  ?>">
            <i class="fa fa-th" title="View"></i>
        </a>&nbsp;&nbsp;
    <?php } else { ?>
        <a href="<?php echo base_url().'view-content/'.$post_value->post_id;  ?>">
            <i class="fa fa-th" title="View"></i>
        </a>&nbsp;&nbsp;
        <?php
    }
} else {
    if ($post_value->post_status == 1) {
        ?>
        <a href="javascript:void(0)" onclick="changePostStatus('<?php echo base_url() . 'post/change_post_status/' . $post_value->post_id . '/inactive' ?>', 'note_alert', '<?php echo $post_value->post_id ?>')">
            <i class="fa fa-user-times " title="Inactive"></i>
        </a>&nbsp;
    <?php } else { ?>
        <a href="javascript:void(0)" onclick="changePostStatus('<?php echo base_url() . 'post/change_post_status/' . $post_value->post_id . '/active' ?>', 'note_alert', '<?php echo $post_value->post_id ?>')">
            <i class="fa fa-user-plus " title="Active"></i>
        </a>&nbsp;
    <?php } ?>

    <a href="javascript:void(0)" onclick="editPost('<?php echo base_url() . 'post/edit_post_form/' . $post_value->post_id; ?>', '<?php echo $post_value->post_id ?>')">
        <i class="fa fa-edit" title="Edit"></i>
    </a>&nbsp;
    <a href="javascript:void(0)" onclick="changePostStatus('<?php echo base_url() . 'post/change_post_status/' . $post_value->post_id . '/delete' ?>', 'note_alert', '<?php echo $post_value->post_id ?>')" >
        <i class="fa fa-trash-o" title="Delete"></i>
    </a>&nbsp;
    <a href="<?php echo base_url() . 'view-content/' . $post_value->post_id; ?>">
        <i class="fa fa-th" title="View"></i>
    </a>&nbsp;
    <?php
}