Example #1
0
?>
<h1 class="w9_header">W9 Detail: <?=@CHtml::encode(Yii::app()->user->userLogin);?><span class="right items_to_review">W9s to review: <?php echo $num_pages; ?> items</span></h1>

<div class="account_manage">
    <div class="account_header_left left">
        <button class="button" id="send_document_by_fax" data="<?php echo $client->Client_ID; ?>">Fax</button>
        <button class="button" id="send_document_by_email" data="<?php echo $client->Client_ID; ?>">Email</button>
        <?php
        if (strpos($file->Mime_Type, 'pdf') === false) {
            echo '<button class="button" id="print_document" data="' .  $company->Company_Fed_ID . '">Print</button>';
        }
        if ($w9->Access_Type == 1) {
            echo '<button class="button" id="share_document" data-id="' . $w9->W9_ID . '">Share</button>';
        }

        if (Documents::hasDeletePermission($w9->Document_ID,Documents::W9,Yii::app()->user->userID,Yii::app()->user->clientID)) {
            echo '<button class="button" id="delete_document" data-href="' . Yii::app()->createUrl('documents/deletedocument', array('doc_for_delete'=>$w9->Document_ID) ). '">Delete</button>';
        }
        ?>
    </div>
    <?php $this->renderPartial('application.views.widgets.pages_navigation', array(
        'page' => $page,
        'num_pages' => $num_pages,
        'url' => '/w9/detail',
    )); ?>
</div>
<div class="wrapper">
    <div class="w9_details">
        <span class="right created_on">Created on: <span class="created_on_date"><?php echo Helper::convertDateString($lastDocument->Created); ?></span></span>
        <h2><?php echo CHtml::encode($company->Company_Name); ?></h2>
        <table class="details_table">
Example #2
0
 * Created by PhpStorm.
 * User: lee
 * Date: 9/18/14
 * Time: 1:02 PM
 */
echo '<div style="margin-left: 100px;width: 200px;">';
if($docId) {
    $id = intval($docId);
    $str=0;

    //check if current document can be deleted or replaced
    $doc_to_modify = Documents::model()->findByPk($id);
    $can_be_changed = false;
    if (
        //1
        (Documents::hasAccess($id) && Documents::hasDeletePermission($id, $doc_to_modify->Document_Type, Yii::app()->user->userID, Yii::app()->user->clientID))
        ||
        //2
        (Yii::app()->user->userType == UsersClientList::APPROVER)
    )
    {
            $can_be_changed = true;
    }

} else if ($file_name)  {
    $id=$file_name;
    $str=1;

} else if ($imgId)  {
    $id= $imgId;
    $str=0;