<?php
$certificate_id = $certificate_info->certificate_id;
$certificate_status = $certificate_info->certificate_status;
$url = $certificate_info->certificate_public_id;
//$certificate_pulication_status = $certificate_info->certificate_pulication_status;
?>
<a href="<?php echo base_url() . 'certificate/' . $url . '/edit-certificate'; ?>"><i class="fa fa-edit" title="Edit"></i></a>
<span>&nbsp;&nbsp;</span>

<a href="<?php echo base_url() . 'certificate/' . $url . '/certificate' ?>"><i class="fa  fa-th" title="View Details"></i></a>
<span>&nbsp;&nbsp;</span>

<?php
if ($certificate_status == 0) {
    ?>
    <a href="#" onclick="return checkForAction('<?php echo base_url() . 'activate-certificate/' . $url; ?>', 'Active', '<?php echo $certificate_id; ?>')">
        <i class="fa  fa-user-plus" title="Publish"></i>
    </a>&nbsp;&nbsp;
<?php } else if ($certificate_status == 1) { ?>
    <a href="#" onclick="return checkForAction('<?php echo base_url() . 'inactivate-certificate/' . $url; ?>', 'Inactive', '<?php echo $certificate_id; ?>')">
        <i class="fa  fa-user-times" title="Unpublish"></i>
    </a>&nbsp;&nbsp;
<?php } else if ($certificate_status == 2) { ?>
    <a href="#" onclick="return checkForAction('<?php echo base_url() . 'activate-certificate/' . $url; ?>', 'Active', '<?php echo $certificate_id; ?>')">
        <i class="fa  fa-user-plus" title="Publish"></i>
    </a>&nbsp;&nbsp;
<?php } ?>

<?php if ($certificate_status != 2) { ?>
    <a  href="#" onclick="return checkForAction('<?php echo base_url() . 'archive-certificate/' . $url; ?>', 'Delete', '<?php echo $certificate_id; ?>')">
        <i class="fa fa-trash-o" title="Delete"></i>
    </a>&nbsp;&nbsp;
<?php } ?>