123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128 |
- {Template header}
- <body>
- <div class="warp">
- <div class="title winnone">Email发送</div>
- <ul class="setting">
- <li>
- <em>营销模板:</em>
- <select class="select" name="notice">
- {loop $notice as $val}
- <option value="{$val['id']}">{$val['title']}</option>
- {/loop}</select>
- </li>
- <li class="length">
- <em>Email:</em>
- <textarea name="email" class="must" placeholder="每行一条Email" ></textarea>
- </li>
- <div style="clear:both;"></div>
- </ul>
- <div class="button"><font class="datasaveemail">提 交</font> <font class="fh">关 闭</font></div>
- </div>
- <script>var addedit="/notice/addemail/";
- $(".datasaveemail").click(function() {
- layx.load('loadId','数据提交中,请稍后');
- var f = "";
- var e = "";
- $(".select").each(function() {
- f = f + $(this).attr("name") + "=" + $(this).children("option:selected").val() + "&";
- });
- $("input:text").each(function() {
- var str = $(this).val().replace(/\+/g,"%2B");
- var str = str.replace(/&/g,"%26");
- f = f + $(this).attr("name") + "=" + str + "&";
- });
- $("input:password").each(function() {
- f = f + $(this).attr("name") + "=" + $(this).val() + "&";
- });
- $("input:hidden").each(function() {
- f = f + $(this).attr("name") + "=" + $(this).val() + "&";
- });
- $("textarea").each(function() {
- var str2 = $(this).val().replace(/\+/g,"%2B");
- var str2 = str2.replace(/&/g,"%26");
- f = f + $(this).attr("name") + "=" + str2 + "&";
- });
- if($(".scimg img").length > 0)
- {
- var a = '';
- for (var b = 0; b < $(".scimg .upimg img").length; b++)
- {
- a = a + $(".scimg .upimg img")[b].src + "|";
- }
- for (var b = 0; b < $(".scimg .upimg video").length; b++)
- {
- a = a + $('.scimg .upimg video')[b].src + "|";
- }
- var a = a.replace(/\+/g,"%2B");
- var a = a.replace(/&/g,"%26");
- f = f + "img=" + a + "&";
- }
- for(i=0;i<$(".checkbox").length;i++)
- {
- var checkid = ""; var checkname = "";
- $(".checkbox:eq("+i+") .ckrows input:checked").each(function(){
- checkname = $(this).attr("name");
- checkid = checkid + $(this).val()+",";
- });
- if(checkname == "")
- {
- $(".ts p").text($(".checkbox:eq("+i+")").prevAll("em").text()+"为必填项");
- $(".ts").show();
- setTimeout('$(".ts").fadeOut()', 600);
- return false;
- }
- f = f + checkname + "=" + checkid + "&";
-
- }
-
- for(i=0;i<$(".checkboxfbt").length;i++)
- {
- var checkid = ""; var checkname = "";
- $(".checkboxfbt:eq("+i+") .ckrows input:checked").each(function(){
- checkname = $(this).attr("name");
- checkid = checkid + $(this).val()+",";
- });
- if(checkname != "")
- {
- f = f + checkname + "=" + checkid + "&";
- }
-
- }
- var ab = 0;
- $(".must").each(function() {
- if ($.trim($(this).val()).length == 0) {
- $(this).css("border", "1px solid #F66");
- ab = ab + 1;
- }
- });
- if (ab > 0) {
- $(".ts p").text("红框为必填项");
- $(".ts").show();
- setTimeout('$(".ts").fadeOut()', 600);
- return false;
- }
- $.ajax({
- url: addedit,
- data: f,
- type: "POST",
- dataType: "json",
- success: function(a) {
- layx.destroy('loadId');
- if (a && a.success) {
- $(".ts").hide();
- $(".express p:eq(0)").html(a.msg+"是否关闭?");
- $(".express p:eq(1)").html("<font class='fh'>确 定</font><font class='esc'>取 消</font>");
- $(".express").show();
- } else {
- layx.alert('错误',a.msg,function(id,button){
- },{dialogIcon:'error'});
- }
- }
- });
- });
- </script>
- {Template footer}
|