<?
########## 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

$loUser = new SQLString($PHP_AUTH_USER);
$id = safe_query2( "SELECT frontpage, cssl, maxmysql FROM anbieter WHERE anbieter=?", $loUser);
$werte = db_fetch_array($id);
$skfrontpage = $werte["frontpage"];
$skssl = $werte["cssl"];
$maxmysql = $werte["maxmysql"];
if ($maxmysql != 0) $skmysql = 1;

## kundendaten in array
$id = safe_query2("SELECT kunde, name, firstname, gesperrt FROM kunden WHERE anbieter=? ORDER BY number", $loUser);

while ($werte = db_fetch_array($id)){

  $kunde 	= $werte["kunde"];
  $name 	= $werte["name"];
  $firstname 	= $werte["firstname"];
  $gesperrt     = $werte["gesperrt"];

  if (!istleer($name) || !istleer($firstname)){
    $name = $firstname."&nbsp;".$name;
  }
  if (istleer($name)) {
    $name = "".ltext("kuaeku_nousername")."";
  }
  $id2 = safe_query( "SELECT domain FROM domains WHERE kunde=? AND richtigedomain=1 ORDER BY domain", new SQLString($kunde));
  $domains = "";
  while ($werte2 = db_fetch_array($id2)){
    if (!istleer($werte2["domain"])){
      $domains .= $werte2["domain"] . "<br>";
    }
  }
//  if (istleer($domains)){
//		 $domains = "color=#666666>".ltext("kuaeku_nodomain")."";
//  }
  $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('', 'kuaeku_title1');
?>
</script>
      <? 
if (count($tabelle) > 0){
?>
<tr>
    <TD valign="top" class="titel-3" >
            <? echo ltext("kuaeku_cell_user"); ?>
           </td>
          <td  align="left" valign="middle" height="15" class="titel-3" >
       
            <? echo ltext("kuaeku_cell_name"); ?>
           </td>
          <td  align="left" valign="middle" height="15" class="titel-3" >
       
            <? echo ltext("kuaeku_cell_domains"); ?>
            </td>
          <td  align="left" valign="middle" height="15" class="titel-3" >
       
            <? echo ltext("kuaeku_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">
            <a class="data" href="userredirect.php?type=<?=USERTYPE_USER?>&user=<? echo $kunde; ?>" target="_blank"><? echo $kunde; ?></a><? 
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("kuaeku_nodomain")."</font>";
    }else{
      echo $domains; 
    }
?>
            </td>
          <td  align="left" valign="middle" height="15"><a class=data href="kunden_aendern.php?kunde=<? echo $kunde; ?>">
            <? echo ltext("kuaeku_cell_select"); ?>
            </a></td>
        </tr>
        <?
		}
?>
      <? } else { echo ltext("kuaeku_nouser"); }
?>
</TABLE>
</BODY>
</HTML>
<?
db_close();
?>
