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

include_once( "../include/class.SQLInteger.php" );
include_once( "../include/class.SQLString.php" );
include_once("auth.php");

## mysql verbindung aufbauen
db_connect($db_host, $db_user, $db_pass);
## /mysql verbindung aufbauen

$timestamp = time();

if ($all == 1)
	{
	 safe_query( "update kunden set ip = ?  where anbieter = ? ", TRUE, new SQLString( $stdip ), new SQLString( $anbieter ) );
	 $id = safe_query( "select * from ipadressen where anbieter = ? ", TRUE, new SQLString( $anbieter ) );
	 while ($werte = db_fetch_array($id))
		{
		 $kunde = $werte["kunde"];
		 $ip = $werte["ip"];
		 safe_query( "update kunden set ip = ?  where kunde = ?  and anbieter = ? ", TRUE, new SQLString( $ip ), new SQLString( $kunde ), new SQLString( $anbieter ) );
		}
	}

safe_query( "update anbieter set standardip = ? , lastchange = ?  where anbieter = ? ", TRUE, new SQLString( $stdip ), new SQLInteger( $timestamp ), new SQLString( $anbieter ) );
safe_query( "update ipadressen set anbieter = '', lastchange = ?  where anbieter = ?  and kunde = ''", TRUE, new SQLInteger( $timestamp ), new SQLString( $anbieter ) );
for ($i = 0; $i < count($ipadressen); $i++)
	{
	 $ip = $ipadressen[$i];
	 safe_query( "update ipadressen set anbieter = ? , lastchange = ?  where ip = ?  and anbieter = ''", TRUE, new SQLString( $anbieter ), new SQLInteger( $timestamp ), new SQLString( $ip ) );
	}
safe_query( "update ipadressen set anbieter = ? , lastchange = ?  where ip = ?  and anbieter = ''", TRUE, new SQLString( $anbieter ), new SQLInteger( $timestamp ), new SQLString( $stdip ) );
safe_query( "update anbieter set standardip = ? , lastchange = ?  where anbieter = ? ", TRUE, new SQLString( $stdip ), new SQLInteger( $timestamp ), new SQLString( $anbieter ) );
safe_query( "update allgemein set httpd = 1", TRUE );

$fehlertitel = ltext("anaeip2_errortitle");
$fehlertext = ltext("anaeip2_error1");
db_close();
include("anbieter_aendern.php");
exit();
?>
