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

include("auth.php");
//error_reporting(E_ALL);

global $db_type;
if($db_type != 'mysql'){
  include("../include/class.Pgsql.php");
}else{
  include("../include/class.Mysql.php");
}
include("../include/class.Data.php");
include("../include/class.Page.php");
include("../include/class.Cond.php");
include("../include/module.Informer.php");

include("../include/template/csmarty.php");


$edit = false;
$tpl = new CSmarty();
$page = new IDNPage($PHP_AUTH_USER, $tpl);
if (array_key_exists('origdomain', $_POST))
{
	if(!$page->save(array_key_exists('idndomain', $_POST)?$_POST['idndomain']:'', $_POST['origdomain'], array_key_exists('id', $_POST)?$_POST['id']:false))
	{
		$edit = array_key_exists('id', $_POST)?$_POST['id']:false;
	}
}

if(array_key_exists('ids', $_POST))
{
	if(is_array($_POST['ids']) && count($_POST['ids']))
	{
		foreach (array_keys($_POST['ids']) as $dd)	
		{
			$nl = new SQLDataRow('idn_aliases', array('id' => $dd), 'id');
			$db =& get_db_connection();
			$db->Update("UPDATE allgemein SET httpd=1, httpdupdate=0");
			$nl->delete();
		}
	}
}

if (array_key_exists('edit', $_GET))
{
	$edit = $_GET['edit'] * 1;	
}
if(array_key_exists('page', $_GET))
{
	$page->setPageNum($_GET['page']);	
}
$page->build($edit);


//$k = get_html_translation_table(HTML_ENTITIES);
//print_r($k);
/*
if(isset($_POST))
{	
	$z = $_POST['idndomain'];
	echo $z."<br>";
	$z = iconv(strtoupper($lang_html_charset), 'UTF-8', $z);
	echo "<br>" . utf2ent($z);
	echo "<br>" . utf8ToUnicodeEntities($z);
	echo "<br>" . strtoupper($lang_html_charset);
	//echo htmlentities($z, 0, 'UTF-8');
}
*/
$tpl->show();

//phpinfo();
?>
