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

include_once("auth.php");

db_connect($db_host, $db_user, $db_pass);

noMagic($emailbetreff);
noMagic($emailtext);
noMagic($absenderemail);
noMagic($absendername);

$id = safe_query( "select emailadresse, name from anbieter where emailadresse like '%@%' group by emailadresse, name order by name", TRUE );
$anbietermails = db_num_rows($id);
if ($anbietermails < 1)
	{
	 $fehlertext = ltext("anru2_error1");
	 db_close();
	 include("anbieter_rundschreiben.php");
	 exit();
	}

if ((istleer($emailbetreff)) || (istleer($emailtext)) || (istleer($absenderemail)) || (istleer($absendername)))
	{
	 $fehlertext = ltext("anru2_error2");
	 db_close();
	 include("anbieter_rundschreiben.php");
	 exit();
	}

?>

<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">
<? include("../fehler.inc.php"); ?>
<BR>


<table class="tblbgcolor" align="left" border="1" cellpadding="3" cellspacing="0" bordercolorlight="#CCCCCC" bordercolordark="#FFFFFF" HEIGHT="300">
<tr>
<td colspan="3"><? echo ltext("anru2_descr1"); ?></td>
</tr>
<tr>
<td colspan="3"><? echo ltext("anru2_descr2"); ?></td>
</tr>

  <TR> 
    <TD> 
      <form method="post" action="anbieter_rundschreiben3.php">
        <input type="hidden" name="emailbetreff" value="<? echo HTMLSpecialChars($emailbetreff); ?>">
        <input type="hidden" name="emailtext" value="<? echo HTMLSpecialChars($emailtext); ?>">
        <input type="hidden" name="absenderemail" value="<? echo $absenderemail; ?>">
        <input type="hidden" name="absendername" value="<? echo HTMLSpecialChars($absendername); ?>">
        <br>
        <p> 
          <?
if ($anbietermails > 50) { $anbietermails = 50; }
?>
          <select name="empfaenger[]" size="<? echo $anbietermails; ?>" multiple>
            <?

while ($werte = db_fetch_array($id))
        {
         $name = $werte["name"];
         $emailadresse = $werte["emailadresse"];
        ?>
            <option value="<? echo $emailadresse; ?>" selected>
            <? echo "$name &lt;$emailadresse&gt;"; ?>
            </option>
            <? } ?>
          </select>
        <p>
<script>
function doChange()
{
document.forms[0].submit();
}
</script>

<? echo std_button(ltext("anru2_button1"), "javascript:doChange()"); ?>
      </form>
    </TD>
  </TR>
  </TBODY> 
</TABLE>
</BODY>
</HTML>

<?
db_close();
?>
