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

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

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

## liste freier ips holen
$id = safe_query( "select standardip from anbieter where anbieter = ? ", TRUE, new SQLString( $anbieter ) );
$werte = db_fetch_array($id);
$astdip = $werte["standardip"];

$id = safe_query( "select ip, anbieter, kunde from ipadressen where anbieter = '' or anbieter = ? ", TRUE, new SQLString( $anbieter ) );
while ($werte = db_fetch_array($id))
	{
	 $zeile = '				<option value="'.$werte["ip"].'"';
	 if (!istleer($werte["anbieter"])) $zeile .= ' selected';
	 $zeile .= '>'.$werte["ip"];
	 if (!istleer($werte["kunde"])) $zeile .= '*';
	 $zeile .= '</option>';
	 $ipliste1[] = $zeile;

	 $zeile2 = '				<option value="'.$werte["ip"].'"';
	 if ($werte["ip"] == $astdip) $zeile2 .= ' selected';
	 $zeile2 .= '>'.$werte["ip"].'</option>';
	 $ipliste2[] = $zeile2;
	}
$id = safe_query( "select standardip from admin", TRUE );
$werte = db_fetch_array($id);
$stdip = $werte["standardip"];
?>
<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" border="1" cellpadding="3" cellspacing="0" bordercolorlight="#CCCCCC" bordercolordark="#FFFFFF">
<script>
<?
echo js_f_call_help('anaeip_title1', 'anaeip_descr1');
?>
</script>
  <TR> 
    <td class="titel-3" >
      <form method="post" action="anbieter_aendern_ips2.php">
              <? echo ltext("anaeip_cell_description"); ?>
              </td>
            <td class="titel-3" >
              <? echo ltext("anaeip_cell_input"); ?>
              </td>
          </tr>
          <tr> 
            <td align="right">
              <? echo ltext("anaeip_cell_ip"); ?>
              </td>
            <td> 
              <? if (count($ipliste1) > 0) { ?>
              <select name="ipadressen[]" size="5" multiple>
                <?
for ($i = 0; $i < count($ipliste1); $i++)
	{
	 echo $ipliste1[$i];
	}
?>
              </select>
              <br>
              
              <? echo ltext("anaeip_cell_descr1"); ?>
               
              <? } else { ?>
              
              <? echo ltext("anaeip_cell_descr2"); ?>
               
              <? } ?>
            </td>
          </tr>
          <tr  align="center"> 
            <td colspan="2" class="titel-3" >
              <? echo ltext("anaeip_cell_question"); ?>
              </td>
          </tr>
          <tr > 
            <td colspan="2" align="center"> 
              <select name="stdip">
                <option value="<? echo $stdip; ?>">
                <? echo ltext("anaeip_select_stdip"); ?>
                </option>
                <?
for ($i = 0; $i < count($ipliste2); $i++)
	{
	 echo $ipliste2[$i];
	}
?>
              </select>
              <input type="checkbox" name="all" value="1">
              <? echo ltext("anaeip_all"); ?> 
            </td>
          </tr>
          <tr > 
            <td colspan=2 align=center><? echo std_button(ltext("anaeip_button1"), "javascript:doChange()"); ?>
        <input type="hidden" name="anbieter" value="<? echo $anbieter; ?>">
      </form>
      </td>
  </TR>
</TABLE>
</BODY>
</HTML>

<?
db_close();
?>
