<?php
$person_id = $this->session->userdata('user_id');
if ($person_link_info) {
    if ($person_link_info->add_link_request_status == 1) {
        ?>

        <a href="javascript:void(0)" 
           onclick="return checkForLinkAction('<?php echo base_url() . 'remove-link-profile/' . $person_info->person_id; ?>', 'Remove Link', ' Do you want to Remove Link', '<?php echo $person_info->person_id; ?>')">
            <i class="fa fa-unlink" title="Remove From Link"></i>
        </a>&nbsp;

        <a href="javascript:void(0)"
           onclick="return checkForLinkAction('<?php echo base_url() . 'block-link-profile/' . $person_info->person_id; ?>', 'Block Person', ' Do you want to Block Person', '<?php echo $person_info->person_id; ?>')"> 
            <i class="fa fa-ban" title="Block Person"></i>
        </a>&nbsp;

        <?php
    } else if ($person_link_info->add_link_request_status == 3) {
        if ($person_link_info->requested_person_id != $this->session->userdata('user_id')) {
            ?>  

            <a href="javascript:void(0)"
               onclick="return checkForLinkAction('<?php echo base_url() . 'accept-link-profile/' . $person_info->person_id; ?>', 'Accept Request', ' Do you want to Accept Request', '<?php echo $person_info->person_id; ?>')"> 
                <i class="fa fa-arrow-right" title="Accept Request"></i>
            </a>&nbsp;

            <a href="javascript:void(0)"
               onclick="return checkForLinkAction('<?php echo base_url() . 'cancel-link-profile/' . $person_info->person_id; ?>', 'Calcel Request', ' Do you want to Cancel Request', '<?php echo $person_info->person_id; ?>')"> 
                <i class="fa fa-user-times" aria-hidden="true" title="Cancel Request"></i>
            </a>&nbsp;

            <a href="javascript:void(0)"
               onclick="return checkForLinkAction('<?php echo base_url() . 'block-link-profile/' . $person_info->person_id; ?>', 'Block Person', ' Do you want to Block Person', '<?php echo $person_info->person_id; ?>')"> 
                <i class="fa fa-ban" aria-hidden="true" title="Block Person"></i>
            </a>&nbsp;

        <?php } else { ?>

            <a href="javascript:void(0)"
               onclick="return checkForLinkAction('<?php echo base_url() . 'cancel-link-profile/' . $person_info->person_id; ?>', 'Calcel Request', ' Do you want to Cancel Request', '<?php echo $person_info->person_id; ?>')"
               class="btn"> 
                <i class="fa fa-user-times" aria-hidden="true" title="Cancel Request"></i>
            </a>&nbsp;

            <?php
        }
    } else if ($person_link_info->add_link_request_status == 5) {
        ?>
        <a href="javascript:void(0)"
           onclick="return checkForLinkAction('<?php echo base_url() . $person_info->person_id . '/connect-from-profile'; ?>', 'Connect', ' Do you want to Connect', '<?php echo $person_info->person_id; ?>')"
           class="btn"><i class="fa fa-link" aria-hidden="true" title="Connect"></i>
        </a>&nbsp;
    <?php } else if ($person_link_info->add_link_request_status != 5) {
        ?>
        <a href="javascript:void(0)"
           onclick="return checkForLinkAction('<?php echo base_url() . $person_info->person_id . '/connect-from-profile'; ?>', 'Connect', ' Do you want to Connect', '<?php echo $person_info->person_id; ?>')"
           class="btn"><i class="fa fa-link" aria-hidden="true" title="Connect"></i>
        </a>&nbsp;
    <?php } else {
        ?>
        <a href="javascript:void(0)"
           onclick="return checkForLinkAction('<?php echo base_url() . $person_info->person_id . '/connect-from-profile'; ?>', 'Connect', ' Do you want to Connect', '<?php echo $person_info->person_id; ?>')"
           class="btn"><i class="fa fa-link" aria-hidden="true" title="Connect"></i>
        </a>&nbsp;
        <?php
    }
} else {
    ?>
    <a href="javascript:void(0)"
       onclick="return checkForLinkAction('<?php echo base_url() . $person_info->person_id . '/connect-from-profile'; ?>', 'Connect', ' Do you want to Connect', '<?php echo $person_info->person_id; ?>')"
       class="btn"><i class="fa fa-link" aria-hidden="true" title="Connect"></i>
    </a>&nbsp;
<?php } ?>