<?php
include_once("../conf/config.inc.php");

//SQLDump Importieren
	
$db = @mysql_connect($server,$user,$passwort) or die ($abfrageAuswertung = '<div class="errorAuswertung">Keine Verbindung zur Datenbank moeglich!</div>');
@mysql_select_db($datenbankname) or die ($abfrageAuswertung = '<div class="errorAuswertung">Die Datenbank existiert nicht!</div>'); 

if (get_magic_quotes_gpc() == 0) {
	foreach ($_GET as $GetKey => $GetElement) {
		if (!is_array($_GET[$GetKey])) {
			$_GET[$GetKey] = addslashes($GetElement);
		}
	}
	
	foreach ($_POST as $PostKey => $PostElement) {
		if (!is_array($_POST[$PostKey])) {
			$_POST[$PostKey] = addslashes($PostElement);
		}
	}
}

// Dump importieren und splitten 
$import = file_get_contents("../update/update.sql");

$import = ereg_replace("randshop_", $config->tablePrefix, $import);

mysql_real_escape_string($import); 


$import = explode (";", $import); 

foreach ($import as $imp){

    if ($imp != '' && $imp != ' '){
        errorlogged_mysql_query($imp);
        
    }
}


$abfrageAuswertung = '<div class="okText">Die Datenbank wurde erfolgreich upgedatet.<br/>Bitte l&ouml;schen Sie zur Sicherheit das update Verzeichnis.<br/><br/><a href="../index.php">Klicken Sie hier, um in den Shop zu kommen.</a> </div>'
?>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Randshop Installation</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<link href="images/style.css" rel="stylesheet" type="text/css">
</head>

<body class="body">

<!-- Logo mit Rahmen -->
<div class="randHeader">
	<a href="http://www.randshop.com"><img src="../images/randlogo.gif" width="155" height="23" border="0" alt="Randshop" /></a>
</div>
<br/>


<!-- Headline des 2. Rahmens -->
<div class="randFirstHeadline">
	Randshop Update Patch 1.3.2 - 1
</div>	


<!-- Content Rahmen -->
<div class="randContent">
	
	<img src="../images/randpeople.gif" width="100" height="60" border="0" alt="Randshop" />
	<br/><br/>
	<div class="randSecondHeadline">
		Schritt 1 von 1
	</div>
	<div class="randThirdHeadline">
		Datenbankupdate
	</div>
	<br/><br/>

	<?php echo $abfrageAuswertung?>
	<br/><br/><br/>
	
	<div class="SecondTextVariante">
		&copy; 2004-<?php echo date("Y");?> by randshop<br/>
		Ein Produkt <a href="http://www.dierandgruppe.com/" target="_blank" class="text_kl">der randgruppe</a>
	</div>
	
	
	<br/>
</div>
</body>
</html>
