westdc-zf1/application/admin/views/scripts/down/sendmail.phtml

96 lines
2.9 KiB
PHTML

<?php
$this->headTitle($this->config->title->site);
$this->headTitle('后台管理');
$this->headTitle()->setSeparator(' - ');
$this->headLink()->appendStylesheet('/css/admin.css');
$this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/admin">后台首页</a>');
$this->breadcrumb('<a href="/admin/data">数据管理</a>');
$this->breadcrumb('元数据管理</a>');
$this->breadcrumb()->setSeparator(' > ');
$this->headScript()->appendFile('/js/jquery-1.7.min.js');
$this->headScript()->appendFile('/js/jquery.colorbox-min.js');
$this->headLink()->appendStylesheet('/css/colorbox.css');
?>
<div id="leftPanel">
<?= $this->partial('data/left.phtml'); ?>
</div>
<div id="rightPanel">
<?php
if(!empty($this->error))
{
echo $this->error;
}
?>
<?php
if(!empty($this->metadata))
{
?>
<h2><?= $this->metadata['title'] ?></h2>
<?php
}
if(!empty($this->mailinfo))
{
?>
共统计到可发送的电子邮件地址:<?= $this->mailinfo?>
<form id="mailform">
<p>
<label>邮件标题</label><br />
<input type="text" id="title" name="title" class="half" />
</p>
<p>
<label>邮件内容</label><br />
<textarea name="body" id="body" class="half large"></textarea>
</p>
<p>
<input type="hidden" name="uuid" value="<?= $this->metadata['uuid']?>" />
<button type="button" class="btn btn-green" id="send_btn" onclick="sendmail()">发送邮件</button>
</p>
<p>
<iframe id="process" style="border:none;width:500px;height:300px;font-size:12px;" src=""></iframe>
</p>
</form>
<?php
}
?>
</div>
<script>
$('#wapper').width($('body').width()-300);
function sendmail(){
if($('#process').attr("src") != "")
{
Alert("您已经发送过邮件,如果页面没有反应请继续等待服务器响应");return false;
}
if($("#title").val() == "")
{
Alert("请填写邮件标题");return false;
}
if($("#body").val() == "")
{
Alert("请填写邮件内容");return false;
}
if($("#body").val().length <= 20 )
{
Alert("邮件内容过短,请重新填写");return false;
}
if(confirm("是否确定发送邮件")==false)
{
return false;
}
$('#process').attr("src","/admin/down/sendmail/?ac=send&"+$('#mailform').serialize());
}
$('#send_btn').ajaxComplete(function() {
$('#send_btn').html('发送邮件');
});
$('#send_btn').ajaxSend(function() {
$('#send_btn').html('<img src="/images/ajax-load-small.gif" />正在处理...');
});
$("#send_btn").ajaxError(function() {
$('#send_btn').html('发送邮件');
Alert('处理中出现问题,请重试');
});
function Alert(html){
$.colorbox({'innerWidth':'50%','html':'<h4>'+html+'</h4>'});
}
function isObject(obj){if(typeof(obj)=='object'){return true;}else if(typeof(obj)!='object'){return false;}else{return false;}}
</script>