<?php
use wap\assets\AppAsset;
use yii\helpers\Url;
use yii\helpers\ArrayHelper;
use yii\helpers\StringHelper;

$this->title = StringHelper::truncate($model['name'], 10);

/* @var $this \yii\web\View */

$asset = $this->getAssetManager()->getBundle(AppAsset::className());
?>

<style>
body{
	background:#f4f4f4;
}
</style>

<div class="mainbody">
    <div class="project-detail">
        <h3><?= $model['name'] ?></h3>

        <div class="bgf">
            <div class="project-info">
                <span >项目概述</span><img src="<?= $asset->baseUrl ?>/images/taskinfoimg.png">
                <p>【<?= ArrayHelper::getValue(\common\api\User::getOne($model->leader_id), 'realname') ?>】   <?= date('y-m-d', $model['begin_time']) ?> 至 <?= date('y-m-d', $model['end_time']) ?></p>
                <p><em>商务</em><?= $model['business_contact'] ?>  <?= $model['business_tel'] ?></p>
                <p><em>代理</em><?= $model['agent_contact'] ?>  <?= $model['agent_tel'] ?></p>
                <div class="introduction">
                    <table>
                        <tr>
                            <td width="33" class="c6" valign="top">简介</td>
                            <td><?= $model['brief'] ?></td>
                        </tr>
                    </table>
                </div>
            </div>
        </div>

        <div class="bgf mgt10">
            <div class="project-info">
                <span>客户信息</span><img src="<?= $asset->baseUrl ?>/images/taskinfoimg.png">
                <p><?= (isset($model['customer']['name'])) ? $model['customer']['name'] : '' ?></p>
                <p><?= $model['customer_address'] ?></p>
                <div><?= isset($model['customer']['remark']) ? $model['customer']['remark'] : '' ?></div>
            </div>
        </div>

        <div class="bgf mgt10">
            <div class="project-info">
                <span>实施范围</span><img src="<?= $asset->baseUrl ?>/images/taskinfoimg.png">
                <?php if (!empty($model['projectScope'])) : ?>
                    <?php foreach ($model['projectScope'] as $scope) : ?>
                    <div><?= $scope['cat_name'] ?> &nbsp;&nbsp; <?= $scope['name'] ?> &nbsp;&nbsp; <?= $scope['count_performance'] ?> × <?= $scope['count'] ?> </div>
                    <p><em> 备注：<?= $scope['remark'] ?></em></p>
                    <?php endforeach; ?>
                <?php endif; ?>
            </div>
        </div>

        <div class="bgf mgt10">
            <div class="project-info">
                <span>资源信息</span><img src="<?= $asset->baseUrl ?>/images/taskinfoimg.png">
                <?php if (!empty($model['projectResource'])) : ?>
                    <?php foreach ($model['projectResource'] as $resource) : ?>
                        <div><?= $resource['cat_name'] ?> &nbsp;&nbsp; <?= $resource['name'] ?> &nbsp;&nbsp; <?= $resource['model'] ?> &nbsp;&nbsp; <?= $resource['count'] ?>   </div>
                        <div><em> 备注：<?= $resource['remark'] ?></em></div>
                    <?php endforeach; ?>
                <?php endif; ?>
            </div>
        </div>
    </div>
</div>


