<?php 

if($shop = $this->getShopByID((int)$this->param['id'])){
	$items = $this->getItems(array("shop_id" => $this->param['id']));
} else {
	$this->view(array("theme/_common/_header", "theme/errors/404", "theme/_common/_footer"), array("user" => $this->user, "shops" => $this->shops)); 
	exit();
}

if($this->user['user_group'] >= "3") {
	$this->view(array("theme/_common/_header", "theme/project/items", "theme/_common/_footer"), array("user" => $this->user, "shops" => $this->shops, "shop" => $shop, "items" => $items)); 
} elseif($this->user['user_id'] == $shop['user_id']) {
	$this->view(array("theme/_common/_header", "theme/project/items", "theme/_common/_footer"), array("user" => $this->user, "shops" => $this->shops, "shop" => $shop, "items" => $items)); 
} else {	
	$this->view(array("theme/_common/_header", "theme/errors/404", "theme/_common/_footer"), array("user" => $this->user, "shops" => $this->shops)); 
}