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

include_once("auth.php");

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


## kundendaten in array


for ($i = 0; $i < count($ergebnis); $i++){
  $kunde = $ergebnis[$i];
	$loKunde = new SQLString($kunde);

  $id = safe_query2( "SELECT name FROM kunden WHERE kunde=?", $loKunde);
  $werte = db_fetch_array($id);
  $name = $werte["name"];
  if (istleer($name)){
    $name = ltext("kuaeku_nousername");
  }
  $id2 = safe_query2( "SELECT domain FROM domains WHERE kunde=? AND richtigedomain=1", $loKunde);
  $domains = "";
  while ($werte2 = db_fetch_array($id2)){
    if (!istleer($werte2["domain"])){
      $domains .= $werte2["domain"] . "<br>";
    }
  }
//  if (istleer($domains)){
//    $domains = "keine Domain";
//  }
  $id3 = safe_query2( "SELECT gesperrt FROM kunden WHERE kunde=?", $loKunde);
  $werte3 = db_fetch_array($id3);
  $gesperrt = $werte3["gesperrt"];
  $tabelle[] = array("kunde" => $kunde, "name" => $name, "domains" => $domains, "gesperrt" => $gesperrt);
}

## /kundendaten in array
?>

<HTML>
<HEAD>
<META content="text/html; charset=<? echo $lang_html_charset; ?>" http-equiv=Content-Type>
<LINK href="<?=$strSkinName?>/style.css" rel=stylesheet type=text/css>
</HEAD>

<BODY bgColor=#ffffff bottomMargin=0 leftMargin=0 topMargin=0 MARGINHEIGHT="0" MARGINWIDTH="0">
<br><? include("../fehler.inc.php"); ?>
<script>
function doChange()
{
document.forms[0].submit();
}
</script>
<table class="tblbgcolor" align="left" border="1" cellpadding="3" cellspacing="0" bordercolorlight="#CCCCCC" bordercolordark="#FFFFFF">

<script>
<?
echo js_f_call_help('', 'kuaesu_title1');
?>
</script>

<? 
if (count($tabelle) > 0){
?>
 <tr > 
   <td height="15" class="titel-3" >
               <? echo ltext("kuaesu_cell_user"); ?>
   </td>
   <td  align="left" valign="middle" height="15" class="titel-3" >
    
            <? echo ltext("kuaesu_cell_name"); ?>
   </td>
   <td  align="left" valign="middle" height="15" class="titel-3" >
            <? echo ltext("kuaesu_cell_domain"); ?>
   </td>
   <td  align="left" valign="middle" height="15" class="titel-3" >
            <? echo ltext("kuaesu_cell_select"); ?>
   </td>
 </tr>
<?
for ($i = 0; $i < (count($tabelle)); $i++)		{
  $kunde = $tabelle[$i]["kunde"];
  $name = $tabelle[$i]["name"];
  $domains = $tabelle[$i]["domains"];
  $gesperrt = $tabelle[$i]["gesperrt"];
?>
 <tr > 
    <td  height="15">
           <? echo $kunde; ?><? 
if ($gesperrt > 0) { echo "<b><font color=\"red\">!</font></b>"; } ?>
    </td>
    <td  align="left" valign="middle" height="15">
            <? echo $name; ?>
            </td>
    <td  align="left" valign="middle" height="15">
<?
  if (istleer($domains)){
    echo "<font color=\"#666666\">".ltext("kuaesu_nodomain")."</font>";
  }else{
    echo $domains; 
  }
?>
    </td>
    <td  align="left" valign="middle" height="15"><a class=data href="kunden_aendern_fwd.php?kunde=<? echo $kunde; ?>&aktion=<? echo $aktion; ?>">
            <? echo ltext("kuaesu_cell_select"); ?>
            </a></td>
        </tr>
        <?
		}
?>
      <? } else { echo ltext("kuaesu_nouser"); }
?>
</TABLE>
<P>&nbsp;</P>
</BODY>
</HTML>
<?
db_close();
?>
