<?php
use home\assets\MainAsset;
use yii\helpers\Url;
use yii\widgets\ActiveForm;
use yii\helpers\StringHelper;
use home\models\Message;

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

$this->title = $model->title.'的收件人列表';
?>

<!--container-->
<div class="container manage-project fix">

	<!--manage-left -->
    <div class="manage-left">
        <dl>
            <dt>信息通知</dt>
            <dd><a href="<?= Url::to(['/message/inbox']) ?>">收件箱</a></dd>
            <dd><a href="<?= Url::to(['/message/outbox']) ?>">发件箱</a></dd>
            <dt>系统信息</dt>
            <dd><a href="<?= Url::to(['/announcement/index']) ?>">消息列表</a></dd>
        </dl>
    </div>

    <div class="manage-right">

        <div class="tab-column tab-manage">
            <p class="caption">信息详情</p>
        </div>
		<div class="modal-window" >
            <table class="table task-table taskdetail-table">
                <tbody>
                    <tr>
                        <td width="14%" class="table-blue">发送的内容:</td>
                        <td >
                            <div style="width: 770px; height: 250px;overflow-y:scroll;" >
                                <?= !empty($model->content)?$model->content:'暂无内容' ?>
                            </div>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
		

		<?php $mainForm = ActiveForm::begin([ 'id' => 'main-form', 'action' => '']); ?>
		<table class="table task-table">

			<tr>
				<th width="40"><label style="font-weight:lighter" ><input type="checkbox" name="select_all" class="box-select-all" style="position:relative;top:2px;" /> 全选</label></th>
				<th width="50">序号</th>
				<th width="55%">收件人</th>
                <th width="60">阅读日期</th>
				<th width="50">是否阅读</th>
			</tr>

			<?php if (empty($models)) : ?>
			<tr><td colspan="5" class="tac red">没有任何数据...</td></tr>
			<?php else : ?>
                <?php foreach ($models as $key => $model) : ?>
					<tr>
						<td><input type="checkbox" name="delete[]" class="box-delete" value="<?= $model->link_id ?>" /></td>
						<td><?= $key+1 ?></td>
						<td><?= $model->toName->realname ?></td>
                        <td><?= ($model->is_read)? date('Y-m-d H:i',$model->read_time):'未读' ?></td>
						<td><?= ($model->is_read == Message::STATUS_ENABLE) ? '<font color="green">是</font>' : '<font color="red">否</font>' ?></td>
					</tr>
				<?php endforeach; ?>
			<?php endif; ?>

		</table>

		<div class="tab-column tab-manage">
            <button type="button" class="btn btn-default btn-task batch-delete" data-url="<?= Url::to([$this->context->id.'/delete']) ?>" >
                <a href="javascript:;">删除</a>
            </button>
        </div>

		<?php ActiveForm::end(); ?>
        <!--分页标签-->
      	<div class="pages">
            <?php if ($pages->totalCount != 0) : ?><span class="pagetotal">共<em><?= $pages->totalCount ?></em>条记录<em><?= $pages->page + 1 ?>/<?= $pages->pageCount ?></em>页 </span><?php endif; ?>
            <?= \yii\widgets\LinkPager::widget(['pagination' => $pages, 'prevPageLabel' => '上一页','nextPageLabel' => '下一页', 'firstPageLabel' => '首页', 'lastPageLabel' => '末页']); ?>
        </div>
        <!--分页标签-->
    </div>
	<!--manage-right-->
</div>
<!--container-->

