<?php

use home\assets\MainAsset;
use yii\helpers\Url;
use yii\widgets\ActiveForm;
use yii\helpers\StringHelper;
use home\modules\contract\models\Contract;
use common\assets\My97DatePickerAsset;
use common\assets\ZTreeAsset;

$assetUrl = $this->getAssetManager()->getBundle(MainAsset::className())->baseUrl;
$this->registerJsFile($assetUrl . '/js/cate.tree.js', ['depends' => [MainAsset::className(), ZTreeAsset::className()]]);

$this->title = '合同列表';
?>

<!--container-->
<div class="container manage-project fix">
<!--mainbody-->
    <div class="mainbody fix">
        <?= $this->render('@home/views/site/_left-menu') ?>

        <!--manage-left -->

        <div class="manage-right">
    <div class="tab-column tab-manage">
            <div class="tab-right">
                <?php if (Contract::readAccess('contract/contract/create')) : ?>
                    <button title="添加合同" type="button" data-url='<?= Url::to([$this->context->id . '/create']) ?>' data-height='510' data-width='834' data-title='添加合同' class="btn btn-default btn-task open-contract-dialog">
                       <i class="icon-plus"></i>
                    </button>
                <?php endif; ?>
                <?php if (Yii::$app->session->get('isSuperAdmin') || Yii::$app->user->can('contract/contract/export')) : ?>
                    <button title="导出合同" type="button" class="btn btn-default btn-task" onclick="javascript:window.location.href = '<?= Url::to(['export']) ?>'">
                       <i class="icon-download-alt"></i>
                    </button>
                <?php endif; ?>

            </div>
            <p class="caption">合同列表</p>
        </div>


           <div class="manage-right-cont fix">

            <div class="mainleft-tree">
                <div class="labellink fix"> <a href="<?= Url::to([$this->context->id . '/index']) ?>" class="labelfocus" title="查看全部">全部</a>
                </div>
                <div class="lefttree" >
                    <ul id="tree"  class="ztree"  ></ul>
                </div>
        </div>

       <div class="manage-right-iframe">
        
        <iframe  frameBorder=0  name="main_content" id="main_content" scrolling=yes width="100%" height="780px" src="<?= Url::to(['index-iframe']) ?>"></iframe>
      </div>
    <!--manage-right-->
    </div>
  </div>
</div>
</div>
<!--container-->
<script>
    var index = "<?= Url::to(['index']) ?>";
    var CSRF = "<?= Yii::$app->request->getCsrfToken() ?>";
    var getTreeDataUrl = "<?= Url::to([$this->context->id . '/get-treedata', '_csrf' => Yii::$app->request->getCsrfToken()]) ?>";
    var iframeDataUrl = "<?= Url::to([$this->context->id . '/index-iframe', '_csrf' => Yii::$app->request->getCsrfToken()]) ?>";
</script>
