
{include file="../head.tpl"}
<script language="javascript" type="text/javascript">
<!--

function check_thisform(){ldelim}
var errors = 0;
if(document.nlform.absname.value == ""){ldelim}
	alert('{$langadmin.jserror_no_sendername}');
	document.nlform.absname.focus();
	errors = 1;
	return false;
{rdelim}

if(document.nlform.absmail.value == ""){ldelim}
	alert('{$langadmin.jserror_no_senderemail}');
	document.nlform.absmail.focus();
	errors = 1;
	return false;
{rdelim}


if(document.nlform.betreff.value == ""){ldelim}
	alert('{$langadmin.jserror_newsletter_nosubject}');
	document.nlform.betreff.focus();
	errors = 1;
	return false;
{rdelim}

if(document.nlform.textversion.value == ""){ldelim}
	alert('{$langadmin.jserror_notextversion}');
	document.nlform.textversion.focus();
	errors = 1;
	return false;
{rdelim}

{if $smarty.request.nltype != "groups"}
if(document.nlform.htmlversion.value == ""){ldelim}
	alert('{$langadmin.jserror_nohtmlversion}');
	document.nlform.htmlversion.focus();
	errors = 1;
	return false;
{rdelim}
{/if}

if(errors < 1){ldelim}
	document.nlform.nlsend.disabled=true;
{rdelim}

{rdelim}
//-->
</script>
<form name="nlform" action="newsletter.php?area={$smarty.request.area}" method="post" enctype="multipart/form-data" style="display:inline;" onsubmit="return check_thisform();">
<table width="100%"  border="0" cellpadding="4" cellspacing="1" class="tableborder">
<tr>
<td colspan="2" class="header"> {$langadmin.newsletter_sendsubject}
</td>
</tr>
<tr>
  <td valign="top" nowrap="nowrap" class="firstrow">&nbsp;</td>
  <td class="secondrow">
  <script language="javascript">
  function switchmode(param){ldelim}
  	var ABNAME = document.getElementById('absname').value;
	var ABSEMAIL = document.getElementById('absmail').value;
	var BETREFF = document.getElementById('betreff').value;
	var CODE = document.getElementById('tv').value;
	if(param==2) var EXTRA = 'groups';
	if(confirm('{$langadmin.jswarning_switchmode}')) location.href = 'newsletter.php?area={$smarty.request.area}&donow=new&absname='+ABNAME+'&absmail='+ABSEMAIL+'&betreff='+BETREFF+'&nltype='+EXTRA+'&code='+CODE+'';
 {rdelim}
  </script>
  <input onclick="return switchmode(1);" type="button" class="button" value="发送邮件列表给订阅者">
  <input onclick="return switchmode(2);" type="button" class="button" value="发送邮件列表给系统用户组"></td>
</tr>
<tr>
<td width="20%" valign="top" nowrap="nowrap" class="firstrow"> {$langadmin.newsletter_groups} </td>
<td class="secondrow">
{foreach from=$items item=cb}
<input type="checkbox" name="ml_{$cb->id}" checked>{$cb->name}<br />
{/foreach}
</td>
</tr>
<tr>
<td width="20%" nowrap="nowrap" class="firstrow"> {$langadmin.newsletter_sendername}
</td>
<td class="secondrow">
<input type="text" name="absname" id="absname" value="{$smarty.request.absname}" style="width:98%;" size="32" />
</td>
</tr>
<tr>
<td width="20%" nowrap="nowrap" class="firstrow"> {$langadmin.newsletter_senderemail}
</td>
<td class="secondrow">
<input type="text" name="absmail" id="absmail" value="{$smarty.request.absmail}" style="width:98%;" size="32" />
</td>
</tr>
<tr>
<td width="20%" nowrap="nowrap" class="firstrow"> {$langadmin.newsletter_subject}
</td>
<td class="secondrow">
<input type="text" name="betreff" id="betreff"  value="{$smarty.request.betreff}" style="width:98%;" size="32" />
</td>
</tr>
<tr>
<td colspan="2" valign="top" nowrap="nowrap" class="header">
  <table width="100%"  border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td style="padding:0px">{if $smarty.request.nltype=="groups"}{$langadmin.newsletter_normcontent_text}{else}{$langadmin.newsletter_textversion}{/if}</td>
      <td>
          <div align="right">
            <input onclick="javascript:document.getElementById('ttext').style.display='';document.getElementById('ttextbutt').style.display='';" type="button" class="button" value="{$langadmin.newsletter_template}">
            <span id="ttextbutt" style="display: none;">
            <input onclick="javascript:document.getElementById('ttext').style.display='none';document.getElementById('ttextbutt').style.display='none';" type="button" class="button" value="{$langadmin.close}">
          </span>
      </div></td>
    </tr>
  </table></td>
</tr>
<tr>
<td colspan="2" valign="top" nowrap="nowrap" class="firstrow">
<div id="ttext" style="display: none;">
{if $smarty.request.nltype != "groups"}
<textarea name="ttext" id="ttext" style="background-color:#fafafa;border: 1px solid #ccc;width:100%;height:150px" readonly>您好 %%NAME%%,

[以下是 TEXT...]

请根据以下格式来编写您的邮件列表:
%%AUSTRAGEN%%</textarea>
{else}
<textarea name="ttext" id="ttext" style="background-color:#fafafa;border: 1px solid #ccc;width:100%;height:150px" readonly>您好 %%NAME%%,

[以下是 TEXT...]

您收到以下来信，是因为您在我们的系统上登记了.
如果您不想再收到我们的邮件列表，你可以在您的个人资料里去掉发送邮件列表.
</textarea>
{/if}
</div>
<textarea name="textversion" id="tv"  style="width:100%;height:300;">{$smarty.request.textversion}</textarea>
</td>
</tr>
{if $smarty.request.nltype != "groups"}
<tr>
<td colspan="2" valign="top" nowrap="nowrap" class="header">

<table width="100%"  border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td style="padding:0px">{$langadmin.newsletter_htmlversion}</td>
            <td><div align="right">
                <div align="right">
                  <input onclick="javascript:document.getElementById('thtml').style.display='';document.getElementById('thtmlbutt').style.display='';" type="button" class="button" value="{$langadmin.newsletter_template}">
                  <span id="thtmlbutt" style="display: none;">
                  <input onclick="javascript:document.getElementById('thtml').style.display='none';document.getElementById('thtmlbutt').style.display='none';" type="button" class="button" value="{$langadmin.close}">
                  </span> </div>
              </div></td>
          </tr>
        </table>
</td>
</tr>
<tr>
<td colspan="2" valign="top" nowrap="nowrap" class="firstrow">			
<div id="thtml" style="display: none;">
<textarea name="thtml" id="thtml" style="background-color:#fafafa;border: 1px solid #ccc;width:100%;height:200px" readonly>&lt;style type=&quot;text/css&quot;&gt;
&lt;!--
body,td {ldelim}
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
color: #000000;
{rdelim}
a:link,a:visited {ldelim}
font-weight: bold;
color: #0000FF;
{rdelim}
--&gt;
&lt;/style&gt;

您好 %%NAME%%,&lt;br /&gt; &lt;br /&gt; 

[以下是 TEXT...]

&lt;br /&gt; &lt;br /&gt; 

请根据以下格式来编写您的邮件列表:&lt;br /&gt; 
&lt;a href=&quot;%%AUSTRAGEN%%&quot;&gt;%%AUSTRAGEN%%&lt;/a&gt;</textarea>
</div>
<textarea name="htmlversion" id="text-area-1" style="width:100%;height:350px"></textarea>
</td>
</tr>
{/if}
<tr>
  <td valign="top" class="firstrow"><strong>{$langadmin.attachments}
  </strong><br />
  <small>{$langadmin.newsletter_attachment_warning}</small>
  
  </td>
  <td class="secondrow">
  <div style="background-color:#F8F8F8; padding:5px; border:1px solid #666; overflow:auto;height:120px;width:380px">
  <table>
  {section name=attach loop=10}
  <tr>
  <td>
  #{$smarty.section.attach.index+1}</td><td><input name="files[]" type="file" id="files[]" size="40" /></td>
</tr>
  {/section}
  </table>
 </div>
  </td>
</tr>
<tr>
  <td valign="top" class="firstrow">{$langadmin.delete_attachments}</td>
  <td class="secondrow"><input name="delattach" type="checkbox" id="delattach" value="1" checked></td>
</tr>
<tr>
<td width="20%" valign="top" nowrap="nowrap" class="firstrow">&nbsp;</td>
<td class="secondrow">
  <input name="nltype" type="hidden" id="nltype" value="{$smarty.request.nltype}">
  <input name="area" type="hidden" id="area" value="{$smarty.request.area}">
  <input type="hidden" name="action" value="send" />
<input name="nlsend" type="submit" class="button" id="nlsend" value="{$langadmin.button_newsletter}" />
</td>
</tr>
</table>
</form>
{include file="../foot.tpl"}