<?php
if(!defined("BASE_DIR")) exit;
if(!perm('products'))
{
	no_perm();
} else {
	
	if(!file_exists(BASE_DIR . 'class/Class.Products.php'))
	{
		module_not_installed('Partners');
	} else {
	
		include_once(BASE_DIR . 'admin/class/class.products.php');
		$products = new Products;
		
		$_REQUEST['sub'] = (isset($_REQUEST['sub']) && !empty($_REQUEST['sub'])) ? $_REQUEST['sub'] : 'overview';
		switch($_REQUEST['sub'])
		{
			case 'overview':
				$products->showProducts();
			break;
			
			case 'settings':
				$products->Settings();
			break;
			
			case 'del':
				$products->Delete($_REQUEST['id']);
			break;
			
			case 'new':
				$products->newProduct();
			break;
			
			case 'edit':
				$products->editProduct($_REQUEST['id']);
			break;
			
			case 'copy':
				$products->copyProduct($_REQUEST['id']);
			break;
			
			case 'genres':
				$products->showGenres();
			break;
			
			case 'delrating':
			if(!perm('del_rating'))
				no_perm();
			else
				$products->DelRating(@$_REQUEST['id']);
			break;
		
			case 'iconupload':
				include_once(BASE_DIR . 'admin/class/class.fileupload.php');
				$upload = new Fileupload('/uploads/products/','hidden',@$_REQUEST['divid'],@$_REQUEST['resize']);
			break;
		}
	}
}
?>