<?php
use yii\web\View;
use yii\helpers\Url;

$imgFileShort = "/images/report_photo/{$model->folder}/";
$info = $model->title;
$rnd = random_int(100, 999999);
?>
            <div id="mycarouselg<?=$rnd?>" class="jcarousel-skin-tango" data-nav="thumbs" data-fit="contain" data-allowfullscreen="native" data-click="false" align="center" data-maxwidth="100%" bgcolor="#eee">
            <?
				$report = $model->getReport();
				foreach( $report as $item ){

					$imgFile = $imgFileShort."".$item->id.".160.jpg";

					if( file_exists(Yii::getAlias('@webroot').$imgFile ) || 1 ){
						$imf = $imgFileShort.$item->id.".800.jpg";
						$r = @getimagesize(Yii::getAlias('@webroot').$imgFileShort.$item->id.".1024.jpg" );
						$imgphoto = ( $r === false )?$imf:$imgFileShort.$item->id.".1024.jpg";
						?>
						<a href="<?=$imgphoto?>" rel='lightbox' target="photo<?=$item->id?>" data-caption="<?=($model->title !='')?htmlspecialchars($model->title):htmlspecialchars($info)?>" ><img alt="<?=($model->title !='')?htmlspecialchars($model->title):htmlspecialchars($info)?>" src="<?=$imgFile?>" border=0 hspace="0" vspace="0"></a>
						<?
					}
				}
?>
		</div>
<?
$str =
<<<JS
  <!-- Fotorama -->
    <script type="text/javascript">
		setTimeout( 1000, $('#mycarouselg$rnd').fotorama({ width:'100%',maxwidth:800,thumbheight:70,thumbwidth:94, click:false,nav: false, captions: true, caption: 'overlay', allowfullscreen:'native' }));
	</script>
JS;

echo $str;
?>
