<?php
$content 	= $page->field("content");
$year 		= $page->field("year");
$client_name= $page->field("client_name");
$link 		= $page->field("link");
$image 		= $page->field("image");
$size 		= @getimagesize(ABSOLUTE_PATH . "/" . $image);

if($page->url == uri_string())
{
	?>
	<div class="portfolio">
		<div class="portfolio_content">
			<div class="row">
				<div class="<?php echo(TWO_COL); ?>">
					<div class="row">
						<?php
						if($page->field("year"))
						{
							?>
							<div class="col-12 col-sm-4"><b>Year:</b></div>
							<div class="col-12 col-sm-8"><?php echo($year); ?></div>
							<?php
						}
						if($page->field("client_name"))
						{
							?>
							<div class="col-12 col-sm-4"><b>Client:</b></div>
							<div class="col-12 col-sm-8"><?php echo($client_name); ?></div>
							<?php
						}
						if($page->field("link"))
						{
							?>
							<div class="col-12 col-sm-4"><b>Website:</b></div>
							<div class="col-12 col-sm-8"><a href="<?php echo($link); ?>" target="_blank"><?php echo($page->field("link")); ?></a></div>
							<?php
						}
						if($page->tags)
						{
							?>
							<div class="col-12 col-sm-4"><b>Tags:</b></div>
							<div class="col-12 col-sm-8">
								<ul class="fa-ul">
									<?php
									foreach($page->tags as $tag)
									{
										?><li><em class="fas fa-li fa-tag" aria-hidden="true"></em> <?php echo($tag->tag); ?></li><?php
									}
									?>
								</ul>
							</div>
							<?php
						}
						?>
					</div>
					<div class="p-3"><?php echo($page->field("content")); ?></div>
				</div>
				<div class="<?php echo(TWO_COL); ?>">
					<img src="<?php echo($image); ?>" style="width: <?php echo($size[0]); ?>px; height: <?php echo($size[1]); ?>px;" />
				</div>
			</div>
		</div>
		<div class="portfolio_separator"></div>
	</div>
	<?php
}
else
{
	?><img src="<?php echo($image); ?>" style="width: <?php echo($size[0]); ?>px; height: <?php echo($size[1]); ?>px;" /><?php
}
