<?php require_once 'header.php'; ?>

<?php require_once 'sidebar.php'; ?>

<div class="span8">
	<div class="well">
	<h4><b class="icon-film" style="margin-top:3px;"></b> <?php echo $vid_type; ?></h4>
	
	<?php if(isset($error)) print $error; ?>
	
	<?php if(!isset($movies) OR !count($movies)) : ?>
		No <?php echo str_replace(array("Watch", "Online"), array("",""), $vid_type); ?> to show
	<?php else: ?>
	
	
	<?php $i=0; foreach($movies as $FMovie): $i++; ?>
		
		<div class="small-item" <?php if($i%4==1) print 'style="clear:both;"';?>>
		<?php $img_prop = array('src' => '/uploads/' . $FMovie->thumbnail, 
								'width' => 120, 'height' => 140, 'alt' => htmlspecialchars($FMovie->film_title)); ?>
		<?php if($FMovie->film_type == 'movie'): ?>
			<a href="<?php echo '/watch-movies/'.url_title($FMovie->film_title).'-'.$FMovie->filmID; ?>">
		<?php else: ?>
			<a href="<?php echo '/watch-tv-shows/'.url_title($FMovie->film_title).'-'.$FMovie->filmID; ?>">
		<?php endif; ?>
			
			<?php echo img($img_prop); ?>
			</a>
		<br/>
		
		<?php if($FMovie->film_type == 'movie'): ?>
			<a href="<?php echo '/watch-movies/'.url_title($FMovie->film_title).'-'.$FMovie->filmID; ?>"><?php echo $FMovie->film_title . ' ('. date("Y", $FMovie->release_date) . ')'; ?></a>
			<?php else: ?>
			<a href="<?php echo '/watch-tv-shows/'.url_title($FMovie->film_title).'-'.$FMovie->filmID; ?>"><?php echo $FMovie->film_title . ' ('. date("Y", $FMovie->release_date) . ')'; ?></a>
		<?php endif; ?>
		<br/>
		Rating <?php echo number_format($FMovie->rating,0); ?>/5
		</div>
	
	<?php endforeach; ?>
	
	<hr/>
	<div style="clear: both;"></div>
	
	<?php if($pagination) print $pagination; ?>
		
	<?php endif; ?>
	
	</div>
</div>

<?php require_once 'footer.php'; ?>