<?php

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

use yii\helpers\Html;
use yii\helpers\Url;

$this->title = 'Команда';
$this->params['breadcrumbs'][] = $this->title;

$this->registerCssFile('/css/teamitem.css');

if ($member->teamInterests) {
	$graph_js = "
jQuery(function($) {
    $('#container').highcharts({
        chart: {
            plotBackgroundColor: null,
            plotBorderWidth: null,
            height:280,
            width:432
        },

        tooltip: {
            //pointFormat: '<b>{point.percentage:.1f}%</b>',
            enabled: false
        },
        plotOptions: {
            pie: {
                allowPointSelect: true,
                size:160,
                borderWidth: 0,
                cursor: 'pointer',
                dataLabels: {
                    //distance: 30,
                    //softConnector: false, // by default
                    connectorColor: 'black',
                    connectorPadding: 10,
                    color: '#464646',
                    enabled: true,
                    format: '<b>{point.name}</b>: {point.percentage:.1f} %',
                    style: {
                        width:85
                    }
                }
            }
        },
        series: [{
            type: 'pie',
            name: '" . Yii::t( 'app', 'Interests' ) . "',
            data: [";

	foreach ( $member->teamInterests as $interest ) {
		$graph_js .= "
		['" . $interest->title . "', " . $interest->value . "],";
	}

	$graph_js .= "
	    ]
    }]
});
});";

	$this->registerJs( $graph_js, 3 );
}
$this->registerJsFile('/js/teamitem/jquery.rating-2.0.min.js');
$this->registerJsFile('/js/teamitem/rating.js');
$this->registerJsFile('/js/teamitem/highcharts.js');
$this->registerJsFile('/js/teamitem/script.js');
?>

<div class="middle">
	<div class="left">
		<img src="/files/<?= $member->photo_big?>" width="400"></div>
	<div class="right">

		<div class="block_1">
			<div class="block_2">
				<div class="name">
					<h1 align="center"><?= $member->name?></h1>
					<p align="center"><?= $member->job?></p>
				</div>
				<div class="zodiak_iq">
					<div class="zodiak">
						<div class="zodiak_2"><?= Yii::t('app', ucfirst($member->zodiac))?></div>
						<div class="zodiak_1"><img src="/images/zodiac/<?= $member->zodiac?>.png" width="24" height="21" alt="vodoley"></div>
					</div>
					<div class="iq">
						<div class="iq_1"><img src="/images/teamitem/iq.png" height="24" width="20" alt="iq"></div>
						<div class="iq_2">IQ <?= $member->iq?></div>
					</div>
				</div>
			<?php if (!empty($member->email)) :?>
				<div class="mail">
					<div class="mail_1">
						<img src="/images/teamitem/mail.jpg" width="24" height="16" alt="mail">
						<a href="mailto:<?= $member->email?>">написать <?= $member->name2?></a>
					</div>
				</div>
			<?php endif?>

			<?php if (!empty($member->soc_vk) || !empty($member->soc_fb) || !empty($member->soc_tw)) :?>
				<div class="social">
					<div class="soc_1"></div>
					<div class="soc_2">
						<?php if (!empty($member->soc_vk)) :?>
						<a href="<?= $member->soc_vk?>"><div id="soc_3_1"><img src="/images/teamitem/vk.png" height="32" width="32" alt="vk.com"/></div></a>
						<?php endif?>
						<?php if (!empty($member->soc_fb)) :?>
						<a href="<?= $member->soc_fb?>"><div id="soc_3_2"><img src="/images/teamitem/fb.png" height="32" width="32" alt="vk.com"/></div></a>
						<?php endif?>
						<?php if (!empty($member->soc_tw)) :?>
						<a href="<?= $member->soc_tw?>"><div id="soc_3_3"><img src="/images/teamitem/twitter.png" height="32" width="32" alt="vk.com"/></div></a>
						<?php endif?>
					</div>
					<div class="soc_3"></div>
				</div>
			<?php endif?>
			</div>
		</div>

	<?php if($member->teamInterests) :?>
		<div class="graph">
			<div class="graph_1">
				<div class="anim">
					<img src="/images/teamitem/min_1.png" width="32" height="32" alt="interests">
				</div>
				<div class="heart">Интересы</div>
				<div class="line_0"></div>
			</div>
			<div class="graph_2">
				<div id="container"></div>
			</div>
		</div>
		<div class="indent">
			<div class="indent_0">
				<div class="line"></div>
			</div>
		</div>
		<?php endif?>
		<?php if (!empty($member->interests_caption)) :?>
		<div class="text">
			<div class="text_l">
				<?= $member->interests_caption?>
			</div>
		</div>
		<div class="indent_1">
			<div class="line"></div>
		</div>
	<?php endif?>

	<?php if (!empty($member->teamSkils) || !empty($member->skils_caption)) :?>
		<div class="skills">
			<div class="skills_1">
				<div>
					<div class="anim_2">
						<img src="/images/teamitem/min_2.png" width="32" height="32" alt="skills">
					</div>
				</div>
				<div class="heart" style="padding-left: 14px;">Скилы</div>
				<div class="line_0"></div>
			</div>
			<div class="skills_2">
				<?php foreach($member->teamSkils as $skill) :?>
				<div id="rating_0">
					<div id="rating_1" style="float: left;">
						<input type="hidden" name="val" value="<?= $skill->value?>">
					</div>
					<div id="rating_0_1">
						<p><?= $skill->title?></p>
					</div>
				</div>
				<?php endforeach?>
			</div>
		</div>
	<?php endif?>

	<?php if (!empty($member->skils_caption)) :?>
		<div class="indent">
			<div class="indent_0">
				<div class="line"></div>
			</div>
		</div>
		<div class="text">
			<div class="text_l">
				<?= $member->skils_caption?>
			</div>
		</div>
		<div class="indent_1">
			<div class="line"></div>
		</div>
	<?php endif?>

	<?php if (!empty($member->teamBooks) || !empty($member->books_caption)) :?>
		<div class="book">
			<div class="book_1">
				<div class="anim_3"><img src="/images/teamitem/min_3.png" width="30" height="32" alt="skills"></div>
				<div class="heart" style="padding-left: 17px;">Книги</div>
				<div class="line_0"></div>
			</div>
			<div class="book_2">
				<?= $member->books_caption?>
			<?php if (!empty($member->teamBooks)) :?>
				<div class="book_3">
					<?= explode(' ', $member->name)[0]?> рекомендует прочитать:
				</div>
				<div class="book_4">
					<?php foreach($member->teamBooks as $book) :?>
					<img src="/files/teamitem/films/<?= $book->cover?>" width="64" height="100" alt="<?= $book->title?>" title="<?= $book->title?>"/>
					<?php endforeach?>
				</div>
			<?php endif?>
			</div>
		</div>
		<div class="indent_1_1">
			<div class="line"></div>
		</div>
	<?php endif?>

	<?php if (!empty($member->teamFilms) || !empty($member->films_caption)) :?>
		<div class="film">
			<div class="film_1">
				<div class="anim_4"><img src="/images/teamitem/min_4.png" width="30" height="32" alt="skills"></div>
				<div class="heart" style="padding-left: 6px;">Фильмы</div>
				<div class="line_0"></div>
			</div>
			<div class="film_2">
				<?= $member->films_caption?>
			<?php if (!empty($member->teamFilms)) :?>
				<div class="film_3">
					<?= explode(' ', $member->name)[0]?> рекомендует посмотреть:
				</div>
				<div class="book_4">
					<?php foreach($member->teamFilms as $film) :?>
						<img src="/files/teamitem/films/<?= $film->cover?>" width="64" height="100" alt="<?= $film->title?>" title="<?= $film->title?>"/>
					<?php endforeach?>
				</div>
			<?php endif?>
			</div>
		</div>
		<div class="indent_1">
			<div class="line"></div>
		</div>
	<?php endif?>

	<?php if (!empty($member->humors) || !empty($member->humors_caption)) :?>
		<div class="jokes">
			<div class="jokes_1">
				<div class="anim_5"><img src="/images/teamitem/min_5.png" width="32" height="32" alt="skills"></div>
				<div class="heart">Анекдоты</div>
				<div class="line_0"></div>
			</div>
			<div class="jokes_2">
				<?php foreach($member->teamHumors as $humor) :?>
					<p><?= $humor?></p>
				<?php endforeach?>

			</div>
		</div>
	<?php endif?>
	</div>
</div>