<?
########## Confixx(R) 3.0 Professional ############
####### Copyright SWsoft, Inc. 2004-2005 ##########
#### http://www.sw-soft.com - info@sw-soft.com ####

if(!defined('CONFIXX'))
{
	return;
}
/*
echo '<pre>';
print_r($_GET);
echo '</pre>';
*/
$skin = $skin * 1;
//echo "select count(*) from custom_skins where id = $skin and anbieter='$PHP_AUTH_USER' and owner_type='reseller'";
$id = db_query("select count(*) as c from custom_skins where id = $skin and anbieter='$PHP_AUTH_USER' and owner_type='reseller'");
$w = db_fetch_array($id);
if($w['c'])
{
	exec("$sbindir/$stylescript --skin skin_$skin --del_skin", $out, $ret);
	if($ret != 0)
	{
		echo '<pre>';
		implode("\n", $out);
		echo '</pre>';
	}
	else
	{
		db_query("delete from custom_skins where id = $skin and anbieter='$PHP_AUTH_USER' and owner_type='reseller'");	
		$id = db_query("SELECT skin_id FROM skins WHERE cuser='$PHP_AUTH_USER'");
		$res = db_fetch_array($id);
		if($res['skin_id'] == $skin)
		{
			$id = db_query("SELECT id FROM custom_skins WHERE name='skin_1'");
			$res = db_fetch_array($id);
			db_query("UPDATE skins SET skin_id=" . $res['id'] . " WHERE cuser='$PHP_AUTH_USER'");
			$strSkinName="/skins/skin_1";
			$confixx_interface_version = 'xp30';
		}
	}
}
else 
{
	$alerts[] = ltext("sk_invalid_skin");	
}



include $thisdir . "/skins_inc/editskins.php";	

?>
